# 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_JTAG()
| Convenience macro for disabling the JTAG interface.

## 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 16:55:22 +0800 (Fri, 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_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().