Kinetis SDK v.2.0 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
The KSDK provides a driver for the LPTMR module of Kinetis devices.
Files | |
file | fsl_lptmr.h |
Data Structures | |
struct | lptmr_config_t |
LPTMR config structure. More... | |
Driver version | |
#define | FSL_LPTMR_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
Version 2.0.0. | |
Initialization and deinitialization | |
void | LPTMR_Init (LPTMR_Type *base, const lptmr_config_t *config) |
Ungate the LPTMR clock and configures the peripheral for basic operation. More... | |
void | LPTMR_Deinit (LPTMR_Type *base) |
Gate the LPTMR clock. More... | |
void | LPTMR_GetDefaultConfig (lptmr_config_t *config) |
Fill in the LPTMR config struct with the default settings. More... | |
Interrupt Interface | |
static void | LPTMR_EnableInterrupts (LPTMR_Type *base, uint32_t mask) |
Enables the selected LPTMR interrupts. More... | |
static void | LPTMR_DisableInterrupts (LPTMR_Type *base, uint32_t mask) |
Disables the selected LPTMR interrupts. More... | |
static uint32_t | LPTMR_GetEnabledInterrupts (LPTMR_Type *base) |
Gets the enabled LPTMR interrupts. More... | |
Status Interface | |
static uint32_t | LPTMR_GetStatusFlags (LPTMR_Type *base) |
Gets the LPTMR status flags. More... | |
static void | LPTMR_ClearStatusFlags (LPTMR_Type *base, uint32_t mask) |
Clears the LPTMR status flags. More... | |
Read and Write the timer period | |
static void | LPTMR_SetTimerPeriod (LPTMR_Type *base, uint16_t ticks) |
Sets the timer period in units of count. More... | |
static uint16_t | LPTMR_GetCurrentTimerCount (LPTMR_Type *base) |
Reads the current timer counting value. More... | |
Timer Start and Stop | |
static void | LPTMR_StartTimer (LPTMR_Type *base) |
Starts the timer counting. More... | |
static void | LPTMR_StopTimer (LPTMR_Type *base) |
Stops the timer counting. More... | |
struct lptmr_config_t |
This structure holds the configuration settings for the LPTMR peripheral. To initialize this structure to reasonable defaults, call the LPTMR_GetDefaultConfig() function and pass a pointer to your config structure instance.
The config struct can be made const so it resides in flash
Data Fields | |
lptmr_timer_mode_t | timerMode |
Time counter mode or pulse counter mode. | |
lptmr_pin_select_t | pinSelect |
LPTMR pulse input pin select; used only in pulse counter mode. | |
lptmr_pin_polarity_t | pinPolarity |
LPTMR pulse input pin polarity; used only in pulse counter mode. | |
bool | enableFreeRunning |
true: enable free running, counter is reset on overflow false: counter is reset when the compare flag is set | |
bool | bypassPrescaler |
true: bypass prescaler; false: use clock from prescaler | |
lptmr_prescaler_clock_select_t | prescalerClockSource |
LPTMR clock source. | |
lptmr_prescaler_glitch_value_t | value |
Prescaler or glitch filter value. | |
enum lptmr_pin_select_t |
enum lptmr_pin_polarity_t |
enum lptmr_timer_mode_t |
enum lptmr_status_flags_t |
void LPTMR_Init | ( | LPTMR_Type * | base, |
const lptmr_config_t * | config | ||
) |
base | LPTMR peripheral base address |
config | Pointer to user's LPTMR config structure. |
void LPTMR_Deinit | ( | LPTMR_Type * | base | ) |
base | LPTMR peripheral base address |
void LPTMR_GetDefaultConfig | ( | lptmr_config_t * | config | ) |
The default values are:
config | Pointer to user's LPTMR config structure. |
|
inlinestatic |
base | LPTMR peripheral base address |
mask | The interrupts to enable. This is a logical OR of members of the enumeration lptmr_interrupt_enable_t |
|
inlinestatic |
base | LPTMR peripheral base address |
mask | The interrupts to disable. This is a logical OR of members of the enumeration lptmr_interrupt_enable_t |
|
inlinestatic |
base | LPTMR peripheral base address |
|
inlinestatic |
base | LPTMR peripheral base address |
|
inlinestatic |
base | LPTMR peripheral base address |
mask | The status flags to clear. This is a logical OR of members of the enumeration lptmr_status_flags_t |
|
inlinestatic |
Timers counts from 0 till it equals the count value set here. The count value is written to the CMR register.
base | LPTMR peripheral base address |
ticks | Timer period in units of ticks |
|
inlinestatic |
This function returns the real-time timer counting value, in a range from 0 to a timer period.
base | LPTMR peripheral base address |
|
inlinestatic |
After calling this function, the timer counts up to the CMR register value. Each time the timer reaches CMR value and then increments, it generates a trigger pulse and sets the timeout interrupt flag. An interrupt will also be triggered if the timer interrupt is enabled.
base | LPTMR peripheral base address |
|
inlinestatic |
This function stops the timer counting and resets the timer's counter register
base | LPTMR peripheral base address |