|
HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
|
Operations a GPIO port driver provides; every one is required. More...
#include <homecore/drivers/gpio.h>
Data Fields | |
| int(* | configure )(void *port, unsigned pin, gpio_mode_t mode) |
Configure pin; returns 0, or -1 with errno EINVAL for an invalid pin or mode. | |
| int(* | set )(void *port, unsigned pin, bool high) |
Drive output pin high (true) or low; returns 0, or -1 with errno EINVAL for an invalid pin. | |
| int(* | get )(void *port, unsigned pin, bool *high) |
Read the level of pin into high; returns 0, or -1 with errno EINVAL for an invalid pin. | |
Operations a GPIO port driver provides; every one is required.
| int(* gpio_ops_t::get) (void *port, unsigned pin, bool *high) |
Read the level of pin into high; returns 0, or -1 with errno EINVAL for an invalid pin.
On the current ports, an output pin reads back the level it drives.