PreviousNext
BeforeSleep
Help > Custom DPA Handler > Events > BeforeSleep

This event is called before the device goes to Sleep mode and at Standby. The code must shut down all HW and MCU peripherals and circuitry not handled by DPA by default. Especially custom handling of SPI and I2C MCU peripherals in a non-DPA way must be handled. Also, to minimize the power consumption, no MCU pin must be left as digital input without a defined input level value. So, unused pins in the given hardware should be set as outputs.

 

☼ See example code CustomDpaHandler-Timer.c.

 

This event is not implemented at [C].

 

Example

 

 case DpaEvent_BeforeSleep:

       StopMyPeripherals();

                return Carry;

 

See example code CustomDpaHandler-Timer.c, CustomDpaHandler-UserPeripheral-i2c.c for more details.