dwm_sleep
Enables the device to enter the sleep state (if in low-power mode). The sleep mode can be delayed internally if necessary. Simply speaking, the device is no guaranteed to enter sleep mode immediately after the call to dwm_sleep. It should be called only from the thread context if used in a user application. Blocks until dwm_wake_up is called.
-
void dwm_sleep(void)
- Parameters
input – none
output – Status code
C code example
/* THREAD 1: sleep and block*/
dwm_sleep();
/*do something*/
...
/*THREAD 2: wait until event */
dwm_evt_wait(&evt);
/*unblock dwm_sleep()*/
dwm_wake_up();
SPI/UART example
TLV Request |
|
---|---|
Type |
Length |
0x0A |
0x00 |
Type 0x0A means command dwm_sleep
TLV Response |
||
---|---|---|
Type |
Length |
Value (see error codes) |
0x40 |
0x01 |
0x00 |
Type 0x40 means err_code of the previous command