gpio_sys/inc/gpio_sys.h

26 lines
458 B
C
Raw Normal View History

2019-07-25 08:26:27 +00:00
#ifndef __GPIO_SYS__
#define __GPIO_SYS__
enum direction {
IN = 0,
OUT
};
enum pin_state {
LOW = 0,
HIGH
};
struct gpio_sys {
2019-07-25 12:07:44 +00:00
int pin;
2019-07-25 12:04:28 +00:00
enum direction 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-25 12:04:28 +00:00
int gpio_direction(struct gpio_sys *gpio, enum direction 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