|
VSF Documented
|
Go to the source code of this file.
Data Structures | |
| struct | gpio_config_t |
| Bulk configuration structure used by gpio_config(). More... | |
Macros | |
| #define | GPIO_NUM_NC (-1) |
Typedefs | |
| typedef int32_t | gpio_num_t |
| GPIO pin number (flat encoding, see file comment). | |
| typedef uint64_t | gpio_pin_bit_mask_t |
| Bit-mask of pin numbers used by gpio_config(). | |
| typedef void(* | gpio_isr_t) (void *arg) |
| Per-pin ISR callback handler. | |
| typedef void * | gpio_isr_handle_t |
| Not supported on the VSF shim. Returns ESP_ERR_NOT_SUPPORTED. | |
Enumerations | |
| enum | gpio_mode_t { GPIO_MODE_DISABLE = 0 , GPIO_MODE_INPUT = 1 , GPIO_MODE_OUTPUT = 2 , GPIO_MODE_OUTPUT_OD = 3 , GPIO_MODE_INPUT_OUTPUT_OD = 4 , GPIO_MODE_INPUT_OUTPUT = 5 } |
| Pin direction. More... | |
| enum | gpio_pullup_t { GPIO_PULLUP_DISABLE = 0 , GPIO_PULLUP_ENABLE = 1 } |
| Pull-resistor configuration. More... | |
| enum | gpio_pulldown_t { GPIO_PULLDOWN_DISABLE = 0 , GPIO_PULLDOWN_ENABLE = 1 } |
| enum | gpio_pull_mode_t { GPIO_FLOATING = 0 , GPIO_PULLUP_ONLY = 1 , GPIO_PULLDOWN_ONLY = 2 , GPIO_PULLUP_PULLDOWN = 3 } |
| enum | gpio_int_type_t { GPIO_INTR_DISABLE = 0 , GPIO_INTR_POSEDGE = 1 , GPIO_INTR_NEGEDGE = 2 , GPIO_INTR_ANYEDGE = 3 , GPIO_INTR_LOW_LEVEL = 4 , GPIO_INTR_HIGH_LEVEL = 5 } |
| External interrupt trigger type. More... | |
| enum | gpio_level_t { GPIO_LOW = 0 , GPIO_HIGH = 1 } |
| Signal level passed to gpio_set_level(). More... | |
Functions | |
| esp_err_t | gpio_config (const gpio_config_t *config) |
| Apply a bulk configuration to every pin listed in config->pin_bit_mask. | |
| esp_err_t | gpio_reset_pin (gpio_num_t gpio_num) |
| Reset a single pin to a safe post-boot state (input, no pull, no interrupt). | |
| esp_err_t | gpio_set_direction (gpio_num_t gpio_num, gpio_mode_t mode) |
| Set the direction of a single pin. | |
| esp_err_t | gpio_set_pull_mode (gpio_num_t gpio_num, gpio_pull_mode_t pull) |
| Set the pull mode of a single pin. | |
| esp_err_t | gpio_set_level (gpio_num_t gpio_num, uint32_t level) |
| Set the output level of a single pin (0 = low, non-zero = high). | |
| int | gpio_get_level (gpio_num_t gpio_num) |
| Read the input level of a single pin (0 or 1). | |
| esp_err_t | gpio_pullup_en (gpio_num_t gpio_num) |
| Shortcut pull-up/pull-down enable/disable APIs. | |
| esp_err_t | gpio_pullup_dis (gpio_num_t gpio_num) |
| esp_err_t | gpio_pulldown_en (gpio_num_t gpio_num) |
| esp_err_t | gpio_pulldown_dis (gpio_num_t gpio_num) |
| esp_err_t | gpio_set_intr_type (gpio_num_t gpio_num, gpio_int_type_t intr_type) |
| Configure the edge/level that generates an external interrupt on the pin. This does NOT enable the interrupt by itself – call gpio_intr_enable() afterwards. | |
| esp_err_t | gpio_intr_enable (gpio_num_t gpio_num) |
| Per-pin interrupt arm/disarm. | |
| esp_err_t | gpio_intr_disable (gpio_num_t gpio_num) |
| esp_err_t | gpio_install_isr_service (int intr_alloc_flags) |
| Install the shim's per-pin ISR dispatcher. | |
| void | gpio_uninstall_isr_service (void) |
| Release the per-pin ISR dispatcher. | |
| esp_err_t | gpio_isr_handler_add (gpio_num_t gpio_num, gpio_isr_t isr_handler, void *args) |
| Attach a per-pin callback under the ISR service. | |
| esp_err_t | gpio_isr_handler_remove (gpio_num_t gpio_num) |
| Detach a per-pin callback previously registered with gpio_isr_handler_add(). | |
| esp_err_t | gpio_isr_register (void(*fn)(void *), void *arg, int intr_alloc_flags, gpio_isr_handle_t *handle) |
| esp_err_t | gpio_wakeup_enable (gpio_num_t gpio_num, gpio_int_type_t intr_type) |
| Accepted for source compatibility. Returns ESP_ERR_NOT_SUPPORTED unless the underlying board enables the corresponding low-power feature – which the shim cannot probe. | |
| esp_err_t | gpio_wakeup_disable (gpio_num_t gpio_num) |
| #define GPIO_NUM_NC (-1) |
| typedef int32_t gpio_num_t |
GPIO pin number (flat encoding, see file comment).
A negative value denotes "not assigned".
| typedef uint64_t gpio_pin_bit_mask_t |
Bit-mask of pin numbers used by gpio_config().
Bit N corresponds to gpio_num_t == N. Callers use pin_bit_mask = 1ULL << GPIO_NUM_X to include pin X.
| typedef void(* gpio_isr_t) (void *arg) |
Per-pin ISR callback handler.
Invoked from the VSF EXTI dispatcher on the underlying HAL driver's interrupt priority. ISR context constraints apply: do not call blocking APIs from here.
| typedef void* gpio_isr_handle_t |
Not supported on the VSF shim. Returns ESP_ERR_NOT_SUPPORTED.
The ESP-IDF "raw ISR" path bypasses the dispatcher and hands the IRQ vector to a user-provided assembly-callable handler. VSF's HAL interrupt surface is prio + handler_fn + per-port dispatch, so this legacy path cannot be mapped cleanly.
| enum gpio_mode_t |
| enum gpio_pullup_t |
| enum gpio_pulldown_t |
| enum gpio_pull_mode_t |
| enum gpio_int_type_t |
| enum gpio_level_t |
Signal level passed to gpio_set_level().
| Enumerator | |
|---|---|
| GPIO_LOW | |
| GPIO_HIGH | |
|
extern |
Apply a bulk configuration to every pin listed in config->pin_bit_mask.
| ESP_OK | success |
| ESP_ERR_INVALID_ARG | config is NULL or the mask selects a pin that does not exist in the current io_mapper |
|
extern |
Reset a single pin to a safe post-boot state (input, no pull, no interrupt).
|
extern |
Set the direction of a single pin.
|
extern |
Set the pull mode of a single pin.
|
extern |
Set the output level of a single pin (0 = low, non-zero = high).
|
extern |
Read the input level of a single pin (0 or 1).
|
extern |
Shortcut pull-up/pull-down enable/disable APIs.
|
extern |
|
extern |
|
extern |
|
extern |
Configure the edge/level that generates an external interrupt on the pin. This does NOT enable the interrupt by itself – call gpio_intr_enable() afterwards.
|
extern |
Per-pin interrupt arm/disarm.
|
extern |
|
extern |
Install the shim's per-pin ISR dispatcher.
Mirrors the ESP-IDF "ISR service" concept: a single central IRQ handler fans out to per-pin callbacks registered via gpio_isr_handler_add(). Must be called once before any _add/_remove call.
| intr_alloc_flags | accepted for source compatibility and otherwise ignored (VSF routes every EXTI through the same HAL priority level chosen by the board). |
| ESP_OK | success or already installed |
| ESP_ERR_NO_MEM | handler table could not be allocated |
| ESP_ERR_INVALID_STATE | VSF io_mapper reports zero ports |
|
extern |
Release the per-pin ISR dispatcher.
All registered per-pin callbacks are dropped; per-port EXTI handlers are disabled in the underlying HAL driver.
|
extern |
Attach a per-pin callback under the ISR service.
| ESP_OK | success |
| ESP_ERR_INVALID_STATE | the ISR service has not been installed |
| ESP_ERR_INVALID_ARG | gpio_num is out of range or isr_handler is NULL |
|
extern |
Detach a per-pin callback previously registered with gpio_isr_handler_add().
|
extern |
|
extern |
Accepted for source compatibility. Returns ESP_ERR_NOT_SUPPORTED unless the underlying board enables the corresponding low-power feature – which the shim cannot probe.
|
extern |