S32 SDK

Detailed Description

Low Power Timer Hardware Abstraction Layer.

This HAL provides low-level access to all hardware features of the LPTMR.

Enumerations

enum  lptmr_pinselect_t { LPTMR_PINSELECT_TRGMUX = 0x00u, LPTMR_PINSELECT_ALT1 = 0x01u, LPTMR_PINSELECT_ALT2 = 0x02u, LPTMR_PINSELECT_ALT3 = 0x03u }
 Pulse Counter Input selection Implements : lptmr_pinselect_t_Class. More...
 
enum  lptmr_pinpolarity_t { LPTMR_PINPOLARITY_RISING = 0u, LPTMR_PINPOLARITY_FALLING = 1u }
 Pulse Counter input polarity Implements : lptmr_pinpolarity_t_Class. More...
 
enum  lptmr_workmode_t { LPTMR_WORKMODE_TIMER = 0u, LPTMR_WORKMODE_PULSECOUNTER = 1u }
 Work Mode Implements : lptmr_workmode_t_Class. More...
 
enum  lptmr_prescaler_t {
  LPTMR_PRESCALE_2 = 0x00u, LPTMR_PRESCALE_4_GLITCHFILTER_2 = 0x01u, LPTMR_PRESCALE_8_GLITCHFILTER_4 = 0x02u, LPTMR_PRESCALE_16_GLITCHFILTER_8 = 0x03u,
  LPTMR_PRESCALE_32_GLITCHFILTER_16 = 0x04u, LPTMR_PRESCALE_64_GLITCHFILTER_32 = 0x05u, LPTMR_PRESCALE_128_GLITCHFILTER_64 = 0x06u, LPTMR_PRESCALE_256_GLITCHFILTER_128 = 0x07u,
  LPTMR_PRESCALE_512_GLITCHFILTER_256 = 0x08u, LPTMR_PRESCALE_1024_GLITCHFILTER_512 = 0x09u, LPTMR_PRESCALE_2048_GLITCHFILTER_1024 = 0x0Au, LPTMR_PRESCALE_4096_GLITCHFILTER_2048 = 0x0Bu,
  LPTMR_PRESCALE_8192_GLITCHFILTER_4096 = 0x0Cu, LPTMR_PRESCALE_16384_GLITCHFILTER_8192 = 0x0Du, LPTMR_PRESCALE_32768_GLITCHFILTER_16384 = 0x0Eu, LPTMR_PRESCALE_65536_GLITCHFILTER_32768 = 0x0Fu
}
 Prescaler Selection Implements : lptmr_prescaler_t_Class. More...
 
enum  lptmr_clocksource_t { LPTMR_CLOCKSOURCE_SIRCDIV2 = 0x00u, LPTMR_CLOCKSOURCE_1KHZ_LPO = 0x01u, LPTMR_CLOCKSOURCE_RTC = 0x02u, LPTMR_CLOCKSOURCE_PCC = 0x03u }
 Clock Source selection Implements : lptmr_clocksource_t_Class. More...
 

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...
 

Enumeration Type Documentation

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.

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.

Pulse Counter Input selection Implements : lptmr_pinselect_t_Class.

Enumerator
LPTMR_PINSELECT_TRGMUX 

Count pulses from TRGMUX trigger

LPTMR_PINSELECT_ALT1 

Count pulses from pin alternative 1

LPTMR_PINSELECT_ALT2 

Count pulses from pin alternative 2

LPTMR_PINSELECT_ALT3 

Count pulses from pin alternative 3

Definition at line 53 of file lptmr_hal.h.

Prescaler Selection Implements : lptmr_prescaler_t_Class.

Enumerator
LPTMR_PRESCALE_2 

Timer mode: prescaler 2, Glitch filter mode: invalid

LPTMR_PRESCALE_4_GLITCHFILTER_2 

Timer mode: prescaler 4, Glitch filter mode: 2 clocks

