libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
FLASH Defines

Defined Constants and Types for the STM32F3xx Flash controller More...

Collaboration diagram for FLASH Defines:

Modules

 Flash Registers
 

Macros

#define FLASH_SR_BSY   (1 << 0)
 
#define FLASH_SR_ERLYBSY   (1 << 1)
 
#define FLASH_SR_PGERR   (1 << 2)
 
#define FLASH_SR_WRPRTERR   (1 << 4)
 
#define FLASH_SR_EOP   (1 << 5)
 
#define FLASH_CR_OBL_LAUNCH   (1 << 13)
 
#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_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)
 
void flash_clear_wrprterr_flag (void)
 
void flash_program_half_word (uint32_t address, uint16_t data)
 
void flash_erase_page (uint32_t page_address)
 
void flash_erase_all_pages (void)
 

Detailed Description

Defined Constants and Types for the STM32F3xx Flash controller

Version
1.0.0
Date
11 July 2013

LGPL License Terms libopencm3 License

Macro Definition Documentation

◆ FLASH_CR_EOPIE

#define FLASH_CR_EOPIE   (1 << 12)

Definition at line 83 of file f3/flash.h.

◆ FLASH_CR_ERRIE

#define FLASH_CR_ERRIE   (1 << 10)

Definition at line 84 of file f3/flash.h.

◆ FLASH_CR_LOCK

#define FLASH_CR_LOCK   (1 << 7)

Definition at line 86 of file f3/flash.h.

◆ FLASH_CR_MER

#define FLASH_CR_MER   (1 << 2)

Definition at line 90 of file f3/flash.h.

◆ FLASH_CR_OBL_LAUNCH

#define FLASH_CR_OBL_LAUNCH   (1 << 13)

Definition at line 82 of file f3/flash.h.

◆ FLASH_CR_OPTER

#define FLASH_CR_OPTER   (1 << 5)

Definition at line 88 of file f3/flash.h.

◆ FLASH_CR_OPTPG

#define FLASH_CR_OPTPG   (1 << 4)

Definition at line 89 of file f3/flash.h.

◆ FLASH_CR_OPTWRE

#define FLASH_CR_OPTWRE   (1 << 9)

Definition at line 85 of file f3/flash.h.

◆ FLASH_CR_PER

#define FLASH_CR_PER   (1 << 1)

Definition at line 91 of file f3/flash.h.

◆ FLASH_CR_PG

#define FLASH_CR_PG   (1 << 0)

Definition at line 92 of file f3/flash.h.

◆ FLASH_CR_STRT

#define FLASH_CR_STRT   (1 << 6)

Definition at line 87 of file f3/flash.h.

◆ FLASH_KEYR_KEY1

#define FLASH_KEYR_KEY1   ((uint32_t)0x45670123)

Definition at line 95 of file f3/flash.h.

◆ FLASH_KEYR_KEY2

#define FLASH_KEYR_KEY2   ((uint32_t)0xcdef89ab)

Definition at line 96 of file f3/flash.h.

◆ FLASH_OPTKEYR_KEY1

#define FLASH_OPTKEYR_KEY1   FLASH_KEYR_KEY1

Definition at line 97 of file f3/flash.h.

◆ FLASH_OPTKEYR_KEY2

#define FLASH_OPTKEYR_KEY2   FLASH_KEYR_KEY2

Definition at line 98 of file f3/flash.h.

◆ FLASH_SR_BSY

#define FLASH_SR_BSY   (1 << 0)

Definition at line 74 of file f3/flash.h.

◆ FLASH_SR_EOP

#define FLASH_SR_EOP   (1 << 5)

Definition at line 78 of file f3/flash.h.

◆ FLASH_SR_ERLYBSY

#define FLASH_SR_ERLYBSY   (1 << 1)

Definition at line 75 of file f3/flash.h.

◆ FLASH_SR_PGERR

#define FLASH_SR_PGERR   (1 << 2)

Definition at line 76 of file f3/flash.h.

◆ FLASH_SR_WRPRTERR

#define FLASH_SR_WRPRTERR   (1 << 4)

Definition at line 77 of file f3/flash.h.

Function Documentation

◆ flash_clear_pgerr_flag()

void flash_clear_pgerr_flag ( void  )

Definition at line 54 of file flash.c.

References FLASH_SR, and FLASH_SR_PGERR.

Referenced by flash_clear_status_flags().

Here is the caller graph for this function:

◆ flash_clear_wrprterr_flag()

void flash_clear_wrprterr_flag ( void  )

Definition at line 59 of file flash.c.

References FLASH_SR, and FLASH_SR_WRPRTERR.

Referenced by flash_clear_status_flags().

Here is the caller graph for this function:

◆ flash_erase_all_pages()

void flash_erase_all_pages ( void  )

Definition at line 104 of file flash.c.

References FLASH_CR, FLASH_CR_MER, FLASH_CR_STRT, and flash_wait_for_last_operation().

Here is the call graph for this function:

◆ flash_erase_page()

void flash_erase_page ( uint32_t  page_address)

Definition at line 91 of file flash.c.

References FLASH_AR, FLASH_CR, FLASH_CR_PER, FLASH_CR_STRT, and flash_wait_for_last_operation().

Here is the call graph for this function:

◆ flash_program_half_word()

void flash_program_half_word ( uint32_t  address,
uint16_t  data 
)

Definition at line 78 of file flash.c.

References FLASH_CR, FLASH_CR_PG, flash_wait_for_last_operation(), and MMIO16.

Here is the call graph for this function: