EEPROM

Dependencies:   EEPROM_24FC1025_I2C mbed

Files at this revision

API Documentation at this revision

Comitter:
Gaku0606
Date:
Mon Mar 13 07:04:18 2017 +0000
Commit message:
???

Changed in this revision

EEPROM_24FC1025_I2C.lib Show annotated file Show diff for this revision Revisions of this file
Hybrid_EEPROM.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EEPROM_24FC1025_I2C.lib	Mon Mar 13 07:04:18 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/PQ_Hybrid_Electrical_Equipment_Team/code/EEPROM_24FC1025_I2C/#d6cc210c71cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Hybrid_EEPROM.cpp	Mon Mar 13 07:04:18 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "EEPROM_24FC1025.h"
+
+Serial pc(USBTX, USBRX, 230400);
+
+I2C i2cBus(p9, p10);
+#define A0_CONNECT 0
+#define A1_CONNECT 0
+EEPROM_24FC1025 eeprom0(i2cBus, A0_CONNECT, A1_CONNECT);
+
+/**
+*   EEPROMは書き込み回数に限りがあるので,むやみに書き込まないように!!
+*/
+int main() {
+    for(int i = 0; i < 16; i++){
+        eeprom0.write((uint64_t)i, 0x07);   
+        wait_ms(10);
+    }
+    pc.printf("0\t00 01 02 03 04 05 06 07\r\n");
+    for(uint64_t i = 0 ; i < 131073; i += 8){
+        uint8_t data[8] = {0};
+        eeprom0.read(i, data, 8);
+        pc.printf("%d\t", i);
+        for(int j = 0; j < 8; j++){
+            pc.printf("%02X ",data[j]);
+        }
+        pc.printf("\r\n");
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 13 07:04:18 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0
\ No newline at end of file