LPTMR_PRESCALE_8_GLITCHFILTER_4 

Timer mode: prescaler 8, Glitch filter mode: 4 clocks

LPTMR_PRESCALE_16_GLITCHFILTER_8 

Timer mode: prescaler 16, Glitch filter mode: 8 clocks

LPTMR_PRESCALE_32_GLITCHFILTER_16 

Timer mode: prescaler 32, Glitch filter mode: 16 clocks

LPTMR_PRESCALE_64_GLITCHFILTER_32 

Timer mode: prescaler 64, Glitch filter mode: 32 clocks

LPTMR_PRESCALE_128_GLITCHFILTER_64 

Timer mode: prescaler 128, Glitch filter mode: 64 clocks

LPTMR_PRESCALE_256_GLITCHFILTER_128 

Timer mode: prescaler 256, Glitch filter mode: 128 clocks

LPTMR_PRESCALE_512_GLITCHFILTER_256 

Timer mode: prescaler 512, Glitch filter mode: 256 clocks

LPTMR_PRESCALE_1024_GLITCHFILTER_512 

Timer mode: prescaler 1024, Glitch filter mode: 512 clocks

LPTMR_PRESCALE_2048_GLITCHFILTER_1024 

Timer mode: prescaler 2048, Glitch filter mode: 1024 clocks

LPTMR_PRESCALE_4096_GLITCHFILTER_2048 

Timer mode: prescaler 4096, Glitch filter mode: 2048 clocks

LPTMR_PRESCALE_8192_GLITCHFILTER_4096 

Timer mode: prescaler 8192, Glitch filter mode: 4096 clocks

LPTMR_PRESCALE_16384_GLITCHFILTER_8192 

Timer mode: prescaler 16384, Glitch filter mode: 8192 clocks

LPTMR_PRESCALE_32768_GLITCHFILTER_16384 

Timer mode: prescaler 32768, Glitch filter mode: 16384 clocks

LPTMR_PRESCALE_65536_GLITCHFILTER_32768 

Timer mode: prescaler 65536, Glitch filter mode: 32768 clocks

Definition at line 79 of file lptmr_hal.h.

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.

Function Documentation

static void LPTMR_HAL_ClearCompareFlag ( LPTMR_Type *const  base)
inlinestatic

Clear the Compare Flag.

This function clears the Compare Flag/Interrupt Pending state.

Parameters
[in]base- lptmr base pointer

Implements : LPTMR_HAL_ClearCompareFlag_Activity

Definition at line 219 of file lptmr_hal.h.

static void LPTMR_HAL_Disable ( LPTMR_Type *const  base)
inlinestatic

Disable the LPTMR.

Disable the LPTMR. Stop the Counter/Timer and allow reconfiguration.

Parameters
[in]base- lptmr base pointer

Implements : LPTMR_HAL_Disable_Activity

Definition at line 539 of file lptmr_hal.h.

static void LPTMR_HAL_Enable ( LPTMR_Type *const  base)
inlinestatic

Enable the LPTMR.

Enable the LPTMR. Starts the timer/counter.

Parameters
[in]base- lptmr base pointer

Implements : LPTMR_HAL_Enable_Activity

Definition at line 518 of file lptmr_hal.h.

static bool LPTMR_HAL_GetBypass ( const LPTMR_Type *const  base)
inlinestatic

Get the Prescaler/Glitch Filter Bypass enable state.

This function checks whether the Prescaler/Glitch Filter Bypass is enabled.

Parameters
[in]base- lptmr base pointer
Returns
the Prescaler Bypass state
  • true: Prescaler/Glitch Filter Bypass enabled
  • false: Prescaler/Glitch Filter Bypass disabled

Implements : LPTMR_HAL_GetBypass_Activity

Definition at line 639 of file lptmr_hal.h.

static lptmr_clocksource_t LPTMR_HAL_GetClockSelect ( const LPTMR_Type *const  base)
inlinestatic

