Implementation
Configuring the TOM
After configuration, the function
IfxGtm_Tom_Pwm_init()
initializes and activates the TOM with the
user configuration.
Start the PWM with the function
IfxGtm_Tom_Pwm_start()
.
Setting the duty cycle
The setting of the duty cycle is done by calling the function
setDutyCycle()
, which contains the
following steps:
›
Set the
dutyCycle
parameters of the configuration structure to set the duty cycle of the PWM
signal to the desired value
›
Call the function
IfxGtm_Tom_Pwm_init()
to reconfigure the TOM with the new value of the duty
cycle
All the functions used for the configuration of the TOM are provided by the iLLD header
IfxGtm_Tom_Pwm.h
.
Fading the LED
The fading of the LED is done in the function
fadeLED()
by repeatedly adding or removing a step
value to the duty cycle of the PWM.
6
2020-02-11
Copyright © Infineon Technologies AG 2020. All rights reserved.