Patrice HAESAERT
/
eeprom_flash_4
Test eeprom F103RB
eeprom_flash.h@0:ea2bec485611, 2016-08-13 (annotated)
- Committer:
- olympux
- Date:
- Sat Aug 13 22:44:48 2016 +0000
- Revision:
- 0:ea2bec485611
- Child:
- 1:e593ae8ff81d
Initial with bug fix on keeping PER cleared after erasing page
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
olympux | 0:ea2bec485611 | 1 | #ifndef __EEPROM_FLASH_H |
olympux | 0:ea2bec485611 | 2 | #define __EEPROM_FLASH_H |
olympux | 0:ea2bec485611 | 3 | |
olympux | 0:ea2bec485611 | 4 | #include "mbed.h" |
olympux | 0:ea2bec485611 | 5 | |
olympux | 0:ea2bec485611 | 6 | #define EEPROM_START_ADDRESS ((uint32_t)0x08019000) // EEPROM emulation start address: after 100KByte of used Flash memory |
olympux | 0:ea2bec485611 | 7 | |
olympux | 0:ea2bec485611 | 8 | void enableEEPROMWriting(); // Unlock and keep PER cleared |
olympux | 0:ea2bec485611 | 9 | void disableEEPROMWriting(); // Lock |
olympux | 0:ea2bec485611 | 10 | |
olympux | 0:ea2bec485611 | 11 | // Write functions |
olympux | 0:ea2bec485611 | 12 | HAL_StatusTypeDef writeEEPROMHalfWord(uint32_t address, uint16_t data); |
olympux | 0:ea2bec485611 | 13 | HAL_StatusTypeDef writeEEPROMWord(uint32_t address, uint32_t data); |
olympux | 0:ea2bec485611 | 14 | |
olympux | 0:ea2bec485611 | 15 | // Read functions |
olympux | 0:ea2bec485611 | 16 | uint16_t readEEPROMHalfWord(uint32_t address); |
olympux | 0:ea2bec485611 | 17 | uint32_t readEEPROMWord(uint32_t address); |
olympux | 0:ea2bec485611 | 18 | |
olympux | 0:ea2bec485611 | 19 | #endif |