Example program for Microchip 47x04 and 47x16 EERAM devices.

Dependencies:   EERAM mbed-dev

Revision:
3:9b5473254d82
Parent:
2:e7a7a5328184
Child:
4:8cc86b207f25
--- a/eeram_main.cpp	Thu Apr 27 13:27:13 2017 +0000
+++ b/eeram_main.cpp	Thu Apr 27 17:56:56 2017 +0000
@@ -135,6 +135,19 @@
     int length = addressPtr - START_ADDRESS + 6;
     serial.printf("Dump %d bytes from 0x%X:\r\n", length, START_ADDRESS);
     eeram.dump(serial, START_ADDRESS, length);
+
+    //Read and write array
+    serial.printf("# # #\r\nTest arrays\r\nWrite:\r\n");
+    const int arraySize = 4;
+    const uint16_t address = 0x300;
+    float floatArrayToWrite[arraySize] = {1976.09f, 1979.04f, 2013.04f, 2015.11f};
+    for (int i = 0; i < arraySize; i++) serial.printf("%f ", floatArrayToWrite[i]);
+    serial.printf("\r\nRead:\r\n");
+    eeram.writeArray(address, floatArrayToWrite, arraySize);
+    float floatArrayToRead[arraySize];
+    eeram.readArray(address, floatArrayToRead, arraySize);
+    for (int i = 0; i < arraySize; i++) serial.printf("%f ", floatArrayToRead[i]);
+    serial.printf("\r\n");
 }
 
 void eeramRegisterTest()