SMU - Security Management Unit#
Security Management Unit (SMU) Peripheral API.
SMU forms the control and status/reporting component of bus-level security in EFM32/EFR32 devices.
Peripheral-level protection is provided via the Peripheral Protection Unit (PPU). PPU provides hardware access barrier to any peripheral that is configured to be protected. When an attempt is made to access a peripheral without the required privilege/security level, PPU detects the fault and intercepts the access. No write or read of the peripheral register space occurs, and an all-zero value is returned if the access is a read.
Usage example
// SMU is always clocked, so no call to CMU_ClockEnable() is necessary
// Initialize SMU to prevent access to CMU, EMU, SMU and GPIO
SMU_Init_TypeDef init = SMU_INIT_DEFAULT;
init.ppu.access.privilegedCMU = true;
init.ppu.access.privilegedEMU = true;
init.ppu.access.privilegedSMU = true;
init.ppu.access.privilegedGPIO = true;
SMU_Init(&init);
Modules#
Enumerations#
SMU peripheral identifiers.
Functions#
Enable or disable PPU of SMU.
Initialize PPU of SMU.
Change access settings for a peripheral.
Get the ID of the peripheral that caused an access fault.
Clear one or more pending SMU interrupts.
Disable one or more SMU interrupts.
Enable one or more SMU interrupts.
Get pending SMU interrupts.
Get enabled and pending SMU interrupt flags.
Set one or more pending SMU interrupts from SW.
SMU secure IRQ Handler.
Macros#
Default SMU initialization structure settings.
Enumeration Documentation#
SMU_Peripheral_TypeDef#
SMU_Peripheral_TypeDef
SMU peripheral identifiers.
Enumerator | |
---|---|
smuPeripheralEMU | SMU peripheral identifier for EMU |
smuPeripheralCMU | SMU peripheral identifier for CMU |
smuPeripheralHFXO | SMU peripheral identifier for HFXO0 |
smuPeripheralHFRCO0 | SMU peripheral identifier for HFRCO0 |
smuPeripheralFSRCO | SMU peripheral identifier for FSRCO |
smuPeripheralDPLL0 | SMU peripheral identifier for DPLL0 |
smuPeripheralLFXO | SMU peripheral identifier for LFXO |
smuPeripheralLFRCO | SMU peripheral identifier for LFRCO |
smuPeripheralULFRCO | SMU peripheral identifier for ULFRCO |
smuPeripheralMSC | SMU peripheral identifier for MSC |
smuPeripheralICACHE0 | SMU peripheral identifier for ICACHE0 |
smuPeripheralPRS | SMU peripheral identifier for PRS |
smuPeripheralGPIO | SMU peripheral identifier for GPIO |
smuPeripheralLDMA | SMU peripheral identifier for LDMA |
smuPeripheralLDMAXBAR | SMU peripheral identifier for LDMAXBAR |
smuPeripheralTIMER0 | SMU peripheral identifier for TIMER0 |
smuPeripheralTIMER1 | SMU peripheral identifier for TIMER1 |
smuPeripheralTIMER2 | SMU peripheral identifier for TIMER2 |
smuPeripheralTIMER3 | SMU peripheral identifier for TIMER3 |
smuPeripheralTIMER4 | SMU peripheral identifier for TIMER4 |
smuPeripheralUSART0 | SMU peripheral identifier for USART0 |
smuPeripheralBURTC | SMU peripheral identifier for BURTC |
smuPeripheralI2C1 | SMU peripheral identifier for I2C1 |
smuPeripheralSYSCFGCFGNS | SMU peripheral identifier for SYSCFGCFGNS. |
smuPeripheralSYSCFG | SMU peripheral identifier for SYSCFG |
smuPeripheralBURAM | SMU peripheral identifier for BURAM |
smuPeripheralGPCRC | SMU peripheral identifier for GPCRC |
smuPeripheralDCDC | SMU peripheral identifier for DCDC |
smuPeripheralHOSTMAILBOX | SMU peripheral identifier for HOSTMAILBOX. |
smuPeripheralEUSART0 | SMU peripheral identifier for EUSART0 |
smuPeripheralEUSART1 | SMU peripheral identifier for EUSART1 |
smuPeripheralEUSART2 | SMU peripheral identifier for EUSART2 |
smuPeripheralSYSRTC | SMU peripheral identifier for SYSRTC |
smuPeripheralLCD | SMU peripheral identifier for LCD |
smuPeripheralKEYSCAN | SMU peripheral identifier for KEYSCAN |
smuPeripheralDMEM | SMU peripheral identifier for DMEM |
smuPeripheralLCDRF | SMU peripheral identifier for LCDRF |
smuPeripheralPFMXPPRF | SMU peripheral identifier for PFMXPPRF |
smuPeripheralVDAC0 | SMU peripheral identifier for VDAC0 |
smuPeripheralPCNT | SMU peripheral identifier for PCNT |
smuPeripheralLESENSE | SMU peripheral identifier for LESENSE |
smuPeripheralHFRCO1 | SMU peripheral identifier for HFRCO1 |
smuPeripheralHFXO0 | SMU peripheral identifier for HFXO0 |
smuPeripheralLETIMER0 | SMU peripheral identifier for LETIMER |
smuPeripheralIADC0 | SMU peripheral identifier for IADC0 |
smuPeripheralACMP0 | SMU peripheral identifier for ACMP0 |
smuPeripheralACMP1 | SMU peripheral identifier for ACMP1 |
smuPeripheralI2C0 | SMU peripheral identifier for I2C0 |
smuPeripheralWDOG0 | SMU peripheral identifier for WDOG0 |
smuPeripheralWDOG1 | SMU peripheral identifier for WDOG1 |
smuPeripheralAMUXCP0 | SMU peripheral identifier for AMUXCP0 |
smuPeripheralRADIOAES | SMU peripheral identifier for RADIOAES |
smuPeripheralSMU | SMU peripheral identifier for SMU |
smuPeripheralSMUCFGNS | SMU peripheral identifier for SMUCFGNS |
smuPeripheralAHBRADIO | SMU peripheral identifier for AHBRADIO |
smuPeripheralSEMAILBOX | SMU peripheral identifier for SEMAILBOX. |
smuPeripheralMVP | SMU peripheral identifier for MVP |
smuPeripheralEnd | SMU peripheral end. |
72
of file platform/emlib/inc/em_smu.h
Function Documentation#
SMU_EnablePPU#
void SMU_EnablePPU (bool enable)
Enable or disable PPU of SMU.
[in] | enable | Set to true to enable PPU; set to false otherwise. |
1477
of file platform/emlib/inc/em_smu.h
SMU_Init#
void SMU_Init (const SMU_Init_TypeDef * init)
Initialize PPU of SMU.
[in] | init | Pointer to initialization structure that defines which peripherals should only be accessed from privileged mode, and if PPU should be enabled. |
1494
of file platform/emlib/inc/em_smu.h
SMU_SetPrivilegedAccess#
void SMU_SetPrivilegedAccess (SMU_Peripheral_TypeDef peripheral, bool privileged)
Change access settings for a peripheral.
[in] | peripheral | ID of the peripheral to change access settings for. |
[in] | privileged | Set to true if the peripheral should only be accessed from privileged mode; set to false otherwise. |
Set to limit access of a peripheral from privileged mode.
1527
of file platform/emlib/inc/em_smu.h
SMU_GetFaultingPeripheral#
SMU_Peripheral_TypeDef SMU_GetFaultingPeripheral (void )
Get the ID of the peripheral that caused an access fault.
N/A |
Note
The return value is only valid if SMU_IF_PPUPRIV interrupt flag is set.
Returns
ID of the peripheral that caused an access fault.
1571
of file platform/emlib/inc/em_smu.h
SMU_IntClear#
void SMU_IntClear (uint32_t flags)
Clear one or more pending SMU interrupts.
[in] | flags | Bitwise logic OR of SMU interrupt sources to clear. |
1588
of file platform/emlib/inc/em_smu.h
SMU_IntDisable#
void SMU_IntDisable (uint32_t flags)
Disable one or more SMU interrupts.
[in] | flags | SMU interrupt sources to disable. |
1609
of file platform/emlib/inc/em_smu.h
SMU_IntEnable#
void SMU_IntEnable (uint32_t flags)
Enable one or more SMU interrupts.
[in] | flags | SMU interrupt sources to enable. |
Note
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. To ignore a pending interrupt, consider using SMU_IntClear() prior to enabling the interrupt.
1635
of file platform/emlib/inc/em_smu.h
SMU_IntGet#
uint32_t SMU_IntGet (void )
Get pending SMU interrupts.
N/A |
Returns
SMU interrupt sources pending.
1656
of file platform/emlib/inc/em_smu.h
SMU_IntGetEnabled#
uint32_t SMU_IntGetEnabled (void )
Get enabled and pending SMU interrupt flags.
N/A |
Useful for handling more interrupt sources in the same interrupt handler.
Note
Interrupt flags are not cleared by this function.
Returns
Pending and enabled SMU interrupt sources. The return value is the bitwise AND combination of
the OR combination of enabled interrupt sources in SMU_IEN register and
the OR combination of valid interrupt flags in SMU_IF register.
1681
of file platform/emlib/inc/em_smu.h
SMU_IntSet#
void SMU_IntSet (uint32_t flags)
Set one or more pending SMU interrupts from SW.
[in] | flags | SMU interrupt sources to set to pending. |
1710
of file platform/emlib/inc/em_smu.h
SMU_SECURE_IRQHandler#
void SMU_SECURE_IRQHandler (void )
SMU secure IRQ Handler.
N/A |
When a PPU detects an access to a secure peripheral at its non-secure address or an access to a non-secure peripheral at its secure address, PPUSECIF in SMU_IF is set and the ID of the peripheral being accessed is written to SMU_PPUFS. If PPUSECIEN is set and the SMU's Secure IRQ enabled, the CPU will be interrupted and SMU_SECURE_IRQHandler Will handle the interrupt.
1737
of file platform/emlib/inc/em_smu.h