File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 11# ChangeLog
22
3+ ## v3.5.0 - 2024-12-27
4+
5+ ### Enhancements:
6+
7+ * Add config to disable gpio button internal pull resistor.
8+
39## v3.4.1 - 2024-12-6
410
511### Fix:
Original file line number Diff line number Diff line change 1- /* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
1+ /* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
22 *
33 * SPDX-License-Identifier: Apache-2.0
44 */
@@ -26,12 +26,17 @@ esp_err_t button_gpio_init(const button_gpio_config_t *config)
2626 gpio_conf .intr_type = GPIO_INTR_DISABLE ;
2727 gpio_conf .mode = GPIO_MODE_INPUT ;
2828 gpio_conf .pin_bit_mask = (1ULL << config -> gpio_num );
29- if (config -> active_level ) {
30- gpio_conf .pull_down_en = GPIO_PULLDOWN_ENABLE ;
29+ if (config -> disable_pull ) {
30+ gpio_conf .pull_down_en = GPIO_PULLDOWN_DISABLE ;
3131 gpio_conf .pull_up_en = GPIO_PULLUP_DISABLE ;
3232 } else {
33- gpio_conf .pull_down_en = GPIO_PULLDOWN_DISABLE ;
34- gpio_conf .pull_up_en = GPIO_PULLUP_ENABLE ;
33+ if (config -> active_level ) {
34+ gpio_conf .pull_down_en = GPIO_PULLDOWN_ENABLE ;
35+ gpio_conf .pull_up_en = GPIO_PULLUP_DISABLE ;
36+ } else {
37+ gpio_conf .pull_down_en = GPIO_PULLDOWN_DISABLE ;
38+ gpio_conf .pull_up_en = GPIO_PULLUP_ENABLE ;
39+ }
3540 }
3641 gpio_config (& gpio_conf );
3742
Original file line number Diff line number Diff line change 1- version : " 3.4.1 "
1+ version : " 3.5.0 "
22description : GPIO and ADC button driver
33url : https://github.com/espressif/esp-iot-solution/tree/master/components/button
44repository : https://github.com/espressif/esp-iot-solution.git
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ typedef struct {
2121#if CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE
2222 bool enable_power_save ; /**< enable power save mode */
2323#endif
24+ bool disable_pull ; /**< disable internal pull or not */
2425} button_gpio_config_t ;
2526
2627/**
You can’t perform that action at this time.
0 commit comments