Hi Jimmy Nguyen
You don't need look into GPIO example to implement an output of PWM using the FTM, FTM channel can be configured for edge-aligned PWM mode, and the signal will be in the pin associated. For example, the SDK 1.3 FTM example uses the FTM0_CH5 witch is in PTD5 (LED) as ATL4:

So inside the hardware_init() you can find the ftm pin configuration with:
PORT_HAL_SetMuxMode(PORTD,5u,kPortMuxAlt4);
The example code set a PWM with a frequency of 24kHZ and a initial duty cycle of 0 that will be increasing and decreasing in the while(1), so you will see changes in the LED brightness:
ftm_pwm_param_t ftmParam = {
.mode = kFtmEdgeAlignedPWM,
.edgeMode = kFtmLowTrue,
.uFrequencyHZ = 24000u,
.uDutyCyclePercent = 0,
.uFirstEdgeDelayPercent = 0,
};
if(brightnessUp)
{
if (++ftmParam.uDutyCyclePercent == 100u)
brightnessUp = false;
}
else
{
if (--ftmParam.uDutyCyclePercent == 0)
brightnessUp = true;
}
Hope this information helps you
Have a great day,
Jorge Alcala
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------