summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-02-25 23:09:34 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-02-25 23:09:34 +0100
commit9a3d3bcc93f8cefea74af2a86b5834a57738e2c3 (patch)
tree6684318cfae0f6761b657a263db96472e78ec8d6 /include
parent4e70dc99f2fe61235c7e23739f91e3f7e2fff837 (diff)
add simple TSL2591 illuminance / IR sensor driver
Diffstat (limited to 'include')
-rw-r--r--include/driver/tsl2591.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/driver/tsl2591.h b/include/driver/tsl2591.h
new file mode 100644
index 0000000..0e9e8c8
--- /dev/null
+++ b/include/driver/tsl2591.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 Daniel Friesel
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+#ifndef TSL2591_H
+#define TSL2591_H
+
+class TSL2591 {
+ private:
+ TSL2591(const TSL2591 &copy);
+ unsigned char const address = 0x29;
+ unsigned char txbuf[2];
+ unsigned char rxbuf[4];
+
+ public:
+ TSL2591() {}
+
+ unsigned short ch0;
+ unsigned short ch1;
+
+ void init();
+
+ unsigned char getStatus();
+ void read();
+};
+
+extern TSL2591 tsl2591;
+
+#endif