avr32.h File Reference

Compiler file for AVR32. More...

Go to the source code of this file.

Defines

#define CONST   const
#define INLINE   inline
#define PSTR(p)   (p)
#define PRG_RDB(p)   (*((const char *)(p)))
#define prog_char   const char
#define PGM_P   prog_char *
#define SIGNAL(x)   __attribute__((__interrupt__)) void x(void)
#define RAMFUNC   __attribute__ ((long_call, section (".ramfunc")))
#define main   NutAppMain
#define strlen_P(x)   strlen((char *)(x))
#define strcpy_P(x, y)   strcpy(x,(char *)(y))
#define strcmp_P(x, y)   strcmp((char *)(x), (char *)(y))
#define memcpy_P(x, y, z)   memcpy(x, y, z)
#define _NOP()   __asm__ __volatile__ ("nop")
#define outb(_reg, _val)   (*((volatile unsigned char *)(_reg)) = (_val))
#define outw(_reg, _val)   (*((volatile unsigned short *)(_reg)) = (_val))
#define outr(_reg, _val)   (*((volatile unsigned long *)(_reg)) = (_val))
#define inb(_reg)   (*((volatile unsigned char *)(_reg)))
#define inw(_reg)   (*((volatile unsigned short *)(_reg)))
#define inr(_reg)   (*((volatile unsigned long *)(_reg)))
#define _BV(bit)   (1 << (bit))
#define _SFR_MEM8(addr)   (addr)
#define _SFR_MEM16(addr)   (addr)
#define Rd_bits(value, mask)   ((value) & (mask))
 Reads the bits of a value specified by a given bit-mask.
#define Tst_bits(value, mask)   (Rd_bits(value, mask) != 0)
 Tests the bits of a value specified by a given bit-mask.
#define Get_system_register(sysreg)   __builtin_mfsr(sysreg)
 Gets the value of the sysreg system register.
#define Set_system_register(sysreg, value)   __builtin_mtsr(sysreg, value)
 Sets the value of the sysreg system register to value.
#define Is_global_interrupt_enabled()   (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_GM_MASK))
 Tells whether interrupts are globally enabled.
#define Disable_global_interrupt()   ({__asm__ __volatile__ ("ssrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})
 Disables interrupts globally.
#define Enable_global_interrupt()   ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})
 Enables interrupts globally.

Variables

void * __bss_end
 End of uninitialized data segment. Defined in the linker script.

Detailed Description

Compiler file for AVR32.

Copyright (C) 2001-2010 by egnite Software GmbH

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. Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``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 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 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.

For additional information see http://www.ethernut.de/

Portions Copyright Atmel Corporation, see the following note.

This file defines commonly used types and macros.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file avr32.h.


Define Documentation

#define CONST   const

Definition at line 100 of file avr32.h.

#define INLINE   inline

Definition at line 101 of file avr32.h.

#define PSTR (  )     (p)

Definition at line 111 of file avr32.h.

#define PRG_RDB (  )     (*((const char *)(p)))

Definition at line 112 of file avr32.h.

#define prog_char   const char

Definition at line 114 of file avr32.h.

#define PGM_P   prog_char *

Definition at line 115 of file avr32.h.

#define SIGNAL (  )     __attribute__((__interrupt__)) void x(void)

Definition at line 117 of file avr32.h.

#define RAMFUNC   __attribute__ ((long_call, section (".ramfunc")))

Definition at line 118 of file avr32.h.

#define main   NutAppMain

Definition at line 124 of file avr32.h.

#define strlen_P (  )     strlen((char *)(x))

Definition at line 127 of file avr32.h.

#define strcpy_P ( x,
 )     strcpy(x,(char *)(y))

Definition at line 128 of file avr32.h.

#define strcmp_P ( x,
 )     strcmp((char *)(x), (char *)(y))

Definition at line 130 of file avr32.h.

#define memcpy_P ( x,
y,
 )     memcpy(x, y, z)

Definition at line 131 of file avr32.h.

 
#define _NOP (  )     __asm__ __volatile__ ("nop")

Definition at line 143 of file avr32.h.

#define outb ( _reg,
_val   )     (*((volatile unsigned char *)(_reg)) = (_val))

Definition at line 149 of file avr32.h.

#define outw ( _reg,
_val   )     (*((volatile unsigned short *)(_reg)) = (_val))

Definition at line 150 of file avr32.h.

#define outr ( _reg,
_val   )     (*((volatile unsigned long *)(_reg)) = (_val))

Definition at line 151 of file avr32.h.

#define inb ( _reg   )     (*((volatile unsigned char *)(_reg)))

Definition at line 153 of file avr32.h.

#define inw ( _reg   )     (*((volatile unsigned short *)(_reg)))

Definition at line 154 of file avr32.h.

#define inr ( _reg   )     (*((volatile unsigned long *)(_reg)))

Definition at line 155 of file avr32.h.

#define _BV ( bit   )     (1 << (bit))

Definition at line 157 of file avr32.h.

#define _SFR_MEM8 ( addr   )     (addr)

Definition at line 163 of file avr32.h.

#define _SFR_MEM16 ( addr   )     (addr)

Definition at line 164 of file avr32.h.

#define Rd_bits ( value,
mask   )     ((value) & (mask))

Reads the bits of a value specified by a given bit-mask.

Parameters:
value Value to read bits from.
mask Bit-mask indicating bits to read.
Returns:
Read bits.

Definition at line 174 of file avr32.h.

#define Tst_bits ( value,
mask   )     (Rd_bits(value, mask) != 0)

Tests the bits of a value specified by a given bit-mask.

Parameters:
value Value of which to test bits.
mask Bit-mask indicating bits to test.
Returns:
1 if at least one of the tested bits is set, else 0.

Definition at line 183 of file avr32.h.

#define Get_system_register ( sysreg   )     __builtin_mfsr(sysreg)

Gets the value of the sysreg system register.

Parameters:
sysreg Address of the system register of which to get the value.
Returns:
Value of the sysreg system register.

Definition at line 194 of file avr32.h.

#define Set_system_register ( sysreg,
value   )     __builtin_mtsr(sysreg, value)

Sets the value of the sysreg system register to value.

Parameters:
sysreg Address of the system register of which to set the value.
value Value to set the sysreg system register to.

Definition at line 206 of file avr32.h.

 
#define Is_global_interrupt_enabled (  )     (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_GM_MASK))

Tells whether interrupts are globally enabled.

Returns:
1 if interrupts are globally enabled, else 0.

Definition at line 215 of file avr32.h.

 
#define Disable_global_interrupt (  )     ({__asm__ __volatile__ ("ssrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})

Disables interrupts globally.

Definition at line 220 of file avr32.h.

 
#define Enable_global_interrupt (  )     ({__asm__ __volatile__ ("csrf\t%0" : : "i" (AVR32_SR_GM_OFFSET));})

Enables interrupts globally.

Definition at line 228 of file avr32.h.


Variable Documentation

void* __bss_end

End of uninitialized data segment. Defined in the linker script.


© 2000-2010 by contributors - visit http://www.ethernut.de/