-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpio.h
31 lines (26 loc) · 839 Bytes
/
gpio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _GPIO_H
#define _GPIO_H
#define GPIO_VAL_LOW 0
#define GPIO_VAL_HIGH 1
#define GPIO_DIR_IN "in"
#define GPIO_DIR_OUT "out"
#define GPIO_EDGE_RISING "rising"
#define GPIO_EDGE_FALLING "falling"
#define GPIO_EDGE_BOTH "both"
#define GPIO_LED_1 24
#define GPIO_LED_2 18
#define GPIO_LED_3 23
#define GPIO_LED_4 17
#define GPIO_BTN_TOP 27
#define GPIO_BTN_LEFT 10
#define GPIO_BTN_RIGHT 22
void gpio_export(unsigned pin);
void gpio_unexport(unsigned pin);
void gpio_set_dir(unsigned pin, char *dir);
void gpio_set_edge(unsigned pin, char *edge);
void gpio_set_value(unsigned pin, unsigned int value);
void gpio_get_value(unsigned pin, unsigned int *value);
void gpio_open_value(unsigned pin, int *filedes);
void gpio_read_value(int filedes, unsigned int *value);
void gpio_close_value(int fd);
#endif