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_ATMEGA644_USART_H__
00029 #define __AVR_CPP_ATMEGA644_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/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
00064 namespace Internal
00065 {
00066 bool &Cancel0();
00067
00068 }
00069
00070 struct USART0 : Internal::USARTBase <
00071 _UBRR0H,
00072 _UBRR0L,
00073 _UCSR0A,
00074 _UCSR0B,
00075 _UCSR0C,
00076 _UDR0,
00077 Pin0<PortB>,
00078 Internal::NoRegisterSelect,
00079 Internal::Cancel0 >
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 };
00086
00087 }
00088
00089 }
00090
00091 #endif // ifndef __AVR_CPP_ATMEGA644_USART_H__