HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
gpio_ops_t Struct Reference

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.
 

Detailed Description

Operations a GPIO port driver provides; every one is required.

Field Documentation

◆ get

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.


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