From f4b31b88508892ca781ebb14716dc322e868b6db Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 8 Aug 2018 15:45:32 +0200 Subject: Add 24LC64 EEPROM driver --- src/app/i2cdetect/main.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/app') 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 -- cgit v1.2.3