XMEGA Application Note | |||||
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. |
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
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 __PORT_PULLUP | ( | port, | |||
mask | ) |
Value:
{ \ PORTCFG.MPCMASK = mask ; \ port.PIN0CTRL = PORT_OPC_PULLUP_gc; \ }
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; \ }
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; \ }
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; \ }
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(); \ }
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; \ }
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); \ }
Definition at line 123 of file lowpower_macros.h.
Referenced by LOWPOWER_Init().
Generated on Mon Nov 9 13:44:32 2009 for XMEGA power consumption evaluation code by ![]() |