FLASH driver modules. More...
Macros | |
#define | RDPRT_MASK ((uint32_t)0x00000002) |
#define | SECTOR_MASK ((uint32_t)0xFFFFFF07) |
#define | WRP01_MASK ((uint32_t)0x0000FFFF) |
#define | WRP23_MASK ((uint32_t)0xFFFF0000) |
Enumerations | |
enum | FLASH_Status { FLASH_BUSY = 1, FLASH_ERROR_PGS, FLASH_ERROR_PGP, FLASH_ERROR_PGA, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_ERROR_OPERATION, FLASH_COMPLETE, FLASH_BUSY = 1, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE, FLASH_TIMEOUT, FLASH_BUSY = 1, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_COMPLETE, FLASH_TIMEOUT } |
FLASH Status. More... | |
enum | FLASH_Status { FLASH_BUSY = 1, FLASH_ERROR_PGS, FLASH_ERROR_PGP, FLASH_ERROR_PGA, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_ERROR_OPERATION, FLASH_COMPLETE, FLASH_BUSY = 1, FLASH_ERROR_PG, FLASH_ERROR_WRP, FLASH_COMPLETE, FLASH_TIMEOUT, FLASH_BUSY = 1, FLASH_ERROR_WRP, FLASH_ERROR_PROGRAM, FLASH_COMPLETE, FLASH_TIMEOUT } |
FLASH Status. More... | |
Functions | |
void | FLASH_DataCacheCmd (FunctionalState NewState) |
Enables or disables the Data Cache feature. More... | |
void | FLASH_DataCacheReset (void) |
Resets the Data Cache. More... | |
FLASH_Status | FLASH_EraseAllPages (void) |
Erases all FLASH pages. More... | |
FLASH_Status | FLASH_EraseAllSectors (uint8_t VoltageRange) |
Erases all FLASH Sectors. More... | |
FLASH_Status | FLASH_ErasePage (uint32_t Page_Address) |
Erases a specified FLASH page. More... | |
FLASH_Status | FLASH_EraseSector (uint32_t FLASH_Sector, uint8_t VoltageRange) |
Erases a specified FLASH Sector. More... | |
void | FLASH_HalfCycleAccessCmd (FunctionalState NewState) |
Enables or disables the Half cycle flash access. More... | |
void | FLASH_InstructionCacheCmd (FunctionalState NewState) |
Enables or disables the Instruction Cache feature. More... | |
void | FLASH_InstructionCacheReset (void) |
Resets the Instruction Cache. More... | |
FLASH_Status | FLASH_OB_BOOTConfig (uint8_t OB_BOOT1) |
Sets or resets the BOOT1. More... | |
void | FLASH_OB_BORConfig (uint8_t OB_BOR) |
Sets the BOR Level. More... | |
FLASH_Status | FLASH_OB_EnableWRP (uint32_t OB_WRP) |
Write protects the desired pages. More... | |
FLASH_Status | FLASH_OB_Erase (void) |
Erases the FLASH option bytes. More... | |
uint8_t | FLASH_OB_GetBOR (void) |
Returns the FLASH BOR level. More... | |
uint16_t | FLASH_OB_GetWRP1 (void) |
Returns the FLASH Write Protection Option Bytes value. More... | |
FLASH_Status | FLASH_OB_SRAMParityConfig (uint8_t OB_SRAM_Parity) |
Sets or resets the SRAM partiy. More... | |
FLASH_Status | FLASH_OB_VDDAConfig (uint8_t OB_VDDA_ANALOG) |
Sets or resets the analogue monitoring on VDDA Power source. More... | |
FLASH_Status | FLASH_OB_WriteUser (uint8_t OB_USER) |
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY/ BOOT1 and OB_VDDA_ANALOG. More... | |
void | FLASH_OB_WRP1Config (uint32_t OB_WRP, FunctionalState NewState) |
Enables or disables the write protection of the desired sectors. More... | |
void | FLASH_OB_WRPConfig (uint32_t OB_WRP, FunctionalState NewState) |
Enables or disables the write protection of the desired sectors. More... | |
FLASH_Status | FLASH_ProgramByte (uint32_t Address, uint8_t Data) |
Programs a byte (8-bit) at a specified address. More... | |
FLASH_Status | FLASH_ProgramDoubleWord (uint32_t Address, uint64_t Data) |
Programs a double word (64-bit) at a specified address. More... | |
FLASH_Status | FLASH_ProgramOptionByteData (uint32_t Address, uint8_t Data) |
Programs a half word at a specified Option Byte Data address. More... | |
FLASH_Status | FLASH_WaitForLastOperation (uint32_t Timeout) |
Waits for a Flash operation to complete or a TIMEOUT to occur. More... | |
FLASH_Status | FLASH_WaitForLastOperation (void) |
Waits for a FLASH operation to complete. More... | |
FLASH driver modules.
#define RDPRT_MASK ((uint32_t)0x00000002) |
Definition at line 91 of file stm32f30x_flash.c.
#define SECTOR_MASK ((uint32_t)0xFFFFFF07) |
Definition at line 85 of file stm32f4xx_flash.c.
#define WRP01_MASK ((uint32_t)0x0000FFFF) |
Definition at line 92 of file stm32f30x_flash.c.
#define WRP23_MASK ((uint32_t)0xFFFF0000) |
Definition at line 93 of file stm32f30x_flash.c.
enum FLASH_Status |
FLASH Status.
Definition at line 52 of file stm32f4xx_flash.h.
enum FLASH_Status |
FLASH Status.
Definition at line 52 of file stm32f30x_flash.h.
void FLASH_DataCacheCmd | ( | FunctionalState | NewState | ) |
Enables or disables the Data Cache feature.
NewState | new state of the Data Cache. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 241 of file stm32f4xx_flash.c.
void FLASH_DataCacheReset | ( | void | ) |
Resets the Data Cache.
None |
None |
Definition at line 273 of file stm32f4xx_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. |
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_EraseAllSectors | ( | uint8_t | VoltageRange | ) |
Erases all FLASH Sectors.
VoltageRange | The device voltage range which defines the erase parallelism. This parameter can be one of the following values:
|
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. |
Definition at line 432 of file stm32f4xx_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. |
Erases a specified FLASH page.
Page_Address | The page address in program memory to be erased. |
FLASH | Status: The returned value can be: FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 419 of file stm32f10x_flash.c.
FLASH_Status FLASH_EraseSector | ( | uint32_t | FLASH_Sector, |
uint8_t | VoltageRange | ||
) |
Erases a specified FLASH Sector.
FLASH_Sector | The Sector number to be erased. For STM32F40xx/41xx devices this parameter can be a value between FLASH_Sector_0 and FLASH_Sector_11. For STM32F427x/437x devices this parameter can be a value between FLASH_Sector_0 and FLASH_Sector_23. |
VoltageRange | The device voltage range which defines the erase parallelism. This parameter can be one of the following values:
|
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. |
Definition at line 364 of file stm32f4xx_flash.c.
void FLASH_HalfCycleAccessCmd | ( | FunctionalState | NewState | ) |
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 156 of file stm32f30x_flash.c.
void FLASH_InstructionCacheCmd | ( | FunctionalState | NewState | ) |
Enables or disables the Instruction Cache feature.
NewState | new state of the Instruction Cache. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 220 of file stm32f4xx_flash.c.
void FLASH_InstructionCacheReset | ( | void | ) |
Resets the Instruction Cache.
None |
None |
Definition at line 262 of file stm32f4xx_flash.c.
FLASH_Status FLASH_OB_BOOTConfig | ( | uint8_t | OB_BOOT1 | ) |
Sets or resets the BOOT1.
OB_BOOT1 | Set or Reset the BOOT1. This parameter can be one of the following values:
|
None |
Definition at line 758 of file stm32f30x_flash.c.
void FLASH_OB_BORConfig | ( | uint8_t | OB_BOR | ) |
Sets the BOR Level.
OB_BOR | specifies the Option Bytes BOR Reset Level. This parameter can be one of the following values:
|
None |
Definition at line 898 of file stm32f4xx_flash.c.
FLASH_Status FLASH_OB_EnableWRP | ( | uint32_t | OB_WRP | ) |
Write protects the desired pages.
OB_WRP | specifies the address of the pages to be write protected. This parameter can be:
|
FLASH | Status: The returned value can be: FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 591 of file stm32f30x_flash.c.
FLASH_Status FLASH_OB_Erase | ( | 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 521 of file stm32f30x_flash.c.
uint8_t FLASH_OB_GetBOR | ( | void | ) |
Returns the FLASH BOR level.
None |
The | FLASH BOR level:
|
Definition at line 994 of file stm32f4xx_flash.c.
uint16_t FLASH_OB_GetWRP1 | ( | void | ) |
Returns the FLASH Write Protection Option Bytes value.
None |
The | FLASH Write Protection Option Bytes value |
Definition at line 957 of file stm32f4xx_flash.c.
FLASH_Status FLASH_OB_SRAMParityConfig | ( | uint8_t | OB_SRAM_Parity | ) |
Sets or resets the SRAM partiy.
OB_SRAM_Parity | Set or Reset the SRAM partiy enable bit. This parameter can be one of the following values:
|
None |
Definition at line 842 of file stm32f30x_flash.c.
FLASH_Status FLASH_OB_VDDAConfig | ( | uint8_t | OB_VDDA_ANALOG | ) |
Sets or resets the analogue monitoring on VDDA Power source.
OB_VDDA_ANALOG | Selects the analog monitoring on VDDA Power source. This parameter can be one of the following values:
|
None |
Definition at line 800 of file stm32f30x_flash.c.
FLASH_Status FLASH_OB_WriteUser | ( | uint8_t | OB_USER | ) |
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY/ BOOT1 and OB_VDDA_ANALOG.
OB_USER | Selects all user option bytes This parameter is a combination of the following values:
|
FLASH | Status: The returned value can be: FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 888 of file stm32f30x_flash.c.
void FLASH_OB_WRP1Config | ( | uint32_t | OB_WRP, |
FunctionalState | NewState | ||
) |
Enables or disables the write protection of the desired sectors.
OB_WRP | specifies the sector(s) to be write protected or unprotected. This parameter can be one of the following values:
|
Newstate | new state of the Write Protection. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 798 of file stm32f4xx_flash.c.
void FLASH_OB_WRPConfig | ( | uint32_t | OB_WRP, |
FunctionalState | NewState | ||
) |
Enables or disables the write protection of the desired sectors.
OB_WRP | specifies the sector(s) to be write protected or unprotected. This parameter can be one of the following values:
|
Newstate | new state of the Write Protection. This parameter can be: ENABLE or DISABLE. |
None |
Definition at line 759 of file stm32f4xx_flash.c.
FLASH_Status FLASH_ProgramByte | ( | uint32_t | Address, |
uint8_t | Data | ||
) |
Programs a byte (8-bit) at a specified address.
Address | specifies the address to be programmed. This parameter can be any address in Program memory zone or in OTP zone. |
Data | specifies the data to be programmed. |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. |
Definition at line 631 of file stm32f4xx_flash.c.
FLASH_Status FLASH_ProgramDoubleWord | ( | uint32_t | Address, |
uint64_t | Data | ||
) |
Programs a double word (64-bit) 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_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. |
Definition at line 504 of file stm32f4xx_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. |
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_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. |
Waits for a Flash operation to complete or a TIMEOUT to occur.
Timeout | FLASH programming Timeout |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. |
Definition at line 1595 of file stm32f10x_flash.c.
FLASH_Status FLASH_WaitForLastOperation | ( | void | ) |
Waits for a FLASH operation to complete.
None |
FLASH | Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PROGRAM, FLASH_ERROR_WRP, FLASH_ERROR_OPERATION or FLASH_COMPLETE. |
Definition at line 1142 of file stm32f4xx_flash.c.