Chapter 2. API Reference
• ESP_OK Success
• ESP_ERR_INVALID_ARG GPIO error
Parameters
• gpio_num: Configure GPIO pins number, it should be GPIO number. If you want to set direction
of e.g. GPIO16, gpio_num should be GPIO_NUM_16 (16);
• mode: GPIO direction
esp_err_t gpio_sleep_set_pull_mode(gpio_num_t
Configure GPIO pull-up/pull-down resistors at sleep.
Only pins that support both input & output have integrated pull-up and pull-down resistors. Input-only GPIOs
34-39 do not.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG : Parameter error
Parameters
• gpio_num: GPIO number. If you want to set pull up or down mode for e.g. GPIO16, gpio_num
should be GPIO_NUM_16 (16);
• pull: GPIO pull up/down mode.
Macros
GPIO_PIN_COUNT
GPIO_IS_VALID_GPIO(gpio_num)
Check whether it is a valid GPIO number.
GPIO_IS_VALID_OUTPUT_GPIO(gpio_num)
Check whether it can be a valid GPIO number of output mode.
Type Definitions
typedef
intr_handle_t
gpio_isr_handle_t
Header File
•
components/hal/include/hal/gpio_types.h
Structures
struct gpio_config_t
Configuration parameters of GPIO pad for gpio_config function.
Public Members
uint64_t pin_bit_mask
GPIO pin: set with bit mask, each bit maps to a GPIO
gpio_mode_t
mode
GPIO mode: set input/output mode
gpio_pullup_t
pull_up_en
GPIO pull-up
gpio_pulldown_t
pull_down_en
GPIO pull-down
gpio_int_type_t
intr_type
GPIO interrupt type
Espressif Systems
gpio_num,
256
Submit Document Feedback
gpio_pull_mode_t
pull)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?