GPIO pin configuration. More...
GPIO pin configuration.
It is fully valid that an implementation extends this structure with additional implementation specific fields. For example, it could be useful to also include fields to configure routing of a GPIO pin to other peripherals (e.g. for us as an TXD pin of an UART). These implementation specific fields MUST however have reasonable defaults when initialized with zero (e.g. pin is not routed to another peripheral but to be used as regular GPIO). For obvious reasons, portable code cannot rely on the presence and semantic of any implementation specific fields. Additionally, out-of-tree users should not use these fields, as the implementation specific fields cannot be considered a stable API.
#include <gpio_ll.h>
Data Fields | |
gpio_state_t | state |
State of the pin. More... | |
gpio_pull_t | pull |
Pull resistor configuration. More... | |
gpio_slew_t | slew_rate |
Configure the slew rate of outputs. More... | |
bool | schmitt_trigger |
Whether to enable the input Schmitt trigger. More... | |
bool | initial_value |
Initial value of the output. More... | |
gpio_pull_strength_t | pull_strength |
Strength of the pull up/down resistor. More... | |
gpio_drive_strength_t | drive_strength |
Drive strength of the GPIO. More... | |
gpio_drive_strength_t gpio_conf_t::drive_strength |
Drive strength of the GPIO.
This value is ignored when gpio_conf_t::state is configured to GPIO_INPUT or GPIO_DISCONNECT.
bool gpio_conf_t::initial_value |
Initial value of the output.
Ignored if gpio_conf_t::state is set to GPIO_INPUT or GPIO_DISCONNECT. If the pin was previously in a high impedance state, it is guaranteed to directly transition to the given initial value.
gpio_ll_query_conf will write the current value of the specified pin here, which is read from the input register when the state is GPIO_INPUT, otherwise the state from the output register is consulted.
gpio_pull_t gpio_conf_t::pull |
gpio_pull_strength_t gpio_conf_t::pull_strength |
Strength of the pull up/down resistor.
This value is ignored when gpio_conf_t::pull is configured to GPIO_FLOATING.
bool gpio_conf_t::schmitt_trigger |
Whether to enable the input Schmitt trigger.
This value is ignored unless gpio_conf_t::state is configured to GPIO_INPUT.
gpio_slew_t gpio_conf_t::slew_rate |
Configure the slew rate of outputs.
This value is ignored unless gpio_conf_t::state is configured to GPIO_OUTPUT_PUSH_PULL or GPIO_OUTPUT_OPEN_DRAIN.
gpio_state_t gpio_conf_t::state |