Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the FlexTimer HAL driver.
Data Structures | |
union | ftm_edge_mode_t |
FlexTimer edge mode. More... | |
struct | ftm_pwm_param_t |
FlexTimer driver PWM parameter. More... | |
struct | ftm_dual_edge_capture_param_t |
FlexTimer Dual Edge Capture parameters. More... | |
struct | ftm_phase_params_t |
FlexTimer quadrature decode phase parameters. More... | |
Macros | |
#define | CHAN0_IDX (0U) |
Channel number for CHAN0. More... | |
#define | CHAN1_IDX (1U) |
Channel number for CHAN1. More... | |
#define | CHAN2_IDX (2U) |
Channel number for CHAN2. More... | |
#define | CHAN3_IDX (3U) |
Channel number for CHAN3. More... | |
#define | CHAN4_IDX (4U) |
Channel number for CHAN4. More... | |
#define | CHAN5_IDX (5U) |
Channel number for CHAN5. More... | |
#define | CHAN6_IDX (6U) |
Channel number for CHAN6. More... | |
#define | CHAN7_IDX (7U) |
Channel number for CHAN7. More... | |
Enumerations | |
enum | ftm_clock_source_t |
FlexTimer clock source selection. | |
enum | ftm_counting_mode_t |
FlexTimer counting mode selection. | |
enum | ftm_clock_ps_t |
FlexTimer pre-scaler factor selection for the clock source. | |
enum | ftm_deadtime_ps_t |
FlexTimer pre-scaler factor for the deadtime insertion. | |
enum | ftm_config_mode_t |
FlexTimer operation mode, capture, output, dual. | |
enum | ftm_input_capture_edge_mode_t |
FlexTimer input capture edge mode, rising edge, or falling edge. | |
enum | ftm_output_compare_edge_mode_t |
FlexTimer output compare edge mode. More... | |
enum | ftm_pwm_edge_mode_t |
FlexTimer PWM output pulse mode, high-true or low-true on match up. | |
enum | ftm_dual_capture_edge_mode_t |
FlexTimer dual capture edge mode, one shot or continuous. | |
enum | ftm_quad_decode_mode_t |
FlexTimer quadrature decode modes, phase encode or count and direction mode. | |
enum | ftm_quad_phase_polarity_t { kFtmQuadPhaseNormal = 0, kFtmQuadPhaseInvert } |
FlexTimer quadrature phase polarities, normal or inverted polarity. More... | |
enum | ftm_sync_method_t |
FlexTimer sync options to update registers with buffer. | |
enum | ftm_bdm_mode_t { kFtmBdmMode_00 = 0, kFtmBdmMode_01, kFtmBdmMode_10, kFtmBdmMode_11 } |
Options for the FlexTimer behaviour in BDM Mode. More... | |
enum | ftm_status_t { kStatusFtmSuccess = 0U, kStatusFtmError = 1U } |
FTM status. More... | |
Functions | |
static void | FTM_HAL_SetClockSource (FTM_Type *ftmBase, ftm_clock_source_t clock) |
Sets the FTM clock source. More... | |
static uint8_t | FTM_HAL_GetClockSource (FTM_Type *ftmBase) |
Reads the FTM clock source. More... | |
static void | FTM_HAL_SetClockPs (FTM_Type *ftmBase, ftm_clock_ps_t ps) |
Sets the FTM clock divider. More... | |
static uint8_t | FTM_HAL_GetClockPs (FTM_Type *ftmBase) |
Reads the FTM clock divider. More... | |
static void | FTM_HAL_EnableTimerOverflowInt (FTM_Type *ftmBase) |
Enables the FTM peripheral timer overflow interrupt. More... | |
static void | FTM_HAL_DisableTimerOverflowInt (FTM_Type *ftmBase) |
Disables the FTM peripheral timer overflow interrupt. More... | |
static bool | FTM_HAL_IsOverflowIntEnabled (FTM_Type *ftmBase) |
Reads the bit that controls enabling the FTM timer overflow interrupt. More... | |
static void | FTM_HAL_ClearTimerOverflow (FTM_Type *ftmBase) |
Clears the timer overflow interrupt flag. More... | |
static bool | FTM_HAL_HasTimerOverflowed (FTM_Type *ftmBase) |
Returns the FTM peripheral timer overflow interrupt flag. More... | |
static void | FTM_HAL_SetCpwms (FTM_Type *ftmBase, uint8_t mode) |
Sets the FTM center-aligned PWM select. More... | |
static void | FTM_HAL_SetCounter (FTM_Type *ftmBase, uint16_t val) |
Sets the FTM peripheral current counter value. More... | |
static uint16_t | FTM_HAL_GetCounter (FTM_Type *ftmBase) |
Returns the FTM peripheral current counter value. More... | |
static void | FTM_HAL_SetMod (FTM_Type *ftmBase, uint16_t val) |
Sets the FTM peripheral timer modulo value. More... | |
static uint16_t | FTM_HAL_GetMod (FTM_Type *ftmBase) |
Returns the FTM peripheral counter modulo value. More... | |
static void | FTM_HAL_SetCounterInitVal (FTM_Type *ftmBase, uint16_t val) |
Sets the FTM peripheral timer counter initial value. More... | |
static uint16_t | FTM_HAL_GetCounterInitVal (FTM_Type *ftmBase) |
Returns the FTM peripheral counter initial value. More... | |
static void | FTM_HAL_SetChnMSnBAMode (FTM_Type *ftmBase, uint8_t channel, uint8_t selection) |
Sets the FTM peripheral timer channel mode. More... | |
static void | FTM_HAL_SetChnEdgeLevel (FTM_Type *ftmBase, uint8_t channel, uint8_t level) |
Sets the FTM peripheral timer channel edge level. More... | |
static uint8_t | FTM_HAL_GetChnMode (FTM_Type *ftmBase, uint8_t channel) |
Gets the FTM peripheral timer channel mode. More... | |
static uint8_t | FTM_HAL_GetChnEdgeLevel (FTM_Type *ftmBase, uint8_t channel) |
Gets the FTM peripheral timer channel edge level. More... | |
static void | FTM_HAL_SetChnDmaCmd (FTM_Type *ftmBase, uint8_t channel, bool val) |
Enables or disables the FTM peripheral timer channel DMA. More... | |
static bool | FTM_HAL_IsChnDma (FTM_Type *ftmBase, uint8_t channel) |
Returns whether the FTM peripheral timer channel DMA is enabled. More... | |
static bool | FTM_HAL_IsChnIntEnabled (FTM_Type *ftmBase, uint8_t channel) |
Gets the FTM channel(n) interrupt enabled or not. More... | |
static void | FTM_HAL_EnableChnInt (FTM_Type *ftmBase, uint8_t channel) |
Enables the FTM peripheral timer channel(n) interrupt. More... | |
static void | FTM_HAL_DisableChnInt (FTM_Type *ftmBase, uint8_t channel) |
Disables the FTM peripheral timer channel(n) interrupt. More... | |
static bool | FTM_HAL_HasChnEventOccurred (FTM_Type *ftmBase, uint8_t channel) |
Returns whether any event for the FTM peripheral timer channel has occurred. More... | |
static void | FTM_HAL_ClearChnEventFlag (FTM_Type *ftmBase, uint8_t channel) |
Clears the channel flag by writing a 0 to the CHF bit. More... | |
static void | FTM_HAL_SetChnCountVal (FTM_Type *ftmBase, uint8_t channel, uint16_t val) |
Sets the FTM peripheral timer channel counter value. More... | |
static uint16_t | FTM_HAL_GetChnCountVal (FTM_Type *ftmBase, uint8_t channel) |
Gets the FTM peripheral timer channel counter value. More... | |
static uint32_t | FTM_HAL_GetChnEventStatus (FTM_Type *ftmBase, uint8_t channel) |
Gets the FTM peripheral timer channel event status. More... | |
static void | FTM_HAL_ClearChnEventStatus (FTM_Type *ftmBase, uint8_t channel) |
Clears the FTM peripheral timer all channel event status. More... | |
static void | FTM_HAL_SetOutmaskReg (FTM_Type *ftmBase, uint32_t regVal) |
Writes the provided value to the OUTMASK register. More... | |
static void | FTM_HAL_SetChnOutputMask (FTM_Type *ftmBase, uint8_t channel, bool mask) |
Sets the FTM peripheral timer channel output mask. More... | |
static void | FTM_HAL_SetChnOutputInitStateCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t state) |
Sets the FTM peripheral timer channel output initial state 0 or 1. More... | |
static void | FTM_HAL_SetChnOutputPolarityCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t pol) |
Sets the FTM peripheral timer channel output polarity. More... | |
static void | FTM_HAL_SetChnFaultInputPolarityCmd (FTM_Type *ftmBase, uint8_t channel, uint8_t pol) |
Sets the FTM peripheral timer channel input polarity. More... | |
static void | FTM_HAL_EnableFaultInt (FTM_Type *ftmBase) |
Enables the FTM peripheral timer fault interrupt. More... | |
static void | FTM_HAL_DisableFaultInt (FTM_Type *ftmBase) |
Disables the FTM peripheral timer fault interrupt. More... | |
static void | FTM_HAL_SetFaultControlMode (FTM_Type *ftmBase, uint8_t mode) |
Defines the FTM fault control mode. More... | |
static void | FTM_HAL_SetCaptureTestCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM peripheral timer capture test mode. More... | |
static void | FTM_HAL_SetWriteProtectionCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM write protection. More... | |
static void | FTM_HAL_Enable (FTM_Type *ftmBase, bool enable) |
Enables the FTM peripheral timer group. More... | |
static void | FTM_HAL_SetInitChnOutputCmd (FTM_Type *ftmBase, bool enable) |
Initializes the channels output. More... | |
static void | FTM_HAL_SetPwmSyncMode (FTM_Type *ftmBase, bool enable) |
Sets the FTM peripheral timer sync mode. More... | |
static void | FTM_HAL_SetSoftwareTriggerCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM peripheral timer software trigger. More... | |
void | FTM_HAL_SetHardwareSyncTriggerSrc (FTM_Type *ftmBase, uint32_t trigger_num, bool enable) |
Sets the FTM peripheral timer hardware trigger. More... | |
static void | FTM_HAL_SetOutmaskPwmSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Determines when the OUTMASK register is updated with the value of its buffer. More... | |
static void | FTM_HAL_SetCountReinitSyncCmd (FTM_Type *ftmBase, bool enable) |
Determines if the FTM counter is re-initialized when the selected trigger for synchronization is detected. More... | |
static void | FTM_HAL_SetMaxLoadingCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM peripheral timer maximum loading points. More... | |
static void | FTM_HAL_SetMinLoadingCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM peripheral timer minimum loading points. More... | |
uint32_t | FTM_HAL_GetChnPairIndex (uint8_t channel) |
Combines the channel control. More... | |
static void | FTM_HAL_SetDualChnFaultCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables the FTM peripheral timer channel pair fault control. More... | |
static void | FTM_HAL_SetDualChnPwmSyncCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables or disables the FTM peripheral timer channel pair counter PWM sync. More... | |
static void | FTM_HAL_SetDualChnDeadtimeCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables or disabled the FTM peripheral timer channel pair deadtime insertion. More... | |
static void | FTM_HAL_SetDualChnDecapCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables or disables the FTM peripheral timer channel dual edge capture decap. More... | |
static void | FTM_HAL_SetDualEdgeCaptureCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables the FTM peripheral timer dual edge capture mode. More... | |
static void | FTM_HAL_SetDualChnCompCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables or disables the FTM peripheral timer channel pair output complement mode. More... | |
static void | FTM_HAL_SetDualChnCombineCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool enable) |
Enables or disables the FTM peripheral timer channel pair output combine mode. More... | |
static void | FTM_HAL_SetDeadtimePrescale (FTM_Type *ftmBase, ftm_deadtime_ps_t divider) |
Sets the FTM deadtime divider. More... | |
static void | FTM_HAL_SetDeadtimeCount (FTM_Type *ftmBase, uint8_t count) |
Sets the FTM deadtime value. More... | |
static void | FTM_HAL_SetInitTriggerCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the generation of the trigger when the FTM counter is equal to the CNTIN register. More... | |
void | FTM_HAL_SetChnTriggerCmd (FTM_Type *ftmBase, uint8_t channel, bool val) |
Enables or disables the generation of the FTM peripheral timer channel trigger. More... | |
static bool | FTM_HAL_IsChnTriggerGenerated (FTM_Type *ftmBase) |
Checks whether any channel trigger event has occurred. More... | |
static uint8_t | FTM_HAL_GetDetectedFaultInput (FTM_Type *ftmBase) |
Gets the FTM detected fault input. More... | |
static bool | FTM_HAL_IsWriteProtectionEnabled (FTM_Type *ftmBase) |
Checks whether the write protection is enabled. More... | |
static void | FTM_HAL_SetQuadDecoderCmd (FTM_Type *ftmBase, bool enable) |
Enables the channel quadrature decoder. More... | |
static void | FTM_HAL_SetQuadPhaseAFilterCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the phase A input filter. More... | |
static void | FTM_HAL_SetQuadPhaseBFilterCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the phase B input filter. More... | |
static void | FTM_HAL_SetQuadPhaseAPolarity (FTM_Type *ftmBase, ftm_quad_phase_polarity_t mode) |
Selects polarity for the quadrature decode phase A input. More... | |
static void | FTM_HAL_SetQuadPhaseBPolarity (FTM_Type *ftmBase, ftm_quad_phase_polarity_t mode) |
Selects polarity for the quadrature decode phase B input. More... | |
static void | FTM_HAL_SetQuadMode (FTM_Type *ftmBase, ftm_quad_decode_mode_t quadMode) |
Sets the encoding mode used in quadrature decoding mode. More... | |
static uint8_t | FTM_HAL_GetQuadDir (FTM_Type *ftmBase) |
Gets the FTM counter direction in quadrature mode. More... | |
static uint8_t | FTM_HAL_GetQuadTimerOverflowDir (FTM_Type *ftmBase) |
Gets the timer overflow direction in quadrature mode. More... | |
void | FTM_HAL_SetChnInputCaptureFilter (FTM_Type *ftmBase, uint8_t channel, uint8_t val) |
Sets the FTM peripheral timer channel input capture filter value. More... | |
static void | FTM_HAL_SetFaultInputFilterVal (FTM_Type *ftmBase, uint32_t val) |
Sets the fault input filter value. More... | |
static void | FTM_HAL_SetFaultInputFilterCmd (FTM_Type *ftmBase, uint8_t inputNum, bool val) |
Enables or disables the fault input filter. More... | |
static void | FTM_HAL_SetFaultInputCmd (FTM_Type *ftmBase, uint8_t inputNum, bool val) |
Enables or disables the fault input. More... | |
static void | FTM_HAL_SetDualChnInvertCmd (FTM_Type *ftmBase, uint8_t chnlPairNum, bool val) |
Enables or disables the channel invert for a channel pair. More... | |
static void | FTM_HAL_SetInvctrlReg (FTM_Type *ftmBase, uint32_t regVal) |
Writes the provided value to the Inverting Control register. More... | |
static void | FTM_HAL_SetChnSoftwareCtrlCmd (FTM_Type *ftmBase, uint8_t channel, bool val) |
Enables or disables the channel software output control. More... | |
static void | FTM_HAL_SetChnSoftwareCtrlVal (FTM_Type *ftmBase, uint8_t channel, bool val) |
Sets the channel software output control value. More... | |
static void | FTM_HAL_SetPwmLoadCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the loading of MOD, CNTIN, and CV with values of their write buffer. More... | |
static void | FTM_HAL_SetPwmLoadChnSelCmd (FTM_Type *ftmBase, uint8_t channel, bool val) |
Includes or excludes the channel in the matching process. More... | |
static void | FTM_HAL_SetGlobalTimeBaseOutputCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM global time base signal generation to other FTM's. More... | |
static void | FTM_HAL_SetGlobalTimeBaseCmd (FTM_Type *ftmBase, bool enable) |
Enables or disables the FTM timer global time base. More... | |
static void | FTM_HAL_SetBdmMode (FTM_Type *ftmBase, ftm_bdm_mode_t val) |
Sets the BDM mode. More... | |
static void | FTM_HAL_SetTofFreq (FTM_Type *ftmBase, uint8_t val) |
Sets the FTM timer TOF Frequency. More... | |
void | FTM_HAL_SetSyncMode (FTM_Type *ftmBase, uint32_t syncMethod) |
Sets the FTM register synchronization method. More... | |
static void | FTM_HAL_SetSwoctrlHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets the sync mode for the FTM SWOCTRL register when using a hardware trigger. More... | |
static void | FTM_HAL_SetInvctrlHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM INVCTRL register when using a hardware trigger. More... | |
static void | FTM_HAL_SetOutmaskHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM OUTMASK register when using a hardware trigger. More... | |
static void | FTM_HAL_SetModCntinCvHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM MOD, CNTIN and CV registers when using a hardware trigger. More... | |
static void | FTM_HAL_SetCounterHardwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM counter register when using a hardware trigger. More... | |
static void | FTM_HAL_SetSwoctrlSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM SWOCTRL register when using a software trigger. More... | |
static void | FTM_HAL_SetInvctrlSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM INVCTRL register when using a software trigger. More... | |
static void | FTM_HAL_SetOutmaskSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM OUTMASK register when using a software trigger. More... | |
static void | FTM_HAL_SetModCntinCvSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets synch mode for FTM MOD, CNTIN, and CV registers when using a software trigger. More... | |
static void | FTM_HAL_SetCounterSoftwareSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets sync mode for FTM counter register when using a software trigger. More... | |
static void | FTM_HAL_SetPwmSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets the PWM synchronization mode to enhanced or legacy. More... | |
static void | FTM_HAL_SetSwoctrlPwmSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets the SWOCTRL register PWM synchronization mode. More... | |
static void | FTM_HAL_SetInvctrlPwmSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets the INVCTRL register PWM synchronization mode. More... | |
static void | FTM_HAL_SetCntinPwmSyncModeCmd (FTM_Type *ftmBase, bool enable) |
Sets the CNTIN register PWM synchronization mode. More... | |
void | FTM_HAL_Reset (FTM_Type *ftmBase) |
Resets the FTM registers. More... | |
void | FTM_HAL_Init (FTM_Type *ftmBase) |
Initializes the FTM. More... | |
void | FTM_HAL_EnablePwmMode (FTM_Type *ftmBase, ftm_pwm_param_t *config, uint8_t channel) |
Enables the FTM timer when it is PWM output mode. More... | |
void | FTM_HAL_DisablePwmMode (FTM_Type *ftmBase, ftm_pwm_param_t *config, uint8_t channel) |
Disables the PWM output mode. More... | |
union ftm_edge_mode_t |
struct ftm_pwm_param_t |
Data Fields | |
ftm_config_mode_t | mode |
FlexTimer PWM operation mode. | |
ftm_pwm_edge_mode_t | edgeMode |
PWM output mode. | |
uint32_t | uFrequencyHZ |
PWM period in Hz. | |
uint32_t | uDutyCyclePercent |
PWM pulse width, value should be between 0 to 100 0=inactive signal(0% duty cycle)... More... | |
uint16_t | uFirstEdgeDelayPercent |
Used only in combined PWM mode to generate asymmetrical PWM. More... | |
uint32_t ftm_pwm_param_t::uDutyCyclePercent |
100=active signal (100% duty cycle).
uint16_t ftm_pwm_param_t::uFirstEdgeDelayPercent |
Specifies the delay to the first edge in a PWM period. If unsure please leave as 0, should be specified as percentage of the PWM period
struct ftm_dual_edge_capture_param_t |
Data Fields | |
ftm_dual_capture_edge_mode_t | mode |
Dual Edge Capture mode: one-shot or continuous. | |
ftm_input_capture_edge_mode_t | currChanEdgeMode |
Input Edge select for Channel n. | |
ftm_input_capture_edge_mode_t | nextChanEdgeMode |
Input Edge select for Channel n + 1. | |
struct ftm_phase_params_t |
Data Fields | |
bool | kFtmPhaseInputFilter |
false: disable phase filter, true: enable phase filter | |
uint32_t | kFtmPhaseFilterVal |
Filter value, used only if phase input filter is enabled. | |
ftm_quad_phase_polarity_t | kFtmPhasePolarity |
kFtmQuadPhaseNormal or kFtmQuadPhaseInvert | |
#define CHAN0_IDX (0U) |
#define CHAN1_IDX (1U) |
#define CHAN2_IDX (2U) |
#define CHAN3_IDX (3U) |
#define CHAN4_IDX (4U) |
#define CHAN5_IDX (5U) |
#define CHAN6_IDX (6U) |
#define CHAN7_IDX (7U) |
Toggle, clear or set.
enum ftm_bdm_mode_t |
enum ftm_status_t |
|
inlinestatic |
ftmBase | The FTM base address pointer |
clock | The FTM peripheral clock selection bits - 00: No clock 01: system clock 10: fixed clock 11: External clock |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
ps | The FTM peripheral clock pre-scale divider |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
mode | 1:upcounting mode 0:up_down counting mode |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | FTM timer counter value to be set |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | The value to be set to the timer modulo |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | initial value to be set |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
selection | The mode to be set valid value MSnB:MSnA : 00, 01, 10, 11 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
level | The rising or falling edge to be set, valid value ELSnB:ELSnA : 00, 01, 10, 11 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
val | enable or disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | FTM module base address. |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
val | counter value to be set |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
|
inlinestatic |
This function will mask/uumask multiple channels.
ftmBase | The FTM base address pointer |
regVal | value to be written to the register |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
mask | mask to be set 0 or 1, unmasked or masked |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
state | counter value to be set 0 or 1 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
pol | polarity to be set 0 or 1 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number |
pol | polarity to be set, 0: active high, 1:active low |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
mode,valid | options are 1, 2, 3, 4 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true to enable capture test mode, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true: Write-protection is enabled, false: Write-protection is disabled |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true: all registers including FTM-specific registers are available false: only the TPM-compatible registers are available |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true: the channels output is initialized according to the state of OUTINIT reg false: has no effect |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true: no restriction both software and hardware triggers can be used false: software trigger can only be used for MOD and CnV synch, hardware trigger only for OUTMASK and FTM counter synch. |
|
inlinestatic |
ftmBase | The FTM base address pointer. |
enable | true: software trigger is selected, false: software trigger is not selected |
void FTM_HAL_SetHardwareSyncTriggerSrc | ( | FTM_Type * | ftmBase, |
uint32_t | trigger_num, | ||
bool | enable | ||
) |
ftmBase | The FTM base address pointer |
trigger_num | 0, 1, 2 for trigger0, trigger1, and trigger3 |
enable | true: enable hardware trigger from field trigger_num for PWM synch false: disable hardware trigger from field trigger_num for PWM synch |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true if OUTMASK register is updated only by PWM sync false if OUTMASK register is updated in all rising edges of the system clock |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to update FTM counter when triggered , false to count normally |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable maximum loading point, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable minimum loading point, false to disable |
uint32_t FTM_HAL_GetChnPairIndex | ( | uint8_t | channel | ) |
Returns an index for each channel pair.
channel | The FTM peripheral channel number. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable fault control, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable PWM synchronization, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable deadtime insertion, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable dual edge capture mode, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable dual edge capture, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable complementary mode, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
enable | True to enable channel pair to combine, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
divider | The FTM peripheral prescale divider 0x :divided by 1, 10: divided by 4, 11:divided by 16 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
count | The FTM peripheral prescale divider 0: no counts inserted, 1: 1 count is inserted, 2: 2 count is inserted.... |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable, false to disable |
void FTM_HAL_SetChnTriggerCmd | ( | FTM_Type * | ftmBase, |
uint8_t | channel, | ||
bool | val | ||
) |
Enables or disables the generation of the FTM peripheral timer channel trigger when the FTM counter is equal to its initial value. Channels 6 and 7 cannot be used as triggers.
ftmBase | The FTM base address pointer |
channel | Channel to be enabled, valid value 0, 1, 2, 3, 4, 5 |
val | True to enable, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
This function reads the status for all fault inputs
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true enables the phase input filter, false disables the filter |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true enables the phase input filter, false disables the filter |
|
inlinestatic |
ftmBase | The FTM base address pointer |
mode | 0: Normal polarity, 1: Inverted polarity |
|
inlinestatic |
ftmBase | The FTM base address pointer |
mode | 0: Normal polarity, 1: Inverted polarity |
|
inlinestatic |
ftmBase | The FTM base address pointer |
quadMode | 0: Phase A and Phase B encoding mode 1: Count and direction encoding mode |
|
inlinestatic |
ftmBase | The FTM base address pointer |
|
inlinestatic |
ftmBase | The FTM base address pointer |
void FTM_HAL_SetChnInputCaptureFilter | ( | FTM_Type * | ftmBase, |
uint8_t | channel, | ||
uint8_t | val | ||
) |
ftmBase | The FTM base address pointer |
channel | The FTM peripheral channel number, only 0, 1, 2, 3, channel 4, 5, 6, 7 don't have. |
val | Filter value to be set |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | fault input filter value |
|
inlinestatic |
ftmBase | The FTM base address pointer |
inputNum | fault input to be configured, valid value 0, 1, 2, 3 |
val | true to enable fault input filter, false to disable fault input filter |
|
inlinestatic |
ftmBase | The FTM base address pointer |
inputNum | fault input to be configured, valid value 0, 1, 2, 3 |
val | true to enable fault input, false to disable fault input |
|
inlinestatic |
ftmBase | The FTM base address pointer |
chnlPairNum | The FTM peripheral channel pair number |
val | true to enable channel inverting, false to disable channel inver |
|
inlinestatic |
This function is enable/disable inverting control on multiple channel pairs.
ftmBase | The FTM base address pointer |
regVal | value to be written to the register |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | Channel to be enabled or disabled |
val | true to enable, channel output will be affected by software output control false to disable, channel output is unaffected |
|
inlinestatic |
ftmBase | The FTM base address pointer. |
channel | Channel to be configured |
val | True to set 1, false to set 0 |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true to enable, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
channel | Channel to be configured |
val | true means include the channel in the matching process false means do not include channel in the matching process |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | True to enable, false to disable |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | FTM behaviour in BDM mode, options are defined in the enum ftm_bdm_mode_t |
|
inlinestatic |
ftmBase | The FTM base address pointer |
val | Value of the TOF bit set frequency |
void FTM_HAL_SetSyncMode | ( | FTM_Type * | ftmBase, |
uint32_t | syncMethod | ||
) |
This function will set the necessary bits for the synchronization mode that user wishes to use.
ftmBase | The FTM base address pointer |
syncMethod | Synchronization method defined by ftm_sync_method_t enum. User can choose multiple synch methods by OR'ing options |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means the hardware trigger activates register sync false means the hardware trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means the hardware trigger activates register sync false means the hardware trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means hardware trigger activates register sync false means hardware trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means hardware trigger activates register sync false means hardware trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means hardware trigger activates register sync false means hardware trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means software trigger activates register sync false means software trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means software trigger activates register sync false means software trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means software trigger activates register sync false means software trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means software trigger activates register sync false means software trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means software trigger activates register sync false means software trigger does not activate register sync. |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means use Enhanced PWM synchronization false means to use Legacy mode |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means SWOCTRL register is updated by PWM synch false means SWOCTRL register is updated at all rising edges of system clock |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means INVCTRL register is updated by PWM synch false means INVCTRL register is updated at all rising edges of system clock |
|
inlinestatic |
ftmBase | The FTM base address pointer |
enable | true means CNTIN register is updated by PWM synch false means CNTIN register is updated at all rising edges of system clock |
void FTM_HAL_Reset | ( | FTM_Type * | ftmBase | ) |
ftmBase | The FTM base address pointer |
void FTM_HAL_Init | ( | FTM_Type * | ftmBase | ) |
ftmBase | The FTM base address pointer. |
void FTM_HAL_EnablePwmMode | ( | FTM_Type * | ftmBase, |
ftm_pwm_param_t * | config, | ||
uint8_t | channel | ||
) |
ftmBase | The FTM base address pointer |
config | PWM configuration parameter |
channel | The channel or channel pair number(combined mode). |
void FTM_HAL_DisablePwmMode | ( | FTM_Type * | ftmBase, |
ftm_pwm_param_t * | config, | ||
uint8_t | channel | ||
) |
ftmBase | The FTM base address pointer |
config | PWM configuration parameter |
channel | The channel or channel pair number(combined mode). |