Get the LPTMR input Clock selection.

This function returns the current configured input Clock for the LPTMR.

Parameters
[in]base- lptmr base pointer
Returns
the Clock source
  • LPTMR_CLOCKSOURCE_SIRCDIV2: clock from SIRC DIV2
  • LPTMR_CLOCKSOURCE_1KHZ_LPO: clock from 1kHz LPO
  • LPTMR_CLOCKSOURCE_RTC: clock from RTC
  • LPTMR_CLOCKSOURCE_PCC: clock from PCC

Implements : LPTMR_HAL_GetClockSelect_Activity

Definition at line 688 of file lptmr_hal.h.

static bool LPTMR_HAL_GetCompareFlag ( const LPTMR_Type *const  base)
inlinestatic

Get the Compare Flag state.

This function checks whether a Compare Match event has occurred or if there is an Interrupt Pending.

Parameters
[in]base- lptmr base pointer
Returns
the Compare Flag state
  • true: Compare Match/Interrupt Pending asserted
  • false: Compare Match/Interrupt Pending not asserted

Implements : LPTMR_HAL_GetCompareFlag_Activity

Definition at line 199 of file lptmr_hal.h.

static uint16_t LPTMR_HAL_GetCompareValue ( const LPTMR_Type *const  base)
inlinestatic

Get the Compare Value.

This function returns the current Compare Value.

Parameters
[in]base- lptmr base pointer
Returns
the Compare Value

Implements : LPTMR_HAL_GetCompareValue_Activity

Definition at line 735 of file lptmr_hal.h.

static uint16_t LPTMR_HAL_GetCounterValue ( LPTMR_Type *const  base)
inlinestatic

Get the current Counter Value.

This function returns the Counter Value.

Parameters
[in]base- lptmr base pointer
Returns
The Counter Value

Implements : LPTMR_HAL_GetCounterValue_Activity

Definition at line 779 of file lptmr_hal.h.

static bool LPTMR_HAL_GetDmaRequest ( const LPTMR_Type *const  base)
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.

Parameters
[in]base- lptmr base pointer
Returns
DMA Request enable
  • true: enable DMA Request
  • false: disable DMA Request

Implements : LPTMR_HAL_GetDmaRequest_Activity

Definition at line 146 of file lptmr_hal.h.

static bool LPTMR_HAL_GetEnable ( const LPTMR_Type *const  base)
inlinestatic

Get the Enable state.

Prior to reconfiguring the LPTMR, it is necessary to disable it.

Parameters
[in]base- lptmr base pointer
Returns
The state of the LPTMR
  • true: LPTMR enabled
  • false: LPTMR disabled

Implements : LPTMR_HAL_GetEnable_Activity

Definition at line 497 of file lptmr_hal.h.

static bool LPTMR_HAL_GetFreeRunning ( const LPTMR_Type *const  base)
inlinestatic

Get the Free Running state.

This function checks whether the Free Running feature of the LPTMR is enabled or disabled.

Parameters
[in]base- lptmr base pointer
Returns
Free running mode state
  • true: Free Running Mode enabled. Reset counter on 16-bit overflow
  • false: Free Running Mode disabled. Reset counter on Compare Match.

Implements : LPTMR_HAL_GetFreeRunning_Activity

Definition at line 398 of file lptmr_hal.h.

static bool LPTMR_HAL_GetInterruptEnable ( const LPTMR_Type *const  base)
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.

Parameters
[in]base- lptmr base pointer
Returns
Interrupt Enable state
  • true: Interrupt enabled
  • false: Interrupt disabled

Implements : LPTMR_HAL_GetInterruptEnable_Activity

Definition at line 246 of file lptmr_hal.h.

static lptmr_pinpolarity_t LPTMR_HAL_GetPinPolarity ( const LPTMR_Type *const  base)
inlinestatic

Get Pin Polarity for Pulse Counter Mode.

