Ouss4 commented on a change in pull request #5352: URL: https://github.com/apache/incubator-nuttx/pull/5352#discussion_r793474529
########## File path: arch/xtensa/src/esp32s3/esp32s3_clockconfig.c ########## @@ -0,0 +1,312 @@ +/**************************************************************************** + * arch/xtensa/src/esp32s3/esp32s3_clockconfig.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <stdint.h> + +#include "xtensa.h" +#include "xtensa_attr.h" +#include "hardware/esp32s3_soc.h" +#include "hardware/esp32s3_uart.h" +#include "hardware/esp32s3_system.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +#define DEFAULT_CPU_FREQ 80 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +enum cpu_freq_e +{ + CPU_80M = 0, + CPU_160M = 1, + CPU_240M = 2, +}; + +enum cpu_clksrc_e +{ + XTAL_CLK, + PLL_CLK, + FOSC_CLK +}; + +enum pll_freq_e +{ + PLL_320, + PLL_480 +}; + +/**************************************************************************** + * ROM Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: ets_update_cpu_frequency + * + * Description: + * Set the real CPU ticks per us to the ets, so that ets_delay_us will be + * accurate. Call this function when CPU frequency is changed. + * + * Input Parameters: + * ticks_per_us - CPU ticks per us. + * + * Returned Value: + * None + * + ****************************************************************************/ + +extern void ets_update_cpu_frequency(uint32_t ticks_per_us); Review comment: These functions come from the ROM ELF file. The prototypes are just declared to avoid warnings. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
