STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_MPU_Enable (uint32_t Options)
 Enable MPU with input options MPU_CTRL ENABLE LL_MPU_Enable. More...
 
__STATIC_INLINE void LL_MPU_Disable (void)
 Disable MPU MPU_CTRL ENABLE LL_MPU_Disable. More...
 
__STATIC_INLINE uint32_t LL_MPU_IsEnabled (void)
 Check if MPU is enabled or not MPU_CTRL ENABLE LL_MPU_IsEnabled. More...
 
__STATIC_INLINE void LL_MPU_EnableRegion (uint32_t Region)
 Enable a MPU region MPU_RASR ENABLE LL_MPU_EnableRegion. More...
 
__STATIC_INLINE void LL_MPU_ConfigRegion (uint32_t Region, uint32_t SubRegionDisable, uint32_t Address, uint32_t Attributes)
 Configure and enable a region MPU_RNR REGION LL_MPU_ConfigRegion
MPU_RBAR REGION LL_MPU_ConfigRegion
MPU_RBAR ADDR LL_MPU_ConfigRegion
MPU_RASR XN LL_MPU_ConfigRegion
MPU_RASR AP LL_MPU_ConfigRegion
MPU_RASR S LL_MPU_ConfigRegion
MPU_RASR C LL_MPU_ConfigRegion
MPU_RASR B LL_MPU_ConfigRegion
MPU_RASR SIZE LL_MPU_ConfigRegion. More...
 
__STATIC_INLINE void LL_MPU_DisableRegion (uint32_t Region)
 Disable a region MPU_RNR REGION LL_MPU_DisableRegion
MPU_RASR ENABLE LL_MPU_DisableRegion. More...
 

Detailed Description

Function Documentation

◆ LL_MPU_ConfigRegion()

__STATIC_INLINE void LL_MPU_ConfigRegion ( uint32_t  Region,
uint32_t  SubRegionDisable,
uint32_t  Address,
uint32_t  Attributes 
)

Configure and enable a region MPU_RNR REGION LL_MPU_ConfigRegion
MPU_RBAR REGION LL_MPU_ConfigRegion
MPU_RBAR ADDR LL_MPU_ConfigRegion
MPU_RASR XN LL_MPU_ConfigRegion
MPU_RASR AP LL_MPU_ConfigRegion
MPU_RASR S LL_MPU_ConfigRegion
MPU_RASR C LL_MPU_ConfigRegion
MPU_RASR B LL_MPU_ConfigRegion
MPU_RASR SIZE LL_MPU_ConfigRegion.

Parameters
RegionThis parameter can be one of the following values:
  • LL_MPU_REGION_NUMBER0
  • LL_MPU_REGION_NUMBER1
  • LL_MPU_REGION_NUMBER2
  • LL_MPU_REGION_NUMBER3
  • LL_MPU_REGION_NUMBER4
  • LL_MPU_REGION_NUMBER5
  • LL_MPU_REGION_NUMBER6
  • LL_MPU_REGION_NUMBER7
AddressValue of region base address
SubRegionDisableSub-region disable value between Min_Data = 0x00 and Max_Data = 0xFF
AttributesThis parameter can be a combination of the following values:
  • LL_MPU_REGION_SIZE_32B or LL_MPU_REGION_SIZE_64B or LL_MPU_REGION_SIZE_128B or LL_MPU_REGION_SIZE_256B or LL_MPU_REGION_SIZE_512B or LL_MPU_REGION_SIZE_1KB or LL_MPU_REGION_SIZE_2KB or LL_MPU_REGION_SIZE_4KB or LL_MPU_REGION_SIZE_8KB or LL_MPU_REGION_SIZE_16KB or LL_MPU_REGION_SIZE_32KB or LL_MPU_REGION_SIZE_64KB or LL_MPU_REGION_SIZE_128KB or LL_MPU_REGION_SIZE_256KB or LL_MPU_REGION_SIZE_512KB or LL_MPU_REGION_SIZE_1MB or LL_MPU_REGION_SIZE_2MB or LL_MPU_REGION_SIZE_4MB or LL_MPU_REGION_SIZE_8MB or LL_MPU_REGION_SIZE_16MB or LL_MPU_REGION_SIZE_32MB or LL_MPU_REGION_SIZE_64MB or LL_MPU_REGION_SIZE_128MB or LL_MPU_REGION_SIZE_256MB or LL_MPU_REGION_SIZE_512MB or LL_MPU_REGION_SIZE_1GB or LL_MPU_REGION_SIZE_2GB or LL_MPU_REGION_SIZE_4GB
  • LL_MPU_REGION_NO_ACCESS or LL_MPU_REGION_PRIV_RW or LL_MPU_REGION_PRIV_RW_URO or LL_MPU_REGION_FULL_ACCESS or LL_MPU_REGION_PRIV_RO or LL_MPU_REGION_PRIV_RO_URO
  • LL_MPU_TEX_LEVEL0 or LL_MPU_TEX_LEVEL1 or LL_MPU_TEX_LEVEL2 or LL_MPU_TEX_LEVEL4
  • LL_MPU_INSTRUCTION_ACCESS_ENABLE or LL_MPU_INSTRUCTION_ACCESS_DISABLE
  • LL_MPU_ACCESS_SHAREABLE or LL_MPU_ACCESS_NOT_SHAREABLE
  • LL_MPU_ACCESS_CACHEABLE or LL_MPU_ACCESS_NOT_CACHEABLE
  • LL_MPU_ACCESS_BUFFERABLE or LL_MPU_ACCESS_NOT_BUFFERABLE
