Modification into 17th July New display demo code
Dependencies: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of Ext_Demo_17July2017_newdis by
eeprom_pgm.cpp@20:7c64e6ecad76, 2017-06-17 (annotated)
- Committer:
- nikitateggi
- Date:
- Sat Jun 17 09:36:18 2017 +0000
- Revision:
- 20:7c64e6ecad76
- Parent:
- 4:6bd81bb1790d
- Child:
- 22:ffa88619551d
poc code with finger detect and leadoff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nikitateggi | 4:6bd81bb1790d | 1 | #include "mbed.h" |
nikitateggi | 4:6bd81bb1790d | 2 | #include "eeprom.h" |
nikitateggi | 4:6bd81bb1790d | 3 | #include "eeprom_pgm.h" |
nikitateggi | 4:6bd81bb1790d | 4 | |
nikitateggi | 4:6bd81bb1790d | 5 | #include <stdio.h> |
nikitateggi | 4:6bd81bb1790d | 6 | Serial ec(USBTX, USBRX); // tx, rx |
nikitateggi | 4:6bd81bb1790d | 7 | EEPROM rom(PTC11, PTC10, 0x00, EEPROM::T24C32); |
nikitateggi | 4:6bd81bb1790d | 8 | |
nikitateggi | 4:6bd81bb1790d | 9 | |
nikitateggi | 4:6bd81bb1790d | 10 | |
nikitateggi | 4:6bd81bb1790d | 11 | |
nikitateggi | 4:6bd81bb1790d | 12 | void eprom_write(uint32_t address, int8_t data) |
nikitateggi | 4:6bd81bb1790d | 13 | { |
nikitateggi | 4:6bd81bb1790d | 14 | rom.write(address ,data); // write data into the address |
nikitateggi | 4:6bd81bb1790d | 15 | |
nikitateggi | 4:6bd81bb1790d | 16 | } |
nikitateggi | 4:6bd81bb1790d | 17 | |
nikitateggi | 4:6bd81bb1790d | 18 | |
nikitateggi | 4:6bd81bb1790d | 19 | |
nikitateggi | 4:6bd81bb1790d | 20 | |
nikitateggi | 4:6bd81bb1790d | 21 | int eprom_read(uint32_t address) // readng the data from the specified address |
nikitateggi | 4:6bd81bb1790d | 22 | { |
nikitateggi | 4:6bd81bb1790d | 23 | int8_t rdata; |
nikitateggi | 4:6bd81bb1790d | 24 | rom.read(address, rdata); |
nikitateggi | 4:6bd81bb1790d | 25 | ec.printf("Read back value=%u\n", rdata); |
nikitateggi | 4:6bd81bb1790d | 26 | return rdata; |
nikitateggi | 4:6bd81bb1790d | 27 | } |