]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blob - mt_keys.h
mt_server: Use "%s" format string in syslog()
[coffee/mt-apps.git] / mt_keys.h
1 #ifndef MT_KEYS_H
2 #define MT_KEYS_H
3
4 #include <ev.h>
5
6 typedef struct mt_keys_dev_t {
7     char chip[16];
8     unsigned int offset;
9 } mt_keys_dev_t;
10
11 #define DEV "/dev/gpiochip"
12 #define ADV_GPIO_PINS \
13 { \
14     {DEV "0", 27}, \
15     {DEV "0", 29}, \
16     {DEV "0", 25}, \
17     {DEV "0", 30}, \
18     {DEV "5", 31}, \
19     {DEV "2", 30}, \
20     {DEV "2", 31}, \
21     {DEV "2", 21}, \
22     {DEV "4",  2}, \
23     {DEV "2", 20}, \
24     {DEV "2", 23}, \
25     {DEV "5", 11}, \
26     {DEV "1",  2}, \
27     {DEV "5",  9}, \
28     {DEV "1",  3}, \
29     {DEV "5", 16}, \
30     {DEV "5",  7}, \
31     {DEV "1",  4}, \
32     {DEV "1",  0}, \
33     {DEV "5",  8}  \
34 }
35
36 typedef struct ev_io_keys {
37     ev_io w;
38     int fd;
39 } ev_io_keys;
40
41 typedef struct mt_keys_t {
42     ev_io_keys w;
43     int fd;
44 } mt_keys_t;
45
46 int mt_keys_init(mt_keys_t *self, struct ev_loop *loop, int fd);
47
48 void mt_keys_deinit(mt_keys_t *self);
49
50 #endif