refactor(gpio): public some IO configuration functions

This allows different peripheral drivers to act on the same IO.
This commit is contained in:
Song Ruo Jing
2024-08-28 18:31:32 +08:00
parent 1b6a829e81
commit e1d3d830ce
28 changed files with 349 additions and 88 deletions

View File

@@ -52,6 +52,39 @@ esp_err_t gpio_sleep_pupd_config_unapply(gpio_num_t gpio_num);
*/
esp_err_t gpio_func_sel(gpio_num_t gpio_num, uint32_t func);
/**
* @brief Disable output for an IO
*
* @param gpio_num GPIO number
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG GPIO number error
*/
esp_err_t gpio_output_disable(gpio_num_t gpio_num);
/**
* @brief Enable open-drain for an IO
*
* @param gpio_num GPIO number
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG GPIO number error
*/
esp_err_t gpio_od_disable(gpio_num_t gpio_num);
/**
* @brief Disable open-drain for an IO
*
* @param gpio_num GPIO number
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG GPIO number error
*/
esp_err_t gpio_od_enable(gpio_num_t gpio_num);
#ifdef __cplusplus
}
#endif