XMEGA Application Note


config_sleepmgr.h File Reference

Sleep manager configuration file. More...

#include <stdint.h>
#include "avr_compiler.h"

Include dependency graph for config_sleepmgr.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SLEEPMGR_CTRL_REG   SLEEP.CTRL
 Sleep mode control register.
#define SLEEPMGR_DEFINE_MODES
 Sleep mode configuration values.
#define SLEEPMGR_DISABLE_SLEEP()
 Disable sleep, so that subsequent sleep attempts will fail, until reenabled.
#define SLEEPMGR_ENABLE_MASK   SLEEP_SEN_bm
 Bitmask for Sleep Enable bit.
#define SLEEPMGR_MODE_MASK   SLEEP_SMODE_gm
 Bitmask for all sleep mode bits.
#define SLEEPMGR_PREPARE_SLEEP(sleepMode)
 Prepare sleep configuration. Used before actually entering sleep mode.

Typedefs

typedef uint8_t SLEEPMGR_lock_t
 Type holding sleep mode lock counts. This decides the maximum lock count.
typedef enum SLEEPMGR_mode_enum SLEEPMGR_mode_t
 Sleep mode names.

Enumerations

enum  SLEEPMGR_mode_enum {
  SLEEPMGR_IDLE, SLEEPMGR_ESTDBY, SLEEPMGR_SAVE, SLEEPMGR_STDBY,
  SLEEPMGR_DOWN, SLEEPMGR_NUM_MODES
}
 Sleep mode names. More...


Detailed Description

Sleep manager configuration file.

This file contains the configuration of the different sleep modes and their order of priority for the sleep manager.

Application note:
AVR1010: Minimizing the power consumption of XMEGA devices
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Revision
2770
Date
2009-09-11 10:55:22 +0200 (fr, 11 sep 2009)

Copyright (c) 2008, Atmel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file config_sleepmgr.h.


Define Documentation

#define SLEEPMGR_CTRL_REG   SLEEP.CTRL

Sleep mode control register.

Definition at line 62 of file config_sleepmgr.h.

Value:

static uint8_t PROGMEM_DECLARE(SLEEPMGR_modes[SLEEPMGR_NUM_MODES]) = \
{ \
        SLEEP_SMODE_IDLE_gc, \
        SLEEP_SMODE_ESTDBY_gc, \
        SLEEP_SMODE_PSAVE_gc, \
        SLEEP_SMODE_STDBY_gc, \
        SLEEP_SMODE_PDOWN_gc \
};
Sleep mode configuration values.

This table is defined as a macro, which in turn is used in the sleepmgr.c file. It contains the sleep mode configuration values for all relevant sleep modes. Only include the sleep modes you intend to use, and make sure the shallowest (most "awake") sleep mode is the first one listed, and the deepest mode the last one listed. Do not include ACTIVE mode, as that is not regarded as a sleep mode as such. Make sure that the SLEEPMGR_mode_enum is updated accordingly.

Definition at line 107 of file config_sleepmgr.h.

 
#define SLEEPMGR_DISABLE_SLEEP (  ) 

Value:

Disable sleep, so that subsequent sleep attempts will fail, until reenabled.

Definition at line 127 of file config_sleepmgr.h.

Referenced by SLEEPMGR_CancelSleep(), and SLEEPMGR_Sleep().

#define SLEEPMGR_ENABLE_MASK   SLEEP_SEN_bm

Bitmask for Sleep Enable bit.

Definition at line 64 of file config_sleepmgr.h.

#define SLEEPMGR_MODE_MASK   SLEEP_SMODE_gm

Bitmask for all sleep mode bits.

Definition at line 66 of file config_sleepmgr.h.

#define SLEEPMGR_PREPARE_SLEEP ( sleepMode   ) 

Value:

Prepare sleep configuration. Used before actually entering sleep mode.

Definition at line 119 of file config_sleepmgr.h.

Referenced by SLEEPMGR_Sleep().


Typedef Documentation

typedef uint8_t SLEEPMGR_lock_t

Type holding sleep mode lock counts. This decides the maximum lock count.

Definition at line 73 of file config_sleepmgr.h.

Sleep mode names.

This enumeration holds the identifiers used throughout the application to refer to sleep modes when locking and unlocking. Make sure the contents of this enumeration always correspond to the contents of the SLEEPMGR_modes[] table, which is defined below. Do not touch the last entry SLEEPMGR_NUM_MODES as it is used to indicate the number of sleep modes used in this application.


Enumeration Type Documentation

Sleep mode names.

This enumeration holds the identifiers used throughout the application to refer to sleep modes when locking and unlocking. Make sure the contents of this enumeration always correspond to the contents of the SLEEPMGR_modes[] table, which is defined below. Do not touch the last entry SLEEPMGR_NUM_MODES as it is used to indicate the number of sleep modes used in this application.

Enumerator:
SLEEPMGR_IDLE 
SLEEPMGR_ESTDBY 
SLEEPMGR_SAVE 
SLEEPMGR_STDBY 
SLEEPMGR_DOWN 
SLEEPMGR_NUM_MODES  Do not change! This equals the sleep mode count.

Definition at line 83 of file config_sleepmgr.h.

@DOC_TITLE@
Generated on Mon Nov 9 13:44:30 2009 for XMEGA power consumption evaluation code by doxygen 1.5.9