STM8S/A Standard Peripherals Drivers
|
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_EraseOptionByte (uint16_t Address) |
Erases option byte. | |
uint32_t | FLASH_GetBootSize (void) |
Returns the Boot memory size in bytes. | |
FlagStatus | FLASH_GetFlagStatus (FLASH_Flag_TypeDef FLASH_FLAG) |
Checks whether the specified SPI flag is set or not. | |
FLASH_LPMode_TypeDef | FLASH_GetLowPowerMode (void) |
Returns the Flash behaviour type in low power mode. | |
FLASH_ProgramTime_TypeDef | FLASH_GetProgrammingTime (void) |
Returns the fixed programming time. | |
void | FLASH_ITConfig (FunctionalState NewState) |
Enables or Disables the Flash interrupt mode. | |
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_ProgramOptionByte (uint16_t Address, uint8_t Data) |
Programs option byte. | |
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 any byte from flash memory. | |
uint16_t | FLASH_ReadOptionByte (uint16_t Address) |
Reads one option byte. | |
void | FLASH_SetLowPowerMode (FLASH_LPMode_TypeDef FLASH_LPMode) |
Select the Flash behaviour in low power mode. | |
void | FLASH_SetProgrammingTime (FLASH_ProgramTime_TypeDef FLASH_ProgTime) |
Sets the fixed programming time. | |
void | FLASH_Unlock (FLASH_MemType_TypeDef FLASH_MemType) |
Unlocks the program or data EEPROM memory. | |
IN_RAM (void FLASH_EraseBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType)) | |
IN_RAM (void FLASH_ProgramBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType, FLASH_ProgramMode_TypeDef FLASH_ProgMode, uint8_t *Buffer)) | |
IN_RAM (FLASH_Status_TypeDef FLASH_WaitForLastOperation(FLASH_MemType_TypeDef FLASH_MemType)) |
Function Documentation
void FLASH_DeInit | ( | void | ) |
DeInitializes the FLASH registers to their default reset values.
Definition at line 126 of file stm8s_flash.c.
References FLASH, FLASH_CR1_RESET_VALUE, FLASH_CR2_RESET_VALUE, FLASH_IAPSR_DUL, FLASH_IAPSR_PUL, and FLASH_NCR2_RESET_VALUE.
void FLASH_EraseByte | ( | uint32_t | Address | ) |
Erases one byte in the program or data EEPROM memory.
- Note:
- PointerAttr define is declared in the stm8s.h file to select if the pointer will be declared as near (2 bytes) or far (3 bytes).
Definition at line 164 of file stm8s_flash.c.
References FLASH_CLEAR_BYTE, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
void FLASH_EraseOptionByte | ( | uint16_t | Address | ) |
Erases option byte.
Definition at line 270 of file stm8s_flash.c.
References FLASH, FLASH_CLEAR_BYTE, FLASH_CR2_OPT, FLASH_MEMTYPE_PROG, FLASH_NCR2_NOPT, FLASH_SET_BYTE, IS_OPTION_BYTE_ADDRESS_OK, and NEAR.
uint32_t FLASH_GetBootSize | ( | void | ) |
Returns the Boot memory size in bytes.
Definition at line 392 of file stm8s_flash.c.
References FLASH.
FlagStatus FLASH_GetFlagStatus | ( | FLASH_Flag_TypeDef | FLASH_FLAG | ) |
Checks whether the specified SPI flag is set or not.
- Note:
- This function can clear the EOP, WR_PG_DIS flags in the IAPSR register.
Definition at line 417 of file stm8s_flash.c.
References FLASH, IS_FLASH_FLAGS_OK, RESET, and SET.
FLASH_LPMode_TypeDef FLASH_GetLowPowerMode | ( | void | ) |
Returns the Flash behaviour type in low power mode.
Definition at line 372 of file stm8s_flash.c.
References FLASH, FLASH_CR1_AHALT, and FLASH_CR1_HALT.
FLASH_ProgramTime_TypeDef FLASH_GetProgrammingTime | ( | void | ) |
Returns the fixed programming time.
Definition at line 382 of file stm8s_flash.c.
References FLASH, and FLASH_CR1_FIX.
void FLASH_ITConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the Flash interrupt mode.
Definition at line 142 of file stm8s_flash.c.
References DISABLE, FLASH, FLASH_CR1_IE, and IS_FUNCTIONALSTATE_OK.
void FLASH_Lock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Locks the program or data EEPROM memory.
Definition at line 112 of file stm8s_flash.c.
References FLASH, and IS_MEMORY_TYPE_OK.
Programs one byte in program or data EEPROM memory.
- Note:
- PointerAttr define is declared in the stm8s.h file to select if the pointer will be declared as near (2 bytes) or far (3 bytes).
Definition at line 181 of file stm8s_flash.c.
References IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Programs option byte.
Definition at line 237 of file stm8s_flash.c.
References FLASH, FLASH_CR2_OPT, FLASH_MEMTYPE_PROG, FLASH_NCR2_NOPT, IS_OPTION_BYTE_ADDRESS_OK, and NEAR.
Programs one word (4 bytes) in program or data EEPROM memory.
- Note:
- PointerAttr define is declared in the stm8s.h file to select if the pointer will be declared as near (2 bytes) or far (3 bytes).
Definition at line 212 of file stm8s_flash.c.
References FLASH, FLASH_CR2_WPRG, FLASH_NCR2_NWPRG, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Reads any byte from flash memory.
- Note:
- PointerAttr define is declared in the stm8s.h file to select if the pointer will be declared as near (2 bytes) or far (3 bytes).
Definition at line 195 of file stm8s_flash.c.
References IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Reads one option byte.
Definition at line 303 of file stm8s_flash.c.
References FLASH_OPTIONBYTE_ERROR, IS_OPTION_BYTE_ADDRESS_OK, and NEAR.
void FLASH_SetLowPowerMode | ( | FLASH_LPMode_TypeDef | FLASH_LPMode | ) |
Select the Flash behaviour in low power mode.
Definition at line 340 of file stm8s_flash.c.
References FLASH, FLASH_CR1_AHALT, FLASH_CR1_HALT, and IS_FLASH_LOW_POWER_MODE_OK.
void FLASH_SetProgrammingTime | ( | FLASH_ProgramTime_TypeDef | FLASH_ProgTime | ) |
Sets the fixed programming time.
Definition at line 358 of file stm8s_flash.c.
References FLASH, FLASH_CR1_FIX, and IS_FLASH_PROGRAM_TIME_OK.
void FLASH_Unlock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Unlocks the program or data EEPROM memory.
Definition at line 87 of file stm8s_flash.c.
References FLASH, FLASH_MEMTYPE_PROG, FLASH_RASS_KEY1, FLASH_RASS_KEY2, and IS_MEMORY_TYPE_OK.
IN_RAM | ( | void | FLASH_EraseBlockuint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType | ) |
All the functions declared below must be executed from RAM exclusively, except for the FLASH_WaitForLastOperation function which can be executed from Flash. Steps of the execution from RAM differs from one toolchain to another. for more details refer to stm8s_flash.c file. To enable execution from RAM you can either uncomment the following define in the stm8s.h file or define it in your toolchain compiler preprocessor - #define RAM_EXECUTION (1)
IN_RAM | ( | void | FLASH_ProgramBlockuint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType, FLASH_ProgramMode_TypeDef FLASH_ProgMode, uint8_t *Buffer | ) |
IN_RAM | ( | FLASH_Status_TypeDef | FLASH_WaitForLastOperationFLASH_MemType_TypeDef FLASH_MemType | ) |