summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-01-12 08:29:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-01-12 08:29:05 +0100
commit4436c14ab688ca57fc82c1fd68f2f366fa131de1 (patch)
tree3b930d1285fe8255b9adc13cda37ccf190e069a8 /include/driver
parent0d84f5e512c4148bc45dd26eea177e09c0a21b56 (diff)
add mmsimple driver
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/mmsimple.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/driver/mmsimple.h b/include/driver/mmsimple.h
new file mode 100644
index 0000000..42b0f5d
--- /dev/null
+++ b/include/driver/mmsimple.h
@@ -0,0 +1,34 @@
+#ifndef MMSIMPLE_H
+#define MMSIMPLE_H
+
+class MicroMoodySimple {
+ private:
+ MicroMoodySimple(const MicroMoodySimple &copy);
+
+ unsigned char const address;
+ unsigned char txbuf[3];
+
+ void sendCmd(unsigned char byte);
+
+ public:
+ MicroMoodySimple(unsigned char const addr) : address(addr) {}
+
+ void off();
+ void red();
+ void redOn();
+ void redOff();
+ void green();
+ void greenOn();
+ void greenOff();
+ void blue();
+ void blueOn();
+ void blueOff();
+ void toggleRed();
+ void toggleGreen();
+ void toggleBlue();
+ void setBrightness(unsigned char red, unsigned char green);
+};
+
+extern MicroMoodySimple moody;
+
+#endif