Merge branch 'feat/support_hysteresis_filter_on_c61' into 'master'

feat(gpio): support hysteresis filter on C61

See merge request espressif/esp-idf!32881
This commit is contained in:
Gao Xu
2024-08-22 19:30:16 +08:00
5 changed files with 52 additions and 21 deletions

View File

@@ -259,6 +259,31 @@ static inline void gpio_ll_pin_filter_disable(gpio_dev_t *hw, uint32_t gpio_num)
IO_MUX.gpion[gpio_num].gpion_filter_en = 0;
}
/**
* @brief Enable GPIO hysteresis
*
* @param hw Peripheral GPIO hardware instance address.
* @param gpio_num GPIO number
*/
static inline void gpio_ll_pin_input_hysteresis_enable(gpio_dev_t *hw, uint32_t gpio_num)
{
// Always set hys_sel to 1 to use software control hysteresis, since no efuse bit reserved for hysteresis on ESP32C61
IO_MUX.gpion[gpio_num].gpion_hys_sel = 1;
IO_MUX.gpion[gpio_num].gpion_hys_en = 1;
}
/**
* @brief Disable GPIO hysteresis
*
* @param hw Peripheral GPIO hardware instance address.
* @param gpio_num GPIO number
*/
static inline void gpio_ll_pin_input_hysteresis_disable(gpio_dev_t *hw, uint32_t gpio_num)
{
IO_MUX.gpion[gpio_num].gpion_hys_sel = 1;
IO_MUX.gpion[gpio_num].gpion_hys_en = 0;
}
/**
* @brief Disable output mode on GPIO.
*