Asynchronous delay routines based on the SysTick Timer.
More...
|
#define | MXC_DELAY_SEC(s) (((unsigned long)s) * 1000000UL) |
| Macro used to specify a microsecond timing parameter in seconds. More...
|
|
#define | MXC_DELAY_MSEC(ms) (ms * 1000UL) |
| Macro used to specify a microsecond timing parameter in milliseconds. More...
|
|
#define | MXC_DELAY_USEC(us) (us) |
| Macro used to specify a microsecond timing parameter. More...
|
|
◆ MXC_DELAY_SEC
#define MXC_DELAY_SEC |
( |
|
s | ) |
(((unsigned long)s) * 1000000UL) |
◆ MXC_DELAY_MSEC
#define MXC_DELAY_MSEC |
( |
|
ms | ) |
(ms * 1000UL) |
◆ MXC_DELAY_USEC
#define MXC_DELAY_USEC |
( |
|
us | ) |
(us) |
◆ mxc_delay()
int mxc_delay |
( |
unsigned long |
us | ) |
|
Uses the SysTick to create the requested delay. If the SysTick is running, the current settings will be used. If the SysTick is not running, it will be started.
- Parameters
-
- Returns
- E_NO_ERROR if no errors, error if unsuccessful.
◆ mxc_delay_start()
int mxc_delay_start |
( |
unsigned long |
us | ) |
|
Uses the SysTick to time the requested delay. If the SysTick is running, the current settings will be used. If the SysTick is not running, it will be started.
- Note
- mxc_delay_handler() must be called from the SysTick interrupt service routine or at a rate greater than the SysTick overflow rate.
- Parameters
-
- Returns
- E_NO_ERROR if no errors, E_BUSY if currently servicing another delay request.
◆ mxc_delay_check()
int mxc_delay_check |
( |
void |
| ) |
|
- Precondition
- Start the asynchronous delay by calling mxc_delay_start().
- Returns
- E_BUSY until the requested delay time has expired.
◆ mxc_delay_stop()
void mxc_delay_stop |
( |
void |
| ) |
|
◆ mxc_delay_handler()
void mxc_delay_handler |
( |
void |
| ) |
|
This function must be called from the SysTick IRQ or polled at a rate greater than the SysTick overflow rate.