S32 SDK

Detailed Description

FlexTimer Module Hardware Abstraction Level. FTM HAL provides low level APIs for reading and writing to all hardware features of the FlexTimer module.

Macros

#define FTM_RMW_SC(base, mask, value)   (((base)->SC) = ((((base)->SC) & ~(mask)) | (value)))
 FTM_SC - Read and modify and write to Status And Control (RW) More...
 
#define FTM_RMW_CNT(base, mask, value)   (((base)->CNT) = ((((base)->CNT) & ~(mask)) | (value)))
 FTM_CNT - Read and modify and write to Counter (RW) More...
 
#define FTM_RMW_MOD(base, mask, value)   (((base)->MOD) = ((((base)->MOD) & ~(mask)) | (value)))
 FTM_MOD - Read and modify and write Modulo (RW) More...
 
#define FTM_RMW_CNTIN(base, mask, value)   (((base)->CNTIN) = ((((base)->CNTIN) & ~(mask)) | (value)))
 FTM_CNTIN - Read and modify and write Counter Initial Value (RW) More...
 
#define FTM_RMW_STATUS(base, mask, value)   (((base)->STATUS) = ((((base)->STATUS) & ~(mask)) | (value)))
 FTM_STATUS - Read and modify and write Capture And Compare Status (RW) More...
 
#define FTM_RMW_MODE(base, mask, value)   (((base)->MODE) = ((((base)->MODE) & ~(mask)) | (value)))
 FTM_MODE - Read and modify and write Counter Features Mode Selection (RW) More...
 
#define FTM_RMW_CnSCV_REG(base, channel, mask, value)   (((base)->CONTROLS[channel].CnSC) = ((((base)->CONTROLS[channel].CnSC) & ~(mask)) | (value)))
 FTM_CnSCV - Read and modify and write Channel (n) Status And Control (RW) More...
 
#define FTM_RMW_DEADTIME(base, mask, value)   (((base)->DEADTIME) = ((((base)->DEADTIME) & ~(mask)) | (value)))
 FTM_DEADTIME - Read and modify and write Dead-time Insertion Control (RW) More...
 
#define FTM_RMW_EXTTRIG_REG(base, mask, value)   (((base)->EXTTRIG) = ((((base)->EXTTRIG) & ~(mask)) | (value)))
 FTM_EXTTRIG - Read and modify and write External Trigger Control (RW) More...
 
#define FTM_RMW_FLTCTRL(base, mask, value)   (((base)->FLTCTRL) = ((((base)->FLTCTRL) & ~(mask)) | (value)))
 FTM_FLTCTRL - Read and modify and write Fault Control (RW) More...
 
#define FTM_RMW_FMS(base, mask, value)   (((base)->FMS) = ((((base)->FMS) & ~(mask)) | (value)))
 FTM_FMS - Read and modify and write Fault Mode Status (RW) More...
 
#define FTM_RMW_CONF(base, mask, value)   (((base)->CONF) = ((((base)->CONF) & ~(mask)) | (value)))
 FTM_CONF - Read and modify and write Configuration (RW) More...
 
#define FTM_RMW_POL(base, mask, value)   (((base)->POL) = ((((base)->POL) & ~(mask)) | (value)))
 POL - Read and modify and write Polarity (RW) More...
 
#define FTM_RMW_FILTER(base, mask, value)   (((base)->FILTER) = ((((base)->FILTER) & ~(mask)) | (value)))
 FILTER - Read and modify and write Filter (RW) More...
 
#define FTM_RMW_SYNC(base, mask, value)   (((base)->SYNC) = ((((base)->SYNC) & ~(mask)) | (value)))
 SYNC - Read and modify and write Synchronization (RW) More...
 
#define FTM_RMW_QDCTRL(base, mask, value)   (((base)->QDCTRL) = ((((base)->QDCTRL) & ~(mask)) | (value)))
 QDCTRL - Read and modify and write Quadrature Decoder Control And Status (RW) More...
 
#define FTM_RMW_PAIR0DEADTIME(base, mask, value)   (((base)->PAIR0DEADTIME) = ((((base)->PAIR0DEADTIME) & ~(mask)) | (value)))
 FTM_PAIR0DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 0 (RW) More...
 
#define FTM_RMW_PAIR1DEADTIME(base, mask, value)   (((base)->PAIR1DEADTIME) = ((((base)->PAIR1DEADTIME) & ~(mask)) | (value)))
 FTM_PAIR1DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 1 (RW) More...
 
#define FTM_RMW_PAIR2DEADTIME(base, mask, value)   (((base)->PAIR2DEADTIME) = ((((base)->PAIR2DEADTIME) & ~(mask)) | (value)))
 FTM_PAIR2DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 2 (RW) More...
 
#define FTM_RMW_PAIR3DEADTIME(base, mask, value)   (((base)->PAIR3DEADTIME) = ((((base)->PAIR3DEADTIME) & ~(mask)) | (value)))
 FTM_PAIR3DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 3 (RW) More...
 
#define CHAN0_IDX   (0U)
 Channel number for CHAN1. More...
 
#define CHAN1_IDX   (1U)
 Channel number for CHAN2. More...
 
#define CHAN2_IDX   (2U)
 Channel number for CHAN3. More...
 
#define CHAN3_IDX   (3U)
 Channel number for CHAN4. More...
 
#define CHAN4_IDX   (4U)
 Channel number for CHAN5. More...
 
#define CHAN5_IDX   (5U)
 Channel number for CHAN6. More...
 
#define CHAN6_IDX   (6U)
 Channel number for CHAN7. More...
 
#define CHAN7_IDX   (7U)
 

Enumerations

enum  ftm_clock_source_t { FTM_CLOCK_SOURCE_NONE = 0x00U, FTM_CLOCK_SOURCE_SYSTEMCLK = 0x01U, FTM_CLOCK_SOURCE_FIXEDCLK = 0x02U, FTM_CLOCK_SOURCE_EXTERNALCLK = 0x03U }
 FlexTimer clock source selection. More...
 
enum  ftm_clock_ps_t {
  FTM_CLOCK_DIVID_BY_1 = 0x00U, FTM_CLOCK_DIVID_BY_2 = 0x01U, FTM_CLOCK_DIVID_BY_4 = 0x02U, FTM_CLOCK_DIVID_BY_8 = 0x03U,
  FTM_CLOCK_DIVID_BY_16 = 0x04U, FTM_CLOCK_DIVID_BY_32 = 0x05U, FTM_CLOCK_DIVID_BY_64 = 0x06U, FTM_CLOCK_DIVID_BY_128 = 0x07U
}
 FlexTimer pre-scaler factor selection for the clock source. In quadrature decoder mode set FTM_CLOCK_DIVID_BY_1. More...
 
enum  ftm_deadtime_ps_t { FTM_DEADTIME_DIVID_BY_1 = 0x01U, FTM_DEADTIME_DIVID_BY_4 = 0x02U, FTM_DEADTIME_DIVID_BY_16 = 0x03U }
 FlexTimer pre-scaler factor for the dead-time insertion. 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_quad_decode_mode_t { FTM_QUAD_PHASE_ENCODE = 0x00U, FTM_QUAD_COUNT_AND_DIR = 0x01U }
 FlexTimer quadrature decode modes, phase encode or count and direction mode. More...
 
enum  ftm_quad_phase_polarity_t { FTM_QUAD_PHASE_NORMAL = 0x00U, FTM_QUAD_PHASE_INVERT = 0x01U }
 FlexTimer quadrature phase polarities, normal or inverted polarity. More...
 
enum  ftm_bdm_mode_t { FTM_BDM_MODE_00 = 0x00U, FTM_BDM_MODE_01 = 0x01U, FTM_BDM_MODE_10 = 0x02U, FTM_BDM_MODE_11 = 0x03U }
 Options for the FlexTimer behavior in BDM 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_reg_update_t { FTM_SYSTEM_CLOCK = 0U, FTM_PWM_SYNC = 1U }
 FTM sync source. More...
 
enum  ftm_pwm_sync_mode_t { FTM_WAIT_LOADING_POINTS = 0U, FTM_UPDATE_NOW = 1U }
 FTM update register. More...
 

Functions

static void FTM_HAL_SetHalfCycleValue (FTM_Type *const ftmBase, uint16_t value)
 Sets the value for the half cycle reload register. More...
 
static void FTM_HAL_SetClockFilterPs (FTM_Type *const ftmBase, uint8_t filterPrescale)
 Sets the filter Pre-scaler divider. More...
 
static uint8_t FTM_HAL_GetClockFilterPs (const FTM_Type *ftmBase)
 Reads the FTM filter clock divider. More...
 
static void FTM_HAL_SetClockSource (FTM_Type *const ftmBase, ftm_clock_source_t clock)
 Sets the FTM clock source. More...
 
static uint8_t FTM_HAL_GetClockSource (const FTM_Type *ftmBase)
 Reads the FTM clock source. More...
 
static void FTM_HAL_SetClockPs (FTM_Type *const ftmBase, ftm_clock_ps_t ps)
 Sets the FTM clock divider. More...
 
static uint8_t FTM_HAL_GetClockPs (const FTM_Type *ftmBase)
 Reads the FTM clock divider. More...
 
static void FTM_HAL_SetTimerOverflowInt (FTM_Type *const ftmBase, bool state)
 Enables the FTM peripheral timer overflow interrupt. More...
 
static bool FTM_HAL_IsOverflowIntEnabled (const FTM_Type *ftmBase)
 Reads the bit that controls enabling the FTM timer overflow interrupt. More...
 
static void FTM_HAL_EnablePwmChannelOutputs (FTM_Type *const ftmBase, uint8_t channel)
 Enable PWM channel Outputs. More...
 
static void FTM_HAL_DisablePwmChannelOutputs (FTM_Type *const ftmBase, uint8_t channel)
 Disable PWM channel Outputs. More...
 
static void FTM_HAL_ClearTimerOverflow (FTM_Type *const ftmBase)
 Clears the timer overflow interrupt flag. More...
 
static bool FTM_HAL_HasTimerOverflowed (const FTM_Type *ftmBase)
 Returns the FTM peripheral timer overflow interrupt flag. More...
 
static void FTM_HAL_SetCpwms (FTM_Type *const ftmBase, bool mode)
 Sets the FTM count direction bit. More...
 
static bool FTM_HAL_GetCpwms (const FTM_Type *ftmBase)
 Gets the FTM count direction bit. More...
 
static void FTM_HAL_SetReIntEnabledCmd (FTM_Type *const ftmBase, bool enable)
 Set the FTM reload interrupt enable. More...
 
static bool FTM_HAL_GetReloadFlag (const FTM_Type *ftmBase)
 Get the state whether the FTM counter reached a reload point. More...
 
static void FTM_HAL_ClearReloadFlag (FTM_Type *const ftmBase)
 Clears the reload flag bit. More...
 
static void FTM_HAL_SetCounter (FTM_Type *const ftmBase, uint16_t value)
 Sets the FTM peripheral current counter value. More...
 
static uint16_t FTM_HAL_GetCounter (const FTM_Type *ftmBase)
 Returns the FTM peripheral current counter value. More...
 
static void FTM_HAL_SetMod (FTM_Type *const ftmBase, uint16_t value)
 Sets the FTM peripheral timer modulo value. More...
 
static uint16_t FTM_HAL_GetMod (const FTM_Type *ftmBase)
 Returns the FTM peripheral counter modulo value. More...
 
static void FTM_HAL_SetCounterInitVal (FTM_Type *const ftmBase, uint16_t value)
 Sets the FTM peripheral timer counter initial value. More...
 
static uint16_t FTM_HAL_GetCounterInitVal (const FTM_Type *ftmBase)
 Returns the FTM peripheral counter initial value. More...
 
