Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FlexTimer HAL driver

Overview

This section describes the programming interface of the FlexTimer HAL driver.

Data Structures

union  ftm_edge_mode_t
 FlexTimer edge mode. More...
 
struct  ftm_pwm_param_t
 FlexTimer driver PWM parameter. More...
 
struct  ftm_dual_edge_capture_param_t
 FlexTimer Dual Edge Capture parameters. More...
 
struct  ftm_phase_params_t
 FlexTimer quadrature decode phase parameters. More...
 

Macros

#define CHAN0_IDX   (0U)
 Channel number for CHAN0. More...
 
#define CHAN1_IDX   (1U)
 Channel number for CHAN1. More...
 
#define CHAN2_IDX   (2U)
 Channel number for CHAN2. More...
 
#define CHAN3_IDX   (3U)
 Channel number for CHAN3. More...
 
#define CHAN4_IDX   (4U)
 Channel number for CHAN4. More...
 
#define CHAN5_IDX   (5U)
 Channel number for CHAN5. More...
 
#define CHAN6_IDX   (6U)
 Channel number for CHAN6. More...
 
#define CHAN7_IDX   (7U)
 Channel number for CHAN7. More...
 

Enumerations

enum  ftm_clock_source_t
 FlexTimer clock source selection.
 
enum  ftm_counting_mode_t
 FlexTimer counting mode selection.
 
enum  ftm_clock_ps_t
 FlexTimer pre-scaler factor selection for the clock source.
 
enum  ftm_deadtime_ps_t
 FlexTimer pre-scaler factor for the deadtime insertion.
 
enum  ftm_config_mode_t
 FlexTimer operation mode, capture, output, dual.
 
enum  ftm_input_capture_edge_mode_t
 FlexTimer input capture edge mode, rising edge, or falling edge.
 
enum  ftm_output_compare_edge_mode_t
 FlexTimer output compare edge mode. More...
 
enum  ftm_pwm_edge_mode_t
 FlexTimer PWM output pulse mode, high-true or low-true on match up.
 
enum  ftm_dual_capture_edge_mode_t
 FlexTimer dual capture edge mode, one shot or continuous.
 
enum  ftm_quad_decode_mode_t
 FlexTimer quadrature decode modes, phase encode or count and direction mode.
 
enum  ftm_quad_phase_polarity_t {
  kFtmQuadPhaseNormal = 0,
  kFtmQuadPhaseInvert
}
 FlexTimer quadrature phase polarities, normal or inverted polarity. More...
 
enum  ftm_sync_method_t
 FlexTimer sync options to update registers with buffer.
 
enum  ftm_bdm_mode_t {
  kFtmBdmMode_00 = 0,
  kFtmBdmMode_01,
  kFtmBdmMode_10,
  kFtmBdmMode_11
}
 Options for the FlexTimer behaviour in BDM Mode. More...
 
enum  ftm_status_t {
  kStatusFtmSuccess = 0U,
  kStatusFtmError = 1U
}
 FTM status. More...
 

Functions

static void FTM_HAL_SetClockSource (FTM_Type *ftmBase, ftm_clock_source_t clock)
 Sets the FTM clock source. More...
 
static uint8_t FTM_HAL_GetClockSource (FTM_Type *ftmBase)
 Reads the FTM clock source. More...
 
static void FTM_HAL_SetClockPs (FTM_Type *ftmBase, ftm_clock_ps_t ps)
 Sets the FTM clock divider. More...
 
static uint8_t FTM_HAL_GetClockPs (FTM_Type *ftmBase)
 Reads the FTM clock divider. More...
 
static void FTM_HAL_EnableTimerOverflowInt (FTM_Type *ftmBase)
 Enables the FTM peripheral timer overflow interrupt. More...
 
static void FTM_HAL_DisableTimerOverflowInt (FTM_Type *ftmBase)
 Disables the FTM peripheral timer overflow interrupt. More...
 
static bool FTM_HAL_IsOverflowIntEnabled (FTM_Type *ftmBase)
 Reads the bit that controls enabling the FTM timer overflow interrupt. More...
 
static void FTM_HAL_ClearTimerOverflow (FTM_Type *ftmBase)
 Clears the timer overflow interrupt flag. More...
 
static bool FTM_HAL_HasTimerOverflowed (FTM_Type *ftmBase)
 Returns the FTM peripheral timer overflow interrupt flag. More...
 
static void FTM_HAL_SetCpwms (FTM_Type *ftmBase, uint8_t mode)
 Sets the FTM center-aligned PWM select. More...
 
static void FTM_HAL_SetCounter (FTM_Type *ftmBase, uint16_t val)
 Sets the FTM peripheral current counter value. More...
 
