Delay

Delay Routines. More...

Data Structures

struct  gos_microsecond_timer_t
 

Functions

void gos_wait_microseconds (uint32_t microseconds)
 Delay for specified microseconds. More...
 
void gos_wait_milliseconds (uint32_t milliseconds)
 Delay for specified milliseconds. More...
 
void gos_microsecond_timer_init (gos_microsecond_timer_t *timer, uint32_t timeout_microseconds)
 Initialize a microsecond timer context. More...
 
bool gos_microsecond_timer_expired (gos_microsecond_timer_t *timer)
 Determine if a microsecond timer has expired. More...
 

Detailed Description

Delay Routines.

Function Documentation

◆ gos_microsecond_timer_expired()

bool gos_microsecond_timer_expired ( gos_microsecond_timer_t timer)

Determine if a microsecond timer has expired.

gos_microsecond_timer_init() should be used to initialize the gos_microsecond_timer_t context. Once the context is initialized, periodically call this API to determine when the specified number of microseconds has elapsed.

Parameters
[in]timergos_microsecond_timer_t context
Returns
true if the specified number of microseconds has elapsed, false else

◆ gos_microsecond_timer_init()

void gos_microsecond_timer_init ( gos_microsecond_timer_t timer,
uint32_t  timeout_microseconds 
)

Initialize a microsecond timer context.

This initializes a microsecond timer for the specified number of microseconds. After the context is initialized, periodically call gos_microsecond_timer_expired() to determine when the timer has expired.

Parameters
[in]timerMicrosecond timer context
[in]timeout_microsecondsNumber of microseconds until the timer expires

◆ gos_wait_microseconds()

void gos_wait_microseconds ( uint32_t  microseconds)

Delay for specified microseconds.

Delay for specified microseconds. This function runs with interrupts enabled, so the delay time will not be exact.

Note
This function has a 31 microsecond resolution. For example, requesting a 20 microsecond delay results in a 31 microsecond delay. Requesting a 40 microsecond delay results in a 62 microsecond delay. If your application requires higher resolution, contact Silabs support. A higher resolution delay has a significant cost in power consumption. For delays longer than 1ms it is strongly recommended to use the gos_wait_milliseconds() API. The gos_wait_milliseconds() API yields the calling thread and allows other threads in the system to run.
Parameters
[in]microsecondsTime in microseconds to wait (dependent on timing accuracy)

◆ gos_wait_milliseconds()

void gos_wait_milliseconds ( uint32_t  milliseconds)

Delay for specified milliseconds.

Pause the calling thread for the specified number of milliseconds. This will yield the calling thread and allow other threads in the system to run. If no threads need to run then the system will be put into a low power state until the delay expires.

Note
This has the exact same functionality as gos_rtos_delay_milliseconds()
Parameters
[in]millisecondsTime in milliseconds to wait