stm32: flash: pull set_ws up to common code
All that changes is the size of the field.
This commit is contained in:
@@ -43,6 +43,15 @@ void flash_prefetch_enable(void);
|
||||
void flash_prefetch_disable(void);
|
||||
|
||||
|
||||
/** Set the Number of Wait States.
|
||||
|
||||
Used to match the system clock to the FLASH memory access time. See the
|
||||
programming manual for more information on clock speed ranges. The latency must
|
||||
be changed to the appropriate value <b>before</b> any increase in clock
|
||||
speed, or <b>after</b> any decrease in clock speed.
|
||||
|
||||
@param[in] ws values from @ref flash_latency.
|
||||
*/
|
||||
void flash_set_ws(uint32_t ws);
|
||||
|
||||
/** Lock the Flash Program and Erase Controller
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
/* --- FLASH_ACR values ---------------------------------------------------- */
|
||||
|
||||
#define FLASH_ACR_LATENCY_SHIFT 0
|
||||
#define FLASH_ACR_LATENCY 7
|
||||
#define FLASH_ACR_LATENCY_MASK 7
|
||||
|
||||
#define FLASH_ACR_PRFTBS (1 << 5)
|
||||
#define FLASH_ACR_PRFTBE (1 << 4)
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
|
||||
/* --- FLASH_ACR values ---------------------------------------------------- */
|
||||
|
||||
#define FLASH_ACR_LATENCY_SHIFT 0
|
||||
#define FLASH_ACR_LATENCY_MASK 0x0f
|
||||
#define FLASH_ACR_LATENCY(w) ((w) & FLASH_ACR_LATENCY_MASK)
|
||||
#define FLASH_ACR_LATENCY_0WS 0x00
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
#define FLASH_ACR_RUNPD (1 << 4)
|
||||
#define FLASH_ACR_SLEEPPD (1 << 3)
|
||||
#define FLASH_ACR_PRFTEN (1 << 1)
|
||||
#define FLASH_ACR_LATENCY_SHIFT 0
|
||||
#define FLASH_ACR_LATENCY_MASK 1
|
||||
/** @defgroup flash_latency FLASH Wait States
|
||||
@ingroup flash_defines
|
||||
@{*/
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
#define FLASH_ACR_ARTEN (1 << 9)
|
||||
#define FLASH_ACR_PRFTEN (1 << 8)
|
||||
|
||||
#define FLASH_ACR_LATENCY_SHIFT 0
|
||||
#define FLASH_ACR_LATENCY_MASK 0x0f
|
||||
|
||||
/* --- FLASH_SR values ----------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user