S32 SDK
lptmr_hal.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "device_registers.h"

Go to the source code of this file.

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

Functions

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