HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
gpio.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
6#ifndef HOMECORE_DRIVERS_GPIO_H
7#define HOMECORE_DRIVERS_GPIO_H
8
9#include <stdbool.h>
10
45
47typedef struct {
50 int (*configure)(void *port, unsigned pin, gpio_mode_t mode);
53 int (*set)(void *port, unsigned pin, bool high);
57 int (*get)(void *port, unsigned pin, bool *high);
59
61typedef struct {
65 void *port;
67
70#endif /* HOMECORE_DRIVERS_GPIO_H */
gpio_mode_t
Pin configuration for gpio_ops_t::configure.
Definition gpio.h:35
@ GPIO_INPUT_PULL_UP
Input with the internal pull-up resistor.
Definition gpio.h:39
@ GPIO_INPUT
Floating input.
Definition gpio.h:37
@ GPIO_OUTPUT
Push-pull output at the lowest speed, initially low.
Definition gpio.h:43
@ GPIO_INPUT_PULL_DOWN
Input with the internal pull-down resistor.
Definition gpio.h:41
Operations a GPIO port driver provides; every one is required.
Definition gpio.h:47
A GPIO port: driver operations bound to one port instance.
Definition gpio.h:61
void * port
Port instance passed to every operation.
Definition gpio.h:65
const gpio_ops_t * ops
Operations of the port's driver.
Definition gpio.h:63