Merge branch 'refactor/remove_deprecated_uart_rom_functions' into 'master'

refactor(uart)!: deprecate esp_rom_uart.h

See merge request espressif/esp-idf!39423
This commit is contained in:
morris
2025-07-10 15:56:56 +08:00
93 changed files with 265 additions and 132 deletions

View File

@@ -22,7 +22,7 @@
#include "hal/clk_tree_ll.h"
#endif
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
__attribute__((weak)) void bootloader_clock_configure(void)
{

View File

@@ -14,6 +14,7 @@
#include "soc/gpio_sig_map.h"
#include "soc/rtc.h"
#include "hal/gpio_ll.h"
#include "hal/uart_ll.h"
#if CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/usb/cdc_acm.h"
#include "esp32s2/rom/usb/usb_common.h"
@@ -22,7 +23,7 @@
#include "hal/usb_wrap_ll.h"
#endif
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_caps.h"
@@ -91,7 +92,7 @@ void bootloader_console_init(void)
#if ESP_ROM_UART_CLK_IS_XTAL
clock_hz = (uint32_t)rtc_clk_xtal_freq_get() * MHZ; // From esp32-s3 on, UART clk source is selected to XTAL in ROM
#endif
esp_rom_uart_set_clock_baudrate(uart_num, clock_hz, CONFIG_ESP_CONSOLE_UART_BAUDRATE);
_uart_ll_set_baudrate(UART_LL_GET_HW(uart_num), CONFIG_ESP_CONSOLE_UART_BAUDRATE, clock_hz);
}
#endif // CONFIG_ESP_CONSOLE_UART

View File

@@ -12,7 +12,7 @@
#include <stddef.h>
#include "sdkconfig.h"
#include "bootloader_console.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#if CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/usb/chip_usb_dw_wrapper.h"

View File

@@ -12,7 +12,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "sdkconfig.h"
#if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/cache.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/soc_caps.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -11,7 +11,7 @@
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_efuse.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -10,7 +10,7 @@
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/gpio_sig_map.h"

View File

@@ -7,7 +7,7 @@
#include <string.h>
#include "esp_err.h"
#include "driver/uart.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#define ROM_UART_DRIVER_ENABLE 0

View File

@@ -28,7 +28,7 @@
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "spi_flash_mmap.h"
#include "esp_attr.h"

View File

@@ -16,7 +16,7 @@
#include "esp_private/esp_pmu.h"
#include "soc/ledc_periph.h"
#include "esp_private/sleep_retention.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
// Note. Test cases in this file cannot run one after another without reset

View File

@@ -16,7 +16,7 @@
#include "driver/uart_vfs.h"
#include "driver/uart.h"
#include "driver/uart_select.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "hal/uart_ll.h"
#include "soc/soc_caps.h"
#include "esp_vfs_dev.h" // Old headers for the aliasing functions

View File

@@ -12,7 +12,7 @@
#include <sys/errno.h>
#include <unistd.h>
#include "unity.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"

View File

@@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdlib.h>
#include "esp32/rom/rtc.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
#include "soc/rtc_periph.h"

View File

@@ -17,7 +17,7 @@
#include "esp_hw_log.h"
#include "esp_cpu.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
static const char *TAG = "rtc_clk_init";

View File

@@ -17,7 +17,7 @@
#include "esp_hw_log.h"
#include "esp_cpu.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
static const char *TAG = "rtc_clk_init";

View File

@@ -17,7 +17,7 @@
#include "soc/regi2c_dig_reg.h"
#include "esp_hw_log.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_private/esp_pmu.h"
#include "hal/clk_tree_ll.h"
#include "hal/pmu_ll.h"

View File

@@ -17,7 +17,7 @@
#include "soc/regi2c_pmu.h"
#include "esp_hw_log.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "hal/clk_tree_ll.h"
#include "soc/pmu_reg.h"
#include "pmu_param.h"

View File

@@ -18,7 +18,7 @@
#include "soc/regi2c_dig_reg.h"
#include "esp_hw_log.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_private/esp_pmu.h"
#include "hal/clk_tree_ll.h"
#include "hal/pmu_ll.h"

View File

