Defined Constants and Types for the STM32F1xx FLASH Memory.
More...
Defined Constants and Types for the STM32F1xx FLASH Memory.
- Version
- 1.0.0
- Date
- 14 January 2014
LGPL License Terms libopencm3 License
◆ FLASH_ACR
◆ FLASH_ACR_HLFCYA
#define FLASH_ACR_HLFCYA (1 << 3) |
◆ 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_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_NRST_STDBY
#define FLASH_OBR_NRST_STDBY (1 << 4) |
◆ FLASH_OBR_NRST_STOP
#define FLASH_OBR_NRST_STOP (1 << 3) |
◆ FLASH_OBR_OPTERR
#define FLASH_OBR_OPTERR (1 << 0) |
◆ FLASH_OBR_RDPRT_EN
◆ FLASH_OBR_RDPRT_SHIFT
#define FLASH_OBR_RDPRT_SHIFT 1 |
◆ FLASH_OBR_WDG_SW
#define FLASH_OBR_WDG_SW (1 << 2) |
◆ FLASH_OPTION_BYTE
◆ FLASH_OPTKEYR
◆ FLASH_OPTKEYR_KEY1
◆ FLASH_OPTKEYR_KEY2
◆ FLASH_RDP_KEY
#define FLASH_RDP_KEY ((uint16_t)0x00a5) |
◆ 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_eop_flag_upper()
void flash_clear_eop_flag_upper |
( |
void |
| ) |
|
◆ flash_clear_pgerr_flag()
void flash_clear_pgerr_flag |
( |
void |
| ) |
|
◆ flash_clear_pgerr_flag_upper()
void flash_clear_pgerr_flag_upper |
( |
void |
| ) |
|
◆ flash_clear_wrprterr_flag()
void flash_clear_wrprterr_flag |
( |
void |
| ) |
|
◆ flash_clear_wrprterr_flag_upper()
void flash_clear_wrprterr_flag_upper |
( |
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 | ) |
|
◆ flash_get_status_flags()
uint32_t flash_get_status_flags |
( |
void |
| ) |
|
Read All Status Flags.
The programming error, end of operation, write protect error and busy flags are returned in the order of appearance in the status register.
Flags for the upper bank, where appropriate, are combined with those for the lower bank using bitwise OR, without distinction.
- Returns
- uint32_t. bit 0: busy, bit 2: programming error, bit 4: write protect error, bit 5: end of operation.
Definition at line 189 of file flash.c.
References desig_get_flash_size(), FLASH_SR, FLASH_SR2, FLASH_SR_BSY, FLASH_SR_EOP, FLASH_SR_PGERR, and FLASH_SR_WRPRTERR.
Referenced by flash_wait_for_last_operation().
◆ flash_halfcycle_disable()
void flash_halfcycle_disable |
( |
void |
| ) |
|
Disable the FLASH Half Cycle Mode.
Definition at line 86 of file flash.c.
References FLASH_ACR.
◆ flash_halfcycle_enable()
void flash_halfcycle_enable |
( |
void |
| ) |
|
Enable the FLASH Half Cycle Mode.
This mode is used for power saving during read access. It is disabled by default on reset.
Note carefully the clock restrictions under which the half cycle mode may be enabled or disabled. This mode may only be used while the clock is running at 8MHz. See the reference manual for details.
Definition at line 76 of file flash.c.
References FLASH_ACR, and FLASH_ACR_HLFCYA.
◆ flash_lock_upper()
void flash_lock_upper |
( |
void |
| ) |
|
Lock the Flash Program and Erase Controller, upper Bank.
Used to prevent spurious writes to FLASH.
Definition at line 117 of file flash.c.
References FLASH_CR2, and FLASH_CR_LOCK.
◆ flash_program_half_word()
void flash_program_half_word |
( |
uint32_t |
address, |
|
|
uint16_t |
data |
|
) |
| |
◆ 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().
◆ flash_unlock_upper()
void flash_unlock_upper |
( |
void |
| ) |
|