S32 SDK
FTM Module Counter Driver

Detailed Description

FlexTimer Peripheral Driver.

Data Structures

struct  ftm_timer_param_t
 FlexTimer driver timer mode configuration structure. More...
 

Functions

status_t FTM_DRV_InitCounter (uint32_t instance, const ftm_timer_param_t *timer)
 Initialize the FTM counter. More...
 
status_t FTM_DRV_CounterStart (uint32_t instance)
 Starts the FTM counter. More...
 
status_t FTM_DRV_CounterStop (uint32_t instance)
 Stops the FTM counter. More...
 
uint32_t FTM_DRV_CounterRead (uint32_t instance)
 Reads back the current value of the FTM counter. More...
 

Function Documentation

uint32_t FTM_DRV_CounterRead ( uint32_t  instance)

Reads back the current value of the FTM counter.

Parameters
[in]instanceThe FTM peripheral instance number.
Returns
The current counter value

Definition at line 153 of file ftm_mc_driver.c.

status_t FTM_DRV_CounterStart ( uint32_t  instance)

Starts the FTM counter.

Parameters
[in]instanceThe FTM peripheral instance number.
Returns
operation status
  • STATUS_SUCCESS : Completed successfully.
  • STATUS_ERROR : Error occurred.

Definition at line 112 of file ftm_mc_driver.c.

status_t FTM_DRV_CounterStop ( uint32_t  instance)

Stops the FTM counter.

Parameters
[in]instanceThe FTM peripheral instance number.
Returns
operation status
  • STATUS_SUCCESS : Completed successfully.

Definition at line 133 of file ftm_mc_driver.c.

status_t FTM_DRV_InitCounter ( uint32_t  instance,
const ftm_timer_param_t timer 
)

Initialize the FTM counter.

Starts the FTM counter. This function provides access to the FTM counter settings. The counter can be run in Up counting and Up-down counting modes. To run the counter in Free running mode, choose Up counting option and provide 0x0 for the countStartVal and 0xFFFF for countFinalVal. Please call this function only when FTM is used as timer/counter.

Parameters
[in]instanceThe FTM peripheral instance number.
[in]timerTimer configuration structure.
Returns
operation status
  • STATUS_SUCCESS : Initialized successfully.

Definition at line 53 of file ftm_mc_driver.c.