void DpaApiSleep ( uns8 wdtcon )
Available at [N] devices only. Executes a controlled sleep with the specified watchdog timer setting. If at TR-7xG the parameter is equal to DpaApiSleep_WdtOff, then the watchdog timer is disabled and the device can be woken up e.g. by interrupt-on-change event. Such repeated periods of sleep are typically used for low-power offline activities, e.g. beaming, waiting for sensor measurement, etc. Before the 1st call, a variable FirstDpaApiSleep must be set. After the last call the function DpaApiAfterSleep must be called. Please note the interrupts, integrated temperatures sensor, and external EEPROM are disabled after the call. Brown-Out Reset (BOR) is disabled during the execution and enabled on exit at TR-7xD transceivers.
The following example shows a typical use:
case DpaEvent_Idle:
if ( StartSleepMode() )
{
FirstDpaApiSleep = TRUE;
do {
DpaApiSleep( WDTCON_1s );
} while ( !WakeUp() );
DpaApiAfterSleep();
}
break;