PreviousNext
DpaApiSleep
Help > Custom DPA Handler > DPA API > DpaApiSleep

void DpaApiSleep ( uns8 wdtcon )

 

Available at [N] devices only. Executes a controlled sleep with the specified watchdog timer setting. 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;