Go to the documentation of this file.
42 #ifndef __RS232_ATXMEGA256A3__
43 #define __RS232_ATXMEGA256A3__
53 #define RS232_0 USARTE0
54 #define RS232_1 USARTF0
56 #define RS232_USARTE0 0
57 #define RS232_USARTF0 1
59 #define RS232_PORT_0 0
60 #define RS232_PORT_1 1
68 #if (F_CPU == 48000000UL)
69 #define USART_BAUD_2400 0x04E1
70 #define USART_BAUD_4800 0x0270
71 #define USART_BAUD_9600 0xD9BC
72 #define USART_BAUD_14400 0xCCF5
73 #define USART_BAUD_19200 0xC9B4
74 #define USART_BAUD_28800 0xBCE5
75 #define USART_BAUD_38400 0xB9A4
76 #define USART_BAUD_57600 0xACC5
77 #define USART_BAUD_76800 0xA984
78 #define USART_BAUD_115200 0x9C85
79 #define USART_BAUD_230400 0x9603
80 #define USART_BAUD_250000 0x000B
81 #define USART_BAUD_500000 0x0005
82 #define USART_BAUD_1000000 0x0002
83 #elif (F_CPU == 32000000UL)
85 #define USART_BAUD_2400 0x0340
86 #define USART_BAUD_4800 0xDCFD
87 #define USART_BAUD_9600 0xCCF5
88 #define USART_BAUD_14400 0xC89E
89 #define USART_BAUD_19200 0xBCE5
90 #define USART_BAUD_28800 0xB88E
91 #define USART_BAUD_38400 0xACC5
92 #define USART_BAUD_57600 0xA86E
93 #define USART_BAUD_76800 0x9C85
94 #define USART_BAUD_115200 0x982E
95 #define USART_BAUD_230400 0x93D7
96 #define USART_BAUD_250000 0x0007
97 #define USART_BAUD_500000 0x0003
98 #define USART_BAUD_1000000 0x0001
99 #elif (F_CPU == 18000000UL)
100 #define USART_BAUD_2400 0xDE9E
101 #define USART_BAUD_4800 0xCE96
102 #define USART_BAUD_9600 0xBE86
103 #define USART_BAUD_14400 0xB9A4
104 #define USART_BAUD_19200 0xAE66
105 #define USART_BAUD_28800 0xA984
106 #define USART_BAUD_38400 0x9E26
107 #define USART_BAUD_57600 0x9944
108 #define USART_BAUD_76800 0x96D3
109 #define USART_BAUD_115200 0x9462
110 #define USART_BAUD_230400 0x91F1
111 #define USART_BAUD_250000 0x91C0
112 #define USART_BAUD_500000 0x90A0
113 #define USART_BAUD_1000000 0x9010
114 #elif (F_CPU == 20000000UL)
115 #define USART_BAUD_2400 0xE81F
116 #define USART_BAUD_4800 0xD81B
117 #define USART_BAUD_9600 0xC813
118 #define USART_BAUD_14400 0xBABA
119 #define USART_BAUD_19200 0xB803
120 #define USART_BAUD_28800 0xAA9A
121 #define USART_BAUD_38400 0x9FC7
122 #define USART_BAUD_57600 0x9A5A
123 #define USART_BAUD_76800 0x97A3
124 #define USART_BAUD_115200 0x94ED
125 #define USART_BAUD_230400 0x9236
126 #define USART_BAUD_250000 0x0004
127 #define USART_BAUD_500000 0x90C0
128 #define USART_BAUD_1000000 0x9020
129 #elif (F_CPU == 16000000UL)
131 #define USART_BAUD_2400 0xDCFD
132 #define USART_BAUD_4800 0xCCF5
133 #define USART_BAUD_9600 0xBCE5
134 #define USART_BAUD_14400 0xB88E
135 #define USART_BAUD_19200 0xACC5
136 #define USART_BAUD_28800 0xA86E
137 #define USART_BAUD_38400 0x9C85
138 #define USART_BAUD_57600 0x982E
139 #define USART_BAUD_76800 0x9603
140 #define USART_BAUD_115200 0x93D7
141 #define USART_BAUD_230400 0x91AC
142 #define USART_BAUD_250000 0x0003
143 #define USART_BAUD_500000 0x0001
144 #define USART_BAUD_1000000 0x0001
145 #elif (F_CPU == 12000000UL)
146 #define USART_BAUD_2400 0xD9BC
147 #define USART_BAUD_4800 0xC9B4
148 #define USART_BAUD_9600 0xB9A4
149 #define USART_BAUD_14400 0xACC5
150 #define USART_BAUD_19200 0xA984
151 #define USART_BAUD_28800 0x9C85
152 #define USART_BAUD_38400 0x9944
153 #define USART_BAUD_57600 0x9603
154 #define USART_BAUD_76800 0x9462
155 #define USART_BAUD_115200 0x92C1
156 #define USART_BAUD_230400 0x9121
157 #define USART_BAUD_250000 0x0002
158 #define USART_BAUD_500000 0x9040
159 #define USART_BAUD_1000000 0x9040
160 #elif (F_CPU == 8000000UL)
162 #define USART_BAUD_2400 0xCCF5
163 #define USART_BAUD_4800 0xBCE5
164 #define USART_BAUD_9600 0xACC5
165 #define USART_BAUD_14400 0xA86E
166 #define USART_BAUD_19200 0x9C85
167 #define USART_BAUD_28800 0x982E
168 #define USART_BAUD_38400 0x9603
169 #define USART_BAUD_57600 0x93D7
170 #define USART_BAUD_76800 0x92C1
171 #define USART_BAUD_115200 0x91AC
172 #define USART_BAUD_230400 0x9096
173 #define USART_BAUD_250000 0x0001
174 #define USART_BAUD_500000 0x0001
175 #define USART_BAUD_1000000 0x0001
176 #elif (F_CPU == 6000000UL)
177 #define USART_BAUD_2400 0xC9B4
178 #define USART_BAUD_4800 0xB9A4
179 #define USART_BAUD_9600 0xA984
180 #define USART_BAUD_14400 0x9C85
181 #define USART_BAUD_19200 0x9944
182 #define USART_BAUD_28800 0x9603
183 #define USART_BAUD_38400 0x9462
184 #define USART_BAUD_57600 0x92C1
185 #define USART_BAUD_76800 0x91F1
186 #define USART_BAUD_115200 0x9121
187 #define USART_BAUD_230400 0x9050
188 #define USART_BAUD_250000 0x9040
189 #define USART_BAUD_500000 0x9040
190 #define USART_BAUD_1000000 0x9040
191 #elif (F_CPU == 4000000UL)
192 #define USART_BAUD_2400 0xBCE5
193 #define USART_BAUD_4800 0xACC5
194 #define USART_BAUD_9600 0x9C85
195 #define USART_BAUD_14400 0x982E
196 #define USART_BAUD_19200 0x9603
197 #define USART_BAUD_28800 0x93D7
198 #define USART_BAUD_38400 0x92C1
199 #define USART_BAUD_57600 0x91AC
200 #define USART_BAUD_76800 0x9121
201 #define USART_BAUD_115200 0x9096
202 #define USART_BAUD_230400 0x900B
203 #define USART_BAUD_250000 0x900B
204 #define USART_BAUD_500000 0x900B
205 #define USART_BAUD_1000000 0x900B
206 #elif (F_CPU == 2000000UL)
207 #define USART_BAUD_2400 0xACC5
208 #define USART_BAUD_4800 0x9C85
209 #define USART_BAUD_9600 0x9603
210 #define USART_BAUD_14400 0x93D7
211 #define USART_BAUD_19200 0x92C1
212 #define USART_BAUD_28800 0x91AC
213 #define USART_BAUD_38400 0x9121
214 #define USART_BAUD_57600 0x9096
215 #define USART_BAUD_76800 0x9050
216 #define USART_BAUD_115200 0x900B
217 #define USART_BAUD_230400 0x900B
218 #define USART_BAUD_250000 0x900B
219 #define USART_BAUD_500000 0x900B
220 #define USART_BAUD_1000000 0x900B
222 #error "Please define the baud rates for your CPU clock or set the rate in contiki-conf.h"
230 #define USART_INTERRUPT_RX_COMPLETE USART_RXCIF_bm
231 #define USART_INTERRUPT_TX_COMPLETE USART_TXCIF_bm
232 #define USART_INTERRUPT_DATA_REG_EMPTY USART_DREIF_bm
239 #define USART_RECEIVER_ENABLE USART_RXEN_bm
240 #define USART_TRANSMITTER_ENABLE USART_TXEN_bm
247 #define USART_MODE_ASYNC 0x00
248 #define USART_MODE_SYNC 0x40
249 #define USART_MODE_IRCOM 0x80
250 #define USART_MODE_MSPI 0xC0
257 #define USART_PARITY_NONE 0x00
258 #define USART_PARITY_EVEN 0x20
259 #define USART_PARITY_ODD 0x30
267 #define USART_STOP_BITS_1 0x00
268 #define USART_STOP_BITS_2 0x08
275 #define USART_DATA_BITS_5 0x00
276 #define USART_DATA_BITS_6 0x01
277 #define USART_DATA_BITS_7 0x02
278 #define USART_DATA_BITS_8 0x03
279 #define USART_DATA_BITS_9 0x07