bugfix: ext0_wakeup_prepare func when s_config.wakeup_triggers & RTC_EXT0_TRIG_EN == false

This commit is contained in:
Lou Tianhao
2023-11-17 16:53:19 +08:00
parent 7343d16a13
commit d97f45b3a8
5 changed files with 48 additions and 2 deletions

View File

@@ -360,7 +360,7 @@ static inline void rtcio_ll_disable_sleep_setting(int rtcio_num)
}
/**
* Set specific logic level on an RTC IO pin as a wakeup trigger.
* Set specific logic level on an RTC IO pin as a ext0 wakeup trigger.
*
* @param rtcio_num The index of rtcio. 0 ~ MAX(rtcio).
* @param level Logic level (0)
@@ -373,6 +373,16 @@ static inline void rtcio_ll_ext0_set_wakeup_pin(int rtcio_num, int level)
level , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
/**
* Clear ext0 wakeup trigger.
*/
static inline void rtcio_ll_ext0_clear_wakeup_pins(void)
{
REG_SET_FIELD(RTC_IO_EXT_WAKEUP0_REG, RTC_IO_EXT_WAKEUP0_SEL, 0);
// Clear level which will trigger wakeup
SET_PERI_REG_BITS(RTC_CNTL_EXT_WAKEUP_CONF_REG, 0x1,
0 , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
#ifdef __cplusplus
}
#endif

View File

@@ -376,6 +376,17 @@ static inline void rtcio_ll_ext0_set_wakeup_pin(int rtcio_num, int level)
level , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
/**
* Clear ext0 wakeup trigger.
*/
static inline void rtcio_ll_ext0_clear_wakeup_pins(void)
{
REG_SET_FIELD(RTC_IO_EXT_WAKEUP0_REG, RTC_IO_EXT_WAKEUP0_SEL, 0);
// Clear level which will trigger wakeup
SET_PERI_REG_BITS(RTC_CNTL_EXT_WAKEUP_CONF_REG, 0x1,
0 , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
#ifdef __cplusplus
}
#endif

View File

@@ -391,6 +391,17 @@ static inline void rtcio_ll_ext0_set_wakeup_pin(int rtcio_num, int level)
level , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
/**
* Clear ext0 wakeup trigger.
*/
static inline void rtcio_ll_ext0_clear_wakeup_pins(void)
{
REG_SET_FIELD(RTC_IO_EXT_WAKEUP0_REG, RTC_IO_EXT_WAKEUP0_SEL, 0);
// Clear level which will trigger wakeup
SET_PERI_REG_BITS(RTC_CNTL_EXT_WAKEUP_CONF_REG, 0x1,
0 , RTC_CNTL_EXT_WAKEUP0_LV_S);
}
#ifdef __cplusplus
}
#endif

View File

@@ -259,13 +259,18 @@ void rtcio_hal_set_direction_in_sleep(int rtcio_num, rtc_gpio_mode_t mode);
#define rtcio_hal_wakeup_disable(rtcio_num) rtcio_ll_wakeup_disable(rtcio_num)
/**
* Set specific logic level on an RTC IO pin as a wakeup trigger.
* Set specific logic level on an RTC IO pin as a ext0 wakeup trigger.
*
* @param rtcio_num The index of rtcio. 0 ~ SOC_RTCIO_PIN_COUNT.
* @param level Logic level (0)
*/
#define rtcio_hal_ext0_set_wakeup_pin(rtcio_num, level) rtcio_ll_ext0_set_wakeup_pin(rtcio_num, level)
/**
* Clear ext0 wakeup trigger.
*/
#define rtcio_hal_ext0_clear_wakeup_pins() rtcio_ll_ext0_clear_wakeup_pins()
#endif
#if SOC_RTCIO_HOLD_SUPPORTED && SOC_RTCIO_INPUT_OUTPUT_SUPPORTED