mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(lp_io): allow edge wakeup types for LP-IO on chips which support it
This commit is contained in:
@ -254,9 +254,11 @@ esp_err_t rtc_gpio_isolate(gpio_num_t gpio_num)
|
|||||||
esp_err_t rtc_gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type)
|
esp_err_t rtc_gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type)
|
||||||
{
|
{
|
||||||
ESP_RETURN_ON_FALSE(rtc_gpio_is_valid_gpio(gpio_num), ESP_ERR_INVALID_ARG, RTCIO_TAG, "RTCIO number error");
|
ESP_RETURN_ON_FALSE(rtc_gpio_is_valid_gpio(gpio_num), ESP_ERR_INVALID_ARG, RTCIO_TAG, "RTCIO number error");
|
||||||
|
#if !SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
if (intr_type == GPIO_INTR_POSEDGE || intr_type == GPIO_INTR_NEGEDGE || intr_type == GPIO_INTR_ANYEDGE) {
|
if (intr_type == GPIO_INTR_POSEDGE || intr_type == GPIO_INTR_NEGEDGE || intr_type == GPIO_INTR_ANYEDGE) {
|
||||||
return ESP_ERR_INVALID_ARG; // Dont support this mode.
|
return ESP_ERR_INVALID_ARG; // Dont support this mode.
|
||||||
}
|
}
|
||||||
|
#endif //!SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
RTCIO_ENTER_CRITICAL();
|
RTCIO_ENTER_CRITICAL();
|
||||||
rtcio_hal_wakeup_enable(rtc_io_number_get(gpio_num), intr_type);
|
rtcio_hal_wakeup_enable(rtc_io_number_get(gpio_num), intr_type);
|
||||||
RTCIO_EXIT_CRITICAL();
|
RTCIO_EXIT_CRITICAL();
|
||||||
|
@ -567,6 +567,10 @@ config SOC_RTCIO_WAKE_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
||||||
int
|
int
|
||||||
default 8
|
default 8
|
||||||
|
@ -246,6 +246,7 @@
|
|||||||
*/
|
*/
|
||||||
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||||
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||||
|
#define SOC_RTCIO_EDGE_WAKE_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||||
|
@ -559,6 +559,10 @@ config SOC_RTCIO_WAKE_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
||||||
int
|
int
|
||||||
default 8
|
default 8
|
||||||
|
@ -231,6 +231,7 @@
|
|||||||
*/
|
*/
|
||||||
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||||
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||||
|
#define SOC_RTCIO_EDGE_WAKE_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||||
|
@ -387,6 +387,10 @@ config SOC_RTCIO_WAKE_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
||||||
int
|
int
|
||||||
default 8
|
default 8
|
||||||
|
@ -206,8 +206,9 @@
|
|||||||
* so it supports unique IOMUX configuration (including IE, OE, PU, PD, DRV etc.)
|
* so it supports unique IOMUX configuration (including IE, OE, PU, PD, DRV etc.)
|
||||||
* when the pins are switched to RTC function.
|
* when the pins are switched to RTC function.
|
||||||
*/
|
*/
|
||||||
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||||
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||||
|
#define SOC_RTCIO_EDGE_WAKE_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||||
|
@ -731,6 +731,10 @@ config SOC_RTCIO_WAKE_SUPPORTED
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config SOC_RTCIO_EDGE_WAKE_SUPPORTED
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
config SOC_DEDIC_GPIO_OUT_CHANNELS_NUM
|
||||||
int
|
int
|
||||||
default 8
|
default 8
|
||||||
|
@ -281,6 +281,7 @@
|
|||||||
*/
|
*/
|
||||||
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
#define SOC_RTCIO_HOLD_SUPPORTED 1
|
||||||
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
#define SOC_RTCIO_WAKE_SUPPORTED 1
|
||||||
|
#define SOC_RTCIO_EDGE_WAKE_SUPPORTED 1
|
||||||
|
|
||||||
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
/*-------------------------- Dedicated GPIO CAPS -----------------------------*/
|
||||||
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
#define SOC_DEDIC_GPIO_OUT_CHANNELS_NUM (8) /*!< 8 outward channels on each CPU core */
|
||||||
|
@ -34,7 +34,7 @@ static void wakeup_gpio_init(void)
|
|||||||
rtc_gpio_set_direction(WAKEUP_PIN, RTC_GPIO_MODE_INPUT_ONLY);
|
rtc_gpio_set_direction(WAKEUP_PIN, RTC_GPIO_MODE_INPUT_ONLY);
|
||||||
rtc_gpio_pulldown_dis(WAKEUP_PIN);
|
rtc_gpio_pulldown_dis(WAKEUP_PIN);
|
||||||
rtc_gpio_pullup_en(WAKEUP_PIN);
|
rtc_gpio_pullup_en(WAKEUP_PIN);
|
||||||
rtc_gpio_wakeup_enable(WAKEUP_PIN, GPIO_INTR_LOW_LEVEL);
|
rtc_gpio_wakeup_enable(WAKEUP_PIN, GPIO_INTR_NEGEDGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void app_main(void)
|
void app_main(void)
|
||||||
|
@ -14,9 +14,6 @@ int main (void)
|
|||||||
{
|
{
|
||||||
ulp_lp_core_wakeup_main_processor();
|
ulp_lp_core_wakeup_main_processor();
|
||||||
|
|
||||||
/* Wakeup interrupt is a level interrupt, wait 1 sec to
|
|
||||||
allow user to release button to avoid waking up the ULP multiple times */
|
|
||||||
ulp_lp_core_delay_us(1000*1000);
|
|
||||||
ulp_lp_core_gpio_clear_intr_status();
|
ulp_lp_core_gpio_clear_intr_status();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user