This function returns the configured pin polarity that triggers an increment in Pulse Counter Mode.

Parameters
[in]base- lptmr base pointer
Returns
the pin polarity for Pulse Counter Mode
  • LPTMR_PINPOLARITY_RISING: count pulse on Rising Edge
  • LPTMR_PINPOLARITY_FALLING: count pulse on Falling Edge

Implements : LPTMR_HAL_GetPinPolarity_Activity

Definition at line 348 of file lptmr_hal.h.

static lptmr_pinselect_t LPTMR_HAL_GetPinSelect ( const LPTMR_Type *const  base)
inlinestatic

Get the Pin select for Counter Mode.

This function returns the configured Input Pin for Pulse Counter Mode.

Parameters
[in]base- lptmr base pointer
Returns
Input pin selection
  • LPTMR_PINSELECT_TRGMUX: count pulses from TRGMUX output
  • LPTMR_PINSELECT_ALT1: count pulses from pin alt 1
  • LPTMR_PINSELECT_ALT2: count pulses from pin alt 2
  • LPTMR_PINSELECT_ALT3: count pulses from pin alt 3

Implements : LPTMR_HAL_GetPinSelect_Activity

Definition at line 297 of file lptmr_hal.h.

static lptmr_prescaler_t LPTMR_HAL_GetPrescaler ( const LPTMR_Type *const  base)
inlinestatic

Get Prescaler/Glitch Filter divider value.

This function returns the currently configured Prescaler/Glitch Filter divider value.

Parameters
[in]base- lptmr base pointer
Returns
The Prescaler/Glitch filter value
  • LPTMR_PRESCALE_2: Timer mode: prescaler 2, Glitch filter mode: invalid
  • LPTMR_PRESCALE_4_GLITCHFILTER_2: Timer mode: prescaler 4, Glitch filter mode: 2 clocks
  • LPTMR_PRESCALE_8_GLITCHFILTER_4: Timer mode: prescaler 8, Glitch filter mode: 4 clocks
  • LPTMR_PRESCALE_16_GLITCHFILTER_8: Timer mode: prescaler 16, Glitch filter mode: 8 clocks
  • LPTMR_PRESCALE_32_GLITCHFILTER_16: Timer mode: prescaler 32, Glitch filter mode: 16 clocks
  • LPTMR_PRESCALE_64_GLITCHFILTER_32: Timer mode: prescaler 64, Glitch filter mode: 32 clocks
  • LPTMR_PRESCALE_128_GLITCHFILTER_64: Timer mode: prescaler 128, Glitch filter mode: 64 clocks
  • LPTMR_PRESCALE_256_GLITCHFILTER_128: Timer mode: prescaler 256, Glitch filter mode: 128 clocks
  • LPTMR_PRESCALE_512_GLITCHFILTER_256: Timer mode: prescaler 512, Glitch filter mode: 256 clocks
  • LPTMR_PRESCALE_1024_GLITCHFILTER_512: Timer mode: prescaler 1024, Glitch filter mode: 512 clocks
  • LPTMR_PRESCALE_2048_GLITCHFILTER_1024: Timer mode: prescaler 2048, Glitch filter mode: 1024 clocks
  • LPTMR_PRESCALE_4096_GLITCHFILTER_2048: Timer mode: prescaler 4096, Glitch filter mode: 2048 clocks
  • LPTMR_PRESCALE_8192_GLITCHFILTER_4096: Timer mode: prescaler 8192, Glitch filter mode: 4096 clocks
  • LPTMR_PRESCALE_16384_GLITCHFILTER_8192: Timer mode: prescaler 16384, Glitch filter mode: 8192 clocks
  • LPTMR_PRESCALE_32768_GLITCHFILTER_16384: Timer mode: prescaler 32768, Glitch filter mode: 16384 clocks
  • LPTMR_PRESCALE_65536_GLITCHFILTER_32768: Timer mode: prescaler 65536, Glitch filter mode: 32768 clocks

