STM32F10x Standard Peripherals Library
3.5.0
|
Functions | |
void | FLASH_SetLatency (uint32_t FLASH_Latency) |
Sets the code latency value. | |
void | FLASH_HalfCycleAccessCmd (uint32_t FLASH_HalfCycleAccess) |
Enables or disables the Half cycle flash access. | |
void | FLASH_PrefetchBufferCmd (uint32_t FLASH_PrefetchBuffer) |
Enables or disables the Prefetch Buffer. | |
void | FLASH_Unlock (void) |
Unlocks the FLASH Program Erase Controller. | |
void | FLASH_Lock (void) |
Locks the FLASH Program Erase Controller. | |
FLASH_Status | FLASH_ErasePage (uint32_t Page_Address) |
Erases a specified FLASH page. | |
FLASH_Status | FLASH_EraseAllPages (void) |
Erases all FLASH pages. | |
FLASH_Status | FLASH_EraseOptionBytes (void) |
Erases the FLASH option bytes. | |
FLASH_Status | FLASH_ProgramWord (uint32_t Address, uint32_t Data) |
Programs a word at a specified address. | |
FLASH_Status | FLASH_ProgramHalfWord (uint32_t Address, uint16_t Data) |
Programs a half word at a specified address. | |
FLASH_Status | FLASH_ProgramOptionByteData (uint32_t Address, uint8_t Data) |
Programs a half word at a specified Option Byte Data address. | |
FLASH_Status | FLASH_EnableWriteProtection (uint32_t FLASH_Pages) |
Write protects the desired pages. | |
FLASH_Status | FLASH_ReadOutProtection (FunctionalState NewState) |
Enables or disables the read out protection. | |
FLASH_Status | FLASH_UserOptionByteConfig (uint16_t OB_IWDG, uint16_t OB_STOP, uint16_t OB_STDBY) |
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY. | |
uint32_t | FLASH_GetUserOptionByte (void) |
Returns the FLASH User Option Bytes values. | |
uint32_t | FLASH_GetWriteProtectionOptionByte (void) |
Returns the FLASH Write Protection Option Bytes Register value. | |
FlagStatus | FLASH_GetReadOutProtectionStatus (void) |
Checks whether the FLASH Read Out Protection Status is set or not. | |
FlagStatus | FLASH_GetPrefetchBufferStatus (void) |
Checks whether the FLASH Prefetch Buffer status is set or not. | |
void | FLASH_ITConfig (uint32_t FLASH_IT, FunctionalState NewState) |
Enables or disables the specified FLASH interrupts. | |
FlagStatus | FLASH_GetFlagStatus (uint32_t FLASH_FLAG) |
Checks whether the specified FLASH flag is set or not. | |
void | FLASH_ClearFlag (uint32_t FLASH_FLAG) |
Clears the FLASH's pending flags. | |
FLASH_Status | FLASH_GetStatus (void) |
Returns the FLASH Status. | |
FLASH_Status | FLASH_WaitForLastOperation (uint32_t Timeout) |
Waits for a Flash operation to complete or a TIMEOUT to occur. | |
void | FLASH_UnlockBank1 (void) |
Unlocks the FLASH Bank1 Program Erase Controller. | |
void | FLASH_LockBank1 (void) |
Locks the FLASH Bank1 Program Erase Controller. | |
FLASH_Status | FLASH_EraseAllBank1Pages (void) |
Erases all Bank1 FLASH pages. | |
FLASH_Status | FLASH_GetBank1Status (void) |
Returns the FLASH Bank1 Status. | |
FLASH_Status | FLASH_WaitForLastBank1Operation (uint32_t Timeout) |
Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur. |
void FLASH_ClearFlag | ( | uint32_t | FLASH_FLAG | ) |
Clears the FLASH's pending flags.
FLASH_FLAG,: | specifies the FLASH flags to clear. This parameter can be any combination of the following values:
|
None |
Definition at line 1443 of file stm32f10x_flash.c.
FLASH_Status FLASH_EnableWriteProtection | ( | uint32_t | FLASH_Pages | ) |
Write protects the desired pages.
FLASH_Pages,: | specifies the address of the pages to be write protected. This parameter can be:
|
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 975 of file stm32f10x_flash.c.
FLASH_Status FLASH_EraseAllBank1Pages | ( | void | ) |
Erases all Bank1 FLASH pages.
None |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 555 of file stm32f10x_flash.c.
FLASH_Status FLASH_EraseAllPages | ( | void | ) |
Erases all FLASH pages.
None |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 492 of file stm32f10x_flash.c.
FLASH_Status FLASH_EraseOptionBytes | ( | void | ) |
Erases the FLASH option bytes.
None |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 616 of file stm32f10x_flash.c.
FLASH_Status FLASH_ErasePage | ( | uint32_t | Page_Address | ) |
Erases a specified FLASH page.
Page_Address,: | The page address to be erased. |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 419 of file stm32f10x_flash.c.
FLASH_Status FLASH_GetBank1Status | ( | void | ) |
Returns the FLASH Bank1 Status.
None |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP or FLASH_COMPLETE |
Definition at line 1515 of file stm32f10x_flash.c.
FlagStatus FLASH_GetFlagStatus | ( | uint32_t | FLASH_FLAG | ) |
Checks whether the specified FLASH flag is set or not.
FLASH_FLAG,: | specifies the FLASH flag to check. This parameter can be one of the following values:
|
The | new state of FLASH_FLAG (SET or RESET). |
Definition at line 1357 of file stm32f10x_flash.c.
FlagStatus FLASH_GetPrefetchBufferStatus | ( | void | ) |
Checks whether the FLASH Prefetch Buffer status is set or not.
None |
FLASH | Prefetch Buffer Status (SET or RESET). |
Definition at line 1260 of file stm32f10x_flash.c.
FlagStatus FLASH_GetReadOutProtectionStatus | ( | void | ) |
Checks whether the FLASH Read Out Protection Status is set or not.
None |
FLASH | ReadOut Protection Status(SET or RESET) |
Definition at line 1240 of file stm32f10x_flash.c.
FLASH_Status FLASH_GetStatus | ( | void | ) |
Returns the FLASH Status.
None |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, FLASH_ERROR_WRP or FLASH_COMPLETE |
Definition at line 1477 of file stm32f10x_flash.c.
uint32_t FLASH_GetUserOptionByte | ( | void | ) |
Returns the FLASH User Option Bytes values.
None |
The | FLASH User Option Bytes values:IWDG_SW(Bit0), RST_STOP(Bit1) and RST_STDBY(Bit2). |
Definition at line 1216 of file stm32f10x_flash.c.
uint32_t FLASH_GetWriteProtectionOptionByte | ( | void | ) |
Returns the FLASH Write Protection Option Bytes Register value.
None |
The | FLASH Write Protection Option Bytes Register value |
Definition at line 1228 of file stm32f10x_flash.c.
void FLASH_HalfCycleAccessCmd | ( | uint32_t | FLASH_HalfCycleAccess | ) |
Enables or disables the Half cycle flash access.
FLASH_HalfCycleAccess,: | specifies the FLASH Half cycle Access mode. This parameter can be one of the following values:
|
None |
Definition at line 281 of file stm32f10x_flash.c.
void FLASH_ITConfig | ( | uint32_t | FLASH_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified FLASH interrupts.
FLASH_IT,: | specifies the FLASH interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState,: | new state of the specified Flash interrupts. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 1290 of file stm32f10x_flash.c.
void FLASH_Lock | ( | void | ) |
Locks the FLASH Program Erase Controller.
None |
None |
Definition at line 372 of file stm32f10x_flash.c.
void FLASH_LockBank1 | ( | void | ) |
Locks the FLASH Bank1 Program Erase Controller.
None |
None |
Definition at line 392 of file stm32f10x_flash.c.
void FLASH_PrefetchBufferCmd | ( | uint32_t | FLASH_PrefetchBuffer | ) |
Enables or disables the Prefetch Buffer.
FLASH_PrefetchBuffer,: | specifies the Prefetch buffer status. This parameter can be one of the following values:
|
None |
Definition at line 300 of file stm32f10x_flash.c.
FLASH_Status FLASH_ProgramHalfWord | ( | uint32_t | Address, |
uint16_t | Data | ||
) |
Programs a half word at a specified address.
Address,: | specifies the address to be programmed. |
Data,: | specifies the data to be programmed. |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 858 of file stm32f10x_flash.c.
FLASH_Status FLASH_ProgramOptionByteData | ( | uint32_t | Address, |
uint8_t | Data | ||
) |
Programs a half word at a specified Option Byte Data address.
Address,: | specifies the address to be programmed. This parameter can be 0x1FFFF804 or 0x1FFFF806. |
Data,: | specifies the data to be programmed. |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 929 of file stm32f10x_flash.c.
FLASH_Status FLASH_ProgramWord | ( | uint32_t | Address, |
uint32_t | Data | ||
) |
Programs a word at a specified address.
Address,: | specifies the address to be programmed. |
Data,: | specifies the data to be programmed. |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 681 of file stm32f10x_flash.c.
FLASH_Status FLASH_ReadOutProtection | ( | FunctionalState | NewState | ) |
Enables or disables the read out protection.
Newstate,: | new state of the ReadOut Protection. This parameter can be: ENABLE or DISABLE. |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 1049 of file stm32f10x_flash.c.
void FLASH_SetLatency | ( | uint32_t | FLASH_Latency | ) |
Sets the code latency value.
This driver provides functions to configure and program the Flash memory of all STM32F10x devices, including the latest STM32F10x_XL density devices. STM32F10x_XL devices feature up to 1 Mbyte with dual bank architecture for read-while-write (RWW) capability: - bank1: fixed size of 512 Kbytes (256 pages of 2Kbytes each) - bank2: up to 512 Kbytes (up to 256 pages of 2Kbytes each) While other STM32F10x devices features only one bank with memory up to 512 Kbytes. In version V3.3.0, some functions were updated and new ones were added to support STM32F10x_XL devices. Thus some functions manages all devices, while other are dedicated for XL devices only. The table below presents the list of available functions depending on the used STM32F10x devices. Legacy functions used for all STM32F10x devices * +----------------------------------------------------------------------------------------------------------------------------------+ | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | | | devices | devices | | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_SetLatency | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_HalfCycleAccessCmd | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_PrefetchBufferCmd | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_Unlock | Yes | Yes | - For STM32F10X_XL devices: unlock Bank1 and Bank2. | | | | | - For other devices: unlock Bank1 and it is equivalent | | | | | to FLASH_UnlockBank1 function. | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_Lock | Yes | Yes | - For STM32F10X_XL devices: lock Bank1 and Bank2. | | | | | - For other devices: lock Bank1 and it is equivalent | | | | | to FLASH_LockBank1 function. | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ErasePage | Yes | Yes | - For STM32F10x_XL devices: erase a page in Bank1 and Bank2 | | | | | - For other devices: erase a page in Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_EraseAllPages | Yes | Yes | - For STM32F10x_XL devices: erase all pages in Bank1 and Bank2 | | | | | - For other devices: erase all pages in Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_EraseOptionBytes | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ProgramWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ProgramHalfWord | Yes | Yes | Updated to program up to 1MByte (depending on the used device) | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ProgramOptionByteData | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_EnableWriteProtection | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ReadOutProtection | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_UserOptionByteConfig | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetUserOptionByte | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetWriteProtectionOptionByte | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetReadOutProtectionStatus | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetPrefetchBufferStatus | Yes | Yes | No change | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ITConfig | Yes | Yes | - For STM32F10x_XL devices: enable Bank1 and Bank2's interrupts| | | | | - For other devices: enable Bank1's interrupts | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetFlagStatus | Yes | Yes | - For STM32F10x_XL devices: return Bank1 and Bank2's flag status| | | | | - For other devices: return Bank1's flag status | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_ClearFlag | Yes | Yes | - For STM32F10x_XL devices: clear Bank1 and Bank2's flag | | | | | - For other devices: clear Bank1's flag | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_GetStatus | Yes | Yes | - Return the status of Bank1 (for all devices) | | | | | equivalent to FLASH_GetBank1Status function | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_WaitForLastOperation | Yes | Yes | - Wait for Bank1 last operation (for all devices) | | | | | equivalent to: FLASH_WaitForLastBank1Operation function | +----------------------------------------------------------------------------------------------------------------------------------+ New functions used for all STM32F10x devices to manage Bank1: * - These functions are mainly useful for STM32F10x_XL density devices, to have separate control for Bank1 and bank2 * - For other devices, these functions are optional (covered by functions listed above) * +----------------------------------------------------------------------------------------------------------------------------------+ | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | | | devices | devices | | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_UnlockBank1 | Yes | Yes | - Unlock Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_LockBank1 | Yes | Yes | - Lock Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_EraseAllBank1Pages | Yes | Yes | - Erase all pages in Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_GetBank1Status | Yes | Yes | - Return the status of Bank1 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_WaitForLastBank1Operation | Yes | Yes | - Wait for Bank1 last operation | +----------------------------------------------------------------------------------------------------------------------------------+ New Functions used only with STM32F10x_XL density devices to manage Bank2 * +----------------------------------------------------------------------------------------------------------------------------------+ | Functions prototypes |STM32F10x_XL|Other STM32F10x| Comments | | | devices | devices | | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_UnlockBank2 | Yes | No | - Unlock Bank2 | |----------------------------------------------------------------------------------------------------------------------------------| |FLASH_LockBank2 | Yes | No | - Lock Bank2 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_EraseAllBank2Pages | Yes | No | - Erase all pages in Bank2 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_GetBank2Status | Yes | No | - Return the status of Bank2 | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_WaitForLastBank2Operation | Yes | No | - Wait for Bank2 last operation | |----------------------------------------------------------------------------------------------------------------------------------| | FLASH_BootConfig | Yes | No | - Configure to boot from Bank1 or Bank2 | +----------------------------------------------------------------------------------------------------------------------------------+
FLASH_Latency,: | specifies the FLASH Latency value. This parameter can be one of the following values:
|
None |
Definition at line 254 of file stm32f10x_flash.c.
void FLASH_Unlock | ( | void | ) |
Unlocks the FLASH Program Erase Controller.
None |
None |
Definition at line 319 of file stm32f10x_flash.c.
void FLASH_UnlockBank1 | ( | void | ) |
Unlocks the FLASH Bank1 Program Erase Controller.
None |
None |
Definition at line 340 of file stm32f10x_flash.c.
FLASH_Status FLASH_UserOptionByteConfig | ( | uint16_t | OB_IWDG, |
uint16_t | OB_STOP, | ||
uint16_t | OB_STDBY | ||
) |
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
OB_IWDG,: | Selects the IWDG mode This parameter can be one of the following values:
|
OB_STOP,: | Reset event when entering STOP mode. This parameter can be one of the following values:
|
OB_STDBY,: | Reset event when entering Standby mode. This parameter can be one of the following values:
|
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 1118 of file stm32f10x_flash.c.
FLASH_Status FLASH_WaitForLastBank1Operation | ( | uint32_t | Timeout | ) |
Waits for a Flash operation on Bank1 to complete or a TIMEOUT to occur.
Timeout,: | FLASH programming Timeout |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 1623 of file stm32f10x_flash.c.
FLASH_Status FLASH_WaitForLastOperation | ( | uint32_t | Timeout | ) |
Waits for a Flash operation to complete or a TIMEOUT to occur.
Timeout,: | FLASH programming Timeout |
FLASH | Status: The returned value can be: FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 1595 of file stm32f10x_flash.c.