@@ -34,7 +34,7 @@
#include "esp_private/esp_pmu.h"
#include "pmu_param.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "hal/efuse_hal.h"
#if CONFIG_SPIRAM
#include "hal/ldo_ll.h"

View File

@@ -20,7 +20,7 @@
#include "soc/pmu_reg.h"
#include "esp_hw_log.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_private/esp_pmu.h"
#include "hal/clk_tree_ll.h"

View File

@@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdlib.h>
#include "esp32s2/rom/rtc.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/rtc.h"
#include "soc/rtc_periph.h"
#include "soc/syscon_reg.h"

View File

@@ -8,7 +8,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp32s3/rom/rtc.h"
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"

View File

@@ -23,7 +23,7 @@
#include "hal/brownout_hal.h"
#include "hal/brownout_ll.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "hal/uart_ll.h"
#include "soc/power_supply_periph.h"
#include "esp_brownout.h"

View File

@@ -71,7 +71,7 @@
#include "hal/mspi_ll.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_private/cache_utils.h"
#include "esp_private/brownout.h"

View File

@@ -31,7 +31,7 @@
#endif
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#ifdef CONFIG_IDF_TARGET_ESP32

View File

@@ -22,7 +22,7 @@
#include "driver/uart.h"
#include "unity.h"
#include "test_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "hal/uart_types.h"
#include "hal/uart_ll.h"
#include "soc/dport_reg.h"

View File

@@ -19,7 +19,7 @@
#include "freertos/task.h"
#include "esp_rom_gpio.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "test_utils.h"
#include "esp_random.h"
#include "esp_sleep.h"

View File

@@ -19,7 +19,7 @@ if(target STREQUAL "linux")
"${target}/esp_rom_efuse.c")
else()
list(APPEND sources "patches/esp_rom_crc.c"
"patches/esp_rom_uart.c"
"patches/esp_rom_serial_output.c"
"patches/esp_rom_spiflash.c"
"patches/esp_rom_efuse.c"
"patches/esp_rom_gpio.c")

View File

@@ -60,7 +60,7 @@ As ROM functions are unique to each target, features are as well. For example, E
│   ├── esp_rom_gpio.h
│   ├── esp_rom_md5.h
│   ├── esp_rom_sys.h
│   ├── esp_rom_uart.h
│   ├── esp_rom_serial_output.h
│   └── ... // other ROM wrapper api files
├── Kconfig.projbuild
├── linker.lf

View File

@@ -0,0 +1,98 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Wait for TX FIFO is empty and all data has been sent out.
*
* @param serial_num The serial number defined in ROM, including UART_x, USB_OTG, USB_SERIAL_JTAG.
* Use ESP_ROM_USB_SERIAL_DEVICE_NUM or ESP_ROM_USB_OTG_NUM to identify USB_SERIAL_JTAG and USB_OTG, respectively.
*/
void esp_rom_output_tx_wait_idle(uint8_t serial_num);
/**
* @brief Flush TX FIFO
*
* @param serial_num The serial number defined in ROM, including UART_x, USB_OTG, USB_SERIAL_JTAG.
* Use ESP_ROM_USB_SERIAL_DEVICE_NUM or ESP_ROM_USB_OTG_NUM to identify USB_SERIAL_JTAG and USB_OTG, respectively.
*/
void esp_rom_output_flush_tx(uint8_t serial_num);
/**
* @brief Transmit one character to the console channel.
*
* @param c Character to send
* @return
* - 0 on success
* - 1 on failure
*/
int esp_rom_output_tx_one_char(uint8_t c);
/**
* @brief Transmit one character to the console channel.
* @note This function can help handle line ending issue by replacing '\n' with '\r\n'.
*
* @param c Character to send
*/
void esp_rom_output_putc(char c);
/**
* @brief Get one character from the console channel.
*
* @param c Where to store the character
* @return
* - 0 on success
* - 1 on failure or no data available
*/
int esp_rom_output_rx_one_char(uint8_t *c);
/**
* @brief Get one line of string from console channel (line ending won't be stored in the buffer).
*
* @param str Where to store the string
* @param max_len Maximum length of the buffer (including the NULL delimiter)
* @return always return 0 when on success or wait in a loop for rx data
*/
int esp_rom_output_rx_string(uint8_t *str, uint8_t max_len);
/**
* @brief Set the serial port used by ROM printf
*
* @param serial_num The serial number defined in ROM, including UART_x, USB_OTG, USB_SERIAL_JTAG.
* Use ESP_ROM_USB_SERIAL_DEVICE_NUM or ESP_ROM_USB_OTG_NUM to identify USB_SERIAL_JTAG and USB_OTG, respectively.
*/
void esp_rom_output_set_as_console(uint8_t serial_num);
/**
* @brief Switch the serial port that will use a buffer for TX and RX.
*
* @param serial_num The serial number defined in ROM, including UART_x, USB_OTG, USB_SERIAL_JTAG.
* Use ESP_ROM_USB_SERIAL_DEVICE_NUM or ESP_ROM_USB_OTG_NUM to identify USB_SERIAL_JTAG and USB_OTG, respectively.
*/
void esp_rom_output_switch_buffer(uint8_t serial_num);
#define ESP_ROM_CDC_ACM_WORK_BUF_MIN 128
/**
* @brief Initialize the USB ACM
* @note The ACM working memory should be at least 128 bytes (ESP_ROM_CDC_ACM_WORK_BUF_MIN) in size.
*
* @param cdc_acm_work_mem Pointer to the work memory used for CDC-ACM
* @param cdc_acm_work_mem_len Length of work memory
*/
void esp_rom_output_usb_acm_init(void *cdc_acm_work_mem, int cdc_acm_work_mem_len);
#ifdef __cplusplus
}
#endif

