Infineon SMU IR Alarm 1 Manual Download Page 5

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.

Summary of Contents for SMU IR Alarm 1

Page 1: ...AURIX TC2xx Microcontroller Training V1 0 0 SMU_IR_Alarm_1 Interrupt triggered by an SMU alarm Please read the Important Notice and Warnings at the end of this document...

Page 2: ...he interrupt turns on an LED The Safety Management Unit SMU is configured to trigger an interrupt if an internal software alarm occurs In case of an alarm an LED will be turned on inside the Interrupt...

Page 3: ...e alarm signals related to the different hardware and software based safety mechanisms Each alarm can be individually configured to trigger internal or external actions The SMU in combination with the...

Page 4: ...Hardware setup This code example has been developed for the board KIT_AURIX_TC297_TFT_BC Step 4 2019 10 17 Copyright Infineon Technologies AG 2019 All rights reserved...

Page 5: ...equests 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 th...

Page 6: ...ed type value With the function IfxPort_setPinState using the enumerated type value IfxPort_State_high the LED is turned off as default state All functions above are provided by the iLLD header IfxPor...

Page 7: ...xSmu h The LED is turned on inside the ISR to indicate the successful configuration of the SMU and the triggering of the interrupt This is done by setting the port pin of the connected LED by using th...

Page 8: ...Run and Test After code compilation and flashing the device check if LED D107 1 is turned on 1 8 2019 10 17 Copyright Infineon Technologies AG 2019 All rights reserved...

Page 9: ...www infineon com aurix expert training AURIX Development Studio is available online https www infineon com aurixdevelopmentstudio Use the Import function to get access to more code examples For questi...

Page 10: ...of the product for the intended application and the completeness of the product information given in this document with respect to such application For further information on the product technology de...

Reviews: