stm32: flash_unlock_option_bytes is common code.
The keys differ between some familes, but the documentation and implementation are standard.
This commit is contained in:
@@ -65,4 +65,10 @@ void flash_lock(void);
|
||||
*/
|
||||
void flash_unlock(void);
|
||||
|
||||
/** Unlock the Option Byte Access.
|
||||
* This enables write access to the option bytes. It is locked by default on
|
||||
* reset.
|
||||
*/
|
||||
void flash_unlock_option_bytes(void);
|
||||
|
||||
END_DECLS
|
||||
@@ -95,6 +95,9 @@
|
||||
#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
|
||||
|
||||
/* --- Function prototypes ------------------------------------------------- */
|
||||
|
||||
BEGIN_DECLS
|
||||
@@ -108,7 +111,6 @@ void flash_program_word(uint32_t address, uint32_t data);
|
||||
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);
|
||||
void flash_unlock_option_bytes(void);
|
||||
void flash_erase_option_bytes(void);
|
||||
void flash_program_option_bytes(uint32_t address, uint16_t data);
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@
|
||||
|
||||
BEGIN_DECLS
|
||||
|
||||
void flash_unlock_option_bytes(void);
|
||||
void flash_lock_option_bytes(void);
|
||||
void flash_clear_pgserr_flag(void);
|
||||
void flash_clear_wrperr_flag(void);
|
||||
|
||||
@@ -118,7 +118,6 @@ void flash_unlock_pecr(void);
|
||||
void flash_lock_pecr(void);
|
||||
void flash_unlock_progmem(void);
|
||||
void flash_lock_progmem(void);
|
||||
void flash_unlock_option_bytes(void);
|
||||
void flash_lock_option_bytes(void);
|
||||
|
||||
void eeprom_program_word(uint32_t address, uint32_t data);
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
#define FLASH_CR_PER (1 << 1)
|
||||
#define FLASH_CR_PG (1 << 0)
|
||||
|
||||
/* F3 uses the same keys for option bytes */
|
||||
#define FLASH_OPTKEYR_KEY1 FLASH_KEYR_KEY1
|
||||
#define FLASH_OPTKEYR_KEY2 FLASH_KEYR_KEY2
|
||||
|
||||
BEGIN_DECLS
|
||||
|
||||
|
||||
|
||||
@@ -157,7 +157,6 @@ BEGIN_DECLS
|
||||
void flash_clear_pgperr_flag(void);
|
||||
void flash_wait_for_last_operation(void);
|
||||
|
||||
void flash_unlock_option_bytes(void);
|
||||
void flash_lock_option_bytes(void);
|
||||
void flash_clear_erserr_flag(void);
|
||||
void flash_clear_wrperr_flag(void);
|
||||
|
||||
@@ -228,7 +228,6 @@ void flash_clear_pgserr_flag(void);
|
||||
void flash_clear_pgaerr_flag(void);
|
||||
void flash_clear_wrperr_flag(void);
|
||||
void flash_clear_status_flags(void);
|
||||
void flash_unlock_option_bytes(void);
|
||||
void flash_lock_option_bytes(void);
|
||||
void flash_program_word(uint32_t address, uint32_t data);
|
||||
void flash_program(uint32_t address, uint8_t *data, uint32_t len);
|
||||
|
||||
Reference in New Issue
Block a user