summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-12-04 15:19:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-12-04 15:19:25 +0100
commit7b5284023070b841293d0c5a6be0c6c345372cde (patch)
tree5f2c70451cf61ef6744813cac3a221cef210b213 /include
Add basic system: LED GPIO on MSP430FR5969 Launchpad and faked GPIO on POSIX
Diffstat (limited to 'include')
-rw-r--r--include/msp430fr5969lp/driver/gpio.h18
-rw-r--r--include/posix/driver/gpio.h19
2 files changed, 37 insertions, 0 deletions
diff --git a/include/msp430fr5969lp/driver/gpio.h b/include/msp430fr5969lp/driver/gpio.h
new file mode 100644
index 0000000..177e7c5
--- /dev/null
+++ b/include/msp430fr5969lp/driver/gpio.h
@@ -0,0 +1,18 @@
+#ifndef GPIO_H
+#define GPIO_H
+
+class GPIO {
+ private:
+ GPIO(const GPIO &copy);
+
+ public:
+ GPIO () {}
+ void setup();
+ void led_on(unsigned char id);
+ void led_off(unsigned char id);
+ void led_toggle(unsigned char id);
+};
+
+extern GPIO gpio;
+
+#endif
diff --git a/include/posix/driver/gpio.h b/include/posix/driver/gpio.h
new file mode 100644
index 0000000..0995729
--- /dev/null
+++ b/include/posix/driver/gpio.h
@@ -0,0 +1,19 @@
+#ifndef GPIO_H
+#define GPIO_H
+
+class GPIO {
+ private:
+ GPIO(const GPIO &copy);
+ unsigned char ledstate;
+
+ public:
+ GPIO () : ledstate(0) {}
+ void setup() {}
+ void led_on(unsigned char id);
+ void led_off(unsigned char id);
+ void led_toggle(unsigned char id);
+};
+
+extern GPIO gpio;
+
+#endif