36 #include "ftm_hw_access.h"
53 DEV_ASSERT((instance == 1U) || (instance == 2U));
62 FTM_DRV_SetQuadDecoderCmd(ftmBase,
false);
66 FTM_DRV_SetQuadMode(ftmBase, config->
mode);
87 FTM_DRV_SetCounterInitVal(ftmBase, config->
initialVal);
88 FTM_DRV_SetMod(ftmBase, config->
maxVal);
89 FTM_DRV_SetCounter(ftmBase, config->
initialVal);
91 FTM_DRV_SetQuadDecoderCmd(ftmBase,
true);
111 DEV_ASSERT((instance == 1U) || (instance == 2U));
116 FTM_DRV_SetQuadDecoderCmd(ftmBase,
false);
132 DEV_ASSERT((instance == 1U) || (instance == 2U));
138 state.
overflowFlag = FTM_DRV_HasTimerOverflowed(ftmBase);
FlexTimer state structure of the driver.
ftm_state_t * ftmStatePtr[(2u)]
Pointer to runtime state structure.
status_t FTM_DRV_QuadDecodeStart(uint32_t instance, const ftm_quad_decode_config_t *config)
Configures the quadrature mode and starts measurement.
ftm_phase_params_t phaseAConfig
ftm_phase_params_t phaseBConfig
ftm_quad_decode_mode_t mode
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
#define CHAN0_IDX
Channel number for CHAN1.
FTM quadrature configure structure.
ftm_quad_decoder_state_t FTM_DRV_QuadGetState(uint32_t instance)
Return the current quadrature decoder state (counter value, overflow flag and overflow direction) ...
status_t FTM_DRV_QuadDecodeStop(uint32_t instance)
De-activates the quadrature decode mode.
ftm_config_mode_t ftmMode
#define CHAN1_IDX
Channel number for CHAN2.
ftm_quad_phase_polarity_t phasePolarity
FTM quadrature state(counter value and flags)
static uint16_t FTM_DRV_GetCounter(const FTM_Type *ftmBase)
Returns the FTM peripheral current counter value.
FTM_Type *const g_ftmBase[(2u)]
Table of base addresses for FTM instances.