85 #define SECTOR_MASK ((uint32_t)0xFFFFFF07) 366 uint32_t tmp_psize = 0x0;
396 FLASH->CR |= tmp_psize;
434 uint32_t tmp_psize = 0x0;
460 #if defined (STM32F427X) 462 FLASH->CR |= tmp_psize;
475 FLASH->CR |= tmp_psize;
521 *(
__IO uint64_t*)Address = Data;
564 *(
__IO uint32_t*)Address = Data;
606 *(
__IO uint16_t*)Address = Data;
648 *(
__IO uint8_t*)Address = Data;
867 uint8_t optiontmp = 0xFF;
884 *(
__IO uint8_t *)
OPTCR_BYTE0_ADDRESS = OB_IWDG | (uint8_t)(OB_STDBY | (uint8_t)(OB_STOP | ((uint8_t)optiontmp)));
937 return (uint8_t)(
FLASH->OPTCR >> 5);
1032 FLASH->CR |= FLASH_IT;
1037 FLASH->CR &= ~(uint32_t)FLASH_IT;
1060 if((
FLASH->SR & FLASH_FLAG) != (uint32_t)
RESET)
1090 FLASH->SR = FLASH_FLAG;
1115 if((
FLASH->SR & (uint32_t)0xEF) != (uint32_t)0x00)
#define IS_OB_IWDG_SOURCE(SOURCE)
#define IS_OB_STOP_SOURCE(SOURCE)
#define IS_VOLTAGERANGE(RANGE)
void FLASH_OB_Unlock(void)
Unlocks the FLASH Option Control Registers access.
FLASH_Status FLASH_OB_Launch(void)
Launch the option byte loading.
void FLASH_OB_WRP1Config(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors.
FLASH_Status FLASH_EraseSector(uint32_t FLASH_Sector, uint8_t VoltageRange)
Erases a specified FLASH Sector.
uint16_t FLASH_OB_GetWRP(void)
Returns the FLASH Write Protection Option Bytes value.
#define IS_FLASH_GET_FLAG(FLAG)
void FLASH_OB_UserConfig(uint8_t OB_IWDG, uint8_t OB_STOP, uint8_t OB_STDBY)
Programs the FLASH User Option Byte: IWDG_SW / RST_STOP / RST_STDBY.
#define IS_FLASH_CLEAR_FLAG(FLAG)
void FLASH_InstructionCacheReset(void)
Resets the Instruction Cache.
FLASH_Status FLASH_GetStatus(void)
Returns the FLASH Status.
#define FLASH_OPTCR_OPTLOCK
void FLASH_PrefetchBufferCmd(FunctionalState NewState)
Enables or disables the Prefetch Buffer.
FlagStatus FLASH_GetFlagStatus(uint32_t FLASH_FLAG)
Checks whether the specified FLASH flag is set or not.
void FLASH_DataCacheCmd(FunctionalState NewState)
Enables or disables the Data Cache feature.
void assert_param(int val)
This file contains all the functions prototypes for the FLASH firmware library.
#define IS_FUNCTIONAL_STATE(STATE)
static volatile uint8_t * status
void FLASH_OB_BORConfig(uint8_t OB_BOR)
Sets the BOR Level.
void FLASH_OB_RDPConfig(uint8_t OB_RDP)
Sets the read protection level.
#define OPTCR_BYTE1_ADDRESS
OPTCR register byte 1 (Bits[15:8]) base address.
#define OPTCR1_BYTE2_ADDRESS
OPTCR1 register byte 0 (Bits[7:0]) base address.
void FLASH_OB_WRPConfig(uint32_t OB_WRP, FunctionalState NewState)
Enables or disables the write protection of the desired sectors.
#define ACR_BYTE0_ADDRESS
ACR register byte 0 (Bits[7:0]) base address.
void FLASH_ClearFlag(uint32_t FLASH_FLAG)
Clears the FLASH's pending flags.
void FLASH_Lock(void)
Locks the FLASH control register access.
#define FLASH_PSIZE_DOUBLE_WORD
#define IS_OB_WRP(SECTOR)
FLASH_Status FLASH_ProgramDoubleWord(uint32_t Address, uint64_t Data)
Programs a double word (64-bit) at a specified address.
FlagStatus FLASH_OB_GetRDP(void)
Returns the FLASH Read Protection level.
FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data)
Programs a word (32-bit) at a specified address.
#define FLASH_OPTCR_OPTSTRT
#define FLASH_PSIZE_HALF_WORD
FLASH_Status FLASH_EraseAllSectors(uint8_t VoltageRange)
Erases all FLASH Sectors.
#define IS_FLASH_LATENCY(LATENCY)
#define IS_FLASH_ADDRESS(ADDRESS)
#define IS_OB_STDBY_SOURCE(SOURCE)
FLASH_Status FLASH_ProgramByte(uint32_t Address, uint8_t Data)
Programs a byte (8-bit) at a specified address.
#define OPTCR_BYTE2_ADDRESS
OPTCR register byte 2 (Bits[23:16]) base address.
FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data)
Programs a half word (16-bit) at a specified address.
FLASH_Status
FLASH Status.
uint8_t FLASH_OB_GetUser(void)
Returns the FLASH User Option Bytes values.
void FLASH_OB_Lock(void)
Locks the FLASH Option Control Registers access.
#define FLASH_FLAG_WRPERR
#define FLASH_OPTCR_BOR_LEV
FLASH_Status FLASH_WaitForLastOperation(void)
Waits for a FLASH operation to complete.
uint8_t FLASH_OB_GetBOR(void)
Returns the FLASH BOR level.
void FLASH_SetLatency(uint32_t FLASH_Latency)
Sets the code latency value.
#define OPTCR_BYTE0_ADDRESS
OPTCR register byte 0 (Bits[7:0]) base address.
void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)
Enables or disables the specified FLASH interrupts.
void FLASH_InstructionCacheCmd(FunctionalState NewState)
Enables or disables the Instruction Cache feature.
uint16_t FLASH_OB_GetWRP1(void)
Returns the FLASH Write Protection Option Bytes value.
void FLASH_DataCacheReset(void)
Resets the Data Cache.
void FLASH_Unlock(void)
Unlocks the FLASH control register access.
#define IS_FLASH_SECTOR(SECTOR)