static void FTM_HAL_SetChnMSnBAMode (FTM_Type *const ftmBase, uint8_t channel, uint8_t selection)
 Sets the FTM peripheral timer channel mode. More...
 
static void FTM_HAL_SetChnEdgeLevel (FTM_Type *const ftmBase, uint8_t channel, uint8_t level)
 Sets the FTM peripheral timer channel edge level. More...
 
static void FTM_HAL_ClearChSC (FTM_Type *const ftmBase, uint8_t channel)
 Clears the content of Channel (n) Status And Control. More...
 
static uint8_t FTM_HAL_GetChnMode (const FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel mode. More...
 
static uint8_t FTM_HAL_GetChnEdgeLevel (const FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel edge level. More...
 
static void FTM_HAL_SetChnIcrstCmd (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Configure the feature of FTM counter reset by the selected input capture event. More...
 
static bool FTM_HAL_IsChnIcrst (const FTM_Type *ftmBase, uint8_t channel)
 Returns whether the FTM FTM counter is reset. More...
 
static void FTM_HAL_SetChnDmaCmd (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Enables or disables the FTM peripheral timer channel DMA. More...
 
static bool FTM_HAL_IsChnDma (const FTM_Type *ftmBase, uint8_t channel)
 Returns whether the FTM peripheral timer channel DMA is enabled. More...
 
static bool FTM_HAL_IsChnIntEnabled (const FTM_Type *ftmBase, uint8_t channel)
 Get FTM channel(n) interrupt enabled or not. More...
 
static void FTM_HAL_EnableChnInt (FTM_Type *const ftmBase, uint8_t channel)
 Enables the FTM peripheral timer channel(n) interrupt. More...
 
static void FTM_HAL_DisableChnInt (FTM_Type *const ftmBase, uint8_t channel)
 Disables the FTM peripheral timer channel(n) interrupt. More...
 
static bool FTM_HAL_HasChnEventOccurred (const 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 *const ftmBase, uint8_t channel)
 Clear the channel flag by writing a 0 to the CHF bit. More...
 
static void FTM_HAL_SetTrigModeControlCmd (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Enables or disables the trigger generation on FTM channel outputs. More...
 
static bool FTM_HAL_GetTriggerControled (const FTM_Type *ftmBase, uint8_t channel)
 Returns whether the trigger mode is enabled. More...
 
static bool FTM_HAL_GetChInputState (const FTM_Type *ftmBase, uint8_t channel)
 Get the state of channel input. More...
 
static bool FTM_HAL_GetChOutputValue (const FTM_Type *ftmBase, uint8_t channel)
 Get the value of channel output. More...
 
static void FTM_HAL_SetChnCountVal (FTM_Type *const ftmBase, uint8_t channel, uint16_t value)
 Sets the FTM peripheral timer channel counter value. More...
 
static uint16_t FTM_HAL_GetChnCountVal (const FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel counter value. More...
 
static bool FTM_HAL_GetChnEventStatus (const FTM_Type *ftmBase, uint8_t channel)
 Gets the FTM peripheral timer channel event status. More...
 
static uint32_t FTM_HAL_GetEventStatus (const FTM_Type *ftmBase)
 Gets the FTM peripheral timer status info for all channels. More...
 
static void FTM_HAL_ClearChnEventStatus (FTM_Type *const ftmBase, uint8_t channel)
 Clears the FTM peripheral timer all channel event status. More...
 
static void FTM_HAL_SetOutmaskReg (FTM_Type *const ftmBase, uint32_t regVal)
 Writes the provided value to the OUTMASK register. More...
 
static void FTM_HAL_SetChnOutputMask (FTM_Type *const ftmBase, uint8_t channel, bool mask)
 Sets the FTM peripheral timer channel output mask. More...
 
static void FTM_HAL_SetChnOutputInitStateCmd (FTM_Type *const ftmBase, uint8_t channel, bool state)
 Sets the FTM peripheral timer channel output initial state 0 or 1. More...
 
static void FTM_HAL_SetChnOutputPolarityCmd (FTM_Type *const ftmBase, uint8_t channel, ftm_polarity_t polarity)
 Sets the FTM peripheral timer channel output polarity. More...
 
static void FTM_HAL_SetChnFaultInputPolarityCmd (FTM_Type *const ftmBase, uint8_t fltChannel, ftm_polarity_t polarity)
 Sets the FTM peripheral timer channel fault input polarity. More...
 
static void FTM_HAL_SetFaultInt (FTM_Type *const ftmBase, bool state)
 Enables/disables the FTM peripheral timer fault interrupt. More...
 
static void FTM_HAL_DisableFaultInt (FTM_Type *const ftmBase)
 Disables the FTM peripheral timer fault interrupt. More...
 
static bool FTM_HAL_IsFaultIntEnabled (const FTM_Type *ftmBase)
 Return true/false whether the Fault interrupt was enabled or not. More...
 
static void FTM_HAL_ClearFaultsIsr (FTM_Type *const ftmBase)
 Clears all fault interrupt flags that are active. More...
 
static void FTM_HAL_SetFaultControlMode (FTM_Type *const ftmBase, ftm_fault_mode_t mode)
 Defines the FTM fault control mode. More...
 
static void FTM_HAL_SetCaptureTestCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the FTM peripheral timer capture test mode. More...
 
static void FTM_HAL_SetWriteProtectionCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the FTM write protection. More...
 
static void FTM_HAL_Enable (FTM_Type *const ftmBase, bool enable)
 Enables the FTM peripheral timer group. More...
 
static bool FTM_HAL_IsFtmEnable (const FTM_Type *ftmBase)
 Get status of the FTMEN bit in the FTM_MODE register. More...
 
static void FTM_HAL_SetInitChnOutputCmd (FTM_Type *const ftmBase, bool enable)
 Initializes the channels output. More...
 
static void FTM_HAL_SetPwmSyncMode (FTM_Type *const ftmBase, bool enable)
 Sets the FTM peripheral timer sync mode. More...
 
static void FTM_HAL_SetSoftwareTriggerCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the FTM peripheral timer software trigger. More...
 
static void FTM_HAL_SetHardwareSyncTriggerSrc (FTM_Type *const ftmBase, uint8_t trigger_num, bool enable)
 Sets the FTM hardware synchronization trigger. More...
 
static void FTM_HAL_SetOutmaskPwmSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Determines when the OUTMASK register is updated with the value of its buffer. More...
 
static void FTM_HAL_SetCountReinitSyncCmd (FTM_Type *const 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 *const ftmBase, bool enable)
 Enables or disables the FTM peripheral timer maximum loading points. More...
 
static void FTM_HAL_SetMinLoadingCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the FTM peripheral timer minimum loading points. More...
 
static void FTM_HAL_SetDualChnMofCombineCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables the FTM peripheral timer channel modified combine mode. More...
 
static void FTM_HAL_SetDualChnFaultCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables the FTM peripheral timer channel pair fault control. More...
 
static void FTM_HAL_SetDualChnPwmSyncCmd (FTM_Type *const 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 *const 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 *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel dual edge capture. More...
 
static void FTM_HAL_SetDualEdgeCaptureCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables the FTM peripheral timer dual edge capture mode. More...
 
static bool FTM_HAL_GetDualEdgeCaptureBit (const FTM_Type *ftmBase, uint8_t chnlPairNum)
 Enables the FTM peripheral timer dual edge capture mode. More...
 
static void FTM_HAL_SetDualChnCompCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, ftm_second_channel_polarity_t polarity)
 Enables or disables the FTM peripheral timer channel pair output complement mode. More...
 
static void FTM_HAL_SetDualChnCombineCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the FTM peripheral timer channel pair output combine mode. More...
 
static bool FTM_HAL_GetDualChnCombineCmd (const FTM_Type *ftmBase, uint8_t chnlPairNum)
 Verify if an channels pair is used in combine mode or not. More...
 
static bool FTM_HAL_GetDualChnMofCombineCmd (const FTM_Type *ftmBase, uint8_t chnlPairNum)
 Verify if an channels pair is used in the modified combine mode or not. More...
 
static void FTM_HAL_SetExtDeadtimeValue (FTM_Type *const ftmBase, uint8_t value)
 Sets the FTM extended dead-time value. More...
 
static void FTM_HAL_SetDeadtimePrescale (FTM_Type *const ftmBase, ftm_deadtime_ps_t divider)
 Sets the FTM dead time divider. More...
 
static void FTM_HAL_SetDeadtimeCount (FTM_Type *const ftmBase, uint8_t count)
 Sets the FTM deadtime value. More...
 
static void FTM_HAL_SetInitTriggerCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the generation of the trigger when the FTM counter is equal to the CNTIN register. More...
 
static bool FTM_HAL_IsChnTriggerGenerated (const FTM_Type *ftmBase)
 Checks whether any channel trigger event has occurred. More...
 
static void FTM_HAL_ClearChnTriggerFlag (FTM_Type *const ftmBase)
 Clear the channel trigger flag. More...
 
static bool FTM_HAL_GetDetectedFaultInput (const FTM_Type *ftmBase)
 Gets the FTM detected fault input. More...
 
static bool FTM_HAL_IsWriteProtectionEnabled (const FTM_Type *ftmBase)
 Checks whether the write protection is enabled. More...
 
static bool FTM_HAL_IsFaultInputEnabled (const FTM_Type *ftmBase)
 Checks whether the logic OR of the fault inputs is enabled. More...
 
static bool FTM_HAL_IsFaultFlagDetected (const FTM_Type *ftmBase, uint8_t channel)
 Checks whether a fault condition is detected at the fault input. More...
 
static void FTM_HAL_ClearFaultFlagDetected (FTM_Type *const ftmBase, uint8_t channel)
 Clear a fault condition is detected at the fault input. More...
 
static void FTM_HAL_SetQuadDecoderCmd (FTM_Type *const ftmBase, bool enable)
 Enables the channel quadrature decoder. More...
 
static void FTM_HAL_SetQuadPhaseAFilterCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the phase A input filter. More...
 
static void FTM_HAL_SetQuadPhaseBFilterCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the phase B input filter. More...
 
static void FTM_HAL_SetQuadPhaseAPolarity (FTM_Type *const ftmBase, ftm_quad_phase_polarity_t mode)
 Selects polarity for the quadrature decode phase A input. More...
 
static void FTM_HAL_SetQuadPhaseBPolarity (FTM_Type *const ftmBase, ftm_quad_phase_polarity_t mode)
 Selects polarity for the quadrature decode phase B input. More...
 
static void FTM_HAL_SetQuadMode (FTM_Type *const ftmBase, ftm_quad_decode_mode_t quadMode)
 Sets the encoding mode used in quadrature decoding mode. More...
 
static bool FTM_HAL_GetQuadDir (const FTM_Type *ftmBase)
 Gets the FTM counter direction in quadrature mode. More...
 
static bool FTM_HAL_GetQuadTimerOverflowDir (const FTM_Type *ftmBase)
 Gets the Timer overflow direction in quadrature mode. More...
 
static void FTM_HAL_SetFaultInputFilterVal (FTM_Type *const ftmBase, uint32_t value)
 Sets the fault input filter value. More...
 
static void FTM_HAL_SetFaultInputFilterCmd (FTM_Type *const ftmBase, uint8_t inputNum, bool enable)
 Enables or disables the fault input filter. More...
 
static void FTM_HAL_ClearFaultControl (FTM_Type *const ftmBase)
 Clears the entire content value of the Fault control register. More...
 
static void FTM_HAL_SetFaultInputCmd (FTM_Type *const ftmBase, uint8_t inputNum, bool enable)
 Enables or disables the fault input. More...
 
static void FTM_HAL_SetPwmFaultBehavior (FTM_Type *const ftmBase, bool enable)
 Configures the behavior of the PWM outputs when a fault is detected. More...
 
static void FTM_HAL_SetDualChnInvertCmd (FTM_Type *const ftmBase, uint8_t chnlPairNum, bool enable)
 Enables or disables the channel invert for a channel pair. More...
 
static void FTM_HAL_SetInvctrlReg (FTM_Type *const ftmBase, uint32_t regVal)
 Writes the provided value to the Inverting control register. More...
 
static void FTM_HAL_SetChnSoftwareCtrlCmd (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Enables or disables the channel software output control. More...
 
static void FTM_HAL_SetAllChnSoftwareCtrlCmd (FTM_Type *const ftmBase, uint8_t channelsMask)
 Enables or disables the channel software output control.The main difference between this function and FTM_HAL_SetChnSoftwareCtrlCmd is that this can configure all the channels in the same time. More...
 
static void FTM_HAL_SetChnSoftwareCtrlVal (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Sets the channel software output control value. More...
 
static void FTM_HAL_SetAllChnSoftwareCtrlVal (FTM_Type *const ftmBase, uint8_t channelsValues)
 Sets the channel software output control value. More...
 
static void FTM_HAL_SetGlobalLoadCmd (FTM_Type *const ftmBase)
 Set the global load mechanism. More...
 
static void FTM_HAL_SetLoadCmd (FTM_Type *const ftmBase, bool enable)
 Enable the global load. More...
 
static void FTM_HAL_SetHalfCycleCmd (FTM_Type *const ftmBase, bool enable)
 Enable the half cycle reload. More...
 
static void FTM_HAL_SetPwmLoadCmd (FTM_Type *const 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 *const ftmBase, uint8_t channel, bool enable)
 Includes or excludes the channel in the matching process. More...
 
static void FTM_HAL_SetInitTrigOnReloadCmd (FTM_Type *const ftmBase, bool enable)
 Enables or disables the FTM initialization trigger on Reload Point. More...
 
static void FTM_HAL_SetGlobalTimeBaseOutputCmd (FTM_Type *const 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 *const ftmBase, bool enable)
 Enables or disables the FTM timer global time base. More...
 
static void FTM_HAL_SetBdmMode (FTM_Type *const ftmBase, ftm_bdm_mode_t val)
 Sets the BDM mode. More...
 
static void FTM_HAL_SetLoadFreq (FTM_Type *const ftmBase, uint8_t val)
 Sets the FTM timer TOF Frequency. More...
 
static void FTM_HAL_SetSwoctrlHardwareSyncModeCmd (FTM_Type *const 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 *const ftmBase, bool enable)
 Sets sync mode for FTM INVCTRL register when using a hardware trigger. More...
 
static void FTM_HAL_SetOutmaskHardwareSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets sync mode for FTM OUTMASK register when using a hardware trigger. More...
 
static void FTM_HAL_SetModCntinCvHardwareSyncModeCmd (FTM_Type *const 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 *const ftmBase, bool enable)
 Sets sync mode for FTM counter register when using a hardware trigger. More...
 
static void FTM_HAL_SetSwoctrlSoftwareSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets sync mode for FTM SWOCTRL register when using a software trigger. More...
 
static void FTM_HAL_SetInvctrlSoftwareSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets sync mode for FTM INVCTRL register when using a software trigger. More...
 
static void FTM_HAL_SetOutmaskSoftwareSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets sync mode for FTM OUTMASK register when using a software trigger. More...
 
static void FTM_HAL_SetModCntinCvSoftwareSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets sync mode for FTM MOD, CNTIN and CV registers when using a software trigger. More...
 
static void FTM_HAL_SetHwTriggerSyncModeCmd (FTM_Type *const ftmBase, bool enable)
 Sets hardware trigger mode. More...
 
static void FTM_HAL_SetCounterSoftwareSyncModeCmd (FTM_Type *const ftmBase, ftm_pwm_sync_mode_t update_mode)
 Sets sync mode for FTM counter register when using a software trigger. More...
 
static void FTM_HAL_SetPwmSyncModeCmd (FTM_Type *const ftmBase, bool mode)
 Sets the PWM synchronization mode to enhanced or legacy. More...
 
static void FTM_HAL_SetSwoctrlPwmSyncModeCmd (FTM_Type *const ftmBase, ftm_reg_update_t mode)
 Sets the SWOCTRL register PWM synchronization mode. More...
 
static void FTM_HAL_SetInvctrlPwmSyncModeCmd (FTM_Type *const ftmBase, ftm_reg_update_t mode)
 Sets the INVCTRL register PWM synchronization mode. More...
 
static void FTM_HAL_SetCntinPwmSyncModeCmd (FTM_Type *const ftmBase, ftm_reg_update_t mode)
 Sets the CNTIN register PWM synchronization mode. More...
 
static void FTM_HAL_SetExtPairDeadtimeValue (FTM_Type *const ftmBase, uint8_t channelPair, uint8_t value)
 Sets the FTM extended dead-time value for the channel pair. More...
 
static void FTM_HAL_SetPairDeadtimePrescale (FTM_Type *const ftmBase, uint8_t channelPair, ftm_deadtime_ps_t divider)
 Sets the FTM dead time divider for the channel pair. More...
 
static void FTM_HAL_SetPairDeadtimeCount (FTM_Type *const ftmBase, uint8_t channelPair, uint8_t count)
 Sets the FTM dead-time value for the channel pair. More...
 
void FTM_HAL_Reset (FTM_Type *const ftmBase)
 Resets the FTM registers. All the register use in the driver should be reset to default value of each register. More...
 
void FTM_HAL_Init (FTM_Type *const ftmBase, ftm_clock_ps_t ftmClockPrescaler)
 Initializes the FTM. This function will enable the flexTimer module and selects one pre-scale factor for the FTM clock source. More...
 
void FTM_HAL_SetChnTriggerCmd (FTM_Type *const ftmBase, uint8_t channel, bool enable)
 Enables or disables the generation of the FTM peripheral timer channel trigger when the FTM counter is equal to its initial value. More...
 
void FTM_HAL_SetChnInputCaptureFilter (FTM_Type *const ftmBase, uint8_t channel, uint8_t value)
 Sets the FTM peripheral timer channel input capture filter value. More...
 

FTM instance number

#define FTM0_IDX   (0U)
 Instance number for FTM0. More...
 
#define FTM1_IDX   (1U)
 Instance number for FTM2. More...
 
#define FTM2_IDX   (2U)
 Instance number for FTM3. More...
 
#define FTM3_IDX   (3U)
 

Macro Definition Documentation

#define CHAN0_IDX   (0U)

Channel number for CHAN1.

Definition at line 229 of file ftm_hal.h.

#define CHAN1_IDX   (1U)

Channel number for CHAN2.

Definition at line 231 of file ftm_hal.h.

#define CHAN2_IDX   (2U)

Channel number for CHAN3.

Definition at line 233 of file ftm_hal.h.

#define CHAN3_IDX   (3U)

Channel number for CHAN4.

Definition at line 235 of file ftm_hal.h.

#define CHAN4_IDX   (4U)

Channel number for CHAN5.

Definition at line 237 of file ftm_hal.h.

#define CHAN5_IDX   (5U)

Channel number for CHAN6.

Definition at line 239 of file ftm_hal.h.

#define CHAN6_IDX   (6U)

Channel number for CHAN7.

Definition at line 241 of file ftm_hal.h.

#define CHAN7_IDX   (7U)

Definition at line 243 of file ftm_hal.h.

#define FTM0_IDX   (0U)

Instance number for FTM0.

<Instance number for FTM1.

Definition at line 118 of file ftm_hal.h.

#define FTM1_IDX   (1U)

Instance number for FTM2.

Definition at line 120 of file ftm_hal.h.

#define FTM2_IDX   (2U)

Instance number for FTM3.

Definition at line 122 of file ftm_hal.h.

#define FTM3_IDX   (3U)

Definition at line 124 of file ftm_hal.h.

#define FTM_RMW_CnSCV_REG (   base,
  channel,
  mask,
  value 
)    (((base)->CONTROLS[channel].CnSC) = ((((base)->CONTROLS[channel].CnSC) & ~(mask)) | (value)))

FTM_CnSCV - Read and modify and write Channel (n) Status And Control (RW)

Definition at line 160 of file ftm_hal.h.

#define FTM_RMW_CNT (   base,
  mask,
  value 
)    (((base)->CNT) = ((((base)->CNT) & ~(mask)) | (value)))

FTM_CNT - Read and modify and write to Counter (RW)

Definition at line 135 of file ftm_hal.h.

#define FTM_RMW_CNTIN (   base,
  mask,
  value 
)    (((base)->CNTIN) = ((((base)->CNTIN) & ~(mask)) | (value)))

FTM_CNTIN - Read and modify and write Counter Initial Value (RW)

Definition at line 145 of file ftm_hal.h.

#define FTM_RMW_CONF (   base,
  mask,
  value 
)    (((base)->CONF) = ((((base)->CONF) & ~(mask)) | (value)))

FTM_CONF - Read and modify and write Configuration (RW)

Definition at line 184 of file ftm_hal.h.

#define FTM_RMW_DEADTIME (   base,
  mask,
  value 
)    (((base)->DEADTIME) = ((((base)->DEADTIME) & ~(mask)) | (value)))

FTM_DEADTIME - Read and modify and write Dead-time Insertion Control (RW)

Definition at line 165 of file ftm_hal.h.

#define FTM_RMW_EXTTRIG_REG (   base,
  mask,
  value 
)    (((base)->EXTTRIG) = ((((base)->EXTTRIG) & ~(mask)) | (value)))

FTM_EXTTRIG - Read and modify and write External Trigger Control (RW)

Definition at line 169 of file ftm_hal.h.

#define FTM_RMW_FILTER (   base,
  mask,
  value 
)    (((base)->FILTER) = ((((base)->FILTER) & ~(mask)) | (value)))

FILTER - Read and modify and write Filter (RW)

Definition at line 194 of file ftm_hal.h.

#define FTM_RMW_FLTCTRL (   base,
  mask,
  value 
)    (((base)->FLTCTRL) = ((((base)->FLTCTRL) & ~(mask)) | (value)))

