
Implementation
Configure the SMU module
›
To trigger an interrupt with an SMU alarm, a few steps are required:
–
To modify the SMU registers, the SMU module has to be unlocked with the function
IfxSmu_unlock()
. After the modification is finished, the SMU registers should be locked again
using the function
IfxSmu_lock()
.
–
Additionally, it is required to clear and set the Safety ENDINIT protection before and after the
modification of the SMU configuration registers. This is done with the functions
IfxScuWdt_clearSafetyEndinit()
and
IfxScuWdt_setSafetyEndinit()
.
–
The Alarm Global Configuration register (
SMU_AGC
) provides the software interface to control
how the SMU triggers interrupt requests to the interrupt router. By setting the
IGCS0
bitfield to
1
, SMU Interrupt Request 0 is triggered.
–
The function
IfxSmu_setAlarmConfig()
configures the alarm’s behavior by writing a 3-bit code
to the three Alarm Configuration Registers associated to the specific alarm and its group. In this
example, the software alarm 0 (
IfxSmu_Alarm_SoftwareAlarm0)
and the Interrupt Generation
Configuration Set 0 (
IfxSmu_AlarmConfig_interruptSet0
) are selected. The iLLD function
itself selects the group based on the above mentioned parameters.
–
Configure and enable the SMU Service Request 0 with the functions
IfxSrc_init()
and
IfxSrc_enable()
.
–
Start the SMU state machine (SSM) with the function
IfxSmu_cmd()
and the parameter
IfxSmu_Cmd_start
.
The functions above are provided by the iLLD headers
IfxSmu.h
and
IfxSrc.h
.
5
2019-10-17
Copyright © Infineon Technologies AG 2019. All rights reserved.