STM32L486xx HAL User Manual
Defines
FLASH Exported Macros
FLASH

macros to control FLASH features More...

Defines

#define __HAL_FLASH_SET_LATENCY(__LATENCY__)   (MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (__LATENCY__)))
 Set the FLASH Latency.
#define __HAL_FLASH_GET_LATENCY()   READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY)
 Get the FLASH Latency.
#define __HAL_FLASH_PREFETCH_BUFFER_ENABLE()   SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN)
 Enable the FLASH prefetch buffer.
#define __HAL_FLASH_PREFETCH_BUFFER_DISABLE()   CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN)
 Disable the FLASH prefetch buffer.
#define __HAL_FLASH_INSTRUCTION_CACHE_ENABLE()   SET_BIT(FLASH->ACR, FLASH_ACR_ICEN)
 Enable the FLASH instruction cache.
#define __HAL_FLASH_INSTRUCTION_CACHE_DISABLE()   CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICEN)
 Disable the FLASH instruction cache.
#define __HAL_FLASH_DATA_CACHE_ENABLE()   SET_BIT(FLASH->ACR, FLASH_ACR_DCEN)
 Enable the FLASH data cache.
#define __HAL_FLASH_DATA_CACHE_DISABLE()   CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCEN)
 Disable the FLASH data cache.
#define __HAL_FLASH_INSTRUCTION_CACHE_RESET()
 Reset the FLASH instruction Cache.
#define __HAL_FLASH_DATA_CACHE_RESET()
 Reset the FLASH data Cache.
#define __HAL_FLASH_POWER_DOWN_ENABLE()
 Enable the FLASH power down during Low-power run mode.
#define __HAL_FLASH_POWER_DOWN_DISABLE()
 Disable the FLASH power down during Low-power run mode.
#define __HAL_FLASH_SLEEP_POWERDOWN_ENABLE()   SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
 Enable the FLASH power down during Low-Power sleep mode.
#define __HAL_FLASH_SLEEP_POWERDOWN_DISABLE()   CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)
 Disable the FLASH power down during Low-Power sleep mode.

Detailed Description

macros to control FLASH features


Define Documentation

#define __HAL_FLASH_DATA_CACHE_DISABLE ( )    CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCEN)

Disable the FLASH data cache.

Return values:
none

Definition at line 636 of file stm32l4xx_hal_flash.h.

Referenced by HAL_FLASH_Program(), HAL_FLASH_Program_IT(), HAL_FLASHEx_Erase(), HAL_FLASHEx_Erase_IT(), and HAL_Init().

#define __HAL_FLASH_DATA_CACHE_ENABLE ( )    SET_BIT(FLASH->ACR, FLASH_ACR_DCEN)

Enable the FLASH data cache.

Return values:
none

Definition at line 630 of file stm32l4xx_hal_flash.h.

Referenced by FLASH_FlushCaches().

Value:
do { SET_BIT(FLASH->ACR, FLASH_ACR_DCRST);   \
                                                     CLEAR_BIT(FLASH->ACR, FLASH_ACR_DCRST); \
                                                   } while (0)

Reset the FLASH data Cache.

Note:
This function must be used only when the data Cache is disabled.
Return values:
None

Definition at line 652 of file stm32l4xx_hal_flash.h.

Referenced by FLASH_FlushCaches().

#define __HAL_FLASH_GET_LATENCY ( )    READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY)

Get the FLASH Latency.

Return values:
FLASHLatency This parameter can be one of the following values :
  • FLASH_LATENCY_0: FLASH Zero wait state
  • FLASH_LATENCY_1: FLASH One wait state
  • FLASH_LATENCY_2: FLASH Two wait states
  • FLASH_LATENCY_3: FLASH Three wait states
  • FLASH_LATENCY_4: FLASH Four wait states

Definition at line 600 of file stm32l4xx_hal_flash.h.

Referenced by HAL_RCC_ClockConfig(), HAL_RCC_GetClockConfig(), and RCC_SetFlashLatencyFromMSIRange().