FTM_FLTCTRL - Read and modify and write Fault Control (RW)

Definition at line 174 of file ftm_hal.h.

#define FTM_RMW_FMS (   base,
  mask,
  value 
)    (((base)->FMS) = ((((base)->FMS) & ~(mask)) | (value)))

FTM_FMS - Read and modify and write Fault Mode Status (RW)

Definition at line 179 of file ftm_hal.h.

#define FTM_RMW_MOD (   base,
  mask,
  value 
)    (((base)->MOD) = ((((base)->MOD) & ~(mask)) | (value)))

FTM_MOD - Read and modify and write Modulo (RW)

Definition at line 140 of file ftm_hal.h.

#define FTM_RMW_MODE (   base,
  mask,
  value 
)    (((base)->MODE) = ((((base)->MODE) & ~(mask)) | (value)))

FTM_MODE - Read and modify and write Counter Features Mode Selection (RW)

Definition at line 155 of file ftm_hal.h.

#define FTM_RMW_PAIR0DEADTIME (   base,
  mask,
  value 
)    (((base)->PAIR0DEADTIME) = ((((base)->PAIR0DEADTIME) & ~(mask)) | (value)))

FTM_PAIR0DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 0 (RW)

Definition at line 209 of file ftm_hal.h.

#define FTM_RMW_PAIR1DEADTIME (   base,
  mask,
  value 
)    (((base)->PAIR1DEADTIME) = ((((base)->PAIR1DEADTIME) & ~(mask)) | (value)))

FTM_PAIR1DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 1 (RW)

Definition at line 214 of file ftm_hal.h.

