summaryrefslogtreecommitdiff
path: root/include/esp8266
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-07-12 10:51:47 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-07-12 10:51:47 +0200
commit136d16ad4248d9cbd5aae871ffb76632ca8dfdc9 (patch)
tree8a212ea83f4b781a2ba44507d10e25108fdfec2b /include/esp8266
parent17a7c6d3783288c3ed0b28f898232cd0ea00c0c9 (diff)
Extend ESP8266 GPIO
Diffstat (limited to 'include/esp8266')
-rw-r--r--include/esp8266/driver/gpio.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/esp8266/driver/gpio.h b/include/esp8266/driver/gpio.h
index 177e7c5..3db5d9d 100644
--- a/include/esp8266/driver/gpio.h
+++ b/include/esp8266/driver/gpio.h
@@ -7,10 +7,22 @@ class GPIO {
public:
GPIO () {}
+
+ enum Pin : unsigned char {
+ d3 = 0, tx, d4, rx, d2, d1,
+ d6 = 12, d7, d5, d8,
+ d0 = 16
+ };
+
void setup();
void led_on(unsigned char id);
void led_off(unsigned char id);
void led_toggle(unsigned char id);
+ void input(unsigned char const pin);
+ void input(unsigned char const pin, bool pullup);
+ void output(unsigned char const pin);
+ unsigned char read(unsigned char const pin);
+ void write(unsigned char const pin, unsigned char value);
};
extern GPIO gpio;