View File

@@ -1,19 +1,20 @@
/*
* SPDX-FileCopyrightText: 2010-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2010-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#warning "This header file is deprecated, please use esp_rom_serial_output.h instead"
#include <stdint.h>
#include "hal/uart_ll.h"
#include "esp_rom_serial_output.h"
#define ESP_ROM_CDC_ACM_WORK_BUF_MIN 128
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ESP_ROM_UART_0,
@@ -26,9 +27,8 @@ typedef enum {
*
* @param serial_num The serial number defined in ROM, including UART_x, USB_OTG, USB_SERIAL_JTAG..
*/
void esp_rom_output_tx_wait_idle(uint8_t serial_num);
void esp_rom_uart_tx_wait_idle(uint8_t serial_num) __attribute__((deprecated("Please use esp_rom_output_tx_wait_idle instead")));
__attribute__((deprecated("Please use esp_rom_output_tx_wait_idle instead")))
void esp_rom_uart_tx_wait_idle(uint8_t serial_num);
/**
* @brief Set clock source and baud rate for UART.
@@ -46,9 +46,8 @@ void esp_rom_uart_tx_wait_idle(uint8_t serial_num) __attribute__((deprecated("Pl
*
* @param serial_num UART port number
*/
void esp_rom_output_flush_tx(uint8_t serial_num);
void esp_rom_uart_flush_tx(uint8_t serial_num) __attribute__((deprecated("Please use esp_rom_output_flush_tx instead")));
__attribute__((deprecated("Please use esp_rom_output_flush_tx instead")))
void esp_rom_uart_flush_tx(uint8_t serial_num);
/**
* @brief Transmit one character to the console channel.
@@ -58,9 +57,8 @@ void esp_rom_uart_flush_tx(uint8_t serial_num) __attribute__((deprecated("Please
* - 0 on success
* - 1 on failure
*/
int esp_rom_output_tx_one_char(uint8_t c);
int esp_rom_uart_tx_one_char(uint8_t c) __attribute__((deprecated("Please use esp_rom_output_tx_one_char instead")));
__attribute__((deprecated("Please use esp_rom_output_tx_one_char instead")))
int esp_rom_uart_tx_one_char(uint8_t c);
/**
* @brief Transmit one character to the console channel.
@@ -68,9 +66,8 @@ int esp_rom_uart_tx_one_char(uint8_t c) __attribute__((deprecated("Please use es
*
* @param c Character to send
*/
void esp_rom_output_putc(char c);
void esp_rom_uart_putc(char c) __attribute__((deprecated("Please use esp_rom_output_putc instead")));
__attribute__((deprecated("Please use esp_rom_output_putc instead")))
void esp_rom_uart_putc(char c);
/**
* @brief Get one character from the console channel.
@@ -80,9 +77,8 @@ void esp_rom_uart_putc(char c) __attribute__((deprecated("Please use esp_rom_out
* - 0 on success
* - 1 on failure or no data available
*/
int esp_rom_output_rx_one_char(uint8_t *c);
int esp_rom_uart_rx_one_char(uint8_t *c) __attribute__((deprecated("Please use esp_rom_output_rx_one_char instead")));
__attribute__((deprecated("Please use esp_rom_output_rx_one_char instead")))
int esp_rom_uart_rx_one_char(uint8_t *c);
/**
* @brief Get one line of string from console channel (line ending won't be stored in the buffer).
@@ -91,9 +87,8 @@ int esp_rom_uart_rx_one_char(uint8_t *c) __attribute__((deprecated("Please use e
* @param max_len Maximum length of the buffer (including the NULL delimiter)
* @return always return 0 when on success or wait in a loop for rx data
*/
int esp_rom_output_rx_string(uint8_t *str, uint8_t max_len);
int esp_rom_uart_rx_string(uint8_t *str, uint8_t max_len) __attribute__((deprecated("Please use esp_rom_output_rx_string instead")));
__attribute__((deprecated("Please use esp_rom_output_rx_string instead")))
int esp_rom_uart_rx_string(uint8_t *str, uint8_t max_len);
/**
* @brief Set the UART port used by ets_printf.
@@ -103,9 +98,8 @@ int esp_rom_uart_rx_string(uint8_t *str, uint8_t max_len) __attribute__((depreca
*
* @param serial_num UART port number
*/
void esp_rom_output_set_as_console(uint8_t serial_num);
void esp_rom_uart_set_as_console(uint8_t serial_num) __attribute__((deprecated("Please use esp_rom_output_set_as_console instead")));
__attribute__((deprecated("Please use esp_rom_output_set_as_console instead")))
void esp_rom_uart_set_as_console(uint8_t serial_num);
/**
* @brief Switch the UART port that will use a buffer for TX and RX.
@@ -115,20 +109,18 @@ void esp_rom_uart_set_as_console(uint8_t serial_num) __attribute__((deprecated("
*
* @param serial_num UART port number
*/
void esp_rom_output_switch_buffer(uint8_t serial_num);
void esp_rom_uart_switch_buffer(uint8_t serial_num) __attribute__((deprecated("Please use esp_rom_output_switch_buffer instead")));
__attribute__((deprecated("Please use esp_rom_output_switch_buffer instead")))
void esp_rom_uart_switch_buffer(uint8_t serial_num);
/**
* @brief Initialize the USB ACM UART
* @note The ACM working memroy should be at least 128 bytes (ESP_ROM_CDC_ACM_WORK_BUF_MIN) in size.
* @note The ACM working memory should be at least 128 bytes (ESP_ROM_CDC_ACM_WORK_BUF_MIN) in size.
*
* @param cdc_acm_work_mem Pointer to the work memroy used for CDC-ACM
* @param cdc_acm_work_mem Pointer to the work memory used for CDC-ACM
* @param cdc_acm_work_mem_len Length of work memory
*/
void esp_rom_output_usb_acm_init(void *cdc_acm_work_mem, int cdc_acm_work_mem_len);
void esp_rom_uart_usb_acm_init(uint8_t serial_num) __attribute__((deprecated("Please use esp_rom_output_usb_acm_init instead")));
__attribute__((deprecated("Please use esp_rom_output_usb_acm_init instead")))
void esp_rom_uart_usb_acm_init(void *cdc_acm_work_mem, int cdc_acm_work_mem_len);
#ifdef __cplusplus
}