#define FTM_RMW_PAIR2DEADTIME (   base,
  mask,
  value 
)    (((base)->PAIR2DEADTIME) = ((((base)->PAIR2DEADTIME) & ~(mask)) | (value)))

FTM_PAIR2DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 2 (RW)

Definition at line 219 of file ftm_hal.h.

#define FTM_RMW_PAIR3DEADTIME (   base,
  mask,
  value 
)    (((base)->PAIR3DEADTIME) = ((((base)->PAIR3DEADTIME) & ~(mask)) | (value)))

FTM_PAIR3DEADTIME - Read and modify and write Dead-time Insertion Control for the pair 3 (RW)

Channel number for CHAN0.

Definition at line 224 of file ftm_hal.h.

#define FTM_RMW_POL (   base,
  mask,
  value 
)    (((base)->POL) = ((((base)->POL) & ~(mask)) | (value)))

POL - Read and modify and write Polarity (RW)

Definition at line 189 of file ftm_hal.h.

#define FTM_RMW_QDCTRL (   base,
  mask,
  value 
)    (((base)->QDCTRL) = ((((base)->QDCTRL) & ~(mask)) | (value)))

QDCTRL - Read and modify and write Quadrature Decoder Control And Status (RW)

Definition at line 204 of file ftm_hal.h.

#define FTM_RMW_SC (   base,
  mask,
  value 
)    (((base)->SC) = ((((base)->SC) & ~(mask)) | (value)))

FTM_SC - Read and modify and write to Status And Control (RW)

Definition at line 130 of file ftm_hal.h.

#define FTM_RMW_STATUS (   base,
  mask,
  value 
)    (((base)->STATUS) = ((((base)->STATUS) & ~(mask)) | (value)))

FTM_STATUS - Read and modify and write Capture And Compare Status (RW)

Definition at line 150 of file ftm_hal.h.

#define FTM_RMW_SYNC (   base,
  mask,
  value 
)    (((base)->SYNC) = ((((base)->SYNC) & ~(mask)) | (value)))

SYNC - Read and modify and write Synchronization (RW)

Definition at line 199 of file ftm_hal.h.

Enumeration Type Documentation

Options for the FlexTimer behavior in BDM Mode.

Implements : ftm_bdm_mode_t_Class

Enumerator
FTM_BDM_MODE_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

FTM_BDM_MODE_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

FTM_BDM_MODE_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

FTM_BDM_MODE_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

Definition at line 345 of file ftm_hal.h.

FlexTimer pre-scaler factor selection for the clock source. In quadrature decoder mode set FTM_CLOCK_DIVID_BY_1.

Implements : ftm_clock_ps_t_Class

Enumerator
FTM_CLOCK_DIVID_BY_1 

Divide by 1

FTM_CLOCK_DIVID_BY_2 

Divide by 2

FTM_CLOCK_DIVID_BY_4 

Divide by 4

FTM_CLOCK_DIVID_BY_8 

Divide by 8

FTM_CLOCK_DIVID_BY_16 

Divide by 16

FTM_CLOCK_DIVID_BY_32 

Divide by 32

FTM_CLOCK_DIVID_BY_64 

Divide by 64

FTM_CLOCK_DIVID_BY_128 

Divide by 128

Definition at line 268 of file ftm_hal.h.

FlexTimer clock source selection.

Implements : ftm_clock_source_t_Class

Enumerator
FTM_CLOCK_SOURCE_NONE 

None use clock for FTM

FTM_CLOCK_SOURCE_SYSTEMCLK 

System clock

FTM_CLOCK_SOURCE_FIXEDCLK 

Fixed clock

FTM_CLOCK_SOURCE_EXTERNALCLK 

External clock

Definition at line 254 of file ftm_hal.h.

FlexTimer pre-scaler factor for the dead-time insertion.

Implements : ftm_deadtime_ps_t_Class

Enumerator
FTM_DEADTIME_DIVID_BY_1 

Divide by 1

FTM_DEADTIME_DIVID_BY_4 

Divide by 4

FTM_DEADTIME_DIVID_BY_16 

Divide by 16

Definition at line 285 of file ftm_hal.h.

FlexTimer fault control.

Implements : ftm_fault_mode_t_Class

Enumerator
FTM_FAULT_CONTROL_DISABLED 

Fault control is disabled for all channels

FTM_FAULT_CONTROL_MAN_EVEN 

Fault control is enabled for even channels only (channels 0, 2, 4, and 6), and the selected mode is the manual fault clearing

FTM_FAULT_CONTROL_MAN_ALL 

Fault control is enabled for all channels, and the selected mode is the manual fault clearing

FTM_FAULT_CONTROL_AUTO_ALL 

Fault control is enabled for all channels, and the selected mode is the automatic fault clearing

Definition at line 366 of file ftm_hal.h.

FlexTimer PWM output pulse mode, high-true or low-true on match up.

Implements : ftm_polarity_t_Class

Enumerator
FTM_POLARITY_LOW 

When counter > CnV output signal is LOW

FTM_POLARITY_HIGH 

When counter > CnV output signal is HIGH

Definition at line 297 of file ftm_hal.h.

FTM update register.

Implements : ftm_pwm_sync_mode_t_Class

Enumerator
FTM_WAIT_LOADING_POINTS 

FTM register is updated at first loading point

FTM_UPDATE_NOW 

FTM register is updated immediately

Definition at line 396 of file ftm_hal.h.

FlexTimer quadrature decode modes, phase encode or count and direction mode.

Implements : ftm_quad_decode_mode_t_Class

Enumerator
FTM_QUAD_PHASE_ENCODE 

Phase encoding mode

FTM_QUAD_COUNT_AND_DIR 

Counter and direction encoding mode

Definition at line 321 of file ftm_hal.h.

FlexTimer quadrature phase polarities, normal or inverted polarity.

Implements : ftm_quad_phase_polarity_t_Class

Enumerator
FTM_QUAD_PHASE_NORMAL 

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

FTM_QUAD_PHASE_INVERT 

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

Definition at line 332 of file ftm_hal.h.

FTM sync source.

Implements : ftm_reg_update_t_Class

Enumerator
FTM_SYSTEM_CLOCK 

Register is updated with its buffer value at all rising edges of system clock

FTM_PWM_SYNC 

Register is updated with its buffer value at the FTM synchronization

Definition at line 383 of file ftm_hal.h.

FlexTimer PWM channel (n+1) polarity for combine mode.

Implements : ftm_second_channel_polarity_t_Class

Enumerator
FTM_MAIN_INVERTED 

The channel (n+1) output is the inverse of the channel (n) output

FTM_MAIN_DUPLICATED 

The channel (n+1) output is the same as the channel (n) output

Definition at line 308 of file ftm_hal.h.

Function Documentation

static void FTM_HAL_ClearChnEventFlag ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Clear the channel flag by writing a 0 to the CHF bit.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_ClearChnEventFlag_Activity

Definition at line 1037 of file ftm_hal.h.

static void FTM_HAL_ClearChnEventStatus ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Clears the FTM peripheral timer all channel event status.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_ClearChnEventStatus_Activity

Definition at line 1206 of file ftm_hal.h.

static void FTM_HAL_ClearChnTriggerFlag ( FTM_Type *const  ftmBase)
inlinestatic

Clear the channel trigger flag.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_ClearChnTriggerFlag_Activity

Definition at line 2001 of file ftm_hal.h.

static void FTM_HAL_ClearChSC ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Clears the content of Channel (n) Status And Control.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_ClearChSC_Activity

Definition at line 824 of file ftm_hal.h.

static void FTM_HAL_ClearFaultControl ( FTM_Type *const  ftmBase)
inlinestatic

Clears the entire content value of the Fault control register.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_ClearFaultControl_Activity

Definition at line 2295 of file ftm_hal.h.

static void FTM_HAL_ClearFaultFlagDetected ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Clear a fault condition is detected at the fault input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel

Implements : FTM_HAL_ClearFaultFlagDetected_Activity

Definition at line 2085 of file ftm_hal.h.

static void FTM_HAL_ClearFaultsIsr ( FTM_Type *const  ftmBase)
inlinestatic

Clears all fault interrupt flags that are active.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_ClearFaultsIsr_Activity

Definition at line 1389 of file ftm_hal.h.

static void FTM_HAL_ClearReloadFlag ( FTM_Type *const  ftmBase)
inlinestatic

Clears the reload flag bit.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_ClearReloadFlag_Activity

Definition at line 679 of file ftm_hal.h.

static void FTM_HAL_ClearTimerOverflow ( FTM_Type *const  ftmBase)
inlinestatic

Clears the timer overflow interrupt flag.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_ClearTimerOverflow_Activity

Definition at line 584 of file ftm_hal.h.

static void FTM_HAL_DisableChnInt ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Disables the FTM peripheral timer channel(n) interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_DisableChnInt_Activity

Definition at line 1001 of file ftm_hal.h.

static void FTM_HAL_DisableFaultInt ( FTM_Type *const  ftmBase)
inlinestatic

Disables the FTM peripheral timer fault interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_DisableFaultInt_Activity

Definition at line 1365 of file ftm_hal.h.

static void FTM_HAL_DisablePwmChannelOutputs ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Disable PWM channel Outputs.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM channel

Implements : FTM_HAL_DisablePwmChannelOutputs_Activity

Definition at line 569 of file ftm_hal.h.

static void FTM_HAL_Enable ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables the FTM peripheral timer group.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableFTM mode selection
  • true : All registers including FTM-specific registers are available
  • false: Only the TPM-compatible registers are available

Implements : FTM_HAL_Enable_Activity

Definition at line 1468 of file ftm_hal.h.

static void FTM_HAL_EnableChnInt ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Enables the FTM peripheral timer channel(n) interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_EnableChnInt_Activity

Definition at line 985 of file ftm_hal.h.

static void FTM_HAL_EnablePwmChannelOutputs ( FTM_Type *const  ftmBase,
uint8_t  channel 
)
inlinestatic

Enable PWM channel Outputs.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM channel

Implements : FTM_HAL_EnablePwmChannelOutputs_Activity

Definition at line 555 of file ftm_hal.h.

static bool FTM_HAL_GetChInputState ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Get the state of channel input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
State of the channel inputs
  • true : The channel input is one
  • false: The channel input is zero

Implements : FTM_HAL_GetChInputState_Activity

Definition at line 1100 of file ftm_hal.h.

static uint16_t FTM_HAL_GetChnCountVal ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Gets the FTM peripheral timer channel counter value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
Channel counter value

Implements : FTM_HAL_GetChnCountVal_Activity

Definition at line 1156 of file ftm_hal.h.

static uint8_t FTM_HAL_GetChnEdgeLevel ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Gets the FTM peripheral timer channel edge level.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
The ELSnB:ELSnA mode value, will be 00, 01, 10, 11

Implements : FTM_HAL_GetChnEdgeLevel_Activity

Definition at line 869 of file ftm_hal.h.

static bool FTM_HAL_GetChnEventStatus ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Gets the FTM peripheral timer channel event status.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
Channel event status
  • true : A channel event has occurred
  • false : No channel event has occurred

Implements : FTM_HAL_GetChnEventStatus_Activity

Definition at line 1176 of file ftm_hal.h.

static uint8_t FTM_HAL_GetChnMode ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Gets the FTM peripheral timer channel mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
The MSnB:MSnA mode value, will be 00, 01, 10, 11

Implements : FTM_HAL_GetChnMode_Activity

Definition at line 846 of file ftm_hal.h.

static bool FTM_HAL_GetChOutputValue ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Get the value of channel output.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
Value of the channel outputs
  • true : The channel output is one
  • false: The channel output is zero

Implements : FTM_HAL_GetChOutputValue_Activity

Definition at line 1119 of file ftm_hal.h.

