forked from espressif/esp-idf
Merge branch 'fix/fix_p4_deepsleep_io_leakage' into 'master'
fix(esp_hw_support): fix esp32p4 JTAG pad deepsleep current leakage Closes PM-204 See merge request espressif/esp-idf!35633
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "soc/pmu_reg.h"
|
#include "soc/pmu_reg.h"
|
||||||
#include "soc/pmu_struct.h"
|
#include "soc/pmu_struct.h"
|
||||||
#include "hal/clk_tree_hal.h"
|
#include "hal/clk_tree_hal.h"
|
||||||
|
#include "hal/gpio_hal.h"
|
||||||
#include "hal/lp_aon_hal.h"
|
#include "hal/lp_aon_hal.h"
|
||||||
#include "soc/lp_system_reg.h"
|
#include "soc/lp_system_reg.h"
|
||||||
#include "hal/pmu_hal.h"
|
#include "hal/pmu_hal.h"
|
||||||
@@ -242,6 +243,26 @@ static void pmu_sleep_digital_init(pmu_context_t *ctx, const pmu_sleep_digital_c
|
|||||||
{
|
{
|
||||||
pmu_ll_hp_set_dig_pad_slp_sel (ctx->hal->dev, HP(SLEEP), dig->syscntl.dig_pad_slp_sel);
|
pmu_ll_hp_set_dig_pad_slp_sel (ctx->hal->dev, HP(SLEEP), dig->syscntl.dig_pad_slp_sel);
|
||||||
pmu_ll_hp_set_hold_all_lp_pad (ctx->hal->dev, HP(SLEEP), dig->syscntl.lp_pad_hold_all);
|
pmu_ll_hp_set_hold_all_lp_pad (ctx->hal->dev, HP(SLEEP), dig->syscntl.lp_pad_hold_all);
|
||||||
|
|
||||||
|
// Lowpower workaround for LP pad holding, JTAG IOs is located on lp_pad on esp32p4, if hold its
|
||||||
|
// default state on sleep, there's a high current leakage.
|
||||||
|
if (dig->syscntl.lp_pad_hold_all) {
|
||||||
|
gpio_hal_context_t gpio_hal = {
|
||||||
|
.dev = GPIO_HAL_GET_HW(GPIO_PORT_0)
|
||||||
|
};
|
||||||
|
if ((LP_IOMUX.pad[2].mux_sel == 0) && (IO_MUX.gpio[2].mcu_sel == 0)) {
|
||||||
|
gpio_hal_isolate_in_sleep(&gpio_hal, 2); // MTCK
|
||||||
|
}
|
||||||
|
if ((LP_IOMUX.pad[3].mux_sel == 0) && (IO_MUX.gpio[3].mcu_sel == 0)) {
|
||||||
|
gpio_hal_isolate_in_sleep(&gpio_hal, 3); // MTDI
|
||||||
|
}
|
||||||
|
if ((LP_IOMUX.pad[4].mux_sel == 0) && (IO_MUX.gpio[4].mcu_sel == 0)) {
|
||||||
|
gpio_hal_isolate_in_sleep(&gpio_hal, 4); // MTMS
|
||||||
|
}
|
||||||
|
if ((LP_IOMUX.pad[5].mux_sel == 0) && (IO_MUX.gpio[5].mcu_sel == 0)) {
|
||||||
|
gpio_hal_isolate_in_sleep(&gpio_hal, 5); // MTDO
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pmu_sleep_analog_init(pmu_context_t *ctx, const pmu_sleep_analog_config_t *analog, bool dslp)
|
static void pmu_sleep_analog_init(pmu_context_t *ctx, const pmu_sleep_analog_config_t *analog, bool dslp)
|
||||||
@@ -376,6 +397,11 @@ TCM_IRAM_ATTR uint32_t pmu_sleep_start(uint32_t wakeup_opt, uint32_t reject_opt,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The PMU state machine will switch PAD to sleep setting and do IO holding at the same stage.
|
||||||
|
// IO may be held to an indeterminate state, so the software needs to trigger the PAD to switch
|
||||||
|
// to the sleep setting before starting the PMU state machine.
|
||||||
|
pmu_ll_imm_set_pad_slp_sel(PMU_instance()->hal->dev, true);
|
||||||
|
|
||||||
/* Start entry into sleep mode */
|
/* Start entry into sleep mode */
|
||||||
pmu_ll_hp_set_sleep_enable(PMU_instance()->hal->dev);
|
pmu_ll_hp_set_sleep_enable(PMU_instance()->hal->dev);
|
||||||
|
|
||||||
@@ -412,6 +438,8 @@ TCM_IRAM_ATTR bool pmu_sleep_finish(bool dslp)
|
|||||||
pmu_sleep_shutdown_ldo();
|
pmu_sleep_shutdown_ldo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pmu_ll_imm_set_pad_slp_sel(PMU_instance()->hal->dev, false);
|
||||||
|
|
||||||
// Wait eFuse memory update done.
|
// Wait eFuse memory update done.
|
||||||
while(efuse_ll_get_controller_state() != EFUSE_CONTROLLER_STATE_IDLE);
|
while(efuse_ll_get_controller_state() != EFUSE_CONTROLLER_STATE_IDLE);
|
||||||
|
|
||||||
|
@@ -331,7 +331,7 @@ typedef struct {
|
|||||||
|
|
||||||
#define PMU_SLEEP_DIGITAL_LSLP_CONFIG_DEFAULT(pd_flags) { \
|
#define PMU_SLEEP_DIGITAL_LSLP_CONFIG_DEFAULT(pd_flags) { \
|
||||||
.syscntl = { \
|
.syscntl = { \
|
||||||
.dig_pad_slp_sel = (pd_flags & PMU_SLEEP_PD_TOP) ? 0 : 1, \
|
.dig_pad_slp_sel = 0, \
|
||||||
.lp_pad_hold_all = (pd_flags & PMU_SLEEP_PD_LP_PERIPH) ? 1 : 0, \
|
.lp_pad_hold_all = (pd_flags & PMU_SLEEP_PD_LP_PERIPH) ? 1 : 0, \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
@@ -169,6 +169,7 @@ static inline bool gpio_ll_pulldown_is_enabled(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -180,6 +181,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -192,6 +194,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
* @return if GPIO gpio_num`s SLP_SEL is true
|
* @return if GPIO gpio_num`s SLP_SEL is true
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline bool gpio_ll_sleep_sel_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline bool gpio_ll_sleep_sel_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_SEL) ? true : false;
|
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_SEL) ? true : false;
|
||||||
@@ -203,6 +206,7 @@ static inline bool gpio_ll_sleep_sel_is_enabled(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -214,6 +218,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -226,6 +231,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
* @return if GPIO gpio_num`s SLP_PU is true
|
* @return if GPIO gpio_num`s SLP_PU is true
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline bool gpio_ll_sleep_pullup_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline bool gpio_ll_sleep_pullup_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_PU) ? true : false;
|
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_PU) ? true : false;
|
||||||
@@ -237,6 +243,7 @@ static inline bool gpio_ll_sleep_pullup_is_enabled(gpio_dev_t *hw, uint32_t gpio
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -248,6 +255,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -260,6 +268,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
* @return if GPIO gpio_num`s SLP_PD is true
|
* @return if GPIO gpio_num`s SLP_PD is true
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline bool gpio_ll_sleep_pulldown_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline bool gpio_ll_sleep_pulldown_is_enabled(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_PD) ? true : false;
|
return REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], SLP_PD) ? true : false;
|
||||||
@@ -418,6 +427,7 @@ static inline void gpio_ll_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -429,6 +439,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -440,6 +451,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -451,6 +463,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
|
@@ -603,6 +603,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -614,6 +615,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -625,6 +627,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -636,6 +639,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -647,6 +651,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -658,6 +663,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -669,6 +675,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -680,6 +687,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -691,6 +699,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -702,6 +711,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
|
@@ -576,6 +576,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -587,6 +588,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -598,6 +600,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -609,6 +612,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -620,6 +624,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -631,6 +636,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -642,6 +648,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -653,6 +660,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -664,6 +672,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -675,6 +684,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
|
@@ -617,6 +617,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].slp_sel = 1;
|
IO_MUX.gpio[gpio_num].slp_sel = 1;
|
||||||
@@ -629,6 +630,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].slp_sel = 0;
|
IO_MUX.gpio[gpio_num].slp_sel = 0;
|
||||||
@@ -640,6 +642,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpu = 0;
|
IO_MUX.gpio[gpio_num].mcu_wpu = 0;
|
||||||
@@ -651,6 +654,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpu = 1;
|
IO_MUX.gpio[gpio_num].mcu_wpu = 1;
|
||||||
@@ -662,6 +666,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpd = 1;
|
IO_MUX.gpio[gpio_num].mcu_wpd = 1;
|
||||||
@@ -673,6 +678,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpd = 0;
|
IO_MUX.gpio[gpio_num].mcu_wpd = 0;
|
||||||
@@ -684,6 +690,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_ie = 0;
|
IO_MUX.gpio[gpio_num].mcu_ie = 0;
|
||||||
@@ -695,6 +702,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_ie = 1;
|
IO_MUX.gpio[gpio_num].mcu_ie = 1;
|
||||||
@@ -706,6 +714,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_oe = 0;
|
IO_MUX.gpio[gpio_num].mcu_oe = 0;
|
||||||
@@ -717,6 +726,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_oe = 1;
|
IO_MUX.gpio[gpio_num].mcu_oe = 1;
|
||||||
|
@@ -600,6 +600,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_SEL_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -612,6 +613,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_SEL_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -623,6 +625,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLUP_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -634,6 +637,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLUP_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -645,6 +649,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLDOWN_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -656,6 +661,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLDOWN_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -667,6 +673,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_INPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -678,6 +685,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_INPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -689,6 +697,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_OUTPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -700,6 +709,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_OUTPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
|
@@ -616,6 +616,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_slp_sel = 1;
|
IO_MUX.gpion[gpio_num].gpion_slp_sel = 1;
|
||||||
@@ -628,6 +629,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_slp_sel = 0;
|
IO_MUX.gpion[gpio_num].gpion_slp_sel = 0;
|
||||||
@@ -639,6 +641,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_wpu = 0;
|
IO_MUX.gpion[gpio_num].gpion_mcu_wpu = 0;
|
||||||
@@ -650,6 +653,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_wpu = 1;
|
IO_MUX.gpion[gpio_num].gpion_mcu_wpu = 1;
|
||||||
@@ -661,6 +665,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_wpd = 1;
|
IO_MUX.gpion[gpio_num].gpion_mcu_wpd = 1;
|
||||||
@@ -672,6 +677,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_wpd = 0;
|
IO_MUX.gpion[gpio_num].gpion_mcu_wpd = 0;
|
||||||
@@ -683,6 +689,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_ie = 0;
|
IO_MUX.gpion[gpio_num].gpion_mcu_ie = 0;
|
||||||
@@ -694,6 +701,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_ie = 1;
|
IO_MUX.gpion[gpio_num].gpion_mcu_ie = 1;
|
||||||
@@ -705,6 +713,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_oe = 0;
|
IO_MUX.gpion[gpio_num].gpion_mcu_oe = 0;
|
||||||
@@ -716,6 +725,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpion[gpio_num].gpion_mcu_oe = 1;
|
IO_MUX.gpion[gpio_num].gpion_mcu_oe = 1;
|
||||||
|
@@ -648,6 +648,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_SEL_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -660,6 +661,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_SEL_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -671,6 +673,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLUP_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -682,6 +685,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLUP_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -693,6 +697,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLDOWN_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -704,6 +709,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, gpio_num_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_PULLDOWN_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -715,6 +721,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, gpio_num_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_INPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -726,6 +733,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, gpio_num_t gpio_n
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_INPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -737,6 +745,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, gpio_num_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_OUTPUT_DISABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
@@ -748,6 +757,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, gpio_num_t gpio_
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
PIN_SLP_OUTPUT_ENABLE(IO_MUX_GPIO0_REG + (gpio_num * 4));
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#include "soc/gpio_periph.h"
|
#include "soc/gpio_periph.h"
|
||||||
#include "soc/gpio_struct.h"
|
#include "soc/gpio_struct.h"
|
||||||
|
#include "soc/io_mux_reg.h"
|
||||||
#include "soc/io_mux_struct.h"
|
#include "soc/io_mux_struct.h"
|
||||||
#include "soc/hp_system_struct.h"
|
#include "soc/hp_system_struct.h"
|
||||||
#include "soc/lp_iomux_struct.h"
|
#include "soc/lp_iomux_struct.h"
|
||||||
@@ -723,6 +724,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].slp_sel = 1;
|
IO_MUX.gpio[gpio_num].slp_sel = 1;
|
||||||
@@ -735,6 +737,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].slp_sel = 0;
|
IO_MUX.gpio[gpio_num].slp_sel = 0;
|
||||||
@@ -746,6 +749,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpu = 0;
|
IO_MUX.gpio[gpio_num].mcu_wpu = 0;
|
||||||
@@ -757,6 +761,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpu = 1;
|
IO_MUX.gpio[gpio_num].mcu_wpu = 1;
|
||||||
@@ -768,6 +773,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpd = 1;
|
IO_MUX.gpio[gpio_num].mcu_wpd = 1;
|
||||||
@@ -779,6 +785,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_wpd = 0;
|
IO_MUX.gpio[gpio_num].mcu_wpd = 0;
|
||||||
@@ -790,6 +797,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_ie = 0;
|
IO_MUX.gpio[gpio_num].mcu_ie = 0;
|
||||||
@@ -801,6 +809,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_ie = 1;
|
IO_MUX.gpio[gpio_num].mcu_ie = 1;
|
||||||
@@ -812,6 +821,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_oe = 0;
|
IO_MUX.gpio[gpio_num].mcu_oe = 0;
|
||||||
@@ -823,11 +833,13 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
IO_MUX.gpio[gpio_num].mcu_oe = 1;
|
IO_MUX.gpio[gpio_num].mcu_oe = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -348,6 +348,17 @@ FORCE_INLINE_ATTR void pmu_ll_imm_set_lp_rootclk_sel(pmu_dev_t *hw, bool rootclk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCE_INLINE_ATTR void pmu_ll_imm_set_pad_slp_sel(pmu_dev_t *hw, bool sleep_sel)
|
||||||
|
{
|
||||||
|
if (sleep_sel) {
|
||||||
|
// Switch the pad configuration from active state to sleep state
|
||||||
|
hw->imm.pad_hold_all.tie_high_pad_slp_sel = 1;
|
||||||
|
} else {
|
||||||
|
// Switch the pad configuration from sleep state to active state
|
||||||
|
hw->imm.pad_hold_all.tie_low_pad_slp_sel = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FORCE_INLINE_ATTR void pmu_ll_imm_set_hp_pad_hold_all(pmu_dev_t *hw, bool hold_all)
|
FORCE_INLINE_ATTR void pmu_ll_imm_set_hp_pad_hold_all(pmu_dev_t *hw, bool hold_all)
|
||||||
{
|
{
|
||||||
if (hold_all) {
|
if (hold_all) {
|
||||||
|
@@ -611,6 +611,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -622,6 +623,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -633,6 +635,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -644,6 +647,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -655,6 +659,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -666,6 +671,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -677,6 +683,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -688,6 +695,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -699,6 +707,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -710,6 +719,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
|
@@ -590,6 +590,7 @@ static inline void gpio_ll_force_unhold_all(void)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -601,6 +602,7 @@ static inline void gpio_ll_sleep_sel_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_SEL_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -612,6 +614,7 @@ static inline void gpio_ll_sleep_sel_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -623,6 +626,7 @@ static inline void gpio_ll_sleep_pullup_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLUP_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -634,6 +638,7 @@ static inline void gpio_ll_sleep_pullup_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -645,6 +650,7 @@ static inline void gpio_ll_sleep_pulldown_en(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_PULLDOWN_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -656,6 +662,7 @@ static inline void gpio_ll_sleep_pulldown_dis(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -667,6 +674,7 @@ static inline void gpio_ll_sleep_input_disable(gpio_dev_t *hw, uint32_t gpio_num
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_INPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -678,6 +686,7 @@ static inline void gpio_ll_sleep_input_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_DISABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
@@ -689,6 +698,7 @@ static inline void gpio_ll_sleep_output_disable(gpio_dev_t *hw, uint32_t gpio_nu
|
|||||||
* @param hw Peripheral GPIO hardware instance address.
|
* @param hw Peripheral GPIO hardware instance address.
|
||||||
* @param gpio_num GPIO number
|
* @param gpio_num GPIO number
|
||||||
*/
|
*/
|
||||||
|
__attribute__((always_inline))
|
||||||
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
static inline void gpio_ll_sleep_output_enable(gpio_dev_t *hw, uint32_t gpio_num)
|
||||||
{
|
{
|
||||||
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
PIN_SLP_OUTPUT_ENABLE(GPIO_PIN_MUX_REG[gpio_num]);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
// The HAL layer for GPIO (common part)
|
// The HAL layer for GPIO (common part)
|
||||||
|
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
|
#include "esp_attr.h"
|
||||||
#include "soc/gpio_periph.h"
|
#include "soc/gpio_periph.h"
|
||||||
#include "hal/gpio_hal.h"
|
#include "hal/gpio_hal.h"
|
||||||
|
|
||||||
@@ -44,3 +45,12 @@ void gpio_hal_hysteresis_soft_enable(gpio_hal_context_t *hal, uint32_t gpio_num,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //SOC_GPIO_SUPPORT_PIN_HYS_FILTER
|
#endif //SOC_GPIO_SUPPORT_PIN_HYS_FILTER
|
||||||
|
|
||||||
|
void gpio_hal_isolate_in_sleep(gpio_hal_context_t *hal, uint32_t gpio_num)
|
||||||
|
{
|
||||||
|
gpio_ll_sleep_input_disable(hal->dev, gpio_num);
|
||||||
|
gpio_ll_sleep_output_disable(hal->dev, gpio_num);
|
||||||
|
gpio_ll_sleep_pullup_dis(hal->dev, gpio_num);
|
||||||
|
gpio_ll_sleep_pulldown_dis(hal->dev, gpio_num);
|
||||||
|
gpio_ll_sleep_sel_en(hal->dev, gpio_num);
|
||||||
|
}
|
||||||
|
@@ -545,6 +545,15 @@ void gpio_hal_hysteresis_soft_enable(gpio_hal_context_t *hal, uint32_t gpio_num,
|
|||||||
#endif
|
#endif
|
||||||
#endif // SOC_GPIO_SUPPORT_PIN_HYS_FILTER
|
#endif // SOC_GPIO_SUPPORT_PIN_HYS_FILTER
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Helper function to disconnect internal circuits from an GPIO in sleep mode.
|
||||||
|
* This function disables input, output, pullup, pulldown for an GPIO in sleep mode.
|
||||||
|
*
|
||||||
|
* @param hal Context of the HAL layer
|
||||||
|
* @param gpio_num GPIO number
|
||||||
|
*/
|
||||||
|
void gpio_hal_isolate_in_sleep(gpio_hal_context_t *hal, uint32_t gpio_num);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -24,3 +24,5 @@ entries:
|
|||||||
spi_flash_hal_gpspi (noflash)
|
spi_flash_hal_gpspi (noflash)
|
||||||
if SOC_PMU_SUPPORTED = y:
|
if SOC_PMU_SUPPORTED = y:
|
||||||
pmu_hal (noflash)
|
pmu_hal (noflash)
|
||||||
|
if SOC_GPIO_PORT != 0:
|
||||||
|
gpio_hal: gpio_hal_isolate_in_sleep (noflash)
|
||||||
|
Reference in New Issue
Block a user