STM8S/A Standard Peripherals Firmware Library
|
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. |
Function Documentation
void FLASH_DeInit | ( | void | ) |
DeInitializes the FLASH registers to their default reset values.
- Parameters:
-
None
- Return values:
-
None
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).
- Parameters:
-
Address : Address of the byte to erase
- Return values:
-
None
Definition at line 164 of file stm8s_flash.c.
References assert_param, FLASH_CLEAR_BYTE, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Referenced by main().
void FLASH_EraseOptionByte | ( | uint16_t | Address | ) |
Erases option byte.
- Parameters:
-
Address : Option byte address to erase
- Return values:
-
None
Definition at line 270 of file stm8s_flash.c.
References assert_param, 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.
- Parameters:
-
None
- Return values:
-
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.
- Parameters:
-
FLASH_FLAG : Specifies the flag to check. This parameter can be any of the FLASH_Flag_TypeDef enumeration.
- Return values:
-
FlagStatus : Indicates the state of FLASH_FLAG. This parameter can be any of the FlagStatus enumeration.
- 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 assert_param, FLASH, IS_FLASH_FLAGS_OK, RESET, and SET.
Referenced by FLASH_Config(), and main().
FLASH_LPMode_TypeDef FLASH_GetLowPowerMode | ( | void | ) |
Returns the Flash behaviour type in low power mode.
- Parameters:
-
None
- Return values:
-
FLASH_LPMode_TypeDef 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.
- Parameters:
-
None
- Return values:
-
FLASH_ProgramTime_TypeDef Fixed programming time value
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.
- Parameters:
-
NewState : The new state of the flash interrupt mode This parameter can be a value of FunctionalState enumeration.
- Return values:
-
None
Definition at line 142 of file stm8s_flash.c.
References assert_param, DISABLE, FLASH, FLASH_CR1_IE, and IS_FUNCTIONALSTATE_OK.
void FLASH_Lock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Locks the program or data EEPROM memory.
- Parameters:
-
FLASH_MemType : Memory type This parameter can be a value of FLASH_MemType_TypeDef
- Return values:
-
None
Definition at line 112 of file stm8s_flash.c.
References assert_param, 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).
- Parameters:
-
Address : Address where the byte will be programmed Data : Value to be programmed
- Return values:
-
None
Definition at line 181 of file stm8s_flash.c.
References assert_param, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Referenced by main().
Programs option byte.
- Parameters:
-
Address : option byte address to program Data : Value to write
- Return values:
-
None
Definition at line 237 of file stm8s_flash.c.
References assert_param, 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).
- Parameters:
-
Address : The address where the data will be programmed Data : Value to be programmed
- Return values:
-
None
Definition at line 212 of file stm8s_flash.c.
References assert_param, FLASH, FLASH_CR2_WPRG, FLASH_NCR2_NWPRG, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Referenced by main().
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).
- Parameters:
-
Address : Address to read
- Return values:
-
Value of the byte
Definition at line 195 of file stm8s_flash.c.
References assert_param, IS_FLASH_ADDRESS_OK, MemoryAddressCast, and PointerAttr.
Referenced by main().
Reads one option byte.
- Parameters:
-
Address option byte address to read.
- Return values:
-
Option byte read value + its complement
Definition at line 303 of file stm8s_flash.c.
References assert_param, 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.
- Parameters:
-
FLASH_LPMode Low power mode selection This parameter can be any of the FLASH_LPMode_TypeDef values.
- Return values:
-
None
Definition at line 340 of file stm8s_flash.c.
References assert_param, 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.
- Parameters:
-
FLASH_ProgTime Indicates the programming time to be fixed This parameter can be any of the FLASH_ProgramTime_TypeDef values.
- Return values:
-
None
Definition at line 358 of file stm8s_flash.c.
References assert_param, FLASH, FLASH_CR1_FIX, and IS_FLASH_PROGRAM_TIME_OK.
Referenced by FLASH_Config(), and main().
void FLASH_Unlock | ( | FLASH_MemType_TypeDef | FLASH_MemType | ) |
Unlocks the program or data EEPROM memory.
- Parameters:
-
FLASH_MemType : Memory type to unlock This parameter can be a value of FLASH_MemType_TypeDef
- Return values:
-
None
Definition at line 87 of file stm8s_flash.c.
References assert_param, FLASH, FLASH_MEMTYPE_PROG, FLASH_RASS_KEY1, FLASH_RASS_KEY2, and IS_MEMORY_TYPE_OK.
Referenced by FLASH_Config(), and main().