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_ATMEGA164P_USART_H__
00029 #define __AVR_CPP_ATMEGA164P_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/atmega164p/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__ "atmega164p/USART.h"
00043 #else
00044 #error "Attempt to include more than one <avr/cpp/XXX/USART.h> file."
00045 #endif
00046
00047 #define USART0_RX_ns USART
00048 #define USART0_TX_ns USART
00049 #define USART0_UDRE_ns USART
00050 #define USART1_RX_ns USART
00051 #define USART1_TX_ns USART
00052 #define USART1_UDRE_ns USART
00053
00054 #define USART0_RX_struct USART::USART0::ReceiveCompleteInterrupt
00055 #define USART0_TX_struct USART::USART0::TransferCompleteInterrupt
00056 #define USART0_UDRE_struct USART::USART0::DataRegisterEmptyInterrupt
00057 #define USART1_RX_struct USART::USART1::ReceiveCompleteInterrupt
00058 #define USART1_TX_struct USART::USART1::TransferCompleteInterrupt
00059 #define USART1_UDRE_struct USART::USART1::DataRegisterEmptyInterrupt
00060
00061
00062 namespace AVRCpp
00063 {
00064 namespace USART
00065 {
00066
00067 namespace Internal
00068 {
00069 bool &Cancel0();
00070 bool &Cancel1();
00071
00072 }
00073
00074 struct USART0 : Internal::USARTBase <
00075 _UBRR0H,
00076 _UBRR0L,
00077 _UCSR0A,
00078 _UCSR0B,
00079 _UCSR0C,
00080 _UDR0,
00081 Pin0<PortB>,
00082 Internal::NoRegisterSelect,
00083 Internal::Cancel0 >
00084 {
00085 struct ReceiveCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _RXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00086 struct TransferCompleteInterrupt : BasicInterrupt<Bits<_UCSR0B, _TXCIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00087 struct DataRegisterEmptyInterrupt : BasicInterrupt<Bits<_UCSR0B, _UDRIE0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00088
00089 };
00090
00091 struct USART1 : Internal::USARTBase <
00092 _UBRR1H,
00093 _UBRR1L,
00094 _UCSR1A,
00095 _UCSR1B,
00096 _UCSR1C,
00097 _UDR1,
00098 Pin4<PortD>,
00099 Internal::NoRegisterSelect,
00100 Internal::Cancel1 >
00101 {
00102 struct ReceiveCompleteInterrupt : BasicInterrupt<Bits<_UCSR1B, _RXCIE1> > { __INTERRUPT_HANDLER_SUPPORT__ };
00103 struct TransferCompleteInterrupt : BasicInterrupt<Bits<_UCSR1B, _TXCIE1> > { __INTERRUPT_HANDLER_SUPPORT__ };
00104 struct DataRegisterEmptyInterrupt : BasicInterrupt<Bits<_UCSR1B, _UDRIE1> > { __INTERRUPT_HANDLER_SUPPORT__ };
00105
00106 };
00107
00108 }
00109
00110 }
00111
00112 #endif // ifndef __AVR_CPP_ATMEGA164P_USART_H__