static uint8_t FTM_HAL_GetClockFilterPs ( const FTM_Type ftmBase)
inlinestatic

Reads the FTM filter clock divider.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The FTM filter clock pre-scale divider

Implements : FTM_HAL_GetClockFilterPs_Activity

Definition at line 447 of file ftm_hal.h.

static uint8_t FTM_HAL_GetClockPs ( const FTM_Type ftmBase)
inlinestatic

Reads the FTM clock divider.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The FTM clock pre-scale divider

Implements : FTM_HAL_GetClockPs_Activity

Definition at line 511 of file ftm_hal.h.

static uint8_t FTM_HAL_GetClockSource ( const FTM_Type ftmBase)
inlinestatic

Reads the FTM clock source.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The FTM clock source selection
  • 00: No clock
  • 01: system clock
  • 10: fixed clock
  • 11: External clock

Implements : FTM_HAL_GetClockSource_Activity

Definition at line 483 of file ftm_hal.h.

static uint16_t FTM_HAL_GetCounter ( const FTM_Type ftmBase)
inlinestatic

Returns the FTM peripheral current counter value.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The current FTM timer counter value

Implements : FTM_HAL_GetCounter_Activity

Definition at line 711 of file ftm_hal.h.

static uint16_t FTM_HAL_GetCounterInitVal ( const FTM_Type ftmBase)
inlinestatic

Returns the FTM peripheral counter initial value.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
FTM timer counter initial value

Implements : FTM_HAL_GetCounterInitVal_Activity

Definition at line 767 of file ftm_hal.h.

static bool FTM_HAL_GetCpwms ( const FTM_Type ftmBase)
inlinestatic

Gets the FTM count direction bit.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The Center-Aligned PWM selection
  • 1U: Up counting mode
  • 0U: Up down counting mode

Implements : FTM_HAL_GetCpwms_Activity

Definition at line 636 of file ftm_hal.h.

static bool FTM_HAL_GetDetectedFaultInput ( const FTM_Type ftmBase)
inlinestatic

Gets the FTM detected fault input.

This function reads the status for all fault inputs

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The fault byte
  • 0 : No fault condition was detected.
  • 1 : A fault condition was detected.

Implements : FTM_HAL_GetDetectedFaultInput_Activity

Definition at line 2020 of file ftm_hal.h.

static bool FTM_HAL_GetDualChnCombineCmd ( const FTM_Type ftmBase,
uint8_t  chnlPairNum 
)
inlinestatic

Verify if an channels pair is used in combine mode or not.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
Returns
Channel pair output combine mode status
  • true : Channels pair are combined
  • false: Channels pair are independent

Implements : FTM_HAL_GetDualChnCombineCmd_Activity

Definition at line 1881 of file ftm_hal.h.

static bool FTM_HAL_GetDualChnMofCombineCmd ( const FTM_Type ftmBase,
uint8_t  chnlPairNum 
)
inlinestatic

Verify if an channels pair is used in the modified combine mode or not.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
Returns
Channel pair output combine mode status
  • true : Channels pair are combined
  • false: Channels pair are independent

Implements : FTM_HAL_GetDualChnMofCombineCmd_Activity

Definition at line 1901 of file ftm_hal.h.

static bool FTM_HAL_GetDualEdgeCaptureBit ( const FTM_Type ftmBase,
uint8_t  chnlPairNum 
)
inlinestatic

Enables the FTM peripheral timer dual edge capture mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
Returns
Dual edge capture mode status
  • true : To enable dual edge capture
  • false: To disable

Implements : FTM_HAL_GetDualEdgeCaptureBit_Activity

Definition at line 1807 of file ftm_hal.h.

static uint32_t FTM_HAL_GetEventStatus ( const FTM_Type ftmBase)
inlinestatic

Gets the FTM peripheral timer status info for all channels.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
Channel event status value

Implements : FTM_HAL_GetEventStatus_Activity

Definition at line 1193 of file ftm_hal.h.

static uint16_t FTM_HAL_GetMod ( const FTM_Type ftmBase)
inlinestatic

Returns the FTM peripheral counter modulo value.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
FTM timer modulo value

Implements : FTM_HAL_GetMod_Activity

Definition at line 739 of file ftm_hal.h.

static bool FTM_HAL_GetQuadDir ( const FTM_Type ftmBase)
inlinestatic

Gets the FTM counter direction in quadrature mode.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The counting direction
  • 1U: if counting direction is increasing
  • 0U: if counting direction is decreasing

Implements : FTM_HAL_GetQuadDir_Activity

Definition at line 2226 of file ftm_hal.h.

static bool FTM_HAL_GetQuadTimerOverflowDir ( const FTM_Type ftmBase)
inlinestatic

Gets the Timer overflow direction in quadrature mode.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
The timer overflow direction
  • 1U: if TOF bit was set on the top of counting
  • 0U: if TOF bit was set on the bottom of counting

Implements : FTM_HAL_GetQuadTimerOverflowDir_Activity

Definition at line 2242 of file ftm_hal.h.

static bool FTM_HAL_GetReloadFlag ( const FTM_Type ftmBase)
inlinestatic

Get the state whether the FTM counter reached a reload point.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
State of reload point
  • true : FTM counter reached a reload point
  • false: FTM counter did not reach a reload point

Implements : FTM_HAL_GetReloadFlag_Activity

Definition at line 667 of file ftm_hal.h.

static bool FTM_HAL_GetTriggerControled ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Returns whether the trigger mode is enabled.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
State of the channel outputs
  • true : Enabled a trigger generation on channel output
  • false: PWM outputs without generating a pulse

Implements : FTM_HAL_GetTriggerControled_Activity

Definition at line 1081 of file ftm_hal.h.

static bool FTM_HAL_HasChnEventOccurred ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Returns whether any event for the FTM peripheral timer channel has occurred.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
State of channel flag
  • true : Event occurred
  • false: No event occurred.

Implements : FTM_HAL_HasChnEventOccurred_Activity

Definition at line 1021 of file ftm_hal.h.

static bool FTM_HAL_HasTimerOverflowed ( const FTM_Type ftmBase)
inlinestatic

Returns the FTM peripheral timer overflow interrupt flag.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
State of Timer Overflow Flag
  • true : FTM counter has overflowed
  • false: FTM counter has not overflowed

Implements : FTM_HAL_HasTimerOverflowed_Activity

Definition at line 604 of file ftm_hal.h.

void FTM_HAL_Init ( FTM_Type *const  ftmBase,
ftm_clock_ps_t  ftmClockPrescaler 
)

Initializes the FTM. This function will enable the flexTimer module and selects one pre-scale factor for the FTM clock source.

Parameters
[in]ftmBaseThe FTM base address pointer

Definition at line 43 of file ftm_hal.c.

static bool FTM_HAL_IsChnDma ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Returns whether the FTM peripheral timer channel DMA is enabled.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
State of the FTM peripheral timer channel DMA
  • true : Enabled DMA transfers
  • false: Disabled DMA transfers

Implements : FTM_HAL_IsChnDma_Activity

Definition at line 954 of file ftm_hal.h.

static bool FTM_HAL_IsChnIcrst ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Returns whether the FTM FTM counter is reset.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
Returns
State of the FTM peripheral timer channel ICRST
  • true : Enabled the FTM counter reset
  • false: Disabled the FTM counter reset

Implements : FTM_HAL_IsChnIcrst_Activity

Definition at line 914 of file ftm_hal.h.

static bool FTM_HAL_IsChnIntEnabled ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Get FTM channel(n) interrupt enabled or not.

Parameters
[in]ftmBaseFTM module base address
[in]channelThe FTM peripheral channel number

Implements : FTM_HAL_IsChnIntEnabled_Activity

Definition at line 969 of file ftm_hal.h.

static bool FTM_HAL_IsChnTriggerGenerated ( const FTM_Type ftmBase)
inlinestatic

Checks whether any channel trigger event has occurred.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
Channel trigger status
  • true : If there is a channel trigger event
  • false: If not.

Implements : FTM_HAL_IsChnTriggerGenerated_Activity

Definition at line 1989 of file ftm_hal.h.

static bool FTM_HAL_IsFaultFlagDetected ( const FTM_Type ftmBase,
uint8_t  channel 
)
inlinestatic

Checks whether a fault condition is detected at the fault input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel
Returns
the fault condition status
  • true : A fault condition was detected at the fault input
  • false: No fault condition was detected at the fault input

Implements : FTM_HAL_IsFaultFlagDetected_Activity

Definition at line 2069 of file ftm_hal.h.

static bool FTM_HAL_IsFaultInputEnabled ( const FTM_Type ftmBase)
inlinestatic

Checks whether the logic OR of the fault inputs is enabled.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
the enabled fault inputs status
  • true : The logic OR of the enabled fault inputs is 1
  • false: The logic OR of the enabled fault inputs is 0

Implements : FTM_HAL_IsFaultInputEnabled_Activity

Definition at line 2052 of file ftm_hal.h.

static bool FTM_HAL_IsFaultIntEnabled ( const FTM_Type ftmBase)
inlinestatic

Return true/false whether the Fault interrupt was enabled or not.

Parameters
[in]ftmBaseThe FTM base address pointer

Implements : FTM_HAL_IsFaultIntEnabled_Activity

Definition at line 1377 of file ftm_hal.h.

static bool FTM_HAL_IsFtmEnable ( const FTM_Type ftmBase)
inlinestatic

Get status of the FTMEN bit in the FTM_MODE register.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
the FTM Enable status
  • true : TPM compatibility. Free running counter and synchronization compatible with TPM
  • false: Free running counter and synchronization are different from TPM behaviour

Implements : FTM_HAL_IsFtmEnable_Activity

Definition at line 1484 of file ftm_hal.h.

static bool FTM_HAL_IsOverflowIntEnabled ( const FTM_Type ftmBase)
inlinestatic

Reads the bit that controls enabling the FTM timer overflow interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
State of Timer Overflow Interrupt
  • true : Overflow interrupt is enabled
  • false: Overflow interrupt is disabled

Implements : FTM_HAL_IsOverflowIntEnabled_Activity

Definition at line 542 of file ftm_hal.h.

static bool FTM_HAL_IsWriteProtectionEnabled ( const FTM_Type ftmBase)
inlinestatic

Checks whether the write protection is enabled.

Parameters
[in]ftmBaseThe FTM base address pointer
Returns
Write-protection status
  • true : If enabled
  • false: If not

Implements : FTM_HAL_IsWriteProtectionEnabled_Activity

Definition at line 2036 of file ftm_hal.h.

void FTM_HAL_Reset ( FTM_Type *const  ftmBase)

Resets the FTM registers. All the register use in the driver should be reset to default value of each register.

Parameters
[in]ftmBaseThe FTM base address pointer

Definition at line 59 of file ftm_hal.c.

static void FTM_HAL_SetAllChnSoftwareCtrlCmd ( FTM_Type *const  ftmBase,
uint8_t  channelsMask 
)
inlinestatic

Enables or disables the channel software output control.The main difference between this function and FTM_HAL_SetChnSoftwareCtrlCmd is that this can configure all the channels in the same time.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelsMaskChannels to be enabled or disabled

Implements : FTM_HAL_SetAllChnSoftwareCtrlCmd_Activity

Definition at line 2430 of file ftm_hal.h.

static void FTM_HAL_SetAllChnSoftwareCtrlVal ( FTM_Type *const  ftmBase,
uint8_t  channelsValues 
)
inlinestatic

Sets the channel software output control value.

Parameters
[in]ftmBaseThe FTM base address pointer.
[in]channelsValuesThe values which will overwrite the output channels

Implements : FTM_HAL_SetAllChnSoftwareCtrlVal_Activity

Definition at line 2474 of file ftm_hal.h.

