ftm_pwm_driver.h File Reference
#include "ftm_common.h"

Go to the source code of this file.

Data Structures

struct  ftm_pwm_ch_fault_param_t
 FlexTimer driver PWM Fault channel parameters. More...
 
struct  ftm_pwm_fault_param_t
 FlexTimer driver PWM Fault parameter. More...
 
struct  ftm_independent_ch_param_t
 FlexTimer driver independent PWM parameter. More...
 
struct  ftm_combined_ch_param_t
 FlexTimer driver combined PWM parameter. More...
 
struct  ftm_pwm_param_t
 FlexTimer driver PWM parameters. More...
 

Macros

#define FTM_MAX_DUTY_CYCLE   (0x8000U)
 Maximum value for PWM duty cycle. More...
 
#define FTM_DUTY_TO_TICKS_SHIFT   (15U)
 Shift value which converts duty to ticks. More...
 

Enumerations

enum  ftm_pwm_update_option_t { FTM_PWM_UPDATE_IN_DUTY_CYCLE = 0x00U, FTM_PWM_UPDATE_IN_TICKS = 0x01U }
 FlexTimer Configure type of PWM update in the duty cycle or in ticks. More...
 
enum  ftm_polarity_t { FTM_POLARITY_LOW = 0x00U, FTM_POLARITY_HIGH = 0x01U }
 FlexTimer PWM output pulse mode, high-true or low-true on match up. More...
 
enum  ftm_second_channel_polarity_t { FTM_MAIN_INVERTED = 0x01U, FTM_MAIN_DUPLICATED = 0x00U }
 FlexTimer PWM channel (n+1) polarity for combine mode. More...
 
enum  ftm_fault_mode_t { FTM_FAULT_CONTROL_DISABLED = 0x00U, FTM_FAULT_CONTROL_MAN_EVEN = 0x01U, FTM_FAULT_CONTROL_MAN_ALL = 0x02U, FTM_FAULT_CONTROL_AUTO_ALL = 0x03U }
 FlexTimer fault control. More...
 
enum  ftm_safe_state_polarity_t { FTM_HIGH_TRUE_PULSE = 0x02U, FTM_LOW_TRUE_PULSE = 0x03U }
 Select level of the channel (n) output at the beginning. More...
 

Functions

status_t FTM_DRV_DeinitPwm (uint32_t instance)
 Stops all PWM channels . More...
 
status_t FTM_DRV_InitPwm (uint32_t instance, const ftm_pwm_param_t *param)
 Configures the duty cycle and frequency and starts outputting the PWM on all channels configured in param. More...
 
status_t FTM_DRV_UpdatePwmChannel (uint32_t instance, uint8_t channel, ftm_pwm_update_option_t typeOfUpdate, uint16_t firstEdge, uint16_t secondEdge, bool softwareTrigger)
 This function updates the waveform output in PWM mode (duty cycle and phase). More...
 
status_t FTM_DRV_FastUpdatePwmChannels (uint32_t instance, uint8_t numberOfChannels, const uint8_t *channels, const uint16_t *duty, bool softwareTrigger)
 This function will update the duty cycle of PWM output for multiple channels. More...
 
status_t FTM_DRV_UpdatePwmPeriod (uint32_t instance, ftm_pwm_update_option_t typeOfUpdate, uint32_t newValue, bool softwareTrigger)
 This function will update the new period in the frequency or in the counter value into mode register which modify the period of PWM signal on the channel output. More...
 
status_t FTM_DRV_UpdatePwmPeriodDither (uint32_t instance, uint8_t newModFracVal, bool softwareTrigger)
 This function will use in the PWM period dithering. This value is added to an internal accumulator at the end of each PWM period. The value is updated with its write buffer value according to the register synchronization. More...
 
status_t FTM_DRV_UpdatePwmEdgeChannelDither (uint32_t instance, uint8_t channel, uint8_t newMatchFracVal, bool softwareTrigger)
 This function will use in the PWM edge dithering. This value is added to the channel (n) internal accumulator at the end of each PWM period. The FRACVAL is updated with its write buffer value according to the register synchronization. The PWM edge dithering is not available when the channel in the input capture modes, and the channel in output compare modes. More...