DelayDriver

Description

Basic delay functionality.

Simple delay routines for use with components that require small delays.

Functions

void delay_microseconds (uint32_t usecs)
 
void delay_init (void)
 
void delay_milliseconds (uint32_t msecs, bool blocking)
 
bool delay_expired (void)
 

Function Documentation

void delay_microseconds ( uint32_t  usecs)

Delay for a number of microseconds.

Note
This function can be used without calling delay_init() first. This is not an accurate microsecond delay and can have a delay greater than expected, of about +50%. This error becomes significant for lower values delay.
Parameters
usecsNumber of microseconds to delay
void delay_init ( void  )

Initialize the delay driver's millisecond counter.

void delay_milliseconds ( uint32_t  msecs,
bool  blocking 
)

Delay for a number of milliseconds.

Parameters
msecsNumber of milliseconds to delay
blockingWhether to block until the delay has expired. If false, the delay_expired() function can be called to check whether the delay has expired.
bool delay_expired ( void  )

Check whether the current delay has expired.

Returns
True if the delay has expired