static uint16_t FTM_HAL_GetCounter (FTM_Type *ftmBase)
 Returns the FTM peripheral current counter value. More...
 
static void FTM_HAL_SetMod (FTM_Type *ftmBase, uint16_t val)
 Sets the FTM peripheral timer modulo value. More...
 
static uint16_t FTM_HAL_GetMod (FTM_Type *ftmBase)
 Returns the FTM peripheral counter modulo value. More...
 
static void FTM_HAL_SetCounterInitVal (FTM_Type *ftmBase, uint16_t val)
 Sets the FTM peripheral timer counter initial value. More...
 
static uint16_t FTM_HAL_GetCounterInitVal (FTM_Type *ftmBase)
 Returns the FTM peripheral counter initial value. More...
 
static void FTM_HAL_SetChnMSnBAMode (FTM_Type *ftmBase, uint8_t channel, uint8_t selection)
 Sets the FTM peripheral timer channel mode. More...
 
static void FTM_HAL_SetChnEdgeLevel (FTM_Type *ftmBase, uint8_t channel, uint8_t level)
 Sets the FTM peripheral timer channel edge level. More...
 
static uint8_t FTM_HAL_GetChnMode (FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel mode. More...
 
static uint8_t FTM_HAL_GetChnEdgeLevel (FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel edge level. More...
 
static void FTM_HAL_SetChnDmaCmd (FTM_Type *ftmBase, uint8_t channel, bool val)
 Enables or disables the FTM peripheral timer channel DMA. More...
 
static bool FTM_HAL_IsChnDma (FTM_Type *ftmBase, uint8_t channel)
 Returns whether the FTM peripheral timer channel DMA is enabled. More...
 
static bool FTM_HAL_IsChnIntEnabled (FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM channel(n) interrupt enabled or not. More...
 
static void FTM_HAL_EnableChnInt (FTM_Type *ftmBase, uint8_t channel)
 Enables the FTM peripheral timer channel(n) interrupt. More...
 
static void FTM_HAL_DisableChnInt (FTM_Type *ftmBase, uint8_t channel)
 Disables the FTM peripheral timer channel(n) interrupt. More...
 
static bool FTM_HAL_HasChnEventOccurred (FTM_Type *ftmBase, uint8_t channel)
 Returns whether any event for the FTM peripheral timer channel has occurred. More...
 
static void FTM_HAL_ClearChnEventFlag (FTM_Type *ftmBase, uint8_t channel)
 Clears the channel flag by writing a 0 to the CHF bit. More...
 
static void FTM_HAL_SetChnCountVal (FTM_Type *ftmBase, uint8_t channel, uint16_t val)
 Sets the FTM peripheral timer channel counter value. More...
 
static uint16_t FTM_HAL_GetChnCountVal (FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel counter value. More...
 
static uint32_t FTM_HAL_GetChnEventStatus (FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel event status. More...
 
static void FTM_HAL_ClearChnEventStatus (FTM_Type *ftmBase, uint8_t channel)
 Clears the FTM peripheral timer all channel event status. More...
 
static void FTM_HAL_SetOutmaskReg (FTM_Type *ftmBase, uint32_t regVal)
 Writes the provided value to the OUTMASK register. More...
 
static void FTM_HAL_SetChnOutputMask (FTM_Type *ftmBase, uint8_t channel, bool mask)
 Sets the FTM peripheral timer channel output mask. More...
 
static void FTM_HAL_SetChnOutputInitStateCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t state)
 Sets the FTM peripheral timer channel output initial state 0 or 1. More...
 
static void FTM_HAL_SetChnOutputPolarityCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t pol)
 Sets the FTM peripheral timer channel output polarity. More...
 
static void FTM_HAL_SetChnFaultInputPolarityCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t pol)
 Sets the FTM peripheral timer channel input polarity. More...
 
static void FTM_HAL_EnableFaultInt (FTM_Type *ftmBase)
 Enables the FTM peripheral timer fault interrupt. More...
 
static void FTM_HAL_DisableFaultInt (FTM_Type *ftmBase)
 Disables the FTM peripheral timer fault interrupt. More...
 
static void FTM_HAL_SetFaultControlMode (FTM_Type *ftmBase, uint8_t mode)
 Defines the FTM fault control mode. More...
 
static void FTM_HAL_SetCaptureTestCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM peripheral timer capture test mode. More...
 
static void FTM_HAL_SetWriteProtectionCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM write protection. More...
 
static void FTM_HAL_Enable (FTM_Type *ftmBase, bool enable)
 Enables the FTM peripheral timer group. More...
 
static void FTM_HAL_SetInitChnOutputCmd (FTM_Type *ftmBase, bool enable)
 Initializes the channels output. More...
 
static void FTM_HAL_SetPwmSyncMode (FTM_Type *ftmBase, bool enable)
 Sets the FTM peripheral timer sync mode. More...
 
static void FTM_HAL_SetSoftwareTriggerCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM peripheral timer software trigger. More...
 
void FTM_HAL_SetHardwareSyncTriggerSrc (FTM_Type *ftmBase, uint32_t trigger_num, bool enable)
 Sets the FTM peripheral timer hardware trigger. More...
 
static void FTM_HAL_SetOutmaskPwmSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Determines when the OUTMASK register is updated with the value of its buffer. More...
 
static void FTM_HAL_SetCountReinitSyncCmd (FTM_Type *ftmBase, bool enable)
 Determines if the FTM counter is re-initialized when the selected trigger for synchronization is detected. More...
 
static void FTM_HAL_SetMaxLoadingCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM peripheral timer maximum loading points. More...
 
static void FTM_HAL_SetMinLoadingCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM peripheral timer minimum loading points. More...
 
uint32_t FTM_HAL_GetChnPairIndex (uint8_t channel)
 Combines the channel control. More...
 
static void FTM_HAL_SetDualChnFaultCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables the FTM peripheral timer channel pair fault control. More...
 
static void FTM_HAL_SetDualChnPwmSyncCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel pair counter PWM sync. More...
 
static void FTM_HAL_SetDualChnDeadtimeCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disabled the FTM peripheral timer channel pair deadtime insertion. More...
 
static void FTM_HAL_SetDualChnDecapCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel dual edge capture decap. More...
 
static void FTM_HAL_SetDualEdgeCaptureCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables the FTM peripheral timer dual edge capture mode. More...
 
static void FTM_HAL_SetDualChnCompCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel pair output complement mode. More...
 
static void FTM_HAL_SetDualChnCombineCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel pair output combine mode. More...
 
static void FTM_HAL_SetDeadtimePrescale (FTM_Type *ftmBase, ftm_deadtime_ps_t divider)
 Sets the FTM deadtime divider. More...
 
static void FTM_HAL_SetDeadtimeCount (FTM_Type *ftmBase, uint8_t count)
 Sets the FTM deadtime value. More...
 
static void FTM_HAL_SetInitTriggerCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the generation of the trigger when the FTM counter is equal to the CNTIN register. More...
 
void FTM_HAL_SetChnTriggerCmd (FTM_Type *ftmBase, uint8_t channel, bool val)
 Enables or disables the generation of the FTM peripheral timer channel trigger. More...
 
static bool FTM_HAL_IsChnTriggerGenerated (FTM_Type *ftmBase)
 Checks whether any channel trigger event has occurred. More...
 
static uint8_t FTM_HAL_GetDetectedFaultInput (FTM_Type *ftmBase)
 Gets the FTM detected fault input. More...
 
static bool FTM_HAL_IsWriteProtectionEnabled (FTM_Type *ftmBase)
 Checks whether the write protection is enabled. More...
 
static void FTM_HAL_SetQuadDecoderCmd (FTM_Type *ftmBase, bool enable)
 Enables the channel quadrature decoder. More...
 
static void FTM_HAL_SetQuadPhaseAFilterCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the phase A input filter. More...
 
static void FTM_HAL_SetQuadPhaseBFilterCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the phase B input filter. More...
 
static void FTM_HAL_SetQuadPhaseAPolarity (FTM_Type *ftmBase, ftm_quad_phase_polarity_t mode)
 Selects polarity for the quadrature decode phase A input. More...
 
static void FTM_HAL_SetQuadPhaseBPolarity (FTM_Type *ftmBase, ftm_quad_phase_polarity_t mode)
 Selects polarity for the quadrature decode phase B input. More...
 
static void FTM_HAL_SetQuadMode (FTM_Type *ftmBase, ftm_quad_decode_mode_t quadMode)
 Sets the encoding mode used in quadrature decoding mode. More...
 
static uint8_t FTM_HAL_GetQuadDir (FTM_Type *ftmBase)
 Gets the FTM counter direction in quadrature mode. More...
 
static uint8_t FTM_HAL_GetQuadTimerOverflowDir (FTM_Type *ftmBase)
 Gets the timer overflow direction in quadrature mode. More...
 
void FTM_HAL_SetChnInputCaptureFilter (FTM_Type *ftmBase, uint8_t channel, uint8_t val)
 Sets the FTM peripheral timer channel input capture filter value. More...
 
static void FTM_HAL_SetFaultInputFilterVal (FTM_Type *ftmBase, uint32_t val)
 Sets the fault input filter value. More...
 
static void FTM_HAL_SetFaultInputFilterCmd (FTM_Type *ftmBase, uint8_t inputNum, bool val)
 Enables or disables the fault input filter. More...
 
static void FTM_HAL_SetFaultInputCmd (FTM_Type *ftmBase, uint8_t inputNum, bool val)
 Enables or disables the fault input. More...
 
static void FTM_HAL_SetDualChnInvertCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool val)
 Enables or disables the channel invert for a channel pair. More...
 
static void FTM_HAL_SetInvctrlReg (FTM_Type *ftmBase, uint32_t regVal)
 Writes the provided value to the Inverting Control register. More...
 
static void FTM_HAL_SetChnSoftwareCtrlCmd (FTM_Type *ftmBase, uint8_t channel, bool val)
 Enables or disables the channel software output control. More...
 
static void FTM_HAL_SetChnSoftwareCtrlVal (FTM_Type *ftmBase, uint8_t channel, bool val)
 Sets the channel software output control value. More...
 
static void FTM_HAL_SetPwmLoadCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the loading of MOD, CNTIN, and CV with values of their write buffer. More...
 
static void FTM_HAL_SetPwmLoadChnSelCmd (FTM_Type *ftmBase, uint8_t channel, bool val)
 Includes or excludes the channel in the matching process. More...
 
static void FTM_HAL_SetGlobalTimeBaseOutputCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM global time base signal generation to other FTM's. More...
 
static void FTM_HAL_SetGlobalTimeBaseCmd (FTM_Type *ftmBase, bool enable)
 Enables or disables the FTM timer global time base. More...
 
static void FTM_HAL_SetBdmMode (FTM_Type *ftmBase, ftm_bdm_mode_t val)
 Sets the BDM mode. More...
 
static void FTM_HAL_SetTofFreq (FTM_Type *ftmBase, uint8_t val)
 Sets the FTM timer TOF Frequency. More...
 
void FTM_HAL_SetSyncMode (FTM_Type *ftmBase, uint32_t syncMethod)
 Sets the FTM register synchronization method. More...
 
static void FTM_HAL_SetSwoctrlHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets the sync mode for the FTM SWOCTRL register when using a hardware trigger. More...
 
static void FTM_HAL_SetInvctrlHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM INVCTRL register when using a hardware trigger. More...
 
static void FTM_HAL_SetOutmaskHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM OUTMASK register when using a hardware trigger. More...
 
static void FTM_HAL_SetModCntinCvHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM MOD, CNTIN and CV registers when using a hardware trigger. More...
 
static void FTM_HAL_SetCounterHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM counter register when using a hardware trigger. More...
 
static void FTM_HAL_SetSwoctrlSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM SWOCTRL register when using a software trigger. More...
 
static void FTM_HAL_SetInvctrlSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM INVCTRL register when using a software trigger. More...
 
static void FTM_HAL_SetOutmaskSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM OUTMASK register when using a software trigger. More...
 
static void FTM_HAL_SetModCntinCvSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets synch mode for FTM MOD, CNTIN, and CV registers when using a software trigger. More...
 
static void FTM_HAL_SetCounterSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets sync mode for FTM counter register when using a software trigger. More...
 
static void FTM_HAL_SetPwmSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets the PWM synchronization mode to enhanced or legacy. More...
 
static void FTM_HAL_SetSwoctrlPwmSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets the SWOCTRL register PWM synchronization mode. More...
 
static void FTM_HAL_SetInvctrlPwmSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets the INVCTRL register PWM synchronization mode. More...
 
static void FTM_HAL_SetCntinPwmSyncModeCmd (FTM_Type *ftmBase, bool enable)
 Sets the CNTIN register PWM synchronization mode. More...
 
void FTM_HAL_Reset (FTM_Type *ftmBase)
 Resets the FTM registers. More...
 
void FTM_HAL_Init (FTM_Type *ftmBase)
 Initializes the FTM. More...
 
void FTM_HAL_EnablePwmMode (FTM_Type *ftmBase, ftm_pwm_param_t *config, uint8_t channel)
 Enables the FTM timer when it is PWM output mode. More...
 
void FTM_HAL_DisablePwmMode (FTM_Type *ftmBase, ftm_pwm_param_t *config, uint8_t channel)
 Disables the PWM output mode. More...
 

Data Structure Documentation

union ftm_edge_mode_t
struct ftm_pwm_param_t

Data Fields

ftm_config_mode_t mode
 FlexTimer PWM operation mode.
 
ftm_pwm_edge_mode_t edgeMode
 PWM output mode.
 
uint32_t uFrequencyHZ
 PWM period in Hz.
 
uint32_t uDutyCyclePercent
 PWM pulse width, value should be between 0 to 100 0=inactive signal(0% duty cycle)... More...
 
uint16_t uFirstEdgeDelayPercent
 Used only in combined PWM mode to generate asymmetrical PWM. More...
 

Field Documentation

uint32_t ftm_pwm_param_t::uDutyCyclePercent

100=active signal (100% duty cycle).

uint16_t ftm_pwm_param_t::uFirstEdgeDelayPercent

Specifies the delay to the first edge in a PWM period. If unsure please leave as 0, should be specified as percentage of the PWM period

struct ftm_dual_edge_capture_param_t

Data Fields

ftm_dual_capture_edge_mode_t mode
 Dual Edge Capture mode: one-shot or continuous.
 
ftm_input_capture_edge_mode_t currChanEdgeMode
 Input Edge select for Channel n.
 
ftm_input_capture_edge_mode_t nextChanEdgeMode
 Input Edge select for Channel n + 1.
 
struct ftm_phase_params_t

Data Fields

bool kFtmPhaseInputFilter
 false: disable phase filter, true: enable phase filter
 
uint32_t kFtmPhaseFilterVal
 Filter value, used only if phase input filter is enabled.
 
ftm_quad_phase_polarity_t kFtmPhasePolarity
 kFtmQuadPhaseNormal or kFtmQuadPhaseInvert
 

Macro Definition Documentation

#define CHAN0_IDX   (0U)
#define CHAN1_IDX   (1U)
#define CHAN2_IDX   (2U)
#define CHAN3_IDX   (3U)
#define CHAN4_IDX   (4U)
#define CHAN5_IDX   (5U)
#define CHAN6_IDX   (6U)
#define CHAN7_IDX   (7U)

Enumeration Type Documentation

Toggle, clear or set.

Enumerator
kFtmQuadPhaseNormal 

Phase A input signal is not inverted before identifying the rising and falling edges of this signal.

kFtmQuadPhaseInvert 

Phase A input signal is inverted before identifying the rising and falling edges of this signal.

Enumerator
kFtmBdmMode_00 

FTM counter stopped, CH(n)F bit can be set, FTM channels in functional mode, writes to MOD,CNTIN and C(n)V registers bypass the register buffers.

kFtmBdmMode_01 

FTM counter stopped, CH(n)F bit is not set, FTM channels outputs are forced to their safe value , writes to MOD,CNTIN and C(n)V registers bypass the register buffers.

kFtmBdmMode_10 

FTM counter stopped, CH(n)F bit is not set, FTM channels outputs are frozen when chip enters in BDM mode, writes to MOD,CNTIN and C(n)V registers bypass the register buffers.

kFtmBdmMode_11 

FTM counter in functional mode, CH(n)F bit can be set, FTM channels in functional mode, writes to MOD,CNTIN and C(n)V registers is in fully functional mode.

Enumerator
kStatusFtmSuccess 

FTM success status.

kStatusFtmError 

FTM error status.

Function Documentation

static void FTM_HAL_SetClockSource ( FTM_Type *  ftmBase,
ftm_clock_source_t  clock 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
clockThe FTM peripheral clock selection
bits - 00: No clock 01: system clock 10: fixed clock 11: External clock
static uint8_t FTM_HAL_GetClockSource ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
The FTM clock source selection
bits - 00: No clock 01: system clock 10: fixed clock 11:External clock
static void FTM_HAL_SetClockPs ( FTM_Type *  ftmBase,
ftm_clock_ps_t  ps 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
psThe FTM peripheral clock pre-scale divider
static uint8_t FTM_HAL_GetClockPs ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
The FTM clock pre-scale divider
static void FTM_HAL_EnableTimerOverflowInt ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
static void FTM_HAL_DisableTimerOverflowInt ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
static bool FTM_HAL_IsOverflowIntEnabled ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
true if overflow interrupt is enabled, false if not
static void FTM_HAL_ClearTimerOverflow ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
static bool FTM_HAL_HasTimerOverflowed ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
true if overflow, false if not
static void FTM_HAL_SetCpwms ( FTM_Type *  ftmBase,
uint8_t  mode 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
mode1:upcounting mode 0:up_down counting mode
static void FTM_HAL_SetCounter ( FTM_Type *  ftmBase,
uint16_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valFTM timer counter value to be set
static uint16_t FTM_HAL_GetCounter ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
current FTM timer counter value
static void FTM_HAL_SetMod ( FTM_Type *  ftmBase,
uint16_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valThe value to be set to the timer modulo
static uint16_t FTM_HAL_GetMod ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
FTM timer modulo value
static void FTM_HAL_SetCounterInitVal ( FTM_Type *  ftmBase,
uint16_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valinitial value to be set
static uint16_t FTM_HAL_GetCounterInitVal ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
FTM timer counter initial value
static void FTM_HAL_SetChnMSnBAMode ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  selection 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
selectionThe mode to be set valid value MSnB:MSnA : 00, 01, 10, 11
static void FTM_HAL_SetChnEdgeLevel ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  level 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
levelThe rising or falling edge to be set, valid value ELSnB:ELSnA : 00, 01, 10, 11
static uint8_t FTM_HAL_GetChnMode ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
The MSnB:MSnA mode value, will be 00, 01, 10, 11
static uint8_t FTM_HAL_GetChnEdgeLevel ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
The ELSnB:ELSnA mode value, will be 00, 01, 10, 11
static void FTM_HAL_SetChnDmaCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
valenable or disable
static bool FTM_HAL_IsChnDma ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
true if enabled, false if disabled
static bool FTM_HAL_IsChnIntEnabled ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseFTM module base address.
channelThe FTM peripheral channel number
Returns
true if enabled, false if disabled
static void FTM_HAL_EnableChnInt ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
static void FTM_HAL_DisableChnInt ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
static bool FTM_HAL_HasChnEventOccurred ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
true if event occurred, false otherwise.
static void FTM_HAL_ClearChnEventFlag ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
static void FTM_HAL_SetChnCountVal ( FTM_Type *  ftmBase,
uint8_t  channel,
uint16_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
valcounter value to be set
static uint16_t FTM_HAL_GetChnCountVal ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
return channel counter value
static uint32_t FTM_HAL_GetChnEventStatus ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
Returns
return channel event status value
static void FTM_HAL_ClearChnEventStatus ( FTM_Type *  ftmBase,
uint8_t  channel 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
static void FTM_HAL_SetOutmaskReg ( FTM_Type *  ftmBase,
uint32_t  regVal 
)
inlinestatic

This function will mask/uumask multiple channels.

Parameters
ftmBaseThe FTM base address pointer
regValvalue to be written to the register
static void FTM_HAL_SetChnOutputMask ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  mask 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
maskmask to be set 0 or 1, unmasked or masked
static void FTM_HAL_SetChnOutputInitStateCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  state 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
statecounter value to be set 0 or 1
static void FTM_HAL_SetChnOutputPolarityCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  pol 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
polpolarity to be set 0 or 1
static void FTM_HAL_SetChnFaultInputPolarityCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  pol 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number
polpolarity to be set, 0: active high, 1:active low
static void FTM_HAL_EnableFaultInt ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
static void FTM_HAL_DisableFaultInt ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
static void FTM_HAL_SetFaultControlMode ( FTM_Type *  ftmBase,
uint8_t  mode 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
mode,validoptions are 1, 2, 3, 4
static void FTM_HAL_SetCaptureTestCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue to enable capture test mode, false to disable
static void FTM_HAL_SetWriteProtectionCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue: Write-protection is enabled, false: Write-protection is disabled
static void FTM_HAL_Enable ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue: all registers including FTM-specific registers are available false: only the TPM-compatible registers are available
static void FTM_HAL_SetInitChnOutputCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue: the channels output is initialized according to the state of OUTINIT reg false: has no effect
static void FTM_HAL_SetPwmSyncMode ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue: no restriction both software and hardware triggers can be used
false: software trigger can only be used for MOD and CnV synch, hardware trigger only for OUTMASK and FTM counter synch.
static void FTM_HAL_SetSoftwareTriggerCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer.
enabletrue: software trigger is selected, false: software trigger is not selected
void FTM_HAL_SetHardwareSyncTriggerSrc ( FTM_Type *  ftmBase,
uint32_t  trigger_num,
bool  enable 
)
Parameters
ftmBaseThe FTM base address pointer
trigger_num0, 1, 2 for trigger0, trigger1, and trigger3
enabletrue: enable hardware trigger from field trigger_num for PWM synch false: disable hardware trigger from field trigger_num for PWM synch
static void FTM_HAL_SetOutmaskPwmSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue if OUTMASK register is updated only by PWM sync
false if OUTMASK register is updated in all rising edges of the system clock
static void FTM_HAL_SetCountReinitSyncCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to update FTM counter when triggered , false to count normally
static void FTM_HAL_SetMaxLoadingCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable maximum loading point, false to disable
static void FTM_HAL_SetMinLoadingCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable minimum loading point, false to disable
uint32_t FTM_HAL_GetChnPairIndex ( uint8_t  channel)

Returns an index for each channel pair.

Parameters
channelThe FTM peripheral channel number.
Returns
0 for channel pair 0 & 1
1 for channel pair 2 & 3
2 for channel pair 4 & 5
3 for channel pair 6 & 7
static void FTM_HAL_SetDualChnFaultCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable fault control, false to disable
static void FTM_HAL_SetDualChnPwmSyncCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable PWM synchronization, false to disable
static void FTM_HAL_SetDualChnDeadtimeCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable deadtime insertion, false to disable
static void FTM_HAL_SetDualChnDecapCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable dual edge capture mode, false to disable
static void FTM_HAL_SetDualEdgeCaptureCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable dual edge capture, false to disable
static void FTM_HAL_SetDualChnCompCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable complementary mode, false to disable
static void FTM_HAL_SetDualChnCombineCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
enableTrue to enable channel pair to combine, false to disable
static void FTM_HAL_SetDeadtimePrescale ( FTM_Type *  ftmBase,
ftm_deadtime_ps_t  divider 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
dividerThe FTM peripheral prescale divider
0x :divided by 1, 10: divided by 4, 11:divided by 16
static void FTM_HAL_SetDeadtimeCount ( FTM_Type *  ftmBase,
uint8_t  count 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
countThe FTM peripheral prescale divider
0: no counts inserted, 1: 1 count is inserted, 2: 2 count is inserted....
static void FTM_HAL_SetInitTriggerCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable, false to disable
void FTM_HAL_SetChnTriggerCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  val 
)

Enables or disables the generation of the FTM peripheral timer channel trigger when the FTM counter is equal to its initial value. Channels 6 and 7 cannot be used as triggers.

Parameters
ftmBaseThe FTM base address pointer
channelChannel to be enabled, valid value 0, 1, 2, 3, 4, 5
valTrue to enable, false to disable
static bool FTM_HAL_IsChnTriggerGenerated ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
true if there is a channel trigger event, false if not.
static uint8_t FTM_HAL_GetDetectedFaultInput ( FTM_Type *  ftmBase)
inlinestatic

This function reads the status for all fault inputs

Parameters
ftmBaseThe FTM base address pointer
Returns
Return fault byte
static bool FTM_HAL_IsWriteProtectionEnabled ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
True if enabled, false if not
static void FTM_HAL_SetQuadDecoderCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable, false to disable
static void FTM_HAL_SetQuadPhaseAFilterCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue enables the phase input filter, false disables the filter
static void FTM_HAL_SetQuadPhaseBFilterCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue enables the phase input filter, false disables the filter
static void FTM_HAL_SetQuadPhaseAPolarity ( FTM_Type *  ftmBase,
ftm_quad_phase_polarity_t  mode 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
mode0: Normal polarity, 1: Inverted polarity
static void FTM_HAL_SetQuadPhaseBPolarity ( FTM_Type *  ftmBase,
ftm_quad_phase_polarity_t  mode 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
mode0: Normal polarity, 1: Inverted polarity
static void FTM_HAL_SetQuadMode ( FTM_Type *  ftmBase,
ftm_quad_decode_mode_t  quadMode 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
quadMode0: Phase A and Phase B encoding mode
1: Count and direction encoding mode
static uint8_t FTM_HAL_GetQuadDir ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
1 if counting direction is increasing, 0 if counting direction is decreasing
static uint8_t FTM_HAL_GetQuadTimerOverflowDir ( FTM_Type *  ftmBase)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
Returns
1 if TOF bit was set on the top of counting, 0 if TOF bit was set on the bottom of counting
void FTM_HAL_SetChnInputCaptureFilter ( FTM_Type *  ftmBase,
uint8_t  channel,
uint8_t  val 
)
Parameters
ftmBaseThe FTM base address pointer
channelThe FTM peripheral channel number, only 0, 1, 2, 3, channel 4, 5, 6, 7 don't have.
valFilter value to be set
static void FTM_HAL_SetFaultInputFilterVal ( FTM_Type *  ftmBase,
uint32_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valfault input filter value
static void FTM_HAL_SetFaultInputFilterCmd ( FTM_Type *  ftmBase,
uint8_t  inputNum,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
inputNumfault input to be configured, valid value 0, 1, 2, 3
valtrue to enable fault input filter, false to disable fault input filter
static void FTM_HAL_SetFaultInputCmd ( FTM_Type *  ftmBase,
uint8_t  inputNum,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
inputNumfault input to be configured, valid value 0, 1, 2, 3
valtrue to enable fault input, false to disable fault input
static void FTM_HAL_SetDualChnInvertCmd ( FTM_Type *  ftmBase,
uint8_t  chnlPairNum,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
chnlPairNumThe FTM peripheral channel pair number
valtrue to enable channel inverting, false to disable channel inver
static void FTM_HAL_SetInvctrlReg ( FTM_Type *  ftmBase,
uint32_t  regVal 
)
inlinestatic

This function is enable/disable inverting control on multiple channel pairs.

Parameters
ftmBaseThe FTM base address pointer
regValvalue to be written to the register
static void FTM_HAL_SetChnSoftwareCtrlCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelChannel to be enabled or disabled
valtrue to enable, channel output will be affected by software output control
false to disable, channel output is unaffected
static void FTM_HAL_SetChnSoftwareCtrlVal ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer.
channelChannel to be configured
valTrue to set 1, false to set 0
static void FTM_HAL_SetPwmLoadCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue to enable, false to disable
static void FTM_HAL_SetPwmLoadChnSelCmd ( FTM_Type *  ftmBase,
uint8_t  channel,
bool  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
channelChannel to be configured
valtrue means include the channel in the matching process
false means do not include channel in the matching process
static void FTM_HAL_SetGlobalTimeBaseOutputCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable, false to disable
static void FTM_HAL_SetGlobalTimeBaseCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enableTrue to enable, false to disable
static void FTM_HAL_SetBdmMode ( FTM_Type *  ftmBase,
ftm_bdm_mode_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valFTM behaviour in BDM mode, options are defined in the enum ftm_bdm_mode_t
static void FTM_HAL_SetTofFreq ( FTM_Type *  ftmBase,
uint8_t  val 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
valValue of the TOF bit set frequency
void FTM_HAL_SetSyncMode ( FTM_Type *  ftmBase,
uint32_t  syncMethod 
)

This function will set the necessary bits for the synchronization mode that user wishes to use.

Parameters
ftmBaseThe FTM base address pointer
syncMethodSynchronization method defined by ftm_sync_method_t enum. User can choose multiple synch methods by OR'ing options
static void FTM_HAL_SetSwoctrlHardwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means the hardware trigger activates register sync
false means the hardware trigger does not activate register sync.
static void FTM_HAL_SetInvctrlHardwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means the hardware trigger activates register sync
false means the hardware trigger does not activate register sync.
static void FTM_HAL_SetOutmaskHardwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means hardware trigger activates register sync
false means hardware trigger does not activate register sync.
static void FTM_HAL_SetModCntinCvHardwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means hardware trigger activates register sync
false means hardware trigger does not activate register sync.
static void FTM_HAL_SetCounterHardwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means hardware trigger activates register sync
false means hardware trigger does not activate register sync.
static void FTM_HAL_SetSwoctrlSoftwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means software trigger activates register sync
false means software trigger does not activate register sync.
static void FTM_HAL_SetInvctrlSoftwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means software trigger activates register sync
false means software trigger does not activate register sync.
static void FTM_HAL_SetOutmaskSoftwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means software trigger activates register sync
false means software trigger does not activate register sync.
static void FTM_HAL_SetModCntinCvSoftwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means software trigger activates register sync
false means software trigger does not activate register sync.
static void FTM_HAL_SetCounterSoftwareSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means software trigger activates register sync
false means software trigger does not activate register sync.
static void FTM_HAL_SetPwmSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means use Enhanced PWM synchronization
false means to use Legacy mode
static void FTM_HAL_SetSwoctrlPwmSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means SWOCTRL register is updated by PWM synch
false means SWOCTRL register is updated at all rising edges of system clock
static void FTM_HAL_SetInvctrlPwmSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means INVCTRL register is updated by PWM synch
false means INVCTRL register is updated at all rising edges of system clock
static void FTM_HAL_SetCntinPwmSyncModeCmd ( FTM_Type *  ftmBase,
bool  enable 
)
inlinestatic
Parameters
ftmBaseThe FTM base address pointer
enabletrue means CNTIN register is updated by PWM synch
false means CNTIN register is updated at all rising edges of system clock
void FTM_HAL_Reset ( FTM_Type *  ftmBase)
Parameters
ftmBaseThe FTM base address pointer
void FTM_HAL_Init ( FTM_Type *  ftmBase)
Parameters
ftmBaseThe FTM base address pointer.
void FTM_HAL_EnablePwmMode ( FTM_Type *  ftmBase,
ftm_pwm_param_t config,
uint8_t  channel 
)
Parameters
ftmBaseThe FTM base address pointer
configPWM configuration parameter
channelThe channel or channel pair number(combined mode).
void FTM_HAL_DisablePwmMode ( FTM_Type *  ftmBase,
ftm_pwm_param_t config,
uint8_t  channel 
)
Parameters
ftmBaseThe FTM base address pointer
configPWM configuration parameter
channelThe channel or channel pair number(combined mode).