Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Quad Timer HAL driver

This section describes the programming interface of the Quad Timer HAL driver.

This section describes the programming interface of the Quad timer HAL driver. The Quad Timer HAL driver initializes the Quad timer registers and provides functions to set up the Quad Timer module to generate PWM signals and input capture.

Quad Timer HAL Initialization

The HAL driver provides the initialization (QUADTMR_HAL_Init()) function to initialize the Quad Timer module. It also provides a function (QUADTMR_HAL_SetupCounter()) to initialize the counters. This user needs to pass this structure to initialize the counter. These functions do not start the counter. The user must call QUADTMR_HAL_SetCountMode() to set the count mode and start the counter.

typedef struct QuadTmrCounterParams
{
uint16_t counterVal;

Quad Timer output signals

The HAL provides a function to force out a High or a Low signal (QUADTMR_HAL_ForceOutVal()) on the Quad Timer output pin. The HAL also has a function to output pulses (QUADTMR_HAL_OutPulses()). The user needs to specify the number of pulses to output and the source clock to use. Finally, HAL provides a function (QUADTMR_HAL_OutPwmSignal()) to generate a PWM signal. The user needs to calculate the high and low pulse count to be programmed to the Quad Timer compare registers.

Quad Timer for input capture

The HAL driver provides QUADTMR_HAL_SetupInputCapture() which allows the user to count the source clock cycles until a capture event arrives. The count is stored in the capture register and the counter is started by this function.