diff options
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h new file mode 100644 index 0000000..1e0346d --- /dev/null +++ b/include/gpio.h @@ -0,0 +1,22 @@ +/* + * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef GPIO_H +#define GPIO_H + +/* Number of user configurable I/O pins */ +#define GPIO_MAX 11 + +typedef enum {NONE, INPUT, INPUT_PULLUP, OUTPUT, OUTPUT_TIMER} gpiomode_t; + +int gpio_config(int pin, gpiomode_t mode); +gpiomode_t gpio_config_get(int pin); +int gpio_read(int pin); +void gpio_write(int pin, uint8_t val); +int gpio_clockdiv_set(int pin, unsigned long divider); +long gpio_clockdiv_get(int pin); + +#endif /* GPIO_H */ |