GPIO driver interface.
More...
|
| void | gpio_output_init (const OutputConfig *pin_config, GPIOOType_TypeDef otype) |
| | Initialize a pin as an output.
|
| |
| void | gpio_output_set (const OutputConfig *pin_config, bool asserted) |
| | Assert or deassert an output.
|
| |
| void | gpio_input_init (const InputConfig *input_cfg) |
| | Initialize a pin as an input without pull resistor.
|
| |
| void | gpio_input_init_pull_up_down (const InputConfig *input_cfg, GPIOPuPd_TypeDef pupd) |
| | Initialize a pin as an input with a pull resistor.
|
| |
| bool | gpio_input_read (const InputConfig *input_cfg) |
| | Read an input.
|
| |
GPIO driver interface.
Pins are described by the board's OutputConfig and InputConfig.
void gpio_output_set(const OutputConfig *pin_config, bool asserted)
Assert or deassert an output.
bool gpio_input_read(const InputConfig *input_cfg)
Read an input.
void gpio_input_init_pull_up_down(const InputConfig *input_cfg, GPIOPuPd_TypeDef pupd)
Initialize a pin as an input with a pull resistor.
void gpio_output_init(const OutputConfig *pin_config, GPIOOType_TypeDef otype)
Initialize a pin as an output.
◆ gpio_input_init()
| void gpio_input_init |
( |
const InputConfig * |
input_cfg | ) |
|
Initialize a pin as an input without pull resistor.
- Parameters
-
| input_cfg | Pin configuration. |
◆ gpio_input_init_pull_up_down()
| void gpio_input_init_pull_up_down |
( |
const InputConfig * |
input_cfg, |
|
|
GPIOPuPd_TypeDef |
pupd |
|
) |
| |
Initialize a pin as an input with a pull resistor.
- Parameters
-
| input_cfg | Pin configuration. |
| pupd | Pull resistor. |
◆ gpio_input_read()
| bool gpio_input_read |
( |
const InputConfig * |
input_cfg | ) |
|
Read an input.
- Parameters
-
| input_cfg | Pin configuration. |
- Returns
- Pin level, true if high.
◆ gpio_output_init()
| void gpio_output_init |
( |
const OutputConfig * |
pin_config, |
|
|
GPIOOType_TypeDef |
otype |
|
) |
| |
Initialize a pin as an output.
- Parameters
-
| pin_config | Pin configuration. |
| otype | Output type, GPIO_OType_PP or GPIO_OType_OD. |
◆ gpio_output_set()
| void gpio_output_set |
( |
const OutputConfig * |
pin_config, |
|
|
bool |
asserted |
|
) |
| |
Assert or deassert an output.
Asserting drives the pin high if active_high is set in pin_config, low otherwise.
- Parameters
-
| pin_config | Pin configuration. |
| asserted | True to assert. |