Implementation
Configuring the TOM
The configuration of the TOM is done by calling the initialization function
initGtmTomPwm()
containing the following steps:
›
Enable the GTM by calling the function
IfxGtm_enable()
›
Enable the FXU clocks by calling the function
IfxGtm_Cmu_enableClocks()
The function
IfxGtm_Tom_Pwm_initConfig()
initializes an instance of the structure
IfxGtm_Tom_Pwm_Config
with its default values.
The
IfxGtm_Tom_Pwm_Config
structure can be modified to set the following parameters to initialize
the module:
›
tom
– Selection of the TOM which is counting (TOM 2 in this example)
›
tomChannel
– Selection of the channel which is driving the LED (Channel 5 in this example)
›
period
– Setting of the period for the PWM signal to the desired value
›
pin.outputPin
– Selection of the LED as output pin
›
synchronousUpdateEnable
– Enabling of synchronous update of the timer
5
2020-02-11
Copyright © Infineon Technologies AG 2020. All rights reserved.