View File

@@ -9,7 +9,7 @@
#include <stddef.h>
#include "soc/soc_caps.h"
#include "esp_rom_caps.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "rom/ets_sys.h"
#include "sdkconfig.h"

View File

@@ -5,7 +5,7 @@
*/
#include "esp_system_console.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_usb_serial.h"
#include "esp_rom_caps.h"

View File

@@ -19,7 +19,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
static const char *TAG = "fpga_clk";

View File

@@ -18,7 +18,7 @@
#include "esp_private/cache_err_int.h"
#include "esp_clk_internal.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_caps.h"
#include "sdkconfig.h"
@@ -97,6 +97,7 @@
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
#include "hal/efuse_ll.h"
#include "hal/uart_ll.h"
#include "hal/cpu_utility_ll.h"
#include "soc/periph_defs.h"
#include "esp_cpu.h"
@@ -764,9 +765,7 @@ NOINLINE_ATTR static void system_early_init(const soc_reset_reason_t *rst_reas)
#endif
esp_rom_output_tx_wait_idle(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM);
// In a single thread mode, the freertos is not started yet. So don't have to use a critical section.
int __DECLARE_RCC_ATOMIC_ENV __attribute__((unused)); // To avoid build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
esp_rom_uart_set_clock_baudrate(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM, clock_hz, CONFIG_ESP_CONSOLE_UART_BAUDRATE);
_uart_ll_set_baudrate(UART_LL_GET_HW(CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM), CONFIG_ESP_CONSOLE_UART_BAUDRATE, clock_hz);
#endif
#endif

