S32 SDK
ftm_ic_driver.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
14  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
15  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
35 #include "ftm_ic_driver.h"
36 
37 
38 /*******************************************************************************
39  * Code
40  ******************************************************************************/
41 static void FTM_DRV_InputCaptureHandler(uint32_t instance,
42  uint8_t channelPair);
43 
44 static void FTM_DRV_IrqHandler(uint32_t instance,
45  uint8_t channelPair);
46 
47 void FTM0_Ch0_Ch1_IRQHandler(void);
48 
49 void FTM0_Ch2_Ch3_IRQHandler(void);
50 
51 void FTM0_Ch4_Ch5_IRQHandler(void);
52 
53 void FTM0_Ch6_Ch7_IRQHandler(void);
54 
55 void FTM1_Ch0_Ch1_IRQHandler(void);
56 
57 void FTM1_Ch2_Ch3_IRQHandler(void);
58 
59 void FTM1_Ch4_Ch5_IRQHandler(void);
60 
61 void FTM1_Ch6_Ch7_IRQHandler(void);
62 
63 void FTM2_Ch0_Ch1_IRQHandler(void);
64 
65 void FTM2_Ch2_Ch3_IRQHandler(void);
66 
67 void FTM2_Ch4_Ch5_IRQHandler(void);
68 
69 void FTM2_Ch6_Ch7_IRQHandler(void);
70 
71 void FTM3_Ch0_Ch1_IRQHandler(void);
72 
73 void FTM3_Ch2_Ch3_IRQHandler(void);
74 
75 void FTM3_Ch4_Ch5_IRQHandler(void);
76 
77 void FTM3_Ch6_Ch7_IRQHandler(void);
78 
79 /*FUNCTION**********************************************************************
80  *
81  * Function Name : FTM_DRV_InitInputCapture
82  * Description : Configures Channel Input Capture for either getting time-stamps on edge detection
83  * or on signal measurement . When the edge specified in the captureMode
84  * argument occurs on the channel the FTM counter is captured into the CnV register.
85  * The user will have to read the CnV register separately to get this value. The filter
86  * function is disabled if the filterVal argument passed in is 0. The filter function
87  * is available only on channels 0,1,2,3.
88  *
89  * Implements : FTM_DRV_InitInputCapture_Activity
90  *END**************************************************************************/
92  const ftm_input_param_t * param)
93 {
94  DEV_ASSERT(instance < FTM_INSTANCE_COUNT);
95  DEV_ASSERT(param != NULL);
96  FTM_Type * ftmBase = g_ftmBase[instance];
97  uint8_t chnlPairNum = 0U;
98  uint8_t index = 0U;
99  uint8_t hwChannel = 0U;
100  ftm_signal_measurement_mode_t measurementType;
101  ftm_state_t * state = ftmStatePtr[instance];
102  status_t retStatus = STATUS_SUCCESS;
103 
104  if ((NULL != state) && (FTM_MODE_NOT_INITIALIZED == state->ftmMode))
105  {
106  FTM_DRV_SetClockSource(ftmBase, FTM_CLOCK_SOURCE_NONE);
107  FTM_DRV_SetCounterInitVal(ftmBase, 0U);
108  FTM_DRV_SetMod(ftmBase, param->nMaxCountValue);
109  FTM_DRV_SetCpwms(ftmBase, false);
110  /* Disable the combine mode */
111  FTM_DRV_SetDualChnMofCombineCmd(ftmBase, chnlPairNum, false);
112  FTM_DRV_SetDualChnCombineCmd(ftmBase, chnlPairNum, false);
113 
114  for (index = 0U; index < param->nNumChannels; index++)
115  {
116  hwChannel = param->inputChConfig[index].hwChannelId;
117  chnlPairNum = (uint8_t)(hwChannel >> 1U);
118  /* Save in state structure user define handlers */
119  state->channelsCallbacksParams[hwChannel] = param->inputChConfig[index].channelsCallbacksParams;
120  state->channelsCallbacks[hwChannel] = param->inputChConfig[index].channelsCallbacks;
121  /* Enable filtering for input channels */
122  if (hwChannel < CHAN4_IDX)
123  {
124  if (true == param->inputChConfig[index].filterEn)
125  {
126  FTM_DRV_SetChnInputCaptureFilter(ftmBase, hwChannel, (uint8_t)param->inputChConfig[index].filterValue);
127  }
128  else
129  {
130  FTM_DRV_SetChnInputCaptureFilter(ftmBase, hwChannel, 0U);
131  }
132  }
133 
134  if (FTM_EDGE_DETECT == param->inputChConfig[index].inputMode)
135  {
136  /* Disable the dual edge mode */
137  FTM_DRV_SetDualEdgeCaptureCmd(ftmBase, chnlPairNum, false);
138  /* Set input capture mode */
139  FTM_DRV_SetChnMSnBAMode(ftmBase, hwChannel, 0U);
140  /* Check if no edge is selected */
142  /* Set the event which will generate the interrupt */
143  FTM_DRV_SetChnEdgeLevel(ftmBase, hwChannel, (uint8_t)param->inputChConfig[index].edgeAlignement);
144  /* Enable interrupt request for the current channel */
145  FTM_DRV_EnableChnInt(ftmBase, hwChannel);
146  INT_SYS_EnableIRQ(g_ftmIrqId[instance][hwChannel]);
147  }
148  else if (FTM_SIGNAL_MEASUREMENT == param->inputChConfig[index].inputMode)
149  {
150  /* Enable the dual edge mode */
151  FTM_DRV_SetDualEdgeCaptureCmd(ftmBase, chnlPairNum, true);
152  /* Enable dual edge input capture */
153  FTM_DRV_SetDualChnDecapCmd(ftmBase, chnlPairNum, true);
154  /* If continuous mode is set*/
155  if (true == param->inputChConfig[index].continuousModeEn)
156  {
157  /* Set MSnA and MSnB bit*/
158  FTM_DRV_SetChnMSnBAMode(ftmBase, hwChannel, 3U);
159  }
160  else
161  {
162  /* Clear MSnA and Set MSnB bit*/
163  FTM_DRV_SetChnMSnBAMode(ftmBase, hwChannel, 2U);
164  }
165 
166  measurementType = param->inputChConfig[index].measurementType;
167  /* Check If want to measure a pulse width or period of the signal */
168  if ((FTM_PERIOD_ON_MEASUREMENT == measurementType) || (FTM_RISING_EDGE_PERIOD_MEASUREMENT== measurementType))
169  {
170  FTM_DRV_SetChnEdgeLevel(ftmBase, hwChannel, 1U);
171  if (FTM_PERIOD_ON_MEASUREMENT == measurementType)
172  {
173  /* Measure time between rising and falling edge - positive duty */
174  FTM_DRV_SetChnEdgeLevel(ftmBase, (uint8_t)(hwChannel + 1U), 2U);
175  }
176  else
177  {
178  /* If channel (n) is configured to capture falling edges (ELS(n)B:ELS(n)A = 0:1)
179  * then channel (n+1) also captures falling edges (ELS(n+1)B:ELS(n+1)A = 0:1) */
180  FTM_DRV_SetChnEdgeLevel(ftmBase, (uint8_t)(hwChannel + 1U), 1U);
181  }
182  }
183  else if ((FTM_PERIOD_OFF_MEASUREMENT == measurementType) || (FTM_FALLING_EDGE_PERIOD_MEASUREMENT == measurementType))
184  {
185  FTM_DRV_SetChnEdgeLevel(ftmBase, hwChannel, 2U);
186  if (FTM_PERIOD_OFF_MEASUREMENT == measurementType)
187  {
188  /* Measure time between falling and rising edge - negative duty */
189  FTM_DRV_SetChnEdgeLevel(ftmBase, (uint8_t)(hwChannel + 1U), 1U);
190  }
191  else
192  {
193  /* If channel (n) is configured to capture rising edges (ELS(n)B:ELS(n)A = 1:0) than
194  * channel (n+1) is setup to capture also raising edges (ELS(n+1)B:ELS(n+1)A = 1:0) */
195  FTM_DRV_SetChnEdgeLevel(ftmBase, (uint8_t)(hwChannel + 1U), 2U);
196  }
197  }
198  else
199  {
200  retStatus = STATUS_ERROR;
201  break;
202  }
203 
204  /* Enable the interrupt request for the channel which will indicate that the measurement is done. */
205  FTM_DRV_EnableChnInt(ftmBase, (uint8_t)(hwChannel + 1U));
206  INT_SYS_EnableIRQ(g_ftmIrqId[instance][hwChannel]);
207  }
208  else
209  {
210  /* Do nothing */
211  }
212  }
213 
214  if (STATUS_SUCCESS == retStatus)
215  {
217  /* Set clock source to start the counter */
218  FTM_DRV_SetClockSource(ftmBase, state->ftmClockSource);
219  }
220  }
221  else
222  {
223  retStatus = STATUS_ERROR;
224  }
225 
226  return retStatus;
227 }
228 
229 /*FUNCTION**********************************************************************
230  *
231  * Function Name : FTM_DRV_DeinitInputCapture
232  * Description : Disables Channel Input Capture
233  *
234  * Implements : FTM_DRV_DeinitInputCapture_Activity
235  *END**************************************************************************/
237  const ftm_input_param_t * param)
238 {
239  DEV_ASSERT(instance < FTM_INSTANCE_COUNT);
240  DEV_ASSERT(param != NULL);
241  FTM_Type * ftmBase = g_ftmBase[instance];
242  uint8_t chnlPairNum = 0U;
243  uint8_t index = 0U;
244  uint8_t hwChannel = 0U;
245  ftm_state_t * state = ftmStatePtr[instance];
246 
247  /* FTM counter is disabled */
248  FTM_DRV_SetClockSource(ftmBase, FTM_CLOCK_SOURCE_NONE);
249  FTM_DRV_SetCounterInitVal(ftmBase, 0U);
250  FTM_DRV_SetMod(ftmBase, 0xFFFFU);
251  FTM_DRV_SetCpwms(ftmBase, false);
252  for (index = 0U; index < param->nNumChannels; index++)
253  {
254  hwChannel = param->inputChConfig[index].hwChannelId;
255  chnlPairNum = (uint8_t)(hwChannel >> 1U);
256  /* Disable filtering for input channels */
257  if (hwChannel < CHAN4_IDX)
258  {
259  FTM_DRV_SetChnInputCaptureFilter(ftmBase, hwChannel, 0U);
260  }
261 
262  FTM_DRV_SetDualChnCombineCmd(ftmBase, chnlPairNum, false);
263  FTM_DRV_SetDualEdgeCaptureCmd(ftmBase, chnlPairNum, false);
264  FTM_DRV_SetChnEdgeLevel(ftmBase, hwChannel, (uint8_t)0U);
265  FTM_DRV_DisableChnInt(ftmBase, hwChannel);
266  }
267 
268  /* Clear Callbacks function from the state structure */
269  for (index = 0U; index < FEATURE_FTM_CHANNEL_COUNT; index++)
270  {
271  state->channelsCallbacksParams[index] = NULL;
272  state->channelsCallbacks[index] = NULL;
273  }
274 
276 
277  return STATUS_SUCCESS;
278 }
279 
280 /*FUNCTION**********************************************************************
281  *
282  * Function Name : FTM_DRV_GetInputCaptureMeasurement
283  * Description : This function is used to calculate the measurement and/or time stamps values
284  * which are read from the C(n, n+1)V registers and stored to the static buffers.
285  *
286  * Implements : FTM_DRV_GetInputCaptureMeasurement_Activity
287  *END**************************************************************************/
288 uint16_t FTM_DRV_GetInputCaptureMeasurement(uint32_t instance,
289  uint8_t channel)
290 {
291  DEV_ASSERT(instance < FTM_INSTANCE_COUNT);
293  const ftm_state_t * state = ftmStatePtr[instance];
294 
295  return state->measurementResults[channel];
296 }
297 
298 /*FUNCTION**********************************************************************
299  *
300  * Function Name : FTM_DRV_StartNewSignalMeasurement
301  * Description : This function starts new Signal Measurements on a dual input compare channel
302  * that is configured as single-shot measurement.
303  *
304  * Implements : FTM_DRV_StartNewSignalMeasurement_Activity
305  *END**************************************************************************/
307  uint8_t channel)
308 {
309  DEV_ASSERT(instance < FTM_INSTANCE_COUNT);
311  /* Clear CH(n)F and CH(n+1)F flags and Set DECAP bit */
312  FTM_Type * ftmBase = g_ftmBase[instance];
313  uint8_t chnlPairNum = (uint8_t)(channel >> 1U);
314 
315  /* Get channel mode */
317  {
318  if (FTM_DRV_GetDualChnCombineCmd(ftmBase, chnlPairNum))
319  {
320  /* Clear event flags for channel n and n + 1 */
321  FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)(channel + 1U));
322  FTM_DRV_ClearChnEventFlag(ftmBase, channel);
323  /* Set DECAP bit to start measurement */
324  FTM_DRV_SetDualChnDecapCmd(ftmBase, chnlPairNum, true);
325  }
326  }
327  else
328  {
329  /* Nothing to do */
330  }
331 
332  return STATUS_SUCCESS;
333 }
334 
335 /* Implementation of FTM0_Ch0_Ch1_IRQHandler master handler named in startup code. */
337 {
338  FTM_DRV_IrqHandler(0U, 0U);
339 }
340 
341 /* Implementation of FTM0_Ch2_Ch3_IRQHandler master handler named in startup code. */
343 {
344  FTM_DRV_IrqHandler(0U, 1U);
345 }
346 
347 /* Implementation of FTM0_Ch4_Ch5_IRQHandler master handler named in startup code. */
349 {
350  FTM_DRV_IrqHandler(0U, 2U);
351 }
352 
353 /* Implementation of FTM0_Ch6_Ch7_IRQHandler master handler named in startup code. */
355 {
356  FTM_DRV_IrqHandler(0U, 3U);
357 }
358 
359 /* Implementation of FTM1_Ch0_Ch1_IRQHandler master handler named in startup code. */
361 {
362  FTM_DRV_IrqHandler(1U, 0U);
363 }
364 
365 /* Implementation of FTM1_Ch2_Ch3_IRQHandler master handler named in startup code. */
367 {
368  FTM_DRV_IrqHandler(1U, 1U);
369 }
370 
371 /* Implementation of FTM1_Ch4_Ch5_IRQHandler master handler named in startup code. */
373 {
374  FTM_DRV_IrqHandler(1U, 2U);
375 }
376 
377 /* Implementation of FTM1_Ch6_Ch7_IRQHandler master handler named in startup code. */
379 {
380  FTM_DRV_IrqHandler(1U, 3U);
381 }
382 
383 /* Implementation of FTM2_Ch0_Ch1_IRQHandler master handler named in startup code. */
385 {
386  FTM_DRV_IrqHandler(2U, 0U);
387 }
388 
389 /* Implementation of FTM2_Ch2_Ch3_IRQHandler master handler named in startup code. */
391 {
392  FTM_DRV_IrqHandler(2U, 1U);
393 }
394 
395 /* Implementation of FTM2_Ch4_Ch5_IRQHandler master handler named in startup code. */
397 {
398  FTM_DRV_IrqHandler(2U, 2U);
399 }
400 
401 /* Implementation of FTM2_Ch6_Ch7_IRQHandler master handler named in startup code. */
403 {
404  FTM_DRV_IrqHandler(2U, 3U);
405 }
406 
407 /* Implementation of FTM3_Ch0_Ch1_IRQHandler master handler named in startup code. */
409 {
410  FTM_DRV_IrqHandler(3U, 0U);
411 }
412 
413 /* Implementation of FTM3_Ch2_Ch3_IRQHandler master handler named in startup code. */
415 {
416  FTM_DRV_IrqHandler(3U, 1U);
417 }
418 
419 /* Implementation of FTM3_Ch4_Ch5_IRQHandler master handler named in startup code. */
421 {
422  FTM_DRV_IrqHandler(3U, 2U);
423 }
424 
425 /* Implementation of FTM3_Ch6_Ch7_IRQHandler master handler named in startup code. */
427 {
428  FTM_DRV_IrqHandler(3U, 3U);
429 }
430 
431 static void FTM_DRV_IrqHandler(uint32_t instance,
432  uint8_t channelPair)
433 {
434  const ftm_state_t * state = ftmStatePtr[instance];
435  switch (state->ftmMode)
436  {
438  FTM_DRV_InputCaptureHandler(instance, channelPair);
439  break;
440  default:
441  /* Nothing to do */
442  break;
443  }
444 }
445 
446 static void FTM_DRV_InputCaptureHandler(uint32_t instance,
447  uint8_t channelPair)
448 {
449  ftm_state_t * state = ftmStatePtr[instance];
450  FTM_Type * ftmBase = g_ftmBase[instance];
451 
452  /* Verify the mode for current pair of channels */
453  if (FTM_DRV_GetDualEdgeCaptureBit(ftmBase, channelPair))
454  {
455  /* Dual edge input capture case */
456  uint16_t first_event_time = FTM_DRV_GetChnCountVal(ftmBase, (uint8_t)(channelPair << 1U));
457  uint16_t second_event_time = FTM_DRV_GetChnCountVal(ftmBase, (uint8_t)((channelPair << 1U) + 1U));
458  if (second_event_time < first_event_time)
459  {
460  /* Measurement when overflow occurred */
461  state->measurementResults[channelPair << 1U] = (uint16_t)(second_event_time + (FTM_DRV_GetMod(ftmBase) - first_event_time));
462  }
463  else
464  {
465  /* Measurement when overflow doesn't occurred */
466  state->measurementResults[channelPair << 1U] = (uint16_t)(second_event_time - first_event_time);
467  }
468 
469  /* Clear flags for channels n and n+1 */
470  FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)(channelPair << 1U));
471  FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)((channelPair << 1U) + 1U));
472  /* If the callback is define use it */
473  if ((state->channelsCallbacks[(channelPair << 1U)]) != NULL)
474  {
475  state->channelsCallbacks[(channelPair << 1U)](state->channelsCallbacksParams[channelPair << 1U]);
476  }
477  }
478  else
479  {
480  /* To get the channel interrupt source the both channels flag must be checked */
481  if (FTM_DRV_HasChnEventOccurred(ftmBase, (uint8_t)(channelPair << 1U)))
482  {
483  /* Get the time stamp of the event */
484  state->measurementResults[channelPair << 1U] = FTM_DRV_GetChnCountVal(ftmBase, (uint8_t)(channelPair << 1U));
485  /* Clear the flag for C(n) channel */
486  FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)(channelPair << 1U));
487  /* If the callback is define use it */
488  if ((state->channelsCallbacks[channelPair << 1U]) != NULL)
489  {
490  state->channelsCallbacks[channelPair << 1U](state->channelsCallbacksParams[channelPair << 1U]);
491  }
492  }
493  else
494  {
495  /* Get the time stamp of the event */
496  state->measurementResults[(channelPair << 1U) + 1U] = FTM_DRV_GetChnCountVal(ftmBase, (uint8_t)((channelPair << 1U) + 1U));
497  /* Clear the flag for C(n+1) channel */
498  FTM_DRV_ClearChnEventFlag(ftmBase, (uint8_t)((channelPair << 1U) + 1U));
499  /* If the callback is define use it */
500  if ((state->channelsCallbacks[(channelPair << 1U) + 1U]) != NULL)
501  {
502  state->channelsCallbacks[(channelPair << 1U) + 1U](state->channelsCallbacksParams[(channelPair << 1U) + 1U]);
503  }
504  }
505  }
506 }
507 
508 /*******************************************************************************
509 * EOF
510 ******************************************************************************/
void FTM1_Ch0_Ch1_IRQHandler(void)
#define FTM_FEATURE_INPUT_CAPTURE_SINGLE_SHOT
void FTM2_Ch2_Ch3_IRQHandler(void)
void FTM0_Ch4_Ch5_IRQHandler(void)
static uint16_t FTM_DRV_GetChnCountVal(const FTM_Type *ftmBase, uint8_t channel)
Gets the FTM peripheral timer channel counter value.
Definition: ftm_common.h:660
FlexTimer state structure of the driver.
Definition: ftm_common.h:121
void FTM1_Ch4_Ch5_IRQHandler(void)
ftm_edge_alignment_mode_t edgeAlignement
Definition: ftm_ic_driver.h:90
ftm_channel_event_callback_t channelsCallbacks
Definition: ftm_ic_driver.h:96
FTM_Type *const g_ftmBase[FTM_INSTANCE_COUNT]
Table of base addresses for FTM instances.
Definition: ftm_common.c:70
void FTM2_Ch0_Ch1_IRQHandler(void)
FlexTimer driver input capture parameters.
status_t FTM_DRV_StartNewSignalMeasurement(uint32_t instance, uint8_t channel)
Starts new single-shot signal measurement of the given channel.
void FTM1_Ch2_Ch3_IRQHandler(void)
const ftm_input_ch_param_t * inputChConfig
void FTM3_Ch4_Ch5_IRQHandler(void)
ftm_state_t * ftmStatePtr[FTM_INSTANCE_COUNT]
Pointer to runtime state structure.
Definition: ftm_common.c:83
static void FTM_DRV_InputCaptureHandler(uint32_t instance, uint8_t channelPair)
void FTM3_Ch0_Ch1_IRQHandler(void)
void FTM2_Ch6_Ch7_IRQHandler(void)
static void FTM_DRV_IrqHandler(uint32_t instance, uint8_t channelPair)
#define FEATURE_FTM_CHANNEL_COUNT
void * channelsCallbacksParams[FEATURE_FTM_CHANNEL_COUNT]
Definition: ftm_common.h:128
void FTM3_Ch2_Ch3_IRQHandler(void)
static uint8_t FTM_DRV_GetChnMode(const FTM_Type *ftmBase, uint8_t channel)
Gets the FTM peripheral timer channel mode.
Definition: ftm_common.h:421
static bool FTM_DRV_GetDualChnCombineCmd(const FTM_Type *ftmBase, uint8_t chnlPairNum)
Verify if an channels pair is used in combine mode or not.
Definition: ftm_common.h:915
#define DEV_ASSERT(x)
Definition: devassert.h:77
ftm_clock_source_t ftmClockSource
Definition: ftm_common.h:123
status_t FTM_DRV_InitInputCapture(uint32_t instance, const ftm_input_param_t *param)
Configures Channel Input Capture for either getting time-stamps on edge detection or on signal measur...
Definition: ftm_ic_driver.c:91
void * channelsCallbacksParams
Definition: ftm_ic_driver.h:95
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
Definition: status.h:44
uint16_t nMaxCountValue
#define FTM_INSTANCE_COUNT
Definition: S32K142.h:3939
uint16_t measurementResults[FEATURE_FTM_CHANNEL_COUNT]
Definition: ftm_common.h:127
status_t FTM_DRV_DeinitInputCapture(uint32_t instance, const ftm_input_param_t *param)
Disables input capture mode and clears FTM timer configuration.
static bool FTM_DRV_GetDualEdgeCaptureBit(const FTM_Type *ftmBase, uint8_t chnlPairNum)
Enables the FTM peripheral timer dual edge capture mode.
Definition: ftm_common.h:895
ftm_channel_event_callback_t channelsCallbacks[FEATURE_FTM_CHANNEL_COUNT]
Definition: ftm_common.h:129
void FTM1_Ch6_Ch7_IRQHandler(void)
ftm_signal_measurement_mode_t measurementType
Definition: ftm_ic_driver.h:91
ftm_signal_measurement_mode_t
FlexTimer input capture measurement type for dual edge input capture.
Definition: ftm_ic_driver.h:59
ftm_config_mode_t ftmMode
Definition: ftm_common.h:124
void FTM0_Ch6_Ch7_IRQHandler(void)
void INT_SYS_EnableIRQ(IRQn_Type irqNumber)
Enables an interrupt for a given IRQ number.
static bool FTM_DRV_HasChnEventOccurred(const FTM_Type *ftmBase, uint8_t channel)
Returns whether any event for the FTM peripheral timer channel has occurred.
Definition: ftm_common.h:564
static uint16_t FTM_DRV_GetMod(const FTM_Type *ftmBase)
Returns the FTM peripheral counter modulo value.
Definition: ftm_common.h:372
ftm_input_op_mode_t inputMode
Definition: ftm_ic_driver.h:89
void FTM3_Ch6_Ch7_IRQHandler(void)
void FTM2_Ch4_Ch5_IRQHandler(void)
void FTM0_Ch2_Ch3_IRQHandler(void)
uint16_t FTM_DRV_GetInputCaptureMeasurement(uint32_t instance, uint8_t channel)
This function is used to calculate the measurement and/or time stamps values which are read from the ...
const IRQn_Type g_ftmIrqId[FTM_INSTANCE_COUNT][FEATURE_FTM_CHANNEL_COUNT]
Interrupt vectors for the FTM peripheral.
Definition: ftm_common.c:73
void FTM0_Ch0_Ch1_IRQHandler(void)