summaryrefslogtreecommitdiff
path: root/src/storage.h
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-01-25 23:29:43 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-01-25 23:29:43 +0100
commitf4fe825650e1eb30ad57963232047606ac034e5c (patch)
tree08f25b5ad0deacf77f7e2a9c51b17b79cd3e4240 /src/storage.h
parent55da79c69f302cd86f0776e127daae0a12f557d4 (diff)
refactor I2C class into Storage class. Work-in-progress.
Diffstat (limited to 'src/storage.h')
-rw-r--r--src/storage.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/storage.h b/src/storage.h
new file mode 100644
index 0000000..75998bb
--- /dev/null
+++ b/src/storage.h
@@ -0,0 +1,23 @@
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <stdlib.h>
+
+#define I2C_EEPROM_ADDR 0x50
+
+class Storage {
+ private:
+ void i2c_start_write(void);
+ void i2c_start_read(void);
+ void i2c_stop(void);
+ int8_t i2c_send(uint8_t len, uint8_t *data);
+ int8_t i2c_receive(uint8_t len, uint8_t *data);
+ int8_t i2c_read(uint16_t addr, uint8_t len, uint8_t *data);
+ int8_t i2c_write(uint16_t addr, uint8_t len, uint8_t *data);
+ // TODO "file system" housekeeping (index of first free page)
+ public:
+ Storage() {};
+ void enable();
+ // TODO load / save methods for animations
+};
+
+extern Storage storage;