![]() |
S32 SDK
|
Low Power Timer Hardware Abstraction Layer.
This HAL provides low-level access to all hardware features of the LPTMR.
LPTMR HAL Functions | |
void | LPTMR_HAL_Init (LPTMR_Type *const base) |
Initialize the LPTMR instance to reset values. More... | |
static bool | LPTMR_HAL_GetDmaRequest (const LPTMR_Type *const base) |
Get the DMA Request Enable Flag. More... | |
static void | LPTMR_HAL_SetDmaRequest (LPTMR_Type *const base, bool enable) |
Configure the DMA Request Enable Flag state. More... | |
static bool | LPTMR_HAL_GetCompareFlag (const LPTMR_Type *const base) |
Get the Compare Flag state. More... | |
static void | LPTMR_HAL_ClearCompareFlag (LPTMR_Type *const base) |
Clear the Compare Flag. More... | |
static bool | LPTMR_HAL_GetInterruptEnable (const LPTMR_Type *const base) |
Get the Interrupt Enable state. More... | |
static void | LPTMR_HAL_SetInterrupt (LPTMR_Type *const base, bool enable) |
Configure the Interrupt Enable state. More... | |
static lptmr_pinselect_t | LPTMR_HAL_GetPinSelect (const LPTMR_Type *const base) |
Get the Pin select for Counter Mode. More... | |
static void | LPTMR_HAL_SetPinSelect (LPTMR_Type *const base, const lptmr_pinselect_t pinsel) |
Configure the Pin selection for Pulse Counter Mode. More... | |
static lptmr_pinpolarity_t | LPTMR_HAL_GetPinPolarity (const LPTMR_Type *const base) |
Get Pin Polarity for Pulse Counter Mode. More... | |
static void | LPTMR_HAL_SetPinPolarity (LPTMR_Type *const base, const lptmr_pinpolarity_t pol) |
Configure Pin Polarity for Pulse Counter Mode. More... | |
static bool | LPTMR_HAL_GetFreeRunning (const LPTMR_Type *const base) |
Get the Free Running state. More... | |
static void | LPTMR_HAL_SetFreeRunning (LPTMR_Type *const base, const bool enable) |
Configure the Free Running state. More... | |
static lptmr_workmode_t | LPTMR_HAL_GetWorkMode (const LPTMR_Type *const base) |
Get current Work Mode. More... | |
static void | LPTMR_HAL_SetWorkMode (LPTMR_Type *const base, const lptmr_workmode_t mode) |
Configure the Work Mode. More... | |
static bool | LPTMR_HAL_GetEnable (const LPTMR_Type *const base) |
Get the Enable state. More... | |
static void | LPTMR_HAL_Enable (LPTMR_Type *const base) |
Enable the LPTMR. More... | |
static void | LPTMR_HAL_Disable (LPTMR_Type *const base) |
Disable the LPTMR. More... | |
static lptmr_prescaler_t | LPTMR_HAL_GetPrescaler (const LPTMR_Type *const base) |
Get Prescaler/Glitch Filter divider value. More... | |
static void | LPTMR_HAL_SetPrescaler (LPTMR_Type *const base, const lptmr_prescaler_t presc) |
Configure the Prescaler/Glitch Filter divider value. More... | |
static bool | LPTMR_HAL_GetBypass (const LPTMR_Type *const base) |
Get the Prescaler/Glitch Filter Bypass enable state. More... | |
static void | LPTMR_HAL_SetBypass (LPTMR_Type *const base, const bool enable) |
Configure the Prescaler/Glitch Filter Bypass enable state. More... | |
static lptmr_clocksource_t | LPTMR_HAL_GetClockSelect (const LPTMR_Type *const base) |
Get the LPTMR input Clock selection. More... | |
static void | LPTMR_HAL_SetClockSelect (LPTMR_Type *const base, const lptmr_clocksource_t clocksel) |
Configure the LPTMR input Clock selection. More... | |
static uint16_t | LPTMR_HAL_GetCompareValue (const LPTMR_Type *const base) |
Get the Compare Value. More... | |
static void | LPTMR_HAL_SetCompareValue (LPTMR_Type *const base, const uint16_t compval) |
Configure the Compare Value. More... | |
static uint16_t | LPTMR_HAL_GetCounterValue (LPTMR_Type *const base) |
Get the current Counter Value. More... | |
enum lptmr_clocksource_t |
Clock Source selection Implements : lptmr_clocksource_t_Class.
Enumerator | |
---|---|
LPTMR_CLOCKSOURCE_SIRCDIV2 |
SIRC clock |
LPTMR_CLOCKSOURCE_1KHZ_LPO |
1kHz LPO clock |
LPTMR_CLOCKSOURCE_RTC |
RTC clock |
LPTMR_CLOCKSOURCE_PCC |
PCC configured clock |
Definition at line 101 of file lptmr_hal.h.
enum lptmr_pinpolarity_t |
Pulse Counter input polarity Implements : lptmr_pinpolarity_t_Class.
Enumerator | |
---|---|
LPTMR_PINPOLARITY_RISING |
Count pulse on rising edge |
LPTMR_PINPOLARITY_FALLING |
Count pulse on falling edge |
Definition at line 63 of file lptmr_hal.h.
enum lptmr_pinselect_t |
Pulse Counter Input selection Implements : lptmr_pinselect_t_Class.
Definition at line 53 of file lptmr_hal.h.
enum lptmr_prescaler_t |
Prescaler Selection Implements : lptmr_prescaler_t_Class.
Definition at line 79 of file lptmr_hal.h.
enum lptmr_workmode_t |
Work Mode Implements : lptmr_workmode_t_Class.
Enumerator | |
---|---|
LPTMR_WORKMODE_TIMER |
Timer |
LPTMR_WORKMODE_PULSECOUNTER |
Pulse counter |
Definition at line 71 of file lptmr_hal.h.
|
inlinestatic |
Clear the Compare Flag.
This function clears the Compare Flag/Interrupt Pending state.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_ClearCompareFlag_Activity
Definition at line 219 of file lptmr_hal.h.
|
inlinestatic |
Disable the LPTMR.
Disable the LPTMR. Stop the Counter/Timer and allow reconfiguration.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_Disable_Activity
Definition at line 539 of file lptmr_hal.h.
|
inlinestatic |
Enable the LPTMR.
Enable the LPTMR. Starts the timer/counter.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_Enable_Activity
Definition at line 518 of file lptmr_hal.h.
|
inlinestatic |
Get the Prescaler/Glitch Filter Bypass enable state.
This function checks whether the Prescaler/Glitch Filter Bypass is enabled.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetBypass_Activity
Definition at line 639 of file lptmr_hal.h.
|
inlinestatic |
Get the LPTMR input Clock selection.
This function returns the current configured input Clock for the LPTMR.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetClockSelect_Activity
Definition at line 688 of file lptmr_hal.h.
|
inlinestatic |
Get the Compare Flag state.
This function checks whether a Compare Match event has occurred or if there is an Interrupt Pending.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetCompareFlag_Activity
Definition at line 199 of file lptmr_hal.h.
|
inlinestatic |
Get the Compare Value.
This function returns the current Compare Value.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetCompareValue_Activity
Definition at line 735 of file lptmr_hal.h.
|
inlinestatic |
Get the current Counter Value.
This function returns the Counter Value.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetCounterValue_Activity
Definition at line 779 of file lptmr_hal.h.
|
inlinestatic |
Get the DMA Request Enable Flag.
This function checks whether a DMA Request feature of the LPTMR is enabled. The DMA Request is issued when a Compare Match is asserted. If enabled, the Compare Match/Interrupt Pending flag is cleared when the DMA controller is done.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetDmaRequest_Activity
Definition at line 146 of file lptmr_hal.h.
|
inlinestatic |
Get the Enable state.
Prior to reconfiguring the LPTMR, it is necessary to disable it.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetEnable_Activity
Definition at line 497 of file lptmr_hal.h.
|
inlinestatic |
Get the Free Running state.
This function checks whether the Free Running feature of the LPTMR is enabled or disabled.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetFreeRunning_Activity
Definition at line 398 of file lptmr_hal.h.
|
inlinestatic |
Get the Interrupt Enable state.
This function returns the Interrupt Enable state for the LPTMR. If enabled, an interrupt is generated when a Compare Match event occurs.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetInterruptEnable_Activity
Definition at line 246 of file lptmr_hal.h.
|
inlinestatic |
Get Pin Polarity for Pulse Counter Mode.
This function returns the configured pin polarity that triggers an increment in Pulse Counter Mode.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetPinPolarity_Activity
Definition at line 348 of file lptmr_hal.h.
|
inlinestatic |
Get the Pin select for Counter Mode.
This function returns the configured Input Pin for Pulse Counter Mode.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetPinSelect_Activity
Definition at line 297 of file lptmr_hal.h.
|
inlinestatic |
Get Prescaler/Glitch Filter divider value.
This function returns the currently configured Prescaler/Glitch Filter divider value.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetPrescaler_Activity
Definition at line 578 of file lptmr_hal.h.
|
inlinestatic |
Get current Work Mode.
This function returns the currently configured Work Mode for the LPTMR.
[in] | base | - lptmr base pointer |
Implements : LPTMR_HAL_GetWorkMode_Activity
Definition at line 448 of file lptmr_hal.h.
void LPTMR_HAL_Init | ( | LPTMR_Type *const | base | ) |
Initialize the LPTMR instance to reset values.
This function initializes the LPTMR instance to a known state (the register are written with their reset values from the Reference Manual).
[in] | base | - lptmr base pointer |
Definition at line 43 of file lptmr_hal.c.
|
inlinestatic |
Configure the Prescaler/Glitch Filter Bypass enable state.
This function configures the Prescaler/Glitch filter Bypass. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | enable | - the new Prescaler/Glitch Filter Bypass state
|
Implements : LPTMR_HAL_SetBypass_Activity
Definition at line 663 of file lptmr_hal.h.
|
inlinestatic |
Configure the LPTMR input Clock selection.
This function configures a clock source for the LPTMR. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | clocksel | - new Clock Source
|
Implements : LPTMR_HAL_SetClockSelect_Activity
Definition at line 713 of file lptmr_hal.h.
|
inlinestatic |
Configure the Compare Value.
This function configures the Compare Value. If set to 0, the Compare Match event and the hardware trigger assert and remain asserted until the timer is disabled.
[in] | base | - lptmr base pointer |
[in] | compval | - the new Compare Value |
Implements : LPTMR_HAL_SetCompareValue_Activity
Definition at line 757 of file lptmr_hal.h.
|
inlinestatic |
Configure the DMA Request Enable Flag state.
This function configures the DMA Request feature of the LPTMR. If enabled, a DMA Request is issued when the Compare Match event occurs. If enabled, the Compare Match/Interrupt Pending flag is cleared when the DMA controller is done.
[in] | base | - lptmr base pointer |
[in] | enable | - the new state of the DMA Request Enable Flag
|
Implements : LPTMR_HAL_SetDmaRequest_Activity
Definition at line 173 of file lptmr_hal.h.
|
inlinestatic |
Configure the Free Running state.
This function configures the Free Running feature of the LPTMR. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | enable | - the new Free Running state
|
Implements : LPTMR_HAL_SetFreeRunning_Activity
Definition at line 422 of file lptmr_hal.h.
|
inlinestatic |
Configure the Interrupt Enable state.
This function configures the Interrupt Enable state for the LPTMR. If enabled, an interrupt is generated when a Compare Match event occurs.
[in] | base | - lptmr base pointer |
[in] | enable | - the new state for the interrupt
|
Implements : LPTMR_HAL_SetInterrupt_Activity
Definition at line 270 of file lptmr_hal.h.
|
inlinestatic |
Configure Pin Polarity for Pulse Counter Mode.
This function configures the pin polarity that triggers an increment in Pulse Counter Mode. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | pol | - the pin polarity to count in Pulse Counter Mode
|
Implements : LPTMR_HAL_SetPinPolarity_Activity
Definition at line 372 of file lptmr_hal.h.
|
inlinestatic |
Configure the Pin selection for Pulse Counter Mode.
This function configures the input Pin selection for Pulse Counter Mode. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | pinsel | - pin selection
|
Implements : LPTMR_HAL_SetPinSelect_Activity
Definition at line 322 of file lptmr_hal.h.
|
inlinestatic |
Configure the Prescaler/Glitch Filter divider value.
This function configures the value for the Prescaler/Glitch Filter. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | presc | - the new Prescaler value
|
Implements : LPTMR_HAL_SetPrescaler_Activity
Definition at line 615 of file lptmr_hal.h.
|
inlinestatic |
Configure the Work Mode.
This function configures the LPTMR to either Timer Mode or Pulse Counter Mode. This feature can be configured only when the LPTMR is disabled.
[in] | base | - lptmr base pointer |
[in] | mode | - new Work Mode
|
Implements : LPTMR_HAL_SetWorkMode_Activity
Definition at line 472 of file lptmr_hal.h.