RockBLOCK 9704 C Library
Doxygen documentation for the RockBLOCK 9704 C Library.
gpio.h
Go to the documentation of this file.
1 #ifndef GPIO_H
2 #define GPIO_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <stdbool.h>
9 #include <stdint.h>
10 
11 #define PI_HAT_PATH "/dev/ttyS0"
12 #define CHIP_NAME "/dev/gpiochip0"
13 #define POWER_ENABLE_PIN 24U
14 #define IRIDIUM_ENABLE_PIN 16U
15 #define IRIDIUM_BOOTED_PIN 23U
16 
17 #define GPIO_CHIP_MAX_LEN 20U
18 
19 typedef struct
20 {
21  const char chip[GPIO_CHIP_MAX_LEN];
22  uint8_t pin;
23 } gpioPin_t;
24 
25 typedef struct
26 {
31 
32 extern const rbGpioTable_t gpioTable;
33 
34 bool gpioToggle(const char * selectedChip, int selectedPin, int value);
35 bool gpioDriveHigh(const char * selectedChip, int selectedPin);
36 bool gpioDriveLow(const char * selectedChip, int selectedPin);
37 int gpioReceive(const char * selectedChip, int selectedPin);
38 bool gpioListenIridBooted(const char * selectedChip, int selectedPin, const int timeout);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif
const rbGpioTable_t gpioTable
Definition: gpio.c:7
bool gpioToggle(const char *selectedChip, int selectedPin, int value)
Definition: gpio.c:14
int gpioReceive(const char *selectedChip, int selectedPin)
Definition: gpio.c:56
bool gpioDriveLow(const char *selectedChip, int selectedPin)
Definition: gpio.c:105
#define GPIO_CHIP_MAX_LEN
Definition: gpio.h:17
bool gpioListenIridBooted(const char *selectedChip, int selectedPin, const int timeout)
Definition: gpio.c:115
bool gpioDriveHigh(const char *selectedChip, int selectedPin)
Definition: gpio.c:95
Definition: gpio.h:20
uint8_t pin
Definition: gpio.h:22
Definition: gpio.h:26
gpioPin_t booted
Definition: gpio.h:29
gpioPin_t iridiumEnable
Definition: gpio.h:28
gpioPin_t powerEnable
Definition: gpio.h:27