#define __HAL_FLASH_INSTRUCTION_CACHE_DISABLE ( )    CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICEN)

Disable the FLASH instruction cache.

Return values:
none

Definition at line 624 of file stm32l4xx_hal_flash.h.

Referenced by HAL_FLASHEx_Erase(), HAL_FLASHEx_Erase_IT(), and HAL_Init().

#define __HAL_FLASH_INSTRUCTION_CACHE_ENABLE ( )    SET_BIT(FLASH->ACR, FLASH_ACR_ICEN)

Enable the FLASH instruction cache.

Return values:
none

Definition at line 618 of file stm32l4xx_hal_flash.h.

Referenced by FLASH_FlushCaches().

Value:
do { SET_BIT(FLASH->ACR, FLASH_ACR_ICRST);   \
                                                     CLEAR_BIT(FLASH->ACR, FLASH_ACR_ICRST); \
                                                   } while (0)

Reset the FLASH instruction Cache.

Note:
This function must be used only when the Instruction Cache is disabled.
Return values:
None

Definition at line 643 of file stm32l4xx_hal_flash.h.

Referenced by FLASH_FlushCaches().

Value:
do { WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY1); \
                                                     WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY2); \
                                                     CLEAR_BIT(FLASH->ACR, FLASH_ACR_RUN_PD); \
                                                   } while (0)

Disable the FLASH power down during Low-power run mode.

Note:
Writing this bit to 0 this bit, automatically the keys are loss and a new unlock sequence is necessary to re-write it to 1.

Definition at line 671 of file stm32l4xx_hal_flash.h.

Referenced by HAL_FLASHEx_DisableRunPowerDown().

Value:
do { WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY1); \
                                                     WRITE_REG(FLASH->PDKEYR, FLASH_PDKEY2); \
                                                     SET_BIT(FLASH->ACR, FLASH_ACR_RUN_PD);   \
                                                   } while (0)

Enable the FLASH power down during Low-power run mode.

Note:
Writing this bit to 0 this bit, automatically the keys are loss and a new unlock sequence is necessary to re-write it to 1.

Definition at line 661 of file stm32l4xx_hal_flash.h.

Referenced by HAL_FLASHEx_EnableRunPowerDown().

#define __HAL_FLASH_PREFETCH_BUFFER_DISABLE ( )    CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTEN)

Disable the FLASH prefetch buffer.

Return values:
None

Definition at line 612 of file stm32l4xx_hal_flash.h.

#define __HAL_FLASH_PREFETCH_BUFFER_ENABLE ( )    SET_BIT(FLASH->ACR, FLASH_ACR_PRFTEN)

Enable the FLASH prefetch buffer.

Return values:
None

Definition at line 606 of file stm32l4xx_hal_flash.h.

Referenced by HAL_Init().

#define __HAL_FLASH_SET_LATENCY (   __LATENCY__)    (MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, (__LATENCY__)))

Set the FLASH Latency.

Parameters:
__LATENCY__,:FLASH Latency This parameter can be one of the following values :
  • FLASH_LATENCY_0: FLASH Zero wait state
  • FLASH_LATENCY_1: FLASH One wait state
  • FLASH_LATENCY_2: FLASH Two wait states
  • FLASH_LATENCY_3: FLASH Three wait states
  • FLASH_LATENCY_4: FLASH Four wait states
Return values:
None

Definition at line 588 of file stm32l4xx_hal_flash.h.

Referenced by HAL_RCC_ClockConfig(), and RCC_SetFlashLatencyFromMSIRange().

#define __HAL_FLASH_SLEEP_POWERDOWN_DISABLE ( )    CLEAR_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)

Disable the FLASH power down during Low-Power sleep mode.

Return values:
none

Definition at line 686 of file stm32l4xx_hal_flash.h.

#define __HAL_FLASH_SLEEP_POWERDOWN_ENABLE ( )    SET_BIT(FLASH->ACR, FLASH_ACR_SLEEP_PD)

Enable the FLASH power down during Low-Power sleep mode.

Return values:
none

Definition at line 680 of file stm32l4xx_hal_flash.h.