Penguino Library - Sleep
Contents
1 #include "penguino/sleep.h"
Delay
Function |
Functionality |
void sleep_setMode(uint8_t mode) |
Sets the sleeping mode. Sleeping modes are outlined below. |
void sleep_startSleeping(void) |
Begin sleeping in the current sleep mode. |
SleepMode Type
The following constants are used to specify the sleep mode in the sleep_setMode function.
SleepIdle - Idle mode enables the MCU to wake up from external triggered interrupts as well as internal ones like the Timer Overflow and USART Transmit Complete interrupts.
SleepADCNoiseReduction - This improves the noise environment for the ADC, enabling higher resolution measurements. If the ADC is enabled, a conversion starts automatically when this mode is entered.
SleepPowerDown - In this mode, the External Oscillator is stopped, while the External interrupts, the Two-wire Serial Interface address watch, and the Watchdog continue operating (if enabled).
SleepPowerSave - This mode is identical to Power-down, with one exception:The device can wake up from either Timer Overflow or Output Compare event
SleepStandby - This mode is identical to Power-down with the exception that the Oscillator is kept running. From Standby mode, the device wakes up in six clock cycles.
SleepExtendedStandby - This mode is identical to Power-save mode with the exception that the Oscillator is kept running. From Extended Standby mode, the device wakes up in six clock cycles.
The source of this information, and more on Power Management and Sleep Modes can be found in section 9 of the ATMEL ATMega32A Datasheet.
![icy [labs]](/moin_static171/common/wikilogo.png)