File tree Expand file tree Collapse file tree 4 files changed +19
-23
lines changed
Expand file tree Collapse file tree 4 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ MODULE = esp_idf_api
22
33# ESP-IDF header files must be found first in this module. Therefore,
44# the ESP-IDF include paths must come before the RIOT include paths.
5- PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/driver/include
65PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/esp_common/include
6+ PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/esp_driver_gpio/include
7+ PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/esp_driver_uart/include
78PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/esp_hw_support/include
89PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/esp_rom/include
910PRE_INCLUDES += -I$(ESP32_SDK_DIR ) /components/hal/include
Original file line number Diff line number Diff line change 2020#include <stdbool.h>
2121#include <stdint.h>
2222
23- #include "driver/uart.h"
24- #include "hal/uart_hal.h"
23+ #include "esp_private/uart_share_hw_ctrl.h"
24+ #include "esp_rom_uart.h"
25+ #include "hal/uart_ll.h"
2526
2627#include "esp_idf_api/uart.h"
2728
28- static uart_hal_context_t _uart_hal_ctx [] = {
29- #if UART_NUM_MAX >= 1
30- {
31- .dev = UART_LL_GET_HW (0 ),
32- },
33- #endif
34- #if UART_NUM_MAX >= 2
35- {
36- .dev = UART_LL_GET_HW (1 ),
37- },
38- #endif
39- #if UART_NUM_MAX >= 3
40- {
41- .dev = UART_LL_GET_HW (2 ),
42- },
43- #endif
44- };
45-
4629void esp_idf_uart_set_wakeup_threshold (unsigned uart_num , uint32_t threshold )
4730{
48- assert (uart_num < ARRAY_SIZE (_uart_hal_ctx ));
49- uart_hal_set_wakeup_thrd (& _uart_hal_ctx [uart_num ], threshold );
31+ assert (uart_num < SOC_UART_NUM );
32+
33+ HP_UART_PAD_CLK_ATOMIC () {
34+ uart_ll_set_wakeup_thrd (UART_LL_GET_HW (uart_num ), threshold );
35+ uart_ll_enable_pad_sleep_clock (UART_LL_GET_HW (uart_num ), true);
36+ }
37+ }
38+
39+ void esp_idf_esp_rom_output_tx_wait_idle (unsigned uart_num )
40+ {
41+ esp_rom_output_tx_wait_idle (uart_num );
5042}
Original file line number Diff line number Diff line change 2121
2222#include "esp_err.h"
2323#include "hal/gpio_types.h"
24+ #include "driver/gpio.h"
2425
2526#ifndef DOXYGEN /* Hide implementation details from doxygen */
2627
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ extern "C" {
2727
2828void esp_idf_uart_set_wakeup_threshold (unsigned uart_num , uint32_t threshold );
2929
30+ void esp_idf_esp_rom_output_tx_wait_idle (unsigned uart_num );
31+
3032#ifdef __cplusplus
3133}
3234#endif
You can’t perform that action at this time.
0 commit comments