static void FTM_HAL_SetBdmMode ( FTM_Type *const  ftmBase,
ftm_bdm_mode_t  val 
)
inlinestatic

Sets the BDM mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valThe FTM behavior in BDM mode
  • FTM_BDM_MODE_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
  • FTM_BDM_MODE_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
  • FTM_BDM_MODE_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
  • FTM_BDM_MODE_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

Implements : FTM_HAL_SetBdmMode_Activity

Definition at line 2663 of file ftm_hal.h.

static void FTM_HAL_SetCaptureTestCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer capture test mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableCapture Test Mode Enable
  • true : Capture test mode is enabled
  • false: Capture test mode is disabled

Implements : FTM_HAL_SetCaptureTestCmd_Activity

Definition at line 1429 of file ftm_hal.h.

static void FTM_HAL_SetChnCountVal ( FTM_Type *const  ftmBase,
uint8_t  channel,
uint16_t  value 
)
inlinestatic

Sets the FTM peripheral timer channel counter value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]valueCounter value to be set

Implements : FTM_HAL_SetChnCountVal_Activity

Definition at line 1137 of file ftm_hal.h.

static void FTM_HAL_SetChnDmaCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer channel DMA.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]enableEnable DMA transfers for the channel
  • true : Enabled DMA transfers
  • false: Disabled DMA transfers

Implements : FTM_HAL_SetChnDmaCmd_Activity

Definition at line 933 of file ftm_hal.h.

static void FTM_HAL_SetChnEdgeLevel ( FTM_Type *const  ftmBase,
uint8_t  channel,
uint8_t  level 
)
inlinestatic

Sets the FTM peripheral timer channel edge level.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]levelELSnB:ELSnA :00, 01, 10, 11

Implements : FTM_HAL_SetChnEdgeLevel_Activity

Definition at line 803 of file ftm_hal.h.

static void FTM_HAL_SetChnFaultInputPolarityCmd ( FTM_Type *const  ftmBase,
uint8_t  fltChannel,
ftm_polarity_t  polarity 
)
inlinestatic

Sets the FTM peripheral timer channel fault input polarity.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]polarityThe polarity to be set
  • FTM_POLARITY_LOW : The fault input polarity is active high
  • FTM_POLARITY_HIGH: The fault input polarity is active low

Implements : FTM_HAL_SetChnFaultInputPolarityCmd_Activity

Definition at line 1326 of file ftm_hal.h.

static void FTM_HAL_SetChnIcrstCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Configure the feature of FTM counter reset by the selected input capture event.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]enableEnable the FTM counter reset
  • true : FTM counter is reset
  • false: FTM counter is not reset

Implements : FTM_HAL_SetChnIcrstCmd_Activity

Definition at line 893 of file ftm_hal.h.

void FTM_HAL_SetChnInputCaptureFilter ( FTM_Type *const  ftmBase,
uint8_t  channel,
uint8_t  value 
)

Sets the FTM peripheral timer channel input capture filter value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number, only 0,1,2,3, channel 4, 5,6, 7 don't have
[in]valueFilter value to be set

Definition at line 143 of file ftm_hal.c.

static void FTM_HAL_SetChnMSnBAMode ( FTM_Type *const  ftmBase,
uint8_t  channel,
uint8_t  selection 
)
inlinestatic

Sets the FTM peripheral timer channel mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]selectionThe mode to be set valid value MSnB:MSnA :00, 01, 10, 11

Implements : FTM_HAL_SetChnMSnBAMode_Activity

Definition at line 781 of file ftm_hal.h.

static void FTM_HAL_SetChnOutputInitStateCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  state 
)
inlinestatic

Sets the FTM peripheral timer channel output initial state 0 or 1.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]stateInitial state for channels output
  • true : The initialization value is 1
  • false: The initialization value is 0

Implements : FTM_HAL_SetChnOutputInitStateCmd_Activity

Definition at line 1272 of file ftm_hal.h.

static void FTM_HAL_SetChnOutputMask ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  mask 
)
inlinestatic

Sets the FTM peripheral timer channel output mask.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]maskValue to set Output Mask
  • true : Channel output is masked
  • false: Channel output is not masked

Implements : FTM_HAL_SetChnOutputMask_Activity

Definition at line 1245 of file ftm_hal.h.

static void FTM_HAL_SetChnOutputPolarityCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
ftm_polarity_t  polarity 
)
inlinestatic

Sets the FTM peripheral timer channel output polarity.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]polarityThe polarity to be set
  • FTM_POLARITY_HIGH : The channel polarity is active low
  • FTM_POLARITY_LOW : The channel polarity is active high

Implements : FTM_HAL_SetChnOutputPolarityCmd_Activity

Definition at line 1299 of file ftm_hal.h.

static void FTM_HAL_SetChnSoftwareCtrlCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Enables or disables the channel software output control.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelChannel to be enabled or disabled
[in]enableState of channel software output control
  • true : To enable, channel output will be affected by software output control
  • false: To disable, channel output is unaffected

Implements : FTM_HAL_SetChnSoftwareCtrlCmd_Activity

Definition at line 2404 of file ftm_hal.h.

static void FTM_HAL_SetChnSoftwareCtrlVal ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Sets the channel software output control value.

Parameters
[in]ftmBaseThe FTM base address pointer.
[in]channelChannel to be configured
[in]enableState of software output control value
  • true : to force 1 to the channel output
  • false: to force 0 to the channel output

Implements : FTM_HAL_SetChnSoftwareCtrlVal_Activity

Definition at line 2450 of file ftm_hal.h.

void FTM_HAL_SetChnTriggerCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)

Enables or disables the generation of the FTM peripheral timer channel trigger when the FTM counter is equal to its initial value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]enableEnables the generation of the channel trigger
  • true : The generation of the channel trigger is enabled
  • false: The generation of the channel trigger is disabled

Definition at line 106 of file ftm_hal.c.

static void FTM_HAL_SetClockFilterPs ( FTM_Type *const  ftmBase,
uint8_t  filterPrescale 
)
inlinestatic

Sets the filter Pre-scaler divider.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]filterPrescaleThe FTM peripheral clock pre-scale divider

Implements : FTM_HAL_SetClockFilterPs_Activity

Definition at line 432 of file ftm_hal.h.

static void FTM_HAL_SetClockPs ( FTM_Type *const  ftmBase,
ftm_clock_ps_t  ps 
)
inlinestatic

Sets the FTM clock divider.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]psThe FTM peripheral clock pre-scale divider

Implements : FTM_HAL_SetClockPs_Activity

Definition at line 496 of file ftm_hal.h.

static void FTM_HAL_SetClockSource ( FTM_Type *const  ftmBase,
ftm_clock_source_t  clock 
)
inlinestatic

Sets the FTM clock source.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]clockThe FTM peripheral clock selection
  • 00: No clock
  • 01: system clock
  • 10: fixed clock
  • 11: External clock

Implements : FTM_HAL_SetClockSource_Activity

Definition at line 464 of file ftm_hal.h.

static void FTM_HAL_SetCntinPwmSyncModeCmd ( FTM_Type *const  ftmBase,
ftm_reg_update_t  mode 
)
inlinestatic

Sets the CNTIN register PWM synchronization mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeState of register synchronization
  • true : CNTIN register is updated by PWM sync
  • false: CNTIN register is updated at all rising edges of system clock

Implements : FTM_HAL_SetCntinPwmSyncModeCmd_Activity

Definition at line 2918 of file ftm_hal.h.

static void FTM_HAL_SetCounter ( FTM_Type *const  ftmBase,
uint16_t  value 
)
inlinestatic

Sets the FTM peripheral current counter value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valThe FTM timer counter value to be set

Implements : FTM_HAL_SetCounter_Activity

Definition at line 696 of file ftm_hal.h.

static void FTM_HAL_SetCounterHardwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM counter register when using a hardware trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of FTM counter synchronization
  • true : The hardware trigger activates FTM counter sync
  • false: The hardware trigger does not activate FTM counter sync

Implements : FTM_HAL_SetCounterHardwareSyncModeCmd_Activity

Definition at line 2758 of file ftm_hal.h.

static void FTM_HAL_SetCounterInitVal ( FTM_Type *const  ftmBase,
uint16_t  value 
)
inlinestatic

Sets the FTM peripheral timer counter initial value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valueinitial value to be set

Implements : FTM_HAL_SetCounterInitVal_Activity

Definition at line 752 of file ftm_hal.h.

static void FTM_HAL_SetCounterSoftwareSyncModeCmd ( FTM_Type *const  ftmBase,
ftm_pwm_sync_mode_t  update_mode 
)
inlinestatic

Sets sync mode for FTM counter register when using a software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]update_modeState of FTM counter synchronization
  • true : The software trigger activates FTM counter sync
  • false: The software trigger does not activate FTM counter sync

Implements : FTM_HAL_SetCounterSoftwareSyncModeCmd_Activity

Definition at line 2854 of file ftm_hal.h.

static void FTM_HAL_SetCountReinitSyncCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Determines if the FTM counter is re-initialized when the selected trigger for synchronization is detected.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableFTM counter re-initialization selection
  • true : To update FTM counter when triggered
  • false: To count normally

Implements : FTM_HAL_SetCountReinitSyncCmd_Activity

Definition at line 1595 of file ftm_hal.h.

static void FTM_HAL_SetCpwms ( FTM_Type *const  ftmBase,
bool  mode 
)
inlinestatic

Sets the FTM count direction bit.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeThe Center-Aligned PWM selection
  • 1U: Up counting mode
  • 0U: Up down counting mode

Implements : FTM_HAL_SetCpwms_Activity

Definition at line 619 of file ftm_hal.h.

static void FTM_HAL_SetDeadtimeCount ( FTM_Type *const  ftmBase,
uint8_t  count 
)
inlinestatic

Sets the FTM deadtime value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]countThe FTM peripheral pre-scaler divider
  • 0U : no counts inserted
  • 1U : 1 count is inserted
  • 2U : 2 count is inserted
  • ... up to a possible 63 counts

Implements : FTM_HAL_SetDeadtimeCount_Activity

Definition at line 1953 of file ftm_hal.h.

static void FTM_HAL_SetDeadtimePrescale ( FTM_Type *const  ftmBase,
ftm_deadtime_ps_t  divider 
)
inlinestatic

Sets the FTM dead time divider.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]dividerThe FTM peripheral pre-scaler divider
  • FTM_DEADTIME_DIVID_BY_1 : Divide by 1
  • FTM_DEADTIME_DIVID_BY_4 : Divide by 4
  • FTM_DEADTIME_DIVID_BY_16: Divide by 16

Implements : FTM_HAL_SetDeadtimePrescale_Activity

Definition at line 1935 of file ftm_hal.h.

static void FTM_HAL_SetDualChnCombineCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer channel pair output combine mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel pair output combine mode
  • true : Channels pair are combined
  • false: Channels pair are independent

Implements : FTM_HAL_SetDualChnCombineCmd_Activity

Definition at line 1853 of file ftm_hal.h.

static void FTM_HAL_SetDualChnCompCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
ftm_second_channel_polarity_t  polarity 
)
inlinestatic

Enables or disables the FTM peripheral timer channel pair output complement mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]polarityState of channel pair output complement mode
  • FTM_MAIN_INVERTED : The channel (n+1) output is the complement of the channel (n) output
  • FTM_MAIN_DUPLICATED: The channel (n+1) output is the same as the channel (n) output

Implements : FTM_HAL_SetDualChnCompCmd_Activity

Definition at line 1826 of file ftm_hal.h.

static void FTM_HAL_SetDualChnDeadtimeCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables or disabled the FTM peripheral timer channel pair deadtime insertion.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel pair deadtime insertion
  • true : To enable deadtime insertion
  • false: To disable

Implements : FTM_HAL_SetDualChnDeadtimeCmd_Activity

