eeprom_flash
Dependents: STM32F103C8T6_WIFI_Heating_system
Fork of eeprom_flash by
eeprom_flash.h@4:404dd375323c, 2018-09-18 (annotated)
- Committer:
- andrewklmn
- Date:
- Tue Sep 18 20:47:20 2018 +0000
- Revision:
- 4:404dd375323c
- Parent:
- 3:35953bc8607a
change page address to 63k
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 | 1:e593ae8ff81d | 6 | //#define EEPROM_START_ADDRESS ((uint32_t)0x08019000) // EEPROM emulation start address: after 100KByte of used Flash memory |
andrewklmn | 2:a37f58f78b2b | 7 | //#define EEPROM_START_ADDRESS ((uint32_t)0x0801C000) // EEPROM emulation start address: after 112KByte of used Flash memory |
andrewklmn | 4:404dd375323c | 8 | //#define EEPROM_START_ADDRESS ((uint32_t)0x0800F800) // EEPROM emulation start address: after 63KByte of used Flash memory |
andrewklmn | 4:404dd375323c | 9 | #define EEPROM_START_ADDRESS ((uint32_t)0x0800FC00) // EEPROM emulation start address: after 62KByte of used Flash memory |
olympux | 0:ea2bec485611 | 10 | |
andrewklmn | 3:35953bc8607a | 11 | |
olympux | 0:ea2bec485611 | 12 | void enableEEPROMWriting(); // Unlock and keep PER cleared |
olympux | 0:ea2bec485611 | 13 | void disableEEPROMWriting(); // Lock |
olympux | 0:ea2bec485611 | 14 | |
olympux | 0:ea2bec485611 | 15 | // Write functions |
olympux | 0:ea2bec485611 | 16 | HAL_StatusTypeDef writeEEPROMHalfWord(uint32_t address, uint16_t data); |
olympux | 0:ea2bec485611 | 17 | HAL_StatusTypeDef writeEEPROMWord(uint32_t address, uint32_t data); |
olympux | 0:ea2bec485611 | 18 | |
olympux | 0:ea2bec485611 | 19 | // Read functions |
olympux | 0:ea2bec485611 | 20 | uint16_t readEEPROMHalfWord(uint32_t address); |
olympux | 0:ea2bec485611 | 21 | uint32_t readEEPROMWord(uint32_t address); |
olympux | 0:ea2bec485611 | 22 | |
olympux | 0:ea2bec485611 | 23 | #endif |