AVRCpp::Sleeping Namespace Reference

Power management and sleep modes. More...


Enumerations

enum  EnabledFlag {
  Disabled = 0x00,
  Enabled = 0x20
}
enum  SleepMode {
  Idle = 0x00,
  PowerDown = 0x10,
  Standby = 0x20 | 0x10
}

Functions

void SetUp (SleepMode sleepMode, EnabledFlag enabled)
void FallAsleep ()
void Enable ()
void Disable ()
uint8_t IsEnabled ()
uint8_t GetSleepMode ()
void SetSleepMode (SleepMode sleepMode)


Detailed Description

Power management and sleep modes.

Enumeration Type Documentation

enum AVRCpp::Sleeping::EnabledFlag

Enumerator:
Disabled 
Enabled 

Definition at line 73 of file Sleeping.h.

00074                 {
00075                         Disabled        = 0x00,
00076                         Enabled         = _SE
00077                         
00078                 }; // EnabledFlag

enum AVRCpp::Sleeping::SleepMode

Enumerator:
Idle 
PowerDown 
Standby 

Definition at line 108 of file Sleeping.h.

00109                 {
00110                         Idle                            = 0x00, 
00111                         PowerDown                       = _SM1,
00112                         Standby                         = _SM2 | _SM1
00113                         
00114                 }; // enum SleepMode


Function Documentation

void AVRCpp::Sleeping::Disable (  )  [inline]

Definition at line 151 of file Sleeping.h.

00151 { ClearBits<_MCUCR>(_SE); }

void AVRCpp::Sleeping::Enable (  )  [inline]

Definition at line 150 of file Sleeping.h.

00150 { SetBits<_MCUCR>(_SE); }

void AVRCpp::Sleeping::FallAsleep (  )  [inline]

Definition at line 148 of file Sleeping.h.

00148 { Assembler::SLEEP(); }

uint8_t AVRCpp::Sleeping::GetSleepMode (  )  [inline]

Definition at line 154 of file Sleeping.h.

00155                 {
00156                         return ( SelectBits<_MCUCR>(_SM1)
00157                                         | SelectBits<_MCUCSR>(_SM2)
00158                                         | SelectBits<_EMCUCR>(_SM0) );
00159 
00160                 } // GetSleepMode

uint8_t AVRCpp::Sleeping::IsEnabled (  )  [inline]

Definition at line 152 of file Sleeping.h.

00152 { return IsBitsSet<_MCUCR>(_SE); }

void AVRCpp::Sleeping::SetSleepMode ( SleepMode  sleepMode  )  [inline]

Definition at line 162 of file Sleeping.h.

00163                 {
00164                         ChangeBits<_MCUCR>(_SM1, sleepMode);
00165                         ChangeBits<_MCUCSR>(_SM2, sleepMode);
00166                         ChangeBits<_EMCUCR>(_SM0, sleepMode);
00167 
00168                 } // SetSleepMode

void AVRCpp::Sleeping::SetUp ( SleepMode  sleepMode,
EnabledFlag  enabled 
) [inline]

Definition at line 140 of file Sleeping.h.

00141                 {
00142                         ChangeBits<_MCUCR>(_SM1 | _SE, sleepMode | enabled);
00143                         ChangeBits<_MCUCSR>(_SM2, sleepMode);
00144                         ChangeBits<_EMCUCR>(_SM0, sleepMode);
00145                         
00146                 } // SetUp


Generated on Sat Sep 15 23:41:37 2007 for AVR C++ Lib for ATmega8515 by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi