Xmega Application Note


config.h File Reference


Detailed Description

This file contains the system configuration definition.

Application note:
AVR1907: Xplain Evaluation Board
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
3123
Date
2010-01-13 14:35:03 +0100 (on, 13 jan 2010)

Copyright (c) 2010, 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.h.

#include "avr_compiler.h"

Include dependency graph for config.h:

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

Go to the source code of this file.

Defines

#define ADC_NOISE_REDUCTION_MODE   ((0<<SM2)|(0<<SM1)|(1<<SM0))
#define Clear_prescaler()   (CLKPR = (1<<CLKPCE),CLKPR = 0)
#define code
#define Enter_sleep(mode)   (SMCR = mode | (1<<SE)),(__sleep()),(SMCR=0)
#define EXTENDED_STANDBY_MODE   ((1<<SM2)|(1<<SM1)|(1<<SM0))
#define FOSC   8000
#define IDLE_MODE   ((0<<SM2)|(0<<SM1)|(0<<SM0))
#define Led_init()   ((DDRB |= (1<<PB6)),Led_on())
#define Led_off()   (PORTB |= (1<<PB6))
#define Led_on()   (PORTB &= ~(1<<PB6))
#define Led_tgl()   (PINB |= (1<<PB6))
#define LSB(u16)   (((uint8_t* )&u16)[0])
#define LSB0(u32)   MSB3(u32)
#define LSB1(u32)   MSB2(u32)
#define LSB2(u32)   MSB1(u32)
#define LSB3(u32)   MSB0(u32)
#define LSW(u32)   (((uint16_t*)&u32)[0])
#define MSB(u16)   (((uint8_t* )&u16)[1])
#define MSB0(u32)   (((uint8_t* )&u32)[3])
#define MSB1(u32)   (((uint8_t* )&u32)[2])
#define MSB2(u32)   (((uint8_t* )&u32)[1])
#define MSB3(u32)   (((uint8_t* )&u32)[0])
#define MSW(u32)   (((uint16_t*)&u32)[1])
#define NB_MS_BEFORE_FLUSH   50
#define POWER_DOWN_MODE   ((0<<SM2)|(1<<SM1)|(0<<SM0))
#define POWER_SAVE_MODE   ((0<<SM2)|(1<<SM1)|(1<<SM0))
#define Set_prescaler(x)   (CLKPR = (1<<CKLPCE),CLKPR = x)
#define STANDBY_MODE   ((1<<SM2)|(1<<SM1)|(0<<SM0))
#define Start_PLL()   (PLLCSR = (( (0<<PLLP2) | (1<<PLLP1) | (1<<PLLP0) ) | (1<<PLLE) ))
#define Wait_pll_ready()   while (!(PLLCSR & (1<<PLOCK)))


Define Documentation

#define ADC_NOISE_REDUCTION_MODE   ((0<<SM2)|(0<<SM1)|(1<<SM0))

Definition at line 78 of file config.h.

 
#define Clear_prescaler (  )     (CLKPR = (1<<CLKPCE),CLKPR = 0)

This macro will reset the internal CPU core clock prescaler

Definition at line 59 of file config.h.

Referenced by main().

#define code

Definition at line 90 of file config.h.

#define Enter_sleep ( mode   )     (SMCR = mode | (1<<SE)),(__sleep()),(SMCR=0)

Definition at line 85 of file config.h.

#define EXTENDED_STANDBY_MODE   ((1<<SM2)|(1<<SM1)|(1<<SM0))

Definition at line 82 of file config.h.

#define FOSC   8000

CPU core frequency in kHz

Definition at line 54 of file config.h.

#define IDLE_MODE   ((0<<SM2)|(0<<SM1)|(0<<SM0))

Definition at line 77 of file config.h.

 
#define Led_init (  )     ((DDRB |= (1<<PB6)),Led_on())

Definition at line 74 of file config.h.

Referenced by main().

 
#define Led_off (  )     (PORTB |= (1<<PB6))

Definition at line 72 of file config.h.

 
#define Led_on (  )     (PORTB &= ~(1<<PB6))

Definition at line 71 of file config.h.

 
#define Led_tgl (  )     (PINB |= (1<<PB6))

Definition at line 73 of file config.h.

Referenced by cdc_task().

#define LSB ( u16   )     (((uint8_t* )&u16)[0])

Definition at line 95 of file config.h.

Referenced by usb_get_descriptor().

#define LSB0 ( u32   )     MSB3(u32)

Definition at line 102 of file config.h.

Referenced by cdc_get_line_coding(), and cdc_set_line_coding().

#define LSB1 ( u32   )     MSB2(u32)

Definition at line 103 of file config.h.

Referenced by cdc_get_line_coding(), and cdc_set_line_coding().

#define LSB2 ( u32   )     MSB1(u32)

Definition at line 104 of file config.h.

Referenced by cdc_get_line_coding(), and cdc_set_line_coding().

#define LSB3 ( u32   )     MSB0(u32)

Definition at line 105 of file config.h.

Referenced by cdc_get_line_coding(), and cdc_set_line_coding().

#define LSW ( u32   )     (((uint16_t*)&u32)[0])

Definition at line 97 of file config.h.

#define MSB ( u16   )     (((uint8_t* )&u16)[1])

Definition at line 94 of file config.h.

Referenced by usb_get_descriptor().

#define MSB0 ( u32   )     (((uint8_t* )&u32)[3])

Definition at line 98 of file config.h.

#define MSB1 ( u32   )     (((uint8_t* )&u32)[2])

Definition at line 99 of file config.h.

#define MSB2 ( u32   )     (((uint8_t* )&u32)[1])

Definition at line 100 of file config.h.

#define MSB3 ( u32   )     (((uint8_t* )&u32)[0])

Definition at line 101 of file config.h.

#define MSW ( u32   )     (((uint16_t*)&u32)[1])

Definition at line 96 of file config.h.

#define NB_MS_BEFORE_FLUSH   50

Define of maximum ms before flushing buffer

Definition at line 108 of file config.h.

Referenced by cdc_task().

#define POWER_DOWN_MODE   ((0<<SM2)|(1<<SM1)|(0<<SM0))

Definition at line 79 of file config.h.

#define POWER_SAVE_MODE   ((0<<SM2)|(1<<SM1)|(1<<SM0))

Definition at line 80 of file config.h.

#define Set_prescaler (  )     (CLKPR = (1<<CKLPCE),CLKPR = x)

This macro configure the internal CPU core clock prescaler value

Definition at line 62 of file config.h.

#define STANDBY_MODE   ((1<<SM2)|(1<<SM1)|(0<<SM0))

Definition at line 81 of file config.h.

 
#define Start_PLL (  )     (PLLCSR = (( (0<<PLLP2) | (1<<PLLP1) | (1<<PLLP0) ) | (1<<PLLE) ))

Start PLL with prescaler 4 and test PLL lock bit and wait until lock is set

Definition at line 65 of file config.h.

Referenced by usb_start_device().

 
#define Wait_pll_ready (  )     while (!(PLLCSR & (1<<PLOCK)))

Macro to wait for the PLL to be ready.

Definition at line 68 of file config.h.

Referenced by usb_start_device().

@DOC_TITLE@
Generated on Mon Jan 18 09:26:10 2010 for AVR1907 Xplain USB Gateway by doxygen 1.5.5