mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 20:00:53 +00:00
feat: supports lp uart wakeup
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -29,8 +29,9 @@ extern "C" {
|
||||
// Get UART hardware instance with giving uart num
|
||||
#define UART_LL_GET_HW(num) (((num) == UART_NUM_0) ? (&UART0) : (&UART1))
|
||||
|
||||
#define UART_LL_MIN_WAKEUP_THRESH (3)
|
||||
#define UART_LL_WAKEUP_EDGE_THRED_MIN (3)
|
||||
#define UART_LL_INTR_MASK (0x7ffff) //All interrupt mask
|
||||
#define UART_LL_WAKEUP_EDGE_THRED_MAX(hw) UART_ACTIVE_THRESHOLD_V
|
||||
|
||||
#define UART_LL_FSM_IDLE (0x0)
|
||||
#define UART_LL_FSM_TX_WAIT_SEND (0xf)
|
||||
@@ -676,12 +677,18 @@ FORCE_INLINE_ATTR void uart_ll_set_dtr_active_level(uart_dev_t *hw, int level)
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
FORCE_INLINE_ATTR void uart_ll_set_wakeup_thrd(uart_dev_t *hw, uint32_t wakeup_thrd)
|
||||
FORCE_INLINE_ATTR void uart_ll_set_wakeup_edge_thrd(uart_dev_t *hw, uint32_t wakeup_thrd)
|
||||
{
|
||||
// System would wakeup when the number of positive edges of RxD signal is larger than or equal to (UART_ACTIVE_THRESHOLD+3)
|
||||
hw->sleep_conf.active_threshold = wakeup_thrd - UART_LL_MIN_WAKEUP_THRESH;
|
||||
hw->sleep_conf.active_threshold = wakeup_thrd - UART_LL_WAKEUP_EDGE_THRED_MIN;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Mocking the selection of the UART wakeup mode, as it is not supported by this SOC.
|
||||
*/
|
||||
FORCE_INLINE_ATTR void uart_ll_set_wakeup_mode(uart_dev_t *hw, uart_wakeup_mode_t mode)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief Enable/disable the UART pad clock in sleep_state
|
||||
*
|
||||
@@ -839,9 +846,9 @@ FORCE_INLINE_ATTR void uart_ll_get_at_cmd_char(uart_dev_t *hw, uint8_t *cmd_char
|
||||
*
|
||||
* @return The UART wakeup threshold value.
|
||||
*/
|
||||
FORCE_INLINE_ATTR uint32_t uart_ll_get_wakeup_thrd(uart_dev_t *hw)
|
||||
FORCE_INLINE_ATTR uint32_t uart_ll_get_wakeup_edge_thrd(uart_dev_t *hw)
|
||||
{
|
||||
return hw->sleep_conf.active_threshold + UART_LL_MIN_WAKEUP_THRESH;
|
||||
return hw->sleep_conf.active_threshold + UART_LL_WAKEUP_EDGE_THRED_MIN;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user