Definition at line 1725 of file ftm_hal.h.

static void FTM_HAL_SetDualChnDecapCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer channel dual edge capture.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel dual edge capture
  • true : To enable dual edge capture mode
  • false: To disable

Implements : FTM_HAL_SetDualChnDecapCmd_Activity

Definition at line 1752 of file ftm_hal.h.

static void FTM_HAL_SetDualChnFaultCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables the FTM peripheral timer channel pair fault control.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel pair fault control
  • true : To enable fault control
  • false: To disable

Implements : FTM_HAL_SetDualChnFaultCmd_Activity

Definition at line 1671 of file ftm_hal.h.

static void FTM_HAL_SetDualChnInvertCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables or disables the channel invert for a channel pair.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel invert for a channel pair
  • true : To enable channel inverting
  • false: To disable channel inversion

Implements : FTM_HAL_SetDualChnInvertCmd_Activity

Definition at line 2361 of file ftm_hal.h.

static void FTM_HAL_SetDualChnMofCombineCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables the FTM peripheral timer channel modified combine mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel pair outputs modified combine
  • true : To enable modified combine
  • false: To disable modified combine

Implements : FTM_HAL_SetDualChnMofCombineCmd_Activity

Definition at line 1644 of file ftm_hal.h.

static void FTM_HAL_SetDualChnPwmSyncCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer channel pair counter PWM sync.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of channel pair counter PWM sync
  • true : To enable PWM synchronization
  • false: To disable

Implements : FTM_HAL_SetDualChnPwmSyncCmd_Activity

Definition at line 1698 of file ftm_hal.h.

static void FTM_HAL_SetDualEdgeCaptureCmd ( FTM_Type *const  ftmBase,
uint8_t  chnlPairNum,
bool  enable 
)
inlinestatic

Enables the FTM peripheral timer dual edge capture mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]chnlPairNumThe FTM peripheral channel pair number
[in]enableState of dual edge capture mode
  • true : To enable dual edge capture
  • false: To disable

Implements : FTM_HAL_SetDualEdgeCaptureCmd_Activity

Definition at line 1779 of file ftm_hal.h.

static void FTM_HAL_SetExtDeadtimeValue ( FTM_Type *const  ftmBase,
uint8_t  value 
)
inlinestatic

Sets the FTM extended dead-time value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valueThe FTM peripheral extend pre-scale divider

Implements : FTM_HAL_SetExtDeadtimeValue_Activity

Definition at line 1916 of file ftm_hal.h.

static void FTM_HAL_SetExtPairDeadtimeValue ( FTM_Type *const  ftmBase,
uint8_t  channelPair,
uint8_t  value 
)
inlinestatic

Sets the FTM extended dead-time value for the channel pair.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelPairThe FTM peripheral channel pair (n)
[in]valueThe FTM peripheral extend pre-scale divider using the concatenation with the dead-time value

Implements : FTM_HAL_SetExtPairDeadtimeValue_Activity

Definition at line 2933 of file ftm_hal.h.

static void FTM_HAL_SetFaultControlMode ( FTM_Type *const  ftmBase,
ftm_fault_mode_t  mode 
)
inlinestatic

Defines the FTM fault control mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeFault control mode value
  • FTM_FAULT_CONTROL_DISABLED: Fault control disabled
  • FTM_FAULT_CONTROL_MAN_EVEN: Fault control enabled for even channel (0, 2, 4, 6) and manual fault clearing.
  • FTM_FAULT_CONTROL_MAN_ALL : Fault control enabled for all channels and manual fault clearing is enabled.
  • FTM_FAULT_CONTROL_AUTO_ALL: Fault control enabled for all channels and automatic fault clearing is enabled.

Implements : FTM_HAL_SetFaultControlMode_Activity

Definition at line 1413 of file ftm_hal.h.

static void FTM_HAL_SetFaultInputCmd ( FTM_Type *const  ftmBase,
uint8_t  inputNum,
bool  enable 
)
inlinestatic

Enables or disables the fault input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]inputNumfault input to be configured, valid value 0, 1, 2, 3
[in]enableState of fault input
  • true : To enable fault input
  • false: To disable fault input

Implements : FTM_HAL_SetFaultInputCmd_Activity

Definition at line 2311 of file ftm_hal.h.

static void FTM_HAL_SetFaultInputFilterCmd ( FTM_Type *const  ftmBase,
uint8_t  inputNum,
bool  enable 
)
inlinestatic

Enables or disables the fault input filter.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]inputNumFault input to be configured, valid value 0, 1, 2, 3
[in]enableState of fault input filter
  • true : To enable fault input filter
  • false: To disable fault input filter

Implements : FTM_HAL_SetFaultInputFilterCmd_Activity

Definition at line 2272 of file ftm_hal.h.

static void FTM_HAL_SetFaultInputFilterVal ( FTM_Type *const  ftmBase,
uint32_t  value 
)
inlinestatic

Sets the fault input filter value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valueFault input filter value

Implements : FTM_HAL_SetFaultInputFilterVal_Activity

Definition at line 2255 of file ftm_hal.h.

static void FTM_HAL_SetFaultInt ( FTM_Type *const  ftmBase,
bool  state 
)
inlinestatic

Enables/disables the FTM peripheral timer fault interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]stateTimer fault interrupt state
  • true : Fault control interrupt is enable
  • false: Fault control interrupt is disabled

Implements : FTM_HAL_SetFaultInt_Activity

Definition at line 1352 of file ftm_hal.h.

static void FTM_HAL_SetGlobalLoadCmd ( FTM_Type *const  ftmBase)
inlinestatic

Set the global load mechanism.

Parameters
[in]ftmBaseThe FTM base address pointer
  • true : LDOK bit is set
  • false: No action

Implements : FTM_HAL_SetGlobalLoadCmd_Activity

Definition at line 2493 of file ftm_hal.h.

static void FTM_HAL_SetGlobalTimeBaseCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM timer global time base.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of global time base
  • true : To enable
  • false: To disable

Implements : FTM_HAL_SetGlobalTimeBaseCmd_Activity

Definition at line 2637 of file ftm_hal.h.

static void FTM_HAL_SetGlobalTimeBaseOutputCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM global time base signal generation to other FTM's.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of global time base signal
  • true : To enable
  • false: To disable

Implements : FTM_HAL_SetGlobalTimeBaseOutputCmd_Activity

Definition at line 2621 of file ftm_hal.h.

static void FTM_HAL_SetHalfCycleCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enable the half cycle reload.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of the half cycle match as a reload opportunity
  • true : Half cycle reload is enabled
  • false: Half cycle reload is disabled

Implements : FTM_HAL_SetHalfCycleCmd_Activity

Definition at line 2531 of file ftm_hal.h.

static void FTM_HAL_SetHalfCycleValue ( FTM_Type *const  ftmBase,
uint16_t  value 
)
inlinestatic

Sets the value for the half cycle reload register.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valueThe 16 bit counter value

Implements : FTM_HAL_SetHalfCycleValue_Activity

Definition at line 418 of file ftm_hal.h.

static void FTM_HAL_SetHardwareSyncTriggerSrc ( FTM_Type *const  ftmBase,
uint8_t  trigger_num,
bool  enable 
)
inlinestatic

Sets the FTM hardware synchronization trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]trigger_numNumber of trigger
  • 0U: trigger 0
  • 1U: trigger 1
  • 2U: trigger 2
[in]enableState of trigger
  • true : Enable hardware trigger from field trigger_num for PWM synchronization
  • false: Disable hardware trigger from field trigger_num for PWM synchronization

Implements : FTM_HAL_SetHardwareSyncTriggerSrc_Activity

Definition at line 1552 of file ftm_hal.h.

static void FTM_HAL_SetHwTriggerSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets hardware trigger mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of hardware trigger mode
  • true : FTM does not clear the TRIGx bit when the hardware trigger j is detected
  • false: FTM clears the TRIGx bit when the hardware trigger j is detected

Implements : FTM_HAL_SetHwTriggerSyncModeCmd_Activity

Definition at line 2838 of file ftm_hal.h.

static void FTM_HAL_SetInitChnOutputCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Initializes the channels output.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableInitialize the channels output
  • true : The channels output is initialized according to the state of OUTINIT reg
  • false: No effect

Implements : FTM_HAL_SetInitChnOutputCmd_Activity

Definition at line 1499 of file ftm_hal.h.

static void FTM_HAL_SetInitTriggerCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the generation of the trigger when the FTM counter is equal to the CNTIN register.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of initialization trigger
  • true : To enable
  • false: To disable

Implements : FTM_HAL_SetInitTriggerCmd_Activity

Definition at line 1973 of file ftm_hal.h.

static void FTM_HAL_SetInitTrigOnReloadCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM initialization trigger on Reload Point.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enablebit controls whether an initialization trigger is generated
  • true : Trigger is generated when a reload point is reached
  • false: Trigger is generated on counter wrap events

Implements : FTM_HAL_SetInitTrigOnReloadCmd_Activity

Definition at line 2605 of file ftm_hal.h.

static void FTM_HAL_SetInvctrlHardwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM INVCTRL register when using a hardware trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of inverting control synchronization
  • true : The hardware trigger activates INVCTRL register sync
  • false: The hardware trigger does not activate INVCTRL register sync

Implements : FTM_HAL_SetInvctrlHardwareSyncModeCmd_Activity

Definition at line 2710 of file ftm_hal.h.

static void FTM_HAL_SetInvctrlPwmSyncModeCmd ( FTM_Type *const  ftmBase,
ftm_reg_update_t  mode 
)
inlinestatic

Sets the INVCTRL register PWM synchronization mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeState of register synchronization
  • true : INVCTRL register is updated by PWM sync
  • false: INVCTRL register is updated at all rising edges of system clock

Implements : FTM_HAL_SetInvctrlPwmSyncModeCmd_Activity

Definition at line 2902 of file ftm_hal.h.

static void FTM_HAL_SetInvctrlReg ( FTM_Type *const  ftmBase,
uint32_t  regVal 
)
inlinestatic

Writes the provided value to the Inverting control register.

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

Parameters
[in]ftmBaseThe FTM base address pointer
[in]regValValue to be written to the register

Implements : FTM_HAL_SetInvctrlReg_Activity

Definition at line 2387 of file ftm_hal.h.

static void FTM_HAL_SetInvctrlSoftwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM INVCTRL register when using a software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of State of inverting control synchronization
  • true : The software trigger activates INVCTRL register sync
  • false: The software trigger does not activate INVCTRL register sync

Implements : FTM_HAL_SetInvctrlSoftwareSyncModeCmd_Activity

Definition at line 2790 of file ftm_hal.h.

static void FTM_HAL_SetLoadCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enable the global load.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of the global load mechanism
  • true : Global Load OK enabled
  • false: Global Load OK disabled

Implements : FTM_HAL_SetLoadCmd_Activity

Definition at line 2508 of file ftm_hal.h.

static void FTM_HAL_SetLoadFreq ( FTM_Type *const  ftmBase,
uint8_t  val 
)
inlinestatic

Sets the FTM timer TOF Frequency.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valValue of the TOF bit set frequency

Implements : FTM_HAL_SetLoadFreq_Activity

Definition at line 2677 of file ftm_hal.h.

static void FTM_HAL_SetMaxLoadingCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer maximum loading points.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableMaximum loading point selection
  • true : To enable maximum loading point
  • false: To disable

Implements : FTM_HAL_SetMaxLoadingCmd_Activity

Definition at line 1611 of file ftm_hal.h.

static void FTM_HAL_SetMinLoadingCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer minimum loading points.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableMinimum loading point selection
  • true : To enable minimum loading point
  • false: To disable

Implements : FTM_HAL_SetMinLoadingCmd_Activity

