avr/cpp/atmega48/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_ATMEGA48_USART_H__
00029 #define __AVR_CPP_ATMEGA48_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/atmega48/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__ "atmega48/USART.h"
00043 #else
00044 #error "Attempt to include more than one <avr/cpp/XXX/USART.h> file."
00045 #endif
00046 
00047 #define USART_RX_ns             USART
00048 #define USART_TX_ns             USART
00049 #define USART_UDRE_ns   USART
00050 
00051 #define USART_RX_struct         USART::USART0::ReceiveCompleteInterrupt
00052 #define USART_TX_struct         USART::USART0::TransferCompleteInterrupt
00053 #define USART_UDRE_struct       USART::USART0::DataRegisterEmptyInterrupt
00054 
00055 
00056 namespace AVRCpp
00057 {
00058         namespace USART
00059         {
00060                 // Functions from this namespace should not be called by user
00061                 namespace Internal
00062                 {
00063                         bool &Cancel0();
00064                         
00065                 } // namespace Internal
00066                 
00067                 struct USART0 : Internal::USARTBase <
00068                                 _UBRR0H,                                        /* BaudRateRegisterHigh */
00069                                 _UBRR0L,                                        /* BaudRateRegisterLow */
00070                                 _UCSR0A,                                        /* ControlRegisterA */
00071                                 _UCSR0B,                                        /* ControlRegisterB */
00072                                 _UCSR0C,                                        /* ControlRegisterC */
00073                                 _UDR0,                                          /* DataRegister */
00074                                 Pin4<PortD>,                            /* TransferClockPin */
00075                                 Internal::NoRegisterSelect,     /* registerSelect */
00076                                 Internal::Cancel0 >                     /* Cancel */
00077                 {
00078                         struct ReceiveCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _RXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00079                         struct TransferCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _TXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00080                         struct DataRegisterEmptyInterrupt : BasicInterrupt<Bits<_UCSR0B, _UDRIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00081                         
00082                 }; // struct USART0
00083 
00084         } // namespace USART
00085         
00086 } // namespace AVRCpp
00087 
00088 #endif // ifndef __AVR_CPP_ATMEGA48_USART_H__

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