STM8L15x Standard Peripherals Drivers
|
FLASH Memory Programming functions. More...
Functions | |
void | FLASH_DeInit (void) |
Deinitializes the FLASH registers to their default reset values. | |
void | FLASH_EraseByte (uint32_t Address) |
Erases one byte in the program or data EEPROM memory. | |
void | FLASH_Lock (FLASH_MemType_TypeDef FLASH_MemType) |
Locks the program or data EEPROM memory. | |
void | FLASH_ProgramByte (uint32_t Address, uint8_t Data) |
Programs one byte in program or data EEPROM memory. | |
void | FLASH_ProgramWord (uint32_t Address, uint32_t Data) |
Programs one word (4 bytes) in program or data EEPROM memory. | |
uint8_t | FLASH_ReadByte (uint32_t Address) |
Reads one byte from flash memory. | |
void | FLASH_Unlock (FLASH_MemType_TypeDef FLASH_MemType) |
Unlocks the program or data EEPROM memory. |
Detailed Description
FLASH Memory Programming functions.
=============================================================================== FLASH Memory Programming functions =============================================================================== The FLASH Memory Programming functions, includes the following functions: - void FLASH_DeInit(void); - void FLASH_Unlock(FLASH_MemType_TypeDef FLASH_MemType); - void FLASH_Lock(FLASH_MemType_TypeDef FLASH_MemType); - void FLASH_ProgramByte(uint32_t Address, uint8_t Data); - void FLASH_EraseByte(uint32_t Address); - void FLASH_ProgramWord(uint32_t Address, uint32_t Data); - uint8_t FLASH_ReadByte(uint32_t Address); Any operation of erase or program should follow these steps: 1. Call the FLASH_Unlock(FLASH_MemType) function to enable the memory access 2. Call the desired function to erase or program data 3. Call the FLASH_Lock() function to disable the memory access (it is recommended to protect the FLASH memory against possible unwanted operation)
Function Documentation
void FLASH_DeInit | ( | void | ) |
Deinitializes the FLASH registers to their default reset values.
Definition at line 253 of file stm8l15x_flash.c.
References FLASH, FLASH_CR1_RESET_VALUE, FLASH_CR2_RESET_VALUE, and FLASH_IAPSR_RESET_VALUE.
void FLASH_EraseByte | ( | uint32_t | Address | ) |
Erases one byte in the program or data EEPROM memory.
Definition at line 324 of file stm8l15x_flash.c.
References FLASH_CLEAR_BYTE, IS_FLASH_ADDRESS, and PointerAttr.
void FLASH_Lock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Locks the program or data EEPROM memory.
Definition at line 297 of file stm8l15x_flash.c.
References FLASH, and IS_FLASH_MEMORY_TYPE.
Programs one byte in program or data EEPROM memory.
Definition at line 311 of file stm8l15x_flash.c.
References IS_FLASH_ADDRESS, and PointerAttr.
Programs one word (4 bytes) in program or data EEPROM memory.
Definition at line 338 of file stm8l15x_flash.c.
References FLASH, FLASH_CR2_WPRG, IS_FLASH_ADDRESS, and PointerAttr.
Reads one byte from flash memory.
Definition at line 360 of file stm8l15x_flash.c.
References PointerAttr.
void FLASH_Unlock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Unlocks the program or data EEPROM memory.
Definition at line 269 of file stm8l15x_flash.c.
References FLASH, FLASH_MemType_Data, FLASH_MemType_Program, FLASH_RASS_KEY1, FLASH_RASS_KEY2, and IS_FLASH_MEMORY_TYPE.