View File

@@ -15,7 +15,7 @@
#include "esp_private/panic_internal.h"
#include "esp_private/system_internal.h"
#include "esp_heap_caps.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "sdkconfig.h"

View File

@@ -17,7 +17,7 @@
#include "esp_log.h"
#include "esp_cpu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "sdkconfig.h"

View File

@@ -12,7 +12,7 @@
#include "esp_log.h"
#include "esp_ipc_isr.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/dport_reg.h"
#include "soc/gpio_periph.h"
#include "soc/efuse_periph.h"
@@ -22,6 +22,7 @@
#include "soc/rtc.h"
#include "esp_private/rtc_clk.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "soc/soc_memory_layout.h"
#include "esp_private/cache_err_int.h"

View File

@@ -25,7 +25,7 @@
#include "esp_private/periph_ctrl.h"
#include "bootloader_clock.h"
#include "soc/syscon_reg.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.
* Larger values increase startup delay. Smaller values may cause false positive

View File

@@ -12,7 +12,7 @@
#include "esp_attr.h"
#include "esp_log.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "soc/timer_group_reg.h"
#include "esp_cpu.h"
@@ -22,6 +22,7 @@
#include "soc/syscon_reg.h"
#include "soc/system_reg.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "esp_private/cache_err_int.h"
#include "esp32c2/rom/cache.h"

View File

@@ -25,7 +25,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "soc/syscon_reg.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.

View File

@@ -12,7 +12,7 @@
#include "esp_attr.h"
#include "esp_log.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "soc/timer_group_reg.h"
#include "esp_cpu.h"
@@ -23,6 +23,7 @@
#include "soc/system_reg.h"
#include "soc/uart_reg.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "esp_private/cache_err_int.h"
#include "esp32c3/rom/cache.h"

View File

@@ -64,7 +64,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/soc_caps.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"

View File

@@ -45,7 +45,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
@@ -22,6 +22,7 @@
#include "soc/uart_reg.h"
#include "hal/uart_ll.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "hal/modem_syscon_ll.h"
#include "hal/modem_lpcon_ll.h"
#include "esp_private/cache_err_int.h"

View File

@@ -23,7 +23,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
@@ -22,6 +22,7 @@
#include "soc/uart_reg.h"
#include "hal/uart_ll.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "esp_private/cache_err_int.h"
#if SOC_MODEM_CLOCK_SUPPORTED

View File

@@ -46,7 +46,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_sleep.h"

View File

@@ -14,7 +14,7 @@
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "riscv/interrupt.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
@@ -22,6 +22,7 @@
#include "soc/rtc_periph.h"
#include "soc/uart_reg.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "hal/spimem_flash_ll.h"
#include "hal/uart_ll.h"
#include "esp_private/cache_err_int.h"

View File

@@ -23,7 +23,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_sleep.h"

View File

@@ -13,7 +13,8 @@
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "riscv/interrupt.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/soc_caps.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
@@ -22,6 +23,7 @@
#include "soc/uart_reg.h"
#include "hal/uart_ll.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "hal/spimem_flash_ll.h"
#include "esp_private/cache_err_int.h"

View File

@@ -23,7 +23,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
//TODO: [ESP32H4] IDF-12285 inherited from verification branch, need check

