Norman James | e759492 | 2015-08-27 14:25:24 -0500 | [diff] [blame] | 1 | #ifndef __OBJECTS_GPIO_UTILITIES_H__ |
| 2 | #define __OBJECTS_GPIO_UTILITIES_H__ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <gio/gio.h> |
| 6 | |
| 7 | typedef struct { |
| 8 | gchar* name; |
| 9 | gchar* dev; |
| 10 | uint16_t num; |
| 11 | gchar* direction; |
| 12 | int fd; |
| 13 | } GPIO; |
| 14 | |
| 15 | |
| 16 | //gpio functions |
| 17 | void gpio_init(GDBusConnection*, GPIO*); |
| 18 | void gpio_close(GPIO*); |
| 19 | int gpio_open(GPIO*); |
| 20 | void gpio_write(GPIO*, uint8_t); |
| 21 | void gpio_writec(GPIO*, char); |
| 22 | void gpio_clock_cycle(GPIO*, int); |
| 23 | uint8_t gpio_read(GPIO*); |
| 24 | |
| 25 | #endif |