Implementation
Reload Values calculation example
Calculating the correct reload value to generate a PWM signal, depending on the given 
frequency f and duty cycle, is done in the initialization function initGpt12PWM():
βΊ Get the GPT12 module base frequency π
πΊππ
by calling the iLLD function 
IfxGpt12_getModuleFrequency()
βΊ Calculate the timer frequency with the following formula:
The GPT1 block prescaler is set to IfxGpt12_Gpt1BlockPrescaler_32, π
πΊππ
is divided by 32
The timer prescaler is set to IfxGpt12_TimerInputPrescaler_32, π
πΊππ
is divided by 32
βΊ Calculate dutyUpTime and dutyDownTime with the following formulas:
π
π‘ππππ
=
π
πΊππ
GPT1_BLOCK_PRESCALER Γ TimerInputPrescaler
π
ππππΌππ»πππ =
π
π‘ππππ
Γ
ππ’π‘π¦πΆπ¦πππ
100
π
π
ππππ«ππππ»πππ =
π
π‘ππππ
Γ 1 β
ππ’π‘π¦πΆπ¦πππ
100
π
7
2020-06-05 Copyright Β© Infineon Technologies AG 2020. All rights reserved.