SmartSnippets DA1459x SDK
Files | Functions

System timer. More...

Files

file  sys_timer.h
 System timer header file.
 

Functions

void sys_timer_start (uint32_t period)
 Start the OS timer. More...
 
void sys_timer_stop (void)
 Stop the OS timer. More...
 
__RETAINED_CODE void sys_timer_set_trigger (uint32_t trigger)
 Set OS timer trigger. More...
 
__RETAINED_HOT_CODE uint32_t sys_timer_get_tick_offset (void)
 Get OS timer offset in the tick period. More...
 
uint64_t sys_timer_get_uptime_ticks (void)
 Get uptime ticks value. More...
 
__RETAINED_CODE uint64_t sys_timer_get_uptime_ticks_fromISR (void)
 Get uptime ticks value. More...
 
uint64_t sys_timer_get_uptime_usec (void)
 Get uptime in usec. More...
 
__RETAINED_HOT_CODE uint64_t sys_timer_get_uptime_usec_fromISR (void)
 Get uptime in usec. More...
 
__STATIC_INLINE uint64_t sys_timer_get_timestamp (void)
 Get timestamp value. More...
 
__STATIC_INLINE uint64_t sys_timer_get_timestamp_fromISR (void)
 Get timestamp value. More...
 

Detailed Description

System timer.

Function Documentation

◆ sys_timer_get_tick_offset()

__RETAINED_HOT_CODE uint32_t sys_timer_get_tick_offset ( void  )

Get OS timer offset in the tick period.

Returns
The offset in the tick period

◆ sys_timer_get_timestamp()

__STATIC_INLINE uint64_t sys_timer_get_timestamp ( void  )

Get timestamp value.

Returns
The current timestamp. This is expressed in ticks of the clock that clocks OS timer (e.g. XTAL32K). For example, if XTAL32K drives OS timer, each timestamp tick will be 1000000 / 32768 = 30.5uS
Warning
This function is called only from OS Tasks.
Deprecated:
This function is deprecated. User shall call sys_timer_get_uptime_ticks() instead.

◆ sys_timer_get_timestamp_fromISR()

__STATIC_INLINE uint64_t sys_timer_get_timestamp_fromISR ( void  )

Get timestamp value.

Returns
The current timestamp. This is expressed in ticks of the clock that clocks OS timer (e.g. XTAL32K). For, example, if XTAL32K drives OS timer, each timestamp tick will be 1000000 / 32768 = 30.5uS
Warning
This function is called only when interrupts are disabled.
Deprecated:
This function is deprecated. User shall call sys_timer_get_uptime_ticks_fromISR() instead.

◆ sys_timer_get_uptime_ticks()

uint64_t sys_timer_get_uptime_ticks ( void  )

Get uptime ticks value.

Returns
The uptime ticks. Each tick will be 1000000 / OS_TICK_CLOCK_HZ (e.g. 30.5us if XTAL32K is set as LP clock)
Warning
This function is called only from OS Tasks.

◆ sys_timer_get_uptime_ticks_fromISR()

__RETAINED_CODE uint64_t sys_timer_get_uptime_ticks_fromISR ( void  )

Get uptime ticks value.

Returns
The uptime ticks. Each tick will be 1000000 / OS_TICK_CLOCK_HZ (e.g. 30.5us if XTAL32K is set as LP clock)
Warning
This function is called only when interrupts are disabled.

◆ sys_timer_get_uptime_usec()

uint64_t sys_timer_get_uptime_usec ( void  )

Get uptime in usec.

Returns
The uptime in usec.
Warning
This function is called only from OS Tasks.

◆ sys_timer_get_uptime_usec_fromISR()

__RETAINED_HOT_CODE uint64_t sys_timer_get_uptime_usec_fromISR ( void  )

Get uptime in usec.

Returns
The uptime in usec.
Warning
This function is called only when interrupts are disabled.

◆ sys_timer_set_trigger()

__RETAINED_CODE void sys_timer_set_trigger ( uint32_t  trigger)

Set OS timer trigger.

Parameters
[in]triggerThe new timer trigger

◆ sys_timer_start()

void sys_timer_start ( uint32_t  period)

Start the OS timer.

Parameters
periodThe timer period in LP clock cycles

◆ sys_timer_stop()

void sys_timer_stop ( void  )

Stop the OS timer.