| 1 |
/* Copyright (c) 2002, 2004 Theodore A. Roth |
/* Copyright (c) 2002, 2004 Theodore A. Roth |
| 2 |
Copyright (c) 2004 Eric B. Weddington |
Copyright (c) 2004 Eric B. Weddington |
| 3 |
|
Copyright (c) 2005 Joerg Wunsch |
| 4 |
All rights reserved. |
All rights reserved. |
| 5 |
|
|
| 6 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 111 |
|
|
| 112 |
|
|
| 113 |
#if _SLEEP_TYPE == 2 |
#if _SLEEP_TYPE == 2 |
| 114 |
|
|
| 115 |
|
/* |
| 116 |
|
* Type 2 devices are not completely identical, so we need a few |
| 117 |
|
* #ifdefs here. |
| 118 |
|
* |
| 119 |
|
* Note that it appears the datasheet of the tiny2313 has the bottom |
| 120 |
|
* two lines of table 13 with the wrong SM0/SM1 values. |
| 121 |
|
*/ |
| 122 |
#define SLEEP_MODE_IDLE 0 |
#define SLEEP_MODE_IDLE 0 |
| 123 |
#define SLEEP_MODE_ADC _BV(SM0) |
|
| 124 |
|
#if !defined(__AVR_ATtiny2313__) |
| 125 |
|
/* no ADC in ATtiny2313, SM0 is alternative powerdown mode */ |
| 126 |
|
# define SLEEP_MODE_ADC _BV(SM0) |
| 127 |
|
#endif /* !defined(__AVR_ATtiny2313__) */ |
| 128 |
|
|
| 129 |
#define SLEEP_MODE_PWR_DOWN _BV(SM1) |
#define SLEEP_MODE_PWR_DOWN _BV(SM1) |
| 130 |
#define SLEEP_MODE_PWR_SAVE (_BV(SM0) | _BV(SM1)) |
|
| 131 |
|
#if defined(__AVR_ATtiny2313__) || defined(__AVR_ATtiny26__) |
| 132 |
|
/* tiny2313 and tiny26 have standby rather than powersave */ |
| 133 |
|
# define SLEEP_MODE_STANDBY (_BV(SM0) | _BV(SM1)) |
| 134 |
|
#elif !defined(__AVR_ATtiny13__) |
| 135 |
|
/* SM0|SM1 is reserved on the tiny13 */ |
| 136 |
|
# define SLEEP_MODE_PWR_SAVE (_BV(SM0) | _BV(SM1)) |
| 137 |
|
#endif |
| 138 |
|
|
| 139 |
#endif |
#endif |
| 140 |
|
|
| 141 |
|
|
| 142 |
#if _SLEEP_TYPE == 3 |
#if _SLEEP_TYPE == 3 || defined(DOXYGEN) |
| 143 |
/** \ingroup avr_sleep |
/** \ingroup avr_sleep |
| 144 |
\def SLEEP_MODE_IDLE |
\def SLEEP_MODE_IDLE |
| 145 |
Idle mode. */ |
Idle mode. */ |