Power Management and Sleep Modes


Detailed Description

#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

Note:
Some of these modes are not available on all devices. See the datasheet for target device for the available 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)


Define Documentation

#define SLEEP_MODE_ADC   _BV(SM0)
 

ADC Noise Reduction Mode.

#define SLEEP_MODE_EXT_STANDBY   (_BV(SM0) | _BV(SM1) | _BV(SM2))
 

Extended Standby Mode.

#define SLEEP_MODE_IDLE   0
 

Idle mode.

#define SLEEP_MODE_PWR_DOWN   _BV(SM1)
 

Power Down Mode.

#define SLEEP_MODE_PWR_SAVE   (_BV(SM0) | _BV(SM1))
 

Power Save Mode.

#define SLEEP_MODE_STANDBY   (_BV(SM1) | _BV(SM2))
 

Standby Mode.


Function Documentation

void set_sleep_mode uint8_t  mode  ) 
 

Set the bits in the MCUCR to select a sleep mode.

void sleep_mode void   ) 
 

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.


Automatically generated by Doxygen 1.3.6 on 22 Jan 2005.