EEPROM
Dependencies: EEPROM_24FC1025_I2C mbed
Revision 0:fa049b2de31a, committed 2017-03-13
- Comitter:
- Gaku0606
- Date:
- Mon Mar 13 07:04:18 2017 +0000
- Commit message:
- ???
Changed in this revision
--- /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