summaryrefslogtreecommitdiff
path: root/include/gpio.h
blob: ac48045c69cd2145270347e4c82c42d505ddbdc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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 */