mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 04:25:32 +00:00
gpio: Fix IO hold function related problems
1. Fix deep sleep wakeup IOs can not be unhold issue 2. Correct hold related APIs' description 3. Fix gpio_force_hold_all API docs: Add GPIO wakeup source to sleep_modes doc for ESP32C3 and C2
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include "soc/soc.h"
|
||||
#include "soc/gpio_periph.h"
|
||||
#include "soc/gpio_struct.h"
|
||||
@@ -571,6 +572,20 @@ static inline void gpio_ll_deepsleep_wakeup_disable(gpio_dev_t *hw, uint32_t gpi
|
||||
LP_IO.pin[gpio_num].int_type = 0; // Disable io interrupt
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the status of whether an IO is used for deep-sleep wake-up.
|
||||
*
|
||||
* @param hw Peripheral GPIO hardware instance address.
|
||||
* @param gpio_num GPIO number
|
||||
* @return True if the pin is enabled to wake up from deep-sleep
|
||||
*/
|
||||
static inline bool gpio_ll_deepsleep_wakeup_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
||||
{
|
||||
HAL_ASSERT(gpio_num <= GPIO_NUM_7 && "gpio larger than 7 does not support deep sleep wake-up function");
|
||||
// On ESP32-C6, (lp_io pin number) == (gpio pin number)
|
||||
return LP_IO.pin[gpio_num].wakeup_enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -19,18 +19,13 @@ static inline void rtc_cntl_ll_set_wakeup_timer(uint64_t t)
|
||||
// TODO: IDF-5645
|
||||
}
|
||||
|
||||
static inline uint32_t rtc_cntl_ll_gpio_get_wakeup_pins(void)
|
||||
static inline uint32_t rtc_cntl_ll_gpio_get_wakeup_status(void)
|
||||
{
|
||||
// TODO: IDF-5645
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void rtc_cntl_ll_gpio_set_wakeup_pins(void)
|
||||
{
|
||||
// TODO: IDF-5645
|
||||
}
|
||||
|
||||
static inline void rtc_cntl_ll_gpio_clear_wakeup_pins(void)
|
||||
static inline void rtc_cntl_ll_gpio_clear_wakeup_status(void)
|
||||
{
|
||||
// TODO: IDF-5645
|
||||
}
|
||||
|
Reference in New Issue
Block a user