#include <avr/sleep.h>
Use of the SLEEP
instruction can allow your application to reduce it's power comsumption considerably. AVR devices can be put into different sleep modes by changing the SMn
bits of the MCU
Control Register ( MCUCR
). Refer to the datasheet for the details relating to the device you are using.
Sleep Modes | |
| |
#define | SLEEP_MODE_IDLE 0 |
#define | SLEEP_MODE_ADC _BV(SM0) |
#define | SLEEP_MODE_PWR_DOWN _BV(SM1) |
#define | SLEEP_MODE_PWR_SAVE (_BV(SM0) | _BV(SM1)) |
#define | SLEEP_MODE_STANDBY (_BV(SM1) | _BV(SM2)) |
#define | SLEEP_MODE_EXT_STANDBY (_BV(SM0) | _BV(SM1) | _BV(SM2)) |
Sleep Functions | |
void | set_sleep_mode (uint8_t mode) |
void | sleep_mode (void) |
|
ADC Noise Reduction Mode. |
|
Extended Standby Mode. |
|
Idle mode. |
|
Power Down Mode. |
|
Power Save Mode. |
|
Standby Mode. |
|
Set the bits in the |
|
Put the device in sleep mode. How the device is brought out of sleep mode depends on the specific mode selected with the set_sleep_mode() function. See the data sheet for your device for more details. |