Implements : LPTMR_HAL_GetPrescaler_Activity

Definition at line 578 of file lptmr_hal.h.

static lptmr_workmode_t LPTMR_HAL_GetWorkMode ( const LPTMR_Type *const  base)
inlinestatic

Get current Work Mode.

This function returns the currently configured Work Mode for the LPTMR.

Parameters
[in]base- lptmr base pointer
Returns
Work Mode
  • LPTMR_WORKMODE_TIMER: LPTMR is in Timer Mode
  • LPTMR_WORKMODE_PULSECOUNTER: LPTMR is in Pulse Counter Mode

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).

Parameters
[in]base- lptmr base pointer

Definition at line 43 of file lptmr_hal.c.

static void LPTMR_HAL_SetBypass ( LPTMR_Type *const  base,
const bool  enable 
)
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.

Parameters
[in]base- lptmr base pointer
[in]enable- the new Prescaler/Glitch Filter Bypass state
  • true: Prescaler/Glitch Filter Bypass enabled
  • false: Prescaler/Glitch Filter Bypass disabled

Implements : LPTMR_HAL_SetBypass_Activity

Definition at line 663 of file lptmr_hal.h.

static void LPTMR_HAL_SetClockSelect ( LPTMR_Type *const  base,
const lptmr_clocksource_t  clocksel 
)
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.

Parameters
[in]base- lptmr base pointer
[in]clocksel- new Clock Source
  • LPTMR_CLOCKSOURCE_SIRCDIV2: clock from SIRC DIV2
  • LPTMR_CLOCKSOURCE_1KHZ_LPO: clock from 1kHz LPO
  • LPTMR_CLOCKSOURCE_RTC: clock from RTC
  • LPTMR_CLOCKSOURCE_PCC: clock from PCC

Implements : LPTMR_HAL_SetClockSelect_Activity

Definition at line 713 of file lptmr_hal.h.

static void LPTMR_HAL_SetCompareValue ( LPTMR_Type *const  base,
const uint16_t  compval 
)
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.

