background image

Implementation

Configuring the TOM

The configuration of the TOM is done once in the setup phase by calling the 
initialization function 

initGtmTom()

with the following steps:

Enable the GTM by calling the function 

IfxGtm_enable()

.

The function 

IfxGtm_Tom_Timer_initConfig() 

initializes an instance of the 

structure 

IfxGtm_Tom_Timer_Config 

with its default values.

The 

IfxGtm_Tom_Timer_Config

structure allows to set the following parameters 

to initialize the module:

tom 

– Set TOM 1

timerChannel

– Set channel 0 of TOM 1

clock

– Select CMU clock 0

base.frequency 

– Set timer frequency to 2 Hz (Interrupt every 500 ms)

base.isrPriority 

– Interrupt Service Routine priority

base.isrProvider 

– Interrupt Service Routine provider

5

2019-10-17

Copyright © Infineon Technologies AG 2019. All rights reserved.

Summary of Contents for GTM TOM Interrupt 1

Page 1: ...AURIX TC2xx Microcontroller Training V1 0 0 GTM_TOM_Interrupt_1 GTM TOM interrupt Please read the Important Notice and Warnings at the end of this document...

Page 2: ...0 ms The interrupt toggles an LED The Generic Timer Module triggers an interrupt every 500 ms The state of the port pin where the LED is connected is toggled inside the Interrupt Service Routine ISR 2...

Page 3: ...at can offers 16 independent channels to generate output signals The Clock Management Unit CMU is responsible for clock generation of the GTM The Fixed Clock Generation FXU is one of its subunits and...

Page 4: ...rdware setup This code example has been developed for the board KIT_AURIX_TC297_TFT_BC Step LED D107 1 is used for this example 1 4 2019 10 17 Copyright Infineon Technologies AG 2019 All rights reserv...

Page 5: ...e of the structure IfxGtm_Tom_Timer_Config with its default values The IfxGtm_Tom_Timer_Config structure allows to set the following parameters to initialize the module tom Set TOM 1 timerChannel Set...

Page 6: ...ble the FXU clocks by calling the function IfxGtm_Cmu_enableClocks The function IfxGtm_Tom_Timer_init initializes and activates the TOM with the given configuration All the functions used for the conf...

Page 7: ...t provided by iLLD header IfxPort h Interrupt Service Routine ISR The ISR implemented in this example contains the following steps Clear the timer event with the function IfxGtm_Tom_Timer_acknowledgeT...

Page 8: ...Run and Test After code compilation and flashing the device observe the LED D107 1 which should be blinking 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: ...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 deli...

Reviews: