gpio_conf_t Struct Reference

GPIO pin configuration. More...

Detailed Description

GPIO pin configuration.

Warning
The layout of this structure is implementation dependent and additional implementation specific fields might be present. For this reason, this structure must be initialized using designated initializers or zeroing out the whole contents using `memset() before initializing the individual fields.

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.

Definition at line 323 of file gpio_ll.h.

#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...
 

Field Documentation

◆ drive_strength

gpio_drive_strength_t gpio_conf_t::drive_strength

Drive strength of the GPIO.

Warning
If the requested drive strength is not available, the closest fit supported will be configured instead.

This value is ignored when gpio_conf_t::state is configured to GPIO_INPUT or GPIO_DISCONNECT.

Definition at line 379 of file gpio_ll.h.

◆ initial_value

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.

Definition at line 359 of file gpio_ll.h.

◆ pull

gpio_pull_t gpio_conf_t::pull

Pull resistor configuration.

Definition at line 325 of file gpio_ll.h.

◆ pull_strength

gpio_pull_strength_t gpio_conf_t::pull_strength

Strength of the pull up/down resistor.

Warning
If the requested pull strength is not available, the closest fit supported will be configured instead.

This value is ignored when gpio_conf_t::pull is configured to GPIO_FLOATING.

Definition at line 369 of file gpio_ll.h.

◆ schmitt_trigger

bool gpio_conf_t::schmitt_trigger

Whether to enable the input Schmitt trigger.

Warning
If the requested Schmitt trigger setting is not available, it will be ignored.

This value is ignored unless gpio_conf_t::state is configured to GPIO_INPUT.

Definition at line 345 of file gpio_ll.h.

◆ slew_rate

gpio_slew_t gpio_conf_t::slew_rate

Configure the slew rate of outputs.

Warning
If the requested slew rate is not available, the closest fit supported will be configured instead.

This value is ignored unless gpio_conf_t::state is configured to GPIO_OUTPUT_PUSH_PULL or GPIO_OUTPUT_OPEN_DRAIN.

Definition at line 335 of file gpio_ll.h.

◆ state

gpio_state_t gpio_conf_t::state

State of the pin.

Definition at line 324 of file gpio_ll.h.


The documentation for this struct was generated from the following file: