Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_20sept_2017_4th_oct_2017 by
eeprom_pgm.cpp
00001 #include "mbed.h" 00002 #include "eeprom.h" 00003 #include "eeprom_pgm.h" 00004 00005 #include <stdio.h> 00006 Serial ec(USBTX, USBRX); // tx, rx 00007 EEPROM rom(PTC11, PTC10, 0x00, EEPROM::T24C32); 00008 00009 00010 00011 00012 void eprom_write(uint32_t address, int32_t data) 00013 { 00014 rom.write(address ,data); // write data into the address 00015 00016 } 00017 00018 void eprom_write_8(uint32_t address, int8_t data) 00019 { 00020 rom.write(address ,data); // write data into the address 00021 00022 } 00023 00024 void eprom_write_16(uint32_t address, int16_t data) 00025 { 00026 rom.write(address ,data); // write data into the address 00027 00028 } 00029 00030 00031 int32_t eprom_read(uint32_t address) // readng the data from the specified address 00032 { 00033 int32_t rdata; // changed to int32_t 00034 rom.read(address, rdata); 00035 // ec.printf("Read back value=%d\n", rdata); 00036 return rdata; 00037 } 00038 00039 int8_t eprom_read_8(uint32_t address) // readng the data from the specified address 00040 { 00041 int8_t rdata; // changed to int32_t 00042 rom.read(address, rdata); 00043 //ec.printf("Read back value=%d\n", rdata); 00044 return rdata; 00045 } 00046 00047 int16_t eprom_read_16(uint32_t address) // readng the data from the specified address 00048 { 00049 int16_t rdata; // changed to int32_t 00050 rom.read(address, rdata); 00051 //ec.printf("Read back value=%d\n", rdata); 00052 return rdata; 00053 }
Generated on Thu Jul 14 2022 21:53:48 by
1.7.2
