XMEGA Application Note


lowpower_macros.h File Reference

XMega low power macros. More...

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

Go to the source code of this file.

Defines

#define __PORT_PULLUP(port, mask)
 Convenience macro for enabling pull-ups on specified pins on any port.
#define DISABLE_ANLG()
 Convenience macro for disconnecting analog modules from clock.
#define DISABLE_COM()
 Convenience macro for disconnecting communication interfaces from clock.
#define DISABLE_GEN()
 Convenience macro for disconnecting general modules from clock.
#define DISABLE_JTAG()
 Convenience macro for disabling the JTAG interface.
#define DISABLE_TC()
 Convenience macro for disconnecting timer/counters and associated extensions from clock.
#define ENABLE_PULLUP()
 Convenience macro for enabling pull-up on all I/O pins.


Detailed Description

XMega low power macros.

This file defines the macros used by LOWPOWER_Init(), tailored to the individual XMEGA variants. Six macros are defined, of which the last five are device specific:

      DISABLE_JTAG() - disables JTAG interface
      DISABLE_GEN() - disables crypto, EBI, DMA and event system
      DISABLE_TC() - disables timer/counters
      DISABLE_COM() - disables TWI, SPI and UARTs
      DISABLE_ANLG() - disables ADC, DAC and comparators
      ENABLE_PULLUP() - enables pull-up on all available I/O pins
      

Note:
These macros are not created in lowpower.h because they are only meant for use in lowpower.c.
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 lowpower_macros.h.


Define Documentation

#define __PORT_PULLUP ( port,
mask   ) 

Value:

{ \
        PORTCFG.MPCMASK = mask ; \
        port.PIN0CTRL = PORT_OPC_PULLUP_gc; \
}
Convenience macro for enabling pull-ups on specified pins on any port.

Definition at line 76 of file lowpower_macros.h.

 
#define DISABLE_ANLG (  ) 

Value:

{ \
        PR.PRPA |= PR_AC_bm | PR_ADC_bm | PR_DAC_bm; \
        PR.PRPB |= PR_AC_bm | PR_ADC_bm | PR_DAC_bm; \
}
Convenience macro for disconnecting analog modules from clock.

Definition at line 117 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

 
#define DISABLE_COM (  ) 

Value:

{ \
        PR.PRPC |= PR_SPI_bm | PR_TWI_bm | PR_USART0_bm | PR_USART1_bm; \
        PR.PRPD |= PR_SPI_bm | PR_TWI_bm | PR_USART0_bm | PR_USART1_bm; \
        PR.PRPE |= PR_SPI_bm | PR_TWI_bm | PR_USART0_bm | PR_USART1_bm; \
        PR.PRPF |= PR_SPI_bm | PR_TWI_bm | PR_USART0_bm | PR_USART1_bm; \
}
Convenience macro for disconnecting communication interfaces from clock.

Definition at line 109 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

 
#define DISABLE_GEN (  ) 

Value:

{ \
        PR.PRGEN |= PR_AES_bm | PR_DMA_bm | PR_EBI_bm | PR_EVSYS_bm | PR_RTC_bm; \
}
Convenience macro for disconnecting general modules from clock.

Definition at line 94 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

 
#define DISABLE_JTAG (  ) 

Value:

{ \
        ENTER_CRITICAL_REGION(); \
        CCP = 0xD8; \
        MCU_MCUCR = MCU_JTAGD_bm; \
        LEAVE_CRITICAL_REGION(); \
}
Convenience macro for disabling the JTAG interface.

Definition at line 68 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

 
#define DISABLE_TC (  ) 

Value:

{ \
        PR.PRPC |= PR_HIRES_bm | PR_TC0_bm | PR_TC1_bm; \
        PR.PRPD |= PR_HIRES_bm | PR_TC0_bm | PR_TC1_bm; \
        PR.PRPE |= PR_HIRES_bm | PR_TC0_bm | PR_TC1_bm; \
        PR.PRPF |= PR_HIRES_bm | PR_TC0_bm | PR_TC1_bm; \
}
Convenience macro for disconnecting timer/counters and associated extensions from clock.

Definition at line 101 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

 
#define ENABLE_PULLUP (  ) 

Value:

{ \
        __PORT_PULLUP(PORTA, 0xFF); \
        __PORT_PULLUP(PORTB, 0xFF); \
        __PORT_PULLUP(PORTC, 0xFF); \
        __PORT_PULLUP(PORTD, 0xFF); \
        __PORT_PULLUP(PORTE, 0xFF); \
        __PORT_PULLUP(PORTF, 0xFF); \
        __PORT_PULLUP(PORTH, 0xFF); \
        __PORT_PULLUP(PORTJ, 0xFF); \
        __PORT_PULLUP(PORTK, 0xFF); \
        __PORT_PULLUP(PORTQ, 0x0F); \
        __PORT_PULLUP(PORTR, 0x03); \
}
Convenience macro for enabling pull-up on all I/O pins.

Definition at line 123 of file lowpower_macros.h.

Referenced by LOWPOWER_Init().

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