View File

@@ -13,7 +13,8 @@
#include "esp_macros.h"
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/soc_caps.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"

View File

@@ -63,7 +63,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk.h"
#include "esp_private/esp_pmu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
/* Number of cycles to wait from the 32k XTAL oscillator to consider it running.

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "riscv/rv_utils.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/gpio_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
@@ -28,6 +28,7 @@
#include "soc/hp_sys_clkrst_reg.h"
#include "soc/lp_clkrst_reg.h"
#include "soc/hp_system_reg.h"
#include "hal/uart_ll.h"
#include "hal/gdma_ll.h"
#include "hal/axi_dma_ll.h"
#include "hal/dw_gdma_ll.h"

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_cpu.h"
#include "esp_clk_internal.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "soc/system_reg.h"
#include "soc/dport_reg.h"

View File

@@ -12,7 +12,7 @@
#include "esp_attr.h"
#include "esp_log.h"
#include "esp32s2/rom/cache.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/dport_reg.h"
#include "soc/gpio_reg.h"
#include "soc/timer_group_reg.h"
@@ -22,6 +22,7 @@
#include "soc/syscon_reg.h"
#include "soc/rtc_periph.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "soc/soc_memory_layout.h"
#include "esp32s2/rom/rtc.h"

View File

@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "esp_cpu.h"
#include "esp_clk_internal.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "soc/system_reg.h"
#include "soc/soc.h"

View File

@@ -12,7 +12,8 @@
#include "esp_private/system_internal.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "soc/soc_caps.h"
#include "soc/dport_reg.h"
#include "soc/gpio_reg.h"
#include "soc/timer_group_reg.h"
@@ -22,6 +23,7 @@
#include "soc/syscon_reg.h"
#include "soc/rtc_periph.h"
#include "hal/wdt_hal.h"
#include "hal/uart_ll.h"
#include "soc/soc_memory_layout.h"
#include "esp32s3/rom/cache.h"

View File

@@ -25,7 +25,7 @@
#include "soc/usb_struct.h"
#include "soc/usb_reg.h"
#include "hal/soc_hal.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_rom_caps.h"
#ifdef CONFIG_IDF_TARGET_ESP32S2

View File

@@ -8,7 +8,7 @@
#include <string.h>
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "hal/uart_ll.h"

View File

@@ -12,7 +12,7 @@
#include "unity.h"
#include "test_utils.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#if CONFIG_IDF_TARGET_ARCH_XTENSA

View File

@@ -25,7 +25,7 @@
#include "esp_newlib.h"
#include "test_utils.h"
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_rom_sys.h"
#include "esp_timer.h"
#include "esp_private/esp_clk.h"

View File

@@ -15,8 +15,9 @@
#include "esp_attr.h"
#include "hal/brownout_hal.h"
#include "hal/brownout_ll.h"
#include "hal/uart_ll.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "sdkconfig.h"
#include "esp_tee_intr.h"

View File

@@ -9,7 +9,7 @@
#include "esp_attr.h"
#include "esp_macros.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "rom/cache.h"
#include "riscv/rv_utils.h"

View File

@@ -216,7 +216,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
if (baud == 0) {
return false;
@@ -233,6 +233,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -220,7 +220,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -242,6 +242,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -226,7 +226,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -248,6 +248,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -437,7 +437,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
if ((hw) == &LP_UART) {
abort(); // need to call lp_uart_ll_set_baudrate()
@@ -464,6 +464,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -418,7 +418,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
if ((hw) == &LP_UART) {
abort(); // need to call lp_uart_ll_set_baudrate()
@@ -445,6 +445,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -265,7 +265,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -288,6 +288,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -245,7 +245,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -268,6 +268,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -246,7 +246,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -269,6 +269,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -261,7 +261,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -284,6 +284,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -106,6 +106,7 @@ FORCE_INLINE_ATTR void lp_uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *sou
case 1:
*source_clk = (soc_module_clk_t)LP_UART_SCLK_XTAL_D2;
break;
// TODO: IDF-9581
// case 2:
// *source_clk = (soc_module_clk_t)LP_UART_SCLK_LP_PLL;
// break;
@@ -528,7 +529,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
if ((hw) == &LP_UART) {
abort(); // need to call lp_uart_ll_set_baudrate()
@@ -567,10 +568,16 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
uart_ll_update(hw);
return true;
}
#if !BOOTLOADER_BUILD
//HP_SYS_CLKRST.peri_clk_ctrlxxx are shared registers, so this function must be used in an atomic way
#define uart_ll_set_baudrate(...) uart_ll_set_baudrate(__VA_ARGS__); (void)__DECLARE_RCC_ATOMIC_ENV
#endif
#define uart_ll_set_baudrate(...) ({ \
(void)__DECLARE_RCC_ATOMIC_ENV; \
int _temp; \
do { \
_temp = _uart_ll_set_baudrate(__VA_ARGS__); \
} while(0); \
_temp; \
})
/**
* @brief Get the current baud-rate.

View File

@@ -204,7 +204,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
if (baud == 0) {
return false;
@@ -221,6 +221,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -230,7 +230,7 @@ FORCE_INLINE_ATTR void uart_ll_get_sclk(uart_dev_t *hw, soc_module_clk_t *source
*
* @return True if baud-rate set successfully; False if baud-rate requested cannot be achieved
*/
FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
FORCE_INLINE_ATTR bool _uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint32_t sclk_freq)
{
#define DIV_UP(a, b) (((a) + (b) - 1) / (b))
if (baud == 0) {
@@ -252,6 +252,8 @@ FORCE_INLINE_ATTR bool uart_ll_set_baudrate(uart_dev_t *hw, uint32_t baud, uint3
return true;
}
#define uart_ll_set_baudrate(...) _uart_ll_set_baudrate(__VA_ARGS__)
/**
* @brief Get the current baud-rate.
*

View File

@@ -5,11 +5,11 @@
*/
#include <stddef.h>
#include "esp_attr.h"
#include "soc/soc_caps.h"
#include "esp_macros.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "riscv/csr.h"
#include "riscv/rvruntime-frames.h"

View File

@@ -15,7 +15,7 @@
#include "esp_private/log_print.h"
#include "esp_private/log_util.h"
#include "soc/soc.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#if BOOTLOADER_BUILD
#define APP_TYPE 0x01

View File

@@ -10,7 +10,7 @@
#include <string.h>
#include <inttypes.h>
#include "unity.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "sdkconfig.h"
/*

View File

@@ -14,7 +14,7 @@
#include "freertos/semphr.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "sdkconfig.h"
typedef struct {

View File

@@ -15,7 +15,7 @@
#include <sys/fcntl.h>
#include <sys/stat.h>
#include "sdkconfig.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_system_console.h"
static int syscall_not_implemented(struct _reent *r, ...)

View File

@@ -295,7 +295,7 @@ typedef enum {
typedef enum {
LP_UART_SCLK_LP_FAST = SOC_MOD_CLK_RTC_FAST, /*!< LP_UART source clock is LP(RTC)_FAST */
LP_UART_SCLK_XTAL_D2 = SOC_MOD_CLK_XTAL_D2, /*!< LP_UART source clock is XTAL_D2 */
// LP_UART_SCLK_LP_PLL = SOC_MOD_CLK_LP_PLL, /*!< LP_UART source clock is LP_PLL (8M PLL) */ TODO: LP_PLL clock requires extra support
// LP_UART_SCLK_LP_PLL = SOC_MOD_CLK_LP_PLL, /*!< LP_UART source clock is LP_PLL (8M PLL) */ TODO: IDF-9581
LP_UART_SCLK_DEFAULT = SOC_MOD_CLK_RTC_FAST, /*!< LP_UART source clock default choice is LP(RTC)_FAST */
} soc_periph_lp_uart_clk_src_t;

View File

@@ -7,7 +7,7 @@
#include "sdkconfig.h"
#include "ulp_lp_core_uart.h"
#include "hal/uart_hal.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#define LP_UART_PORT_NUM LP_UART_NUM_0
#define BINARY_SUPPORT 1

View File

@@ -8,7 +8,7 @@
#include "unity.h"
#include "sdkconfig.h"
#include "esp_cpu.h"
#include "esp_rom_uart.h"
#include "esp_rom_serial_output.h"
#include "esp_system_console.h"
#include "esp_private/esp_clk.h"