Merge branch 'contrib/github_pr_17241' into 'master'

Refactor: Use enum values when assigning "pull_[up|down]_en" fields of "gpio_config" (GitHub PR)

Closes IDFGH-16192

See merge request espressif/esp-idf!41058
This commit is contained in:
Song Ruo Jing
2025-08-11 12:08:16 +08:00
29 changed files with 81 additions and 81 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -30,9 +30,9 @@ void app_gpio_pcm_io_cfg(void)
//bit mask of the pins that you want to set,e.g.GPIO18/19
io_conf.pin_bit_mask = GPIO_OUTPUT_PCM_PIN_SEL;
//disable pull-down mode
io_conf.pull_down_en = 0;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//disable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);
@@ -44,8 +44,8 @@ void app_gpio_pcm_io_cfg(void)
//set as input mode
io_conf.mode = GPIO_MODE_INPUT;
//enable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_down_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);
@@ -73,9 +73,9 @@ void app_gpio_aec_io_cfg(void)
//bit mask of the pins that you want to set,e.g.GPIO18/19
io_conf.pin_bit_mask = GPIO_OUTPUT_AEC_PIN_SEL;
//disable pull-down mode
io_conf.pull_down_en = 0;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//disable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -30,9 +30,9 @@ void app_gpio_pcm_io_cfg(void)
//bit mask of the pins that you want to set,e.g.GPIO18/19
io_conf.pin_bit_mask = GPIO_OUTPUT_PCM_PIN_SEL;
//disable pull-down mode
io_conf.pull_down_en = 0;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//disable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);
@@ -44,8 +44,8 @@ void app_gpio_pcm_io_cfg(void)
//set as input mode
io_conf.mode = GPIO_MODE_INPUT;
//enable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_down_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);
@@ -73,9 +73,9 @@ void app_gpio_aec_io_cfg(void)
//bit mask of the pins that you want to set,e.g.GPIO18/19
io_conf.pin_bit_mask = GPIO_OUTPUT_AEC_PIN_SEL;
//disable pull-down mode
io_conf.pull_down_en = 0;
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
//disable pull-up mode
io_conf.pull_up_en = 0;
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
//configure GPIO with the given settings
gpio_config(&io_conf);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -170,8 +170,8 @@ static void uart_gpio_set(void)
.intr_type = GPIO_INTR_DISABLE, //disable interrupt
.mode = GPIO_MODE_OUTPUT, // output mode
.pin_bit_mask = GPIO_OUTPUT_PIN_SEL, // bit mask of the output pins
.pull_down_en = 0, // disable pull-down mode
.pull_up_en = 0, // disable pull-up mode
.pull_down_en = GPIO_PULLDOWN_DISABLE, // disable pull-down mode
.pull_up_en = GPIO_PULLUP_DISABLE, // disable pull-up mode
};
gpio_config(&io_output_conf);
@@ -179,8 +179,8 @@ static void uart_gpio_set(void)
.intr_type = GPIO_INTR_DISABLE, //disable interrupt
.mode = GPIO_MODE_INPUT, // input mode
.pin_bit_mask = GPIO_INPUT_PIN_SEL, // bit mask of the input pins
.pull_down_en = 0, // disable pull-down mode
.pull_up_en = 0, // disable pull-down mode
.pull_down_en = GPIO_PULLDOWN_DISABLE, // disable pull-down mode
.pull_up_en = GPIO_PULLUP_DISABLE, // disable pull-down mode
};
gpio_config(&io_input_conf);

View File

@@ -89,8 +89,8 @@ int ble_direction_finding_antenna_init(uint8_t* gpio_array,uint8_t gpio_array_le
.intr_type = GPIO_INTR_DISABLE,
.mode = GPIO_MODE_OUTPUT,
.pin_bit_mask = gpio_pin_maks,
.pull_down_en = false,
.pull_up_en = true,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.pull_up_en = GPIO_PULLUP_ENABLE,
};
rc = gpio_config(&gpio_conf);
if(rc != 0) {