diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-08-08 15:45:32 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-08-08 15:45:32 +0200 |
commit | f4b31b88508892ca781ebb14716dc322e868b6db (patch) | |
tree | 11ffb6fa4d8ce8c8821ea10fa62b17cd0d7f0024 /src/app/i2cdetect | |
parent | e7f1024732ee9bac13fbf2e2439106f9f3577db7 (diff) |
Add 24LC64 EEPROM driver
Diffstat (limited to 'src/app/i2cdetect')
-rw-r--r-- | src/app/i2cdetect/main.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/app/i2cdetect/main.cc b/src/app/i2cdetect/main.cc index 5094fd5..4ec49d9 100644 --- a/src/app/i2cdetect/main.cc +++ b/src/app/i2cdetect/main.cc @@ -12,6 +12,9 @@ #ifdef DRIVER_AM2320 #include "driver/am2320.h" #endif +#ifdef DRIVER_EEPROM24LC64 +#include "driver/eeprom24lc64.h" +#endif #ifdef DRIVER_MAX44009 #include "driver/max44009.h" #endif @@ -40,6 +43,16 @@ void loop(void) kout.printf_float(max44009.getLux()); kout << endl; #endif +#ifdef DRIVER_EEPROM24LC64 + char buf[33]; + static unsigned char page = 0; + eeprom24lc64.writePage(page, "Hello, World! Und so weiter, lol"); + arch.delay_ms(10); + eeprom24lc64.readPage(page, buf); + buf[32] = '\0'; + kout << "Address " << page << ": " << buf << endl; + page++; +#endif #ifdef DRIVER_MMSIMPLE moody.toggleBlue(); #endif |