Go to the documentation of this file.
42 #ifndef __RS232_ATMEGA644__
43 #define __RS232_ATMEGA644__
52 #define RS232_PORT_0 0
59 #define USART_BAUD_2400 416
60 #define USART_BAUD_4800 207
61 #define USART_BAUD_9600 103
62 #define USART_BAUD_14400 68
63 #define USART_BAUD_19200 51
64 #define USART_BAUD_28800 34
65 #define USART_BAUD_38400 25
66 #define USART_BAUD_57600 16
67 #define USART_BAUD_76800 12
68 #define USART_BAUD_115200 8
69 #define USART_BAUD_230400 3
70 #define USART_BAUD_250000 3
71 #define USART_BAUD_500000 1
72 #define USART_BAUD_1000000 0
73 #elif F_CPU == 8000000
75 #define USART_BAUD_2400 207
76 #define USART_BAUD_4800 103
77 #define USART_BAUD_9600 51
78 #define USART_BAUD_14400 34
79 #define USART_BAUD_19200 25
80 #define USART_BAUD_28800 16
81 #define USART_BAUD_38400 12
82 #define USART_BAUD_57600 8
83 #define USART_BAUD_76800 6
84 #define USART_BAUD_115200 3
85 #define USART_BAUD_230400 1
86 #define USART_BAUD_250000 1
87 #define USART_BAUD_500000 0
89 #error "Please define the baud rates for your CPU clock: ATmega644 handbook p. \
90 187-190 or set the rate in contiki-conf.h"
97 #define USART_INTERRUPT_RX_COMPLETE _BV (RXCIE0)
98 #define USART_INTERRUPT_TX_COMPLETE _BV (TXCIE0)
99 #define USART_INTERRUPT_DATA_REG_EMPTY _BV (UDRIE0)
104 #define USART_RECEIVER_ENABLE _BV (RXEN0)
105 #define USART_TRANSMITTER_ENABLE _BV (TXEN0)
110 #define USART_MODE_ASYNC 0x00
111 #define USART_MODE_SYNC _BV (UMSEL00)
116 #define USART_PARITY_NONE 0x00
117 #define USART_PARITY_EVEN _BV (UPM01)
118 #define USART_PARITY_ODD _BV (UPM01) | _BV (UPM00)
123 #define USART_STOP_BITS_1 0x00
124 #define USART_STOP_BITS_2 _BV (USBS)
129 #define USART_DATA_BITS_5 0x00
130 #define USART_DATA_BITS_6 _BV (UCSZ00)
131 #define USART_DATA_BITS_7 _BV (UCSZ01)
132 #define USART_DATA_BITS_8 _BV (UCSZ01) | _BV (UCSZ00)
138 #define USART_RISING_XCKN_EDGE 0x00
139 #define USART_FALLING_XCKN_EDGE _BV (UCPOL0)