EEPROM emulation using Flash for STM32F103 with fix error on "FLASH_PageErase"

Fork of eeprom_flash by Chau Vo

Committer:
Leech
Date:
Sat May 05 19:06:35 2018 +0000
Revision:
2:16f5373f8b31
Parent:
1:e593ae8ff81d
Fix error on FLASH_PageErase

Who changed what in which revision?

UserRevisionLine numberNew 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
olympux 1:e593ae8ff81d 7 #define EEPROM_START_ADDRESS ((uint32_t)0x0801C000) // EEPROM emulation start address: after 112KByte of used Flash memory
olympux 0:ea2bec485611 8
olympux 0:ea2bec485611 9 void enableEEPROMWriting(); // Unlock and keep PER cleared
olympux 0:ea2bec485611 10 void disableEEPROMWriting(); // Lock
olympux 0:ea2bec485611 11
Leech 2:16f5373f8b31 12 void FLASH_PageErase(uint32_t PageAddress);
Leech 2:16f5373f8b31 13
olympux 0:ea2bec485611 14 // Write functions
olympux 0:ea2bec485611 15 HAL_StatusTypeDef writeEEPROMHalfWord(uint32_t address, uint16_t data);
olympux 0:ea2bec485611 16 HAL_StatusTypeDef writeEEPROMWord(uint32_t address, uint32_t data);
olympux 0:ea2bec485611 17
olympux 0:ea2bec485611 18 // Read functions
olympux 0:ea2bec485611 19 uint16_t readEEPROMHalfWord(uint32_t address);
olympux 0:ea2bec485611 20 uint32_t readEEPROMWord(uint32_t address);
olympux 0:ea2bec485611 21
olympux 0:ea2bec485611 22 #endif