GPIO Driver.
More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
GPIO Driver.
Definition in file gpio.h.
#define GPIO_AHRS_ENABLE 0 |
Defines GPIO pins.
Enable the Compass
Definition at line 42 of file gpio.h.
Defines direction of GPIO.
Enumerator |
---|
gpioInput |
GPIO is input.
|
gpioOutput |
GPIO is output.
|
Definition at line 33 of file gpio.h.
uint32_t gpioGetValue |
( |
| ) |
|
Read all gpio pins at once.
- Returns
- The input of all ports as bit mask. 1 - high, 0 - low.
Definition at line 56 of file gpio.c.
Initializes the GPIO.
Sets all devices to output and off.
Definition at line 21 of file gpio.c.
Configure PIN directionality.
- Parameters
-
pin | The pin number. |
dir | The direction. |
Definition at line 26 of file gpio.c.
bool gpioPinGet |
( |
int |
pin | ) |
|
Gets the PIN value, if set as input.
- Parameters
-
- Returns
- The pin value.
Definition at line 45 of file gpio.c.
void gpioPinSet |
( |
int |
pin, |
|
|
bool |
high |
|
) |
| |
Sets the pin state.
- Parameters
-
pin | The pin to set. |
high | true - Set it high (on), or false - off. |
Definition at line 35 of file gpio.c.
void gpioSetValue |
( |
uint32_t |
mask | ) |
|
Set the complete bitmask on the gpio pins.
- Parameters
-
mask | The pins to set and clear (1 - set, 0 - clear). |
Definition at line 50 of file gpio.c.