Parameters
[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.

static void LPTMR_HAL_SetDmaRequest ( LPTMR_Type *const  base,
bool  enable 
)
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.

Parameters
[in]base- lptmr base pointer
[in]enable- the new state of the DMA Request Enable Flag
  • true: enable DMA Request
  • false: disable DMA Request

Implements : LPTMR_HAL_SetDmaRequest_Activity

Definition at line 173 of file lptmr_hal.h.

static void LPTMR_HAL_SetFreeRunning ( LPTMR_Type *const  base,
const bool  enable 
)
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.

Parameters
[in]base- lptmr base pointer
[in]enable- the new Free Running state
  • true: Free Running Mode enabled. Reset counter on 16-bit overflow
  • false: Free Running Mode disabled. Reset counter on Compare Match.

Implements : LPTMR_HAL_SetFreeRunning_Activity

Definition at line 422 of file lptmr_hal.h.

static void LPTMR_HAL_SetInterrupt ( LPTMR_Type *const  base,
bool  enable 
)
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.

Parameters
[in]base- lptmr base pointer
[in]enable- the new state for the interrupt
  • true: enable Interrupt
  • false: disable Interrupt

Implements : LPTMR_HAL_SetInterrupt_Activity

Definition at line 270 of file lptmr_hal.h.

static void LPTMR_HAL_SetPinPolarity ( LPTMR_Type *const  base,
const lptmr_pinpolarity_t  pol 
)
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.

Parameters
[in]base- lptmr base pointer
[in]pol- the pin polarity to count in Pulse Counter Mode
  • LPTMR_PINPOLARITY_RISING: count pulse on Rising Edge
  • LPTMR_PINPOLARITY_FALLING: count pulse on Falling Edge

Implements : LPTMR_HAL_SetPinPolarity_Activity

Definition at line 372 of file lptmr_hal.h.

static void LPTMR_HAL_SetPinSelect ( LPTMR_Type *const  base,
const lptmr_pinselect_t  pinsel 
)
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.

Parameters
[in]base- lptmr base pointer
[in]pinsel- pin selection
  • LPTMR_PINSELECT_TRGMUX: count pulses from TRGMUX output
  • LPTMR_PINSELECT_ALT1: count pulses from pin alt 1
  • LPTMR_PINSELECT_ALT2: count pulses from pin alt 2
  • LPTMR_PINSELECT_ALT3: count pulses from pin alt 3

Implements : LPTMR_HAL_SetPinSelect_Activity

Definition at line 322 of file lptmr_hal.h.

static void LPTMR_HAL_SetPrescaler ( LPTMR_Type *const  base,
const lptmr_prescaler_t  presc 
)
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.

Parameters
[in]base- lptmr base pointer
[in]presc- the new Prescaler value
  • LPTMR_PRESCALE_2: Timer mode: prescaler 2, Glitch filter mode: invalid
  • LPTMR_PRESCALE_4_GLITCHFILTER_2: Timer mode: prescaler 4, Glitch filter mode: 2 clocks
  • LPTMR_PRESCALE_8_GLITCHFILTER_4: Timer mode: prescaler 8, Glitch filter mode: 4 clocks
  • LPTMR_PRESCALE_16_GLITCHFILTER_8: Timer mode: prescaler 16, Glitch filter mode: 8 clocks
  • LPTMR_PRESCALE_32_GLITCHFILTER_16: Timer mode: prescaler 32, Glitch filter mode: 16 clocks
  • LPTMR_PRESCALE_64_GLITCHFILTER_32: Timer mode: prescaler 64, Glitch filter mode: 32 clocks
  • LPTMR_PRESCALE_128_GLITCHFILTER_64: Timer mode: prescaler 128, Glitch filter mode: 64 clocks
  • LPTMR_PRESCALE_256_GLITCHFILTER_128: Timer mode: prescaler 256, Glitch filter mode: 128 clocks
  • LPTMR_PRESCALE_512_GLITCHFILTER_256: Timer mode: prescaler 512, Glitch filter mode: 256 clocks
  • LPTMR_PRESCALE_1024_GLITCHFILTER_512: Timer mode: prescaler 1024, Glitch filter mode: 512 clocks
  • LPTMR_PRESCALE_2048_GLITCHFILTER_1024: Timer mode: prescaler 2048, Glitch filter mode: 1024 clocks
  • LPTMR_PRESCALE_4096_GLITCHFILTER_2048: Timer mode: prescaler 4096, Glitch filter mode: 2048 clocks
  • LPTMR_PRESCALE_8192_GLITCHFILTER_4096: Timer mode: prescaler 8192, Glitch filter mode: 4096 clocks
  • LPTMR_PRESCALE_16384_GLITCHFILTER_8192: Timer mode: prescaler 16384, Glitch filter mode: 8192 clocks
  • LPTMR_PRESCALE_32768_GLITCHFILTER_16384: Timer mode: prescaler 32768, Glitch filter mode: 16384 clocks
  • LPTMR_PRESCALE_65536_GLITCHFILTER_32768: Timer mode: prescaler 65536, Glitch filter mode: 32768 clocks

Implements : LPTMR_HAL_SetPrescaler_Activity

Definition at line 615 of file lptmr_hal.h.

static void LPTMR_HAL_SetWorkMode ( LPTMR_Type *const  base,
const lptmr_workmode_t  mode 
)
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.

Parameters
[in]base- lptmr base pointer
[in]mode- new Work Mode
  • LPTMR_WORKMODE_TIMER: LPTMR set to Timer Mode
  • LPTMR_WORKMODE_PULSECOUNTER: LPTMR set to Pulse Counter Mode

Implements : LPTMR_HAL_SetWorkMode_Activity

Definition at line 472 of file lptmr_hal.h.