avr/cpp/atmega644/USART.h

Go to the documentation of this file.
00001 /**********************************************************************************************************************\
00002 
00003         C++ library for Atmel AVR microcontrollers
00004         Copyright (C) 2007 Lauri Kirikal, Mikk Leini, MT� TT� Robotiklubi
00005 
00006         This program is free software; you can redistribute it and/or
00007         modify it under the terms of the GNU General Public License
00008         as published by the Free Software Foundation; either version 2
00009         of the License, or (at your option) any later version.
00010 
00011         This program is distributed in the hope that it will be useful,
00012         but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014         GNU General Public License for more details.
00015 
00016         You should have received a copy of the GNU General Public License
00017         along with this program; if not, write to the Free Software
00018         Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019 
00020         See http://creativecommons.org/licenses/GPL/2.0/
00021 
00022         MT� TT� Robotiklubi  http://www.robotiklubi.ee robotiklubi@gmail.com
00023         Lauri Kirikal        laurikirikal@gmail.com
00024         Mikk Leini           mikk.leini@gmail.com
00025 
00026 \**********************************************************************************************************************/
00027 
00028 #ifndef __AVR_CPP_ATMEGA644_USART_H__
00029 #define __AVR_CPP_ATMEGA644_USART_H__
00030 
00031 /* This file should only be included from <avr/cpp/USART.h>, never directly. */
00032 
00033 #ifndef __AVR_CPP_USART_H__
00034 #ifdef __DOXYGEN__
00035 #include <avr/cpp/USART.h>
00036 #else
00037 #error "Include <avr/cpp/USART.h> instead of <avr/cpp/atmega644/USART.h>."
00038 #endif
00039 #endif // ifndef __AVR_CPP_USART_H__
00040 
00041 #ifndef __AVR_CPP_XXX_USART_H__
00042 #define __AVR_CPP_XXX_USART_H__ "atmega644/USART.h"
00043 #else
00044 #error "Attempt to include more than one <avr/cpp/XXX/USART.h> file."
00045 #endif
00046 
00047 #ifndef EXCLUDE_INTERRUPT_HANDLERS
00048 
00049 #define USART0_RX_ns    USART
00050 #define USART0_TX_ns    USART
00051 #define USART0_UDRE_ns  USART
00052 
00053 #define USART0_RX_struct        USART::USART0::ReceiveCompleteInterrupt
00054 #define USART0_TX_struct        USART::USART0::TransferCompleteInterrupt
00055 #define USART0_UDRE_struct      USART::USART0::DataRegisterEmptyInterrupt
00056 
00057 #endif // ifndef EXCLUDE_INTERRUPT_HANDLERS
00058 
00059 namespace AVRCpp
00060 {
00061         namespace USART
00062         {
00063                 // Functions from this namespace should not be called by user
00064                 namespace Internal
00065                 {
00066                         bool &Cancel0();
00067                         
00068                 } // namespace Internal
00069                 
00070                 struct USART0 : Internal::USARTBase <
00071                                 _UBRR0H,                                        /* BaudRateRegisterHigh */
00072                                 _UBRR0L,                                        /* BaudRateRegisterLow */
00073                                 _UCSR0A,                                        /* ControlRegisterA */
00074                                 _UCSR0B,                                        /* ControlRegisterB */
00075                                 _UCSR0C,                                        /* ControlRegisterC */
00076                                 _UDR0,                                          /* DataRegister */
00077                                 Pin0<PortB>,                            /* TransferClockPin */
00078                                 Internal::NoRegisterSelect,     /* registerSelect */
00079                                 Internal::Cancel0 >                     /* Cancel */
00080                 {
00081                         struct ReceiveCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _RXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00082                         struct TransferCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _TXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00083                         struct DataRegisterEmptyInterrupt : BasicInterrupt<Bits<_UCSR0B, _UDRIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00084                         
00085                 }; // struct USART0
00086                 
00087         } // namespace USART
00088         
00089 } // namespace AVRCpp
00090 
00091 #endif // ifndef __AVR_CPP_ATMEGA644_USART_H__

Generated on Sat Sep 15 23:41:13 2007 for AVR C++ Lib for ATmega644 by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi