Defined Constants and Types for the STM32F0xx Flash memory
More...
Defined Constants and Types for the STM32F0xx Flash memory
- Version
- 1.0.0
- Author
- © 2013 Frantisek Burian BuFra.nosp@m.n@se.nosp@m.znam..nosp@m.cz
- Date
- 14 January 2014
LGPL License Terms libopencm3 License
◆ FLASH_ACR
◆ FLASH_ACR_LATENCY_MASK
#define FLASH_ACR_LATENCY_MASK 7 |
◆ FLASH_ACR_LATENCY_SHIFT
#define FLASH_ACR_LATENCY_SHIFT 0 |
◆ FLASH_ACR_PRFTBE
#define FLASH_ACR_PRFTBE (1 << 4) |
◆ FLASH_ACR_PRFTBS
#define FLASH_ACR_PRFTBS (1 << 5) |
◆ FLASH_ACR_PRFTEN
◆ FLASH_AR
◆ FLASH_AR2
◆ FLASH_CR
◆ FLASH_CR2
◆ FLASH_CR_EOPIE
#define FLASH_CR_EOPIE (1 << 12) |
◆ FLASH_CR_ERRIE
#define FLASH_CR_ERRIE (1 << 10) |
◆ FLASH_CR_LOCK
#define FLASH_CR_LOCK (1 << 7) |
◆ FLASH_CR_MER
#define FLASH_CR_MER (1 << 2) |
◆ FLASH_CR_OBL_LAUNCH
#define FLASH_CR_OBL_LAUNCH (1 << 13) |
◆ FLASH_CR_OPTER
#define FLASH_CR_OPTER (1 << 5) |
◆ FLASH_CR_OPTPG
#define FLASH_CR_OPTPG (1 << 4) |
◆ FLASH_CR_OPTWRE
#define FLASH_CR_OPTWRE (1 << 9) |
◆ FLASH_CR_PER
#define FLASH_CR_PER (1 << 1) |
◆ FLASH_CR_PG
#define FLASH_CR_PG (1 << 0) |
◆ FLASH_CR_STRT
#define FLASH_CR_STRT (1 << 6) |
◆ FLASH_KEYR
◆ FLASH_KEYR2
◆ FLASH_KEYR_KEY1
#define FLASH_KEYR_KEY1 ((uint32_t)0x45670123) |
◆ FLASH_KEYR_KEY2
#define FLASH_KEYR_KEY2 ((uint32_t)0xcdef89ab) |
◆ FLASH_OBR
◆ FLASH_OBR_BOOT_SEL
#define FLASH_OBR_BOOT_SEL (1 << 15) |
◆ FLASH_OBR_DATA0
◆ FLASH_OBR_DATA0_SHIFT
#define FLASH_OBR_DATA0_SHIFT 16 |
◆ FLASH_OBR_DATA1
◆ FLASH_OBR_DATA1_SHIFT
#define FLASH_OBR_DATA1_SHIFT 24 |
◆ FLASH_OBR_NBOOT0
#define FLASH_OBR_NBOOT0 (1 << 11) |
◆ FLASH_OBR_NBOOT1
#define FLASH_OBR_NBOOT1 (1 << 12) |
◆ FLASH_OBR_NRST_STDBY
#define FLASH_OBR_NRST_STDBY (1 << 10) |
◆ FLASH_OBR_NRST_STOP
#define FLASH_OBR_NRST_STOP (1 << 9) |
◆ FLASH_OBR_OPTERR
#define FLASH_OBR_OPTERR (1 << 0) |
◆ FLASH_OBR_RAM_PARITY_CHECK
#define FLASH_OBR_RAM_PARITY_CHECK (1 << 14) |
◆ FLASH_OBR_RDPRT
◆ FLASH_OBR_RDPRT_L0
◆ FLASH_OBR_RDPRT_L1
◆ FLASH_OBR_RDPRT_L2
◆ FLASH_OBR_RDPRT_SHIFT
#define FLASH_OBR_RDPRT_SHIFT 1 |
◆ FLASH_OBR_VDDA_MONITOR
#define FLASH_OBR_VDDA_MONITOR (1 << 13) |
◆ FLASH_OBR_WDG_SW
#define FLASH_OBR_WDG_SW (1 << 8) |
◆ FLASH_OPTION_BYTE
◆ FLASH_OPTKEYR
◆ FLASH_OPTKEYR_KEY1
◆ FLASH_OPTKEYR_KEY2
◆ FLASH_RDP_L0
#define FLASH_RDP_L0 ((uint8_t)0xaa) |
◆ FLASH_RDP_L1
#define FLASH_RDP_L1 ((uint8_t)0xf0) /* any value */ |
◆ FLASH_RDP_L2
#define FLASH_RDP_L2 ((uint8_t)0xcc) |
◆ FLASH_SR
◆ FLASH_SR2
◆ FLASH_SR_BSY [1/2]
#define FLASH_SR_BSY (1 << 0) |
◆ FLASH_SR_BSY [2/2]
#define FLASH_SR_BSY (1 << 0) |
◆ FLASH_SR_EOP [1/2]
#define FLASH_SR_EOP (1 << 5) |
◆ FLASH_SR_EOP [2/2]
#define FLASH_SR_EOP (1 << 5) |
◆ FLASH_SR_PGERR [1/2]
#define FLASH_SR_PGERR (1 << 2) |
◆ FLASH_SR_PGERR [2/2]
#define FLASH_SR_PGERR (1 << 2) |
◆ FLASH_SR_WRPRTERR [1/2]
#define FLASH_SR_WRPRTERR (1 << 4) |
◆ FLASH_SR_WRPRTERR [2/2]
#define FLASH_SR_WRPRTERR (1 << 4) |
◆ FLASH_WRPR
◆ flash_clear_pgerr_flag()
void flash_clear_pgerr_flag |
( |
void |
| ) |
|
◆ flash_clear_wrprterr_flag()
void flash_clear_wrprterr_flag |
( |
void |
| ) |
|
◆ flash_erase_all_pages()
void flash_erase_all_pages |
( |
void |
| ) |
|
◆ flash_erase_option_bytes()
void flash_erase_option_bytes |
( |
void |
| ) |
|
◆ flash_erase_page()
void flash_erase_page |
( |
uint32_t |
page_address | ) |
|
Erase a Page of FLASH.
This performs all operations necessary to erase a page in FLASH memory. The page should be checked to ensure that it was properly erased. A page must first be fully erased before attempting to program it.
Note that the page sizes differ between devices. See the reference manual or the FLASH programming manual for details.
- Parameters
-
[in] | page_address | Full address of flash page to be erased. |
Definition at line 123 of file flash.c.
References FLASH_AR, FLASH_CR, FLASH_CR_PER, FLASH_CR_STRT, and flash_wait_for_last_operation().
◆ flash_get_status_flags()
uint32_t flash_get_status_flags |
( |
void |
| ) |
|
◆ flash_program_half_word()
void flash_program_half_word |
( |
uint32_t |
address, |
|
|
uint16_t |
data |
|
) |
| |
Program a Half Word to FLASH.
This performs all operations necessary to program a 16 bit word to FLASH memory. The program error flag should be checked separately for the event that memory was not properly erased.
Status bit polling is used to detect end of operation.
- Parameters
-
[in] | address | Full address of flash half word to be programmed. |
[in] | data | half word to write |
Definition at line 97 of file flash.c.
References FLASH_CR, FLASH_CR_PG, flash_wait_for_last_operation(), and MMIO16.
Referenced by flash_program_word().
◆ flash_program_option_bytes()
void flash_program_option_bytes |
( |
uint32_t |
address, |
|
|
uint16_t |
data |
|
) |
| |
◆ flash_program_word()
void flash_program_word |
( |
uint32_t |
address, |
|
|
uint32_t |
data |
|
) |
| |
Program a 32 bit Word to FLASH.
This performs all operations necessary to program a 32 bit word to FLASH memory. The program error flag should be checked separately for the event that memory was not properly erased.
Status bit polling is used to detect end of operation.
- Parameters
-
[in] | address | Full address of flash word to be programmed. |
[in] | data | word to write |
Definition at line 82 of file flash_common_f01.c.
References flash_program_half_word().