102 base = s_lpitBase[instance];
127 base = s_lpitBase[instance];
160 base = s_lpitBase[instance];
162 if ((channel == 0U) && (userChannelConfig->
chainChannel))
228 base = s_lpitBase[instance];
252 base = s_lpitBase[instance];
290 base = s_lpitBase[instance];
293 count = (count / 1000000U) - 1U;
349 uint64_t periodHighCount;
350 uint64_t periodLowCount;
351 uint64_t periodCount;
363 base = s_lpitBase[instance];
366 periodHighCount = (periodHighCount / 1000000U) - 1U;
370 periodLowCount = (periodLowCount / 1000000U) - 1U;
378 periodCount = (periodHighCount << 16U) | periodLowCount;
400 uint64_t currentPeriod;
412 base = s_lpitBase[instance];
436 return currentPeriod;
459 uint64_t currentTime = 0U;
464 base = s_lpitBase[instance];
509 base = s_lpitBase[instance];
539 base = s_lpitBase[instance];
541 period = ((uint32_t)periodHigh << 16U) | periodLow;
559 uint32_t currentPeriod;
564 base = s_lpitBase[instance];
575 return currentPeriod;
593 uint32_t currentTime;
598 base = s_lpitBase[instance];
629 base = s_lpitBase[instance];
650 base = s_lpitBase[instance];
static void LPIT_HAL_SetStartOnTriggerCmd(LPIT_Type *const base, uint32_t channel, bool isStartOnTrigger)
Sets timer channel start on trigger.
static void LPIT_HAL_SetStopOnInterruptCmd(LPIT_Type *const base, uint32_t channel, bool isStopOnInterrupt)
Sets timer channel stop on interrupt.
#define MAX_PERIOD_COUNT_IN_DUAL_16BIT_MODE
Max period in count of dual 16 bit periodic counter mode.
lpit_timer_modes_t timerMode
lpit_timer_modes_t
Mode options available for the LPIT timer Implements : lpit_timer_modes_t_Class.
static void LPIT_HAL_SetReloadOnTriggerCmd(LPIT_Type *const base, uint32_t channel, bool isReloadOnTrigger)
Sets timer channel reload on trigger.
static void LPIT_HAL_SetTimerChannelModeCmd(LPIT_Type *const base, uint32_t channel, lpit_timer_modes_t mode)
Sets operation mode of timer channel.
static uint32_t LPIT_HAL_GetInterruptFlagTimerChannels(const LPIT_Type *base, uint32_t mask)
Gets the interrupt flag of timer channels.
static void LPIT_HAL_SetTriggerSourceCmd(LPIT_Type *const base, uint32_t channel, lpit_trigger_source_t triggerSource)
Sets trigger source of timer channel.
void LPIT_DRV_SetTimerPeriodByCount(uint32_t instance, uint32_t channel, uint32_t count)
Sets the timer channel period in count unit.
static void LPIT_HAL_EnableInterruptTimerChannels(LPIT_Type *const base, uint32_t mask)
Enables the interrupt generation for timer channels.
void LPIT_DRV_StopTimerChannels(uint32_t instance, uint32_t mask)
Stops the timer channel counting.
static void LPIT_HAL_SetTimerRunInDebugCmd(LPIT_Type *const base, bool isRunInDebug)
Sets operation of LPIT in debug mode.
uint64_t LPIT_DRV_GetTimerPeriodByUs(uint32_t instance, uint32_t channel)
Gets the timer channel period in microseconds.
IRQn_Type
Defines the Interrupt Numbers definitions.
static void LPIT_HAL_DisableInterruptTimerChannels(LPIT_Type *const base, uint32_t mask)
Disables the interrupt generation for timer channels.
lpit_trigger_source_t triggerSource
uint64_t LPIT_DRV_GetCurrentTimerUs(uint32_t instance, uint32_t channel)
Gets the current timer channel counting value in microseconds.
static uint32_t LPIT_HAL_GetCurrentTimerCount(const LPIT_Type *base, uint32_t channel)
Gets the current timer channel counting value.
static LPIT_Type *const s_lpitBase[]
static void LPIT_HAL_StopTimerChannels(LPIT_Type *const base, uint32_t mask)
Stops the timer channel from counting.
void INT_SYS_DisableIRQ(IRQn_Type irqNumber)
Disables an interrupt for a given IRQ number.
bool enableStopOnInterrupt
static void LPIT_HAL_SetTriggerSelectCmd(LPIT_Type *const base, uint32_t channel, uint32_t triggerChannelSelect)
Sets internal trigger source for timer channel.
status_t LPIT_DRV_SetTimerPeriodInDual16ModeByUs(uint32_t instance, uint32_t channel, uint16_t periodHigh, uint16_t periodLow)
Sets the timer channel period in microseconds.
#define LPIT_INSTANCE_COUNT
bool enableStartOnTrigger
status_t CLOCK_SYS_GetFreq(clock_names_t clockName, uint32_t *frequency)
Gets the clock frequency for a specific clock name.
void LPIT_DRV_Init(uint32_t instance, const lpit_user_config_t *userConfig)
Initializes the LPIT module.
void LPIT_DRV_SetTimerPeriodInDual16ModeByCount(uint32_t instance, uint32_t channel, uint16_t periodHigh, uint16_t periodLow)
Sets the timer channel period in count unit.
lpit_period_units_t periodUnits
status_t LPIT_DRV_InitChannel(uint32_t instance, uint32_t channel, const lpit_user_channel_config_t *userChannelConfig)
Initializes the LPIT channel.
void LPIT_DRV_ClearInterruptFlagTimerChannels(uint32_t instance, uint32_t mask)
Clears the interrupt flag of timer channels.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
static void LPIT_HAL_SetTimerChannelChainCmd(LPIT_Type *const base, uint32_t channel, bool isChannelChained)
Sets timer channel chaining.
static void LPIT_HAL_Enable(LPIT_Type *const base)
Enables the LPIT module.
LPIT configuration structure.
static void LPIT_HAL_Disable(LPIT_Type *const base)
Disables the LPIT module.
static const clock_names_t s_lpitClkNames[LPIT_INSTANCE_COUNT]
#define MAX_PERIOD_COUNT
Max period in count of all operation mode except for dual 16 bit periodic counter mode...
static uint32_t LPIT_HAL_GetTimerPeriodByCount(const LPIT_Type *base, uint32_t channel)
Gets the timer channel period in count unit.
Structure to configure the channel timer.
clock_names_t
Clock names.
static void LPIT_HAL_SetTimerRunInDozeCmd(LPIT_Type *const base, bool isRunInDoze)
Sets operation of LPIT in DOZE mode.
static uint32_t s_lpitSourceClockFrequency[LPIT_INSTANCE_COUNT]
void INT_SYS_EnableIRQ(IRQn_Type irqNumber)
Enables an interrupt for a given IRQ number.
uint32_t LPIT_DRV_GetTimerPeriodByCount(uint32_t instance, uint32_t channel)
Gets the current timer channel period in count unit.
#define MAX_PERIOD_COUNT_16_BIT
Max count of 16 bit.
uint32_t LPIT_DRV_GetInterruptFlagTimerChannels(uint32_t instance, uint32_t mask)
Gets the current interrupt flag of timer channels.
static void LPIT_HAL_ClearInterruptFlagTimerChannels(LPIT_Type *const base, uint32_t mask)
Clears the interrupt flag of timer channels.
status_t LPIT_DRV_SetTimerPeriodByUs(uint32_t instance, uint32_t channel, uint32_t periodUs)
Sets the timer channel period in microseconds.
void LPIT_DRV_Deinit(uint32_t instance)
De-Initializes the LPIT module.
static void LPIT_HAL_StartTimerChannels(LPIT_Type *const base, uint32_t mask)
Starts the timer channel counting.
static void LPIT_HAL_Reset(LPIT_Type *const base)
Resets the LPIT module.
void LPIT_DRV_StartTimerChannels(uint32_t instance, uint32_t mask)
Starts the timer channel counting.
bool enableReloadOnTrigger
static lpit_timer_modes_t LPIT_HAL_GetTimerChannelModeCmd(const LPIT_Type *base, uint32_t channel)
Gets current operation mode of timer channel.
static void LPIT_HAL_SetTimerPeriodByCount(LPIT_Type *const base, uint32_t channel, uint32_t count)
Sets the timer channel period in count unit.
uint32_t LPIT_DRV_GetCurrentTimerCount(uint32_t instance, uint32_t channel)
Gets the current timer channel counting value in count.