Return values
None

Definition at line 583 of file stm32l4xx_ll_cortex.h.

584 {
585  /* Set Region number */
586  WRITE_REG(MPU->RNR, Region);
587  /* Set base address */
588  WRITE_REG(MPU->RBAR, (Address & 0xFFFFFFE0U));
589  /* Configure MPU */
590  WRITE_REG(MPU->RASR, (MPU_RASR_ENABLE_Msk | Attributes | SubRegionDisable << MPU_RASR_SRD_Pos));
591 }

◆ LL_MPU_Disable()

__STATIC_INLINE void LL_MPU_Disable ( void  )

Disable MPU MPU_CTRL ENABLE LL_MPU_Disable.

Return values
None

Definition at line 505 of file stm32l4xx_ll_cortex.h.

506 {
507  /* Make sure outstanding transfers are done */
508  __DMB();
509  /* Disable MPU*/
510  WRITE_REG(MPU->CTRL, 0U);
511 }

◆ LL_MPU_DisableRegion()

__STATIC_INLINE void LL_MPU_DisableRegion ( uint32_t  Region)

Disable a region MPU_RNR REGION LL_MPU_DisableRegion
MPU_RASR ENABLE LL_MPU_DisableRegion.

Parameters
RegionThis parameter can be one of the following values:
  • LL_MPU_REGION_NUMBER0
  • LL_MPU_REGION_NUMBER1
  • LL_MPU_REGION_NUMBER2
  • LL_MPU_REGION_NUMBER3
  • LL_MPU_REGION_NUMBER4
  • LL_MPU_REGION_NUMBER5
  • LL_MPU_REGION_NUMBER6
  • LL_MPU_REGION_NUMBER7
Return values
None

Definition at line 608 of file stm32l4xx_ll_cortex.h.

609 {
610  /* Set Region number */
611  WRITE_REG(MPU->RNR, Region);
612  /* Disable the MPU region */
613  CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
614 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_MPU_Enable()

__STATIC_INLINE void LL_MPU_Enable ( uint32_t  Options)

Enable MPU with input options MPU_CTRL ENABLE LL_MPU_Enable.

Parameters
OptionsThis parameter can be one of the following values:
  • LL_MPU_CTRL_HFNMI_PRIVDEF_NONE
  • LL_MPU_CTRL_HARDFAULT_NMI
  • LL_MPU_CTRL_PRIVILEGED_DEFAULT
  • LL_MPU_CTRL_HFNMI_PRIVDEF
Return values
None

Definition at line 490 of file stm32l4xx_ll_cortex.h.

491 {
492  /* Enable the MPU*/
493  WRITE_REG(MPU->CTRL, (MPU_CTRL_ENABLE_Msk | Options));
494  /* Ensure MPU settings take effects */
495  __DSB();
496  /* Sequence instruction fetches using update settings */
497  __ISB();
498 }

◆ LL_MPU_EnableRegion()

__STATIC_INLINE void LL_MPU_EnableRegion ( uint32_t  Region)

Enable a MPU region MPU_RASR ENABLE LL_MPU_EnableRegion.

Parameters
RegionThis parameter can be one of the following values:
  • LL_MPU_REGION_NUMBER0
  • LL_MPU_REGION_NUMBER1
  • LL_MPU_REGION_NUMBER2
  • LL_MPU_REGION_NUMBER3
  • LL_MPU_REGION_NUMBER4
  • LL_MPU_REGION_NUMBER5
  • LL_MPU_REGION_NUMBER6
  • LL_MPU_REGION_NUMBER7
Return values
None

Definition at line 537 of file stm32l4xx_ll_cortex.h.

538 {
539  /* Set Region number */
540  WRITE_REG(MPU->RNR, Region);
541  /* Enable the MPU region */
542  SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
543 }

◆ LL_MPU_IsEnabled()

__STATIC_INLINE uint32_t LL_MPU_IsEnabled ( void  )

Check if MPU is enabled or not MPU_CTRL ENABLE LL_MPU_IsEnabled.

Return values
Stateof bit (1 or 0).

Definition at line 518 of file stm32l4xx_ll_cortex.h.

519 {
520  return (READ_BIT(MPU->CTRL, MPU_CTRL_ENABLE_Msk) == (MPU_CTRL_ENABLE_Msk));
521 }