00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef __AVR_CPP_ATMEGA168_USART_H__
00029 #define __AVR_CPP_ATMEGA168_USART_H__
00030 
00031 
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/atmega168/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__ "atmega168/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                 
00061                 namespace Internal
00062                 {
00063                         bool &Cancel0();
00064                         
00065                 } 
00066                 
00067                 struct USART0 : Internal::USARTBase <
00068                                 _UBRR0H,                                        
00069                                 _UBRR0L,                                        
00070                                 _UCSR0A,                                        
00071                                 _UCSR0B,                                        
00072                                 _UCSR0C,                                        
00073                                 _UDR0,                                          
00074                                 Pin4<PortD>,                            
00075                                 Internal::NoRegisterSelect,     
00076                                 Internal::Cancel0 >                     
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                 }; 
00083 
00084         } 
00085         
00086 } 
00087 
00088 #endif // ifndef __AVR_CPP_ATMEGA168_USART_H__