gpio_sys/inc/gpio.h

21 lines
395 B
C
Raw Normal View History

2019-07-25 08:26:27 +00:00
#ifndef __GPIO_SYS__
#define __GPIO_SYS__
enum pin_state {
LOW = 0,
HIGH
};
struct gpio_sys {
2019-07-25 12:07:44 +00:00
int pin;
2019-07-29 10:23:49 +00:00
int direction;
2019-07-25 08:26:27 +00:00
};
int gpio_open(const struct gpio_sys *gpio);
int gpio_close(const struct gpio_sys *gpio);
2019-07-29 10:23:49 +00:00
int gpio_direction(struct gpio_sys *gpio, int direction);
2019-07-25 08:26:27 +00:00
int gpio_read(const struct gpio_sys *gpio);
int gpio_write(const struct gpio_sys *gpio, int value);
#endif