macro.h File Reference


Detailed Description

Macro file for AVR32.

This file defines macros for accessing system registers on AVR32 devices.

Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Revision
43
Date
2006-03-22 09:10:05 +0100 (Wed, 22 Mar 2006)

Definition in file macro.h.

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

Go to the source code of this file.

Defines

#define CLEARBIT(sregister, bitname)
 define which clears a bit in system registers
#define CLRBIT(sregister, bitname)   CLEARBIT(sregister, bitname)
#define GETBITS(sregister, return_value)   READBITS(sregister, return_value)
#define READBITS(sregister, return_value)
 define to read a given system registers
#define SETBIT(sregister, bitname)
 define which sets a bit in system registers
#define TGLBIT(sregister, bitname)   TOGGLEBIT(sregister, bitname)
#define TOGGLEBIT(sregister, bitname)
 define which toggles a bit in system registers


Define Documentation

#define CLEARBIT ( sregister,
bitname   ) 

Value:

__asm__( "st.w sp++, r7\n" \
                        "mfsr r7, %0\n" \
                        "cbr r7, %1\n" \
                        "mtsr %0, r7\n" \
                        "ld.w r7, --sp\n" \
                        : \
                        :"X"(sregister), "g"(bitname) )
define which clears a bit in system registers

First store the r7 register on the stack and increment the pointer. Then load the system register

Parameters:
sregister,clear the bit
bitname,store the system register and load value from stack to r7 and deincrement.

Definition at line 49 of file macro.h.

#define CLRBIT ( sregister,
bitname   )     CLEARBIT(sregister, bitname)

Definition at line 58 of file macro.h.

#define GETBITS ( sregister,
return_value   )     READBITS(sregister, return_value)

Definition at line 100 of file macro.h.

#define READBITS ( sregister,
return_value   ) 

Value:

__asm__ __volatile__( "st.w sp++, r6\n" \
                        "mfsr r6, %1\n" \
                        "st.w %0, r6\n" \
                        "ld.w r6, --sp\n" \
                        : "=g"(return_value) \
                        :"X"(sregister) )
define to read a given system registers

Store r6 register on stack and increment pointer. Then load the system register

Parameters:
sregister and store this value in the
return_value before loading value from stack and deincrement r7.

Definition at line 92 of file macro.h.

#define SETBIT ( sregister,
bitname   ) 

Value:

__asm__( "st.w sp++, r7\n" \
                        "mfsr r7, %0\n" \
                        "sbr r7, %1\n" \
                        "mtsr %0, r7\n" \
                        "ld.w r7, --sp\n" \
                        : \
                        :"X"(sregister), "g"(bitname) )
define which sets a bit in system registers

First store the r7 register on the stack and increment the pointer. Then load the system register

Parameters:
sregister,set the bit
bitname,store the system register and load value from stack to r7 and deincrement.

Definition at line 31 of file macro.h.

#define TGLBIT ( sregister,
bitname   )     TOGGLEBIT(sregister, bitname)

Definition at line 82 of file macro.h.

#define TOGGLEBIT ( sregister,
bitname   ) 

Value:

__asm__( "st.w sp++, r7\n" \
                        "st.w sp++, r6\n" \
                        "mfsr r7, %0\n" \
                        "mov r6, 0\n" \
                        "sbr r6, %1\n" \
                        "eor r7, r6\n" \
                        "mtsr %0, r7\n" \
                        "ld.w r6, --sp\n" \
                        "ld.w r7, --sp\n" \
                        : \
                        :"X"(sregister), "g"(bitname) )
define which toggles a bit in system registers

First store the r7 register on the stack and increment the pointer. Then load the system register

Parameters:
sregister,toggle the bit
bitname by using an exclusive or, store the system register and load value from stack to r7 and deincrement.

Definition at line 69 of file macro.h.


Generated on Thu May 10 14:14:48 2007 for AVR321000 Communication with the AVR32 USART by  doxygen 1.5.1