gpio_sys: simplify api.

This commit is contained in:
Thomas Klaehn 2019-07-29 12:23:49 +02:00
parent 791cfe8ae2
commit 5c774a3a1c
2 changed files with 3 additions and 8 deletions

View File

@ -1,11 +1,6 @@
#ifndef __GPIO_SYS__ #ifndef __GPIO_SYS__
#define __GPIO_SYS__ #define __GPIO_SYS__
enum direction {
IN = 0,
OUT
};
enum pin_state { enum pin_state {
LOW = 0, LOW = 0,
HIGH HIGH
@ -13,12 +8,12 @@ enum pin_state {
struct gpio_sys { struct gpio_sys {
int pin; int pin;
enum direction direction; int direction;
}; };
int gpio_open(const struct gpio_sys *gpio); int gpio_open(const struct gpio_sys *gpio);
int gpio_close(const struct gpio_sys *gpio); int gpio_close(const struct gpio_sys *gpio);
int gpio_direction(struct gpio_sys *gpio, enum direction direction); int gpio_direction(struct gpio_sys *gpio, int direction);
int gpio_read(const struct gpio_sys *gpio); int gpio_read(const struct gpio_sys *gpio);
int gpio_write(const struct gpio_sys *gpio, int value); int gpio_write(const struct gpio_sys *gpio, int value);

View File

@ -58,7 +58,7 @@ int gpio_close(const struct gpio_sys *gpio)
return 0; return 0;
} }
int gpio_direction(struct gpio_sys *gpio, enum direction direction) int gpio_direction(struct gpio_sys *gpio, int direction)
{ {
int res; int res;