Definition at line 1627 of file ftm_hal.h.

static void FTM_HAL_SetMod ( FTM_Type *const  ftmBase,
uint16_t  value 
)
inlinestatic

Sets the FTM peripheral timer modulo value.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]valueThe value to be set to the timer modulo

Implements : FTM_HAL_SetMod_Activity

Definition at line 724 of file ftm_hal.h.

static void FTM_HAL_SetModCntinCvHardwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM MOD, CNTIN and CV registers when using a hardware trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of registers synchronization
  • true : The hardware trigger activates MOD, HCR, CNTIN, and CV registers sync
  • false: The hardware trigger does not activate MOD, HCR, CNTIN, and CV registers sync

Implements : FTM_HAL_SetModCntinCvHardwareSyncModeCmd_Activity

Definition at line 2742 of file ftm_hal.h.

static void FTM_HAL_SetModCntinCvSoftwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM MOD, CNTIN and CV registers when using a software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of registers synchronization
  • true : The software trigger activates FTM MOD, CNTIN and CV registers sync
  • false: The software trigger does not activate FTM MOD, CNTIN and CV registers sync

Implements : FTM_HAL_SetModCntinCvSoftwareSyncModeCmd_Activity

Definition at line 2822 of file ftm_hal.h.

static void FTM_HAL_SetOutmaskHardwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM OUTMASK register when using a hardware trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of output mask synchronization
  • true : The hardware trigger activates OUTMASK register sync
  • false: The hardware trigger does not activate OUTMASK register sync

Implements : FTM_HAL_SetOutmaskHardwareSyncModeCmd_Activity

Definition at line 2726 of file ftm_hal.h.

static void FTM_HAL_SetOutmaskPwmSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Determines when the OUTMASK register is updated with the value of its buffer.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableOutput Mask synchronization selection
  • true : OUTMASK register is updated only by PWM synchronization
  • false: OUTMASK register is updated in all rising edges of the system clock

Implements : FTM_HAL_SetOutmaskPwmSyncModeCmd_Activity

Definition at line 1578 of file ftm_hal.h.

static void FTM_HAL_SetOutmaskReg ( FTM_Type *const  ftmBase,
uint32_t  regVal 
)
inlinestatic

Writes the provided value to the OUTMASK register.

This function will mask/unmask multiple channels.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]regValValue to be written to the register

Implements : FTM_HAL_SetOutmaskReg_Activity

Definition at line 1228 of file ftm_hal.h.

static void FTM_HAL_SetOutmaskSoftwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM OUTMASK register when using a software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of output mask synchronization
  • true : The software trigger activates OUTMASK register sync
  • false: The software trigger does not activate OUTMASK register sync

Implements : FTM_HAL_SetOutmaskSoftwareSyncModeCmd_Activity

Definition at line 2806 of file ftm_hal.h.

static void FTM_HAL_SetPairDeadtimeCount ( FTM_Type *const  ftmBase,
uint8_t  channelPair,
uint8_t  count 
)
inlinestatic

Sets the FTM dead-time value for the channel pair.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelPairThe FTM peripheral channel pair (n)
[in]countThe FTM peripheral selects the dead-time value
  • 0U : no counts inserted
  • 1U : 1 count is inserted
  • 2U : 2 count is inserted
  • ... up to a possible 63 counts

Implements : FTM_HAL_SetPairDeadtimeCount_Activity

Definition at line 3011 of file ftm_hal.h.

static void FTM_HAL_SetPairDeadtimePrescale ( FTM_Type *const  ftmBase,
uint8_t  channelPair,
ftm_deadtime_ps_t  divider 
)
inlinestatic

Sets the FTM dead time divider for the channel pair.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelPairThe FTM peripheral channel pair (n)
[in]dividerThe FTM peripheral pre-scaler divider
  • FTM_DEADTIME_DIVID_BY_1 : Divide by 1
  • FTM_DEADTIME_DIVID_BY_4 : Divide by 4
  • FTM_DEADTIME_DIVID_BY_16: Divide by 16

Implements : FTM_HAL_SetPairDeadtimePrescale_Activity

Definition at line 2972 of file ftm_hal.h.

static void FTM_HAL_SetPwmFaultBehavior ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Configures the behavior of the PWM outputs when a fault is detected.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of fault output
  • true : Output pins are set tri-state,
  • false: Pins are set to a safe state determined by POL bits

Implements : FTM_HAL_SetPwmFaultBehavior_Activity

Definition at line 2337 of file ftm_hal.h.

static void FTM_HAL_SetPwmLoadChnSelCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Includes or excludes the channel in the matching process.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelChannel to be configured
[in]enableState of channel
  • true : means include the channel in the matching process
  • false: means do not include channel in the matching process

Implements : FTM_HAL_SetPwmLoadChnSelCmd_Activity

Definition at line 2578 of file ftm_hal.h.

static void FTM_HAL_SetPwmLoadCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the loading of MOD, CNTIN and CV with values of their write buffer.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of loading updated values
  • true : To enable
  • false: To disable

Implements : FTM_HAL_SetPwmLoadCmd_Activity

Definition at line 2554 of file ftm_hal.h.

static void FTM_HAL_SetPwmSyncMode ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets the FTM peripheral timer sync mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enablePWM synchronization mode
  • false: No restriction both software and hardware triggers can be used
  • true : Software trigger can only be used for MOD and CnV synchronization, hardware trigger only for OUTMASK and FTM counter synchronization.

Implements : FTM_HAL_SetPwmSyncMode_Activity

Definition at line 1516 of file ftm_hal.h.

static void FTM_HAL_SetPwmSyncModeCmd ( FTM_Type *const  ftmBase,
bool  mode 
)
inlinestatic

Sets the PWM synchronization mode to enhanced or legacy.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeState of synchronization mode
  • true : Enhanced PWM synchronization is selected
  • false: Legacy PWM synchronization is selected

Implements : FTM_HAL_SetPwmSyncModeCmd_Activity

Definition at line 2870 of file ftm_hal.h.

static void FTM_HAL_SetQuadDecoderCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables the channel quadrature decoder.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of channel quadrature decoder
  • true : To enable
  • false: To disable

Implements : FTM_HAL_SetQuadDecoderCmd_Activity

Definition at line 2108 of file ftm_hal.h.

static void FTM_HAL_SetQuadMode ( FTM_Type *const  ftmBase,
ftm_quad_decode_mode_t  quadMode 
)
inlinestatic

Sets the encoding mode used in quadrature decoding mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]quadModeQuadrature decoder mode selection
  • FTM_QUAD_PHASE_ENCODE: Phase A and Phase B encoding mode
  • FTM_QUAD_COUNT_AND_DIR: Count and direction encoding mode

Implements : FTM_HAL_SetQuadMode_Activity

Definition at line 2209 of file ftm_hal.h.

static void FTM_HAL_SetQuadPhaseAFilterCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the phase A input filter.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of phase A input filter
  • true : Enables the phase input filter
  • false: Disables the filter

Implements : FTM_HAL_SetQuadPhaseAFilterCmd_Activity

Definition at line 2131 of file ftm_hal.h.

static void FTM_HAL_SetQuadPhaseAPolarity ( FTM_Type *const  ftmBase,
ftm_quad_phase_polarity_t  mode 
)
inlinestatic

Selects polarity for the quadrature decode phase A input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modePhase A input polarity selection
  • FTM_QUAD_PHASE_NORMAL: Normal polarity
  • FTM_QUAD_PHASE_INVERT: Inverted polarity

Implements : FTM_HAL_SetQuadPhaseAPolarity_Activity

Definition at line 2177 of file ftm_hal.h.

static void FTM_HAL_SetQuadPhaseBFilterCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the phase B input filter.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of phase B input filter
  • true : Enables the phase input filter
  • false: Disables the filter

Implements : FTM_HAL_SetQuadPhaseBFilterCmd_Activity

Definition at line 2154 of file ftm_hal.h.

static void FTM_HAL_SetQuadPhaseBPolarity ( FTM_Type *const  ftmBase,
ftm_quad_phase_polarity_t  mode 
)
inlinestatic

Selects polarity for the quadrature decode phase B input.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modePhase B input polarity selection
  • FTM_QUAD_PHASE_NORMAL: Normal polarity
  • FTM_QUAD_PHASE_INVERT: Inverted polarity

Implements : FTM_HAL_SetQuadPhaseBPolarity_Activity

Definition at line 2193 of file ftm_hal.h.

static void FTM_HAL_SetReIntEnabledCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Set the FTM reload interrupt enable.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enable- true : Reload interrupt is enabled
  • false: Reload interrupt is disabled

Implements : FTM_HAL_SetReIntEnabledCmd_Activity

Definition at line 650 of file ftm_hal.h.

static void FTM_HAL_SetSoftwareTriggerCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM peripheral timer software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer.
[in]enableSoftware trigger selection
  • true : Software trigger is selected
  • false: Software trigger is not selected

Implements : FTM_HAL_SetSoftwareTriggerCmd_Activity

Definition at line 1532 of file ftm_hal.h.

static void FTM_HAL_SetSwoctrlHardwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets the sync mode for the FTM SWOCTRL register when using a hardware trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of software output control synchronization
  • true : The hardware trigger activates SWOCTRL register sync
  • false: The hardware trigger does not activate SWOCTRL register sync

Implements : FTM_HAL_SetSwoctrlHardwareSyncModeCmd_Activity

Definition at line 2694 of file ftm_hal.h.

static void FTM_HAL_SetSwoctrlPwmSyncModeCmd ( FTM_Type *const  ftmBase,
ftm_reg_update_t  mode 
)
inlinestatic

Sets the SWOCTRL register PWM synchronization mode.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]modeState of register synchronization
  • true : SWOCTRL register is updated by PWM sync
  • false: SWOCTRL register is updated at all rising edges of system clock

Implements : FTM_HAL_SetSwoctrlPwmSyncModeCmd_Activity

Definition at line 2886 of file ftm_hal.h.

static void FTM_HAL_SetSwoctrlSoftwareSyncModeCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Sets sync mode for FTM SWOCTRL register when using a software trigger.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableState of software output control synchronization
  • true : The software trigger activates SWOCTRL register sync
  • false: The software trigger does not activate SWOCTRL register sync

Implements : FTM_HAL_SetSwoctrlSoftwareSyncModeCmd_Activity

Definition at line 2774 of file ftm_hal.h.

static void FTM_HAL_SetTimerOverflowInt ( FTM_Type *const  ftmBase,
bool  state 
)
inlinestatic

Enables the FTM peripheral timer overflow interrupt.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]state- true : Overflow interrupt enabled
  • false: Overflow interrupt disabled

Implements : FTM_HAL_SetTimerOverflowInt_Activity

Definition at line 525 of file ftm_hal.h.

static void FTM_HAL_SetTrigModeControlCmd ( FTM_Type *const  ftmBase,
uint8_t  channel,
bool  enable 
)
inlinestatic

Enables or disables the trigger generation on FTM channel outputs.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]channelThe FTM peripheral channel number
[in]enableTrigger mode control
  • false : Enable PWM output without generating a pulse
  • true : Disable a trigger generation on channel output

Implements : FTM_HAL_SetTrigModeControlCmd_Activity

Definition at line 1060 of file ftm_hal.h.

static void FTM_HAL_SetWriteProtectionCmd ( FTM_Type *const  ftmBase,
bool  enable 
)
inlinestatic

Enables or disables the FTM write protection.

Parameters
[in]ftmBaseThe FTM base address pointer
[in]enableThe FTM write protection selection
  • true : Write-protection is enabled
  • false: Write-protection is disabled

Implements : FTM_HAL_SetWriteProtectionCmd_Activity

Definition at line 1445 of file ftm_hal.h.