libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
flash_common_f01.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FLASH_ACR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x00)
 
#define FLASH_KEYR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x04)
 
#define FLASH_OPTKEYR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x08)
 
#define FLASH_SR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x0C)
 
#define FLASH_CR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x10)
 
#define FLASH_AR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x14)
 
#define FLASH_OBR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x1C)
 
#define FLASH_WRPR   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x20)
 
#define FLASH_KEYR2   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x44)
 
#define FLASH_SR2   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x4C)
 
#define FLASH_CR2   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x50)
 
#define FLASH_AR2   MMIO32(FLASH_MEM_INTERFACE_BASE + 0x54)
 
#define FLASH_OPTION_BYTE(i)   MMIO16(INFO_BASE+0x0800 + (i)*2)
 
#define FLASH_ACR_LATENCY_SHIFT   0
 
#define FLASH_ACR_LATENCY_MASK   7
 
#define FLASH_ACR_PRFTBS   (1 << 5)
 
#define FLASH_ACR_PRFTBE   (1 << 4)
 
#define FLASH_ACR_PRFTEN   FLASH_ACR_PRFTBE
 Compatibility define. More...
 
#define FLASH_SR_EOP   (1 << 5)
 
#define FLASH_SR_WRPRTERR   (1 << 4)
 
#define FLASH_SR_PGERR   (1 << 2)
 
#define FLASH_SR_BSY   (1 << 0)
 
#define FLASH_CR_EOPIE   (1 << 12)
 
#define FLASH_CR_ERRIE   (1 << 10)
 
#define FLASH_CR_OPTWRE   (1 << 9)
 
#define FLASH_CR_LOCK   (1 << 7)
 
#define FLASH_CR_STRT   (1 << 6)
 
#define FLASH_CR_OPTER   (1 << 5)
 
#define FLASH_CR_OPTPG   (1 << 4)
 
#define FLASH_CR_MER   (1 << 2)
 
#define FLASH_CR_PER   (1 << 1)
 
#define FLASH_CR_PG   (1 << 0)
 
#define FLASH_OBR_RDPRT_SHIFT   1
 
#define FLASH_OBR_OPTERR   (1 << 0)
 
#define FLASH_KEYR_KEY1   ((uint32_t)0x45670123)
 
#define FLASH_KEYR_KEY2   ((uint32_t)0xcdef89ab)
 
#define FLASH_OPTKEYR_KEY1   FLASH_KEYR_KEY1
 
#define FLASH_OPTKEYR_KEY2   FLASH_KEYR_KEY2
 

Functions

void flash_clear_pgerr_flag (void)
 Unlock the Flash Program and Erase Controller. More...
 
void flash_clear_wrprterr_flag (void)
 Clear the Write Protect Error Status Flag. More...
 
uint32_t flash_get_status_flags (void)
 Read All Status Flags. More...
 
void flash_program_word (uint32_t address, uint32_t data)
 Program a 32 bit Word to FLASH. More...
 
void flash_program_half_word (uint32_t address, uint16_t data)
 Program a Half Word to FLASH. More...
 
void flash_erase_page (uint32_t page_address)
 Erase a Page of FLASH. More...
 
void flash_erase_all_pages (void)
 Erase All FLASH. More...
 
void flash_erase_option_bytes (void)
 Erase All Option Bytes. More...
 
void flash_program_option_bytes (uint32_t address, uint16_t data)
 Program the Option Bytes. More...