Go to the documentation of this file.
53 #define UART_0_BASE 0x4000C000
54 #define UART_1_BASE 0x4000D000
58 #define UART_BASE UART_CONF_BASE
60 #define UART_BASE UART_0_BASE
72 #define UART_IBRD_9600 104
73 #define UART_FBRD_9600 11
74 #define UART_IBRD_38400 26
75 #define UART_FBRD_38400 3
76 #define UART_IBRD_57600 17
77 #define UART_FBRD_57600 24
78 #define UART_IBRD_115200 8
79 #define UART_FBRD_115200 44
80 #define UART_IBRD_230400 4
81 #define UART_FBRD_230400 22
82 #define UART_IBRD_460800 2
83 #define UART_FBRD_460800 11
85 #if UART_CONF_BAUD_RATE==9600
86 #define UART_CONF_IBRD UART_IBRD_9600
87 #define UART_CONF_FBRD UART_FBRD_9600
88 #elif UART_CONF_BAUD_RATE==38400
89 #define UART_CONF_IBRD UART_IBRD_38400
90 #define UART_CONF_FBRD UART_FBRD_38400
91 #elif UART_CONF_BAUD_RATE==57600
92 #define UART_CONF_IBRD UART_IBRD_57600
93 #define UART_CONF_FBRD UART_FBRD_57600
94 #elif UART_CONF_BAUD_RATE==115200
95 #define UART_CONF_IBRD UART_IBRD_115200
96 #define UART_CONF_FBRD UART_FBRD_115200
97 #elif UART_CONF_BAUD_RATE==230400
98 #define UART_CONF_IBRD UART_IBRD_230400
99 #define UART_CONF_FBRD UART_FBRD_230400
100 #elif UART_CONF_BAUD_RATE==460800
101 #define UART_CONF_IBRD UART_IBRD_460800
102 #define UART_CONF_FBRD UART_FBRD_460800
104 #if !(defined UART_CONF_IBRD && defined UART_CONF_FBRD)
105 #error "UART baud rate misconfigured and custom IBRD/FBRD values not provided"
106 #error "Check the value of UART_CONF_BAUD_RATE in contiki-conf.h or project-conf.h"
107 #error "Supported values are 9600, 38400, 57600, 115200, 230400 and 460800."
108 #error "Alternatively, you can provide custom values for "
109 #error "UART_CONF_IBRD and UART_CONF_FBRD"
117 #define UART_DR 0x00000000
118 #define UART_RSR 0x00000004
119 #define UART_ECR 0x00000004
120 #define UART_FR 0x00000018
121 #define UART_ILPR 0x00000020
122 #define UART_IBRD 0x00000024
123 #define UART_FBRD 0x00000028
124 #define UART_LCRH 0x0000002C
125 #define UART_CTL 0x00000030
126 #define UART_IFLS 0x00000034
127 #define UART_IM 0x00000038
128 #define UART_RIS 0x0000003C
129 #define UART_MIS 0x00000040
130 #define UART_ICR 0x00000044
131 #define UART_DMACTL 0x00000048
132 #define UART_LCTL 0x00000090
133 #define UART_LSS 0x00000094
134 #define UART_LTIM 0x00000098
135 #define UART_NINEBITADDR 0x000000A4
136 #define UART_NINEBITAMASK 0x000000A8
137 #define UART_PP 0x00000FC0
138 #define UART_CC 0x00000FC8
144 #define UART_DR_OE 0x00000800
145 #define UART_DR_BE 0x00000400
146 #define UART_DR_PE 0x00000200
147 #define UART_DR_FE 0x00000100
148 #define UART_DR_DATA 0x000000FF
154 #define UART_RSR_OE 0x00000008
155 #define UART_RSR_BE 0x00000004
156 #define UART_RSR_PE 0x00000002
157 #define UART_RSR_FE 0x00000001
163 #define UART_ECR_DATA 0x000000FF
169 #define UART_FR_TXFE 0x00000080
170 #define UART_FR_RXFF 0x00000040
171 #define UART_FR_TXFF 0x00000020
172 #define UART_FR_RXFE 0x00000010
173 #define UART_FR_BUSY 0x00000008
174 #define UART_FR_CTS 0x00000001
180 #define UART_ILPR_ILPDVSR 0x000000FF
186 #define UART_IBRD_DIVINT 0x0000FFFF
192 #define UART_FBRD_DIVFRAC 0x0000003F
198 #define UART_LCRH_SPS 0x00000080
199 #define UART_LCRH_WLEN 0x00000060
200 #define UART_LCRH_FEN 0x00000010
201 #define UART_LCRH_STP2 0x00000008
202 #define UART_LCRH_EPS 0x00000004
203 #define UART_LCRH_PEN 0x00000002
204 #define UART_LCRH_BRK 0x00000001
210 #define UART_LCRH_WLEN_8 0x00000060
211 #define UART_LCRH_WLEN_7 0x00000040
212 #define UART_LCRH_WLEN_6 0x00000020
213 #define UART_LCRH_WLEN_5 0x00000000
219 #define UART_CTL_RXE 0x00000200
220 #define UART_CTL_TXE 0x00000100
221 #define UART_CTL_LBE 0x00000080
222 #define UART_CTL_LIN 0x00000040
223 #define UART_CTL_HSE 0x00000020
224 #define UART_CTL_EOT 0x00000010
225 #define UART_CTL_SMART 0x00000008
226 #define UART_CTL_SIRLP 0x00000004
227 #define UART_CTL_SIREN 0x00000002
228 #define UART_CTL_UARTEN 0x00000001
234 #define UART_IFLS_RXIFLSEL 0x00000038
235 #define UART_IFLS_TXIFLSEL 0x00000007
241 #define UART_IFLS_RXIFLSEL_7_8 0x00000020
242 #define UART_IFLS_RXIFLSEL_3_4 0x00000018
243 #define UART_IFLS_RXIFLSEL_1_2 0x00000010
244 #define UART_IFLS_RXIFLSEL_1_4 0x00000008
245 #define UART_IFLS_RXIFLSEL_1_8 0x00000000
251 #define UART_IFLS_TXIFLSEL_1_8 0x00000004
252 #define UART_IFLS_TXIFLSEL_1_4 0x00000003
253 #define UART_IFLS_TXIFLSEL_1_2 0x00000002
254 #define UART_IFLS_TXIFLSEL_3_4 0x00000001
255 #define UART_IFLS_TXIFLSEL_7_8 0x00000000
261 #define UART_IM_LME5IM 0x00008000
262 #define UART_IM_LME1IM 0x00004000
263 #define UART_IM_LMSBIM 0x00002000
264 #define UART_IM_NINEBITIM 0x00001000
265 #define UART_IM_OEIM 0x00000400
266 #define UART_IM_BEIM 0x00000200
267 #define UART_IM_PEIM 0x00000100
268 #define UART_IM_FEIM 0x00000080
269 #define UART_IM_RTIM 0x00000040
270 #define UART_IM_TXIM 0x00000020
271 #define UART_IM_RXIM 0x00000010
272 #define UART_IM_CTSIM 0x00000002
278 #define UART_RIS_LME5RIS 0x00008000
279 #define UART_RIS_LME1RIS 0x00004000
280 #define UART_RIS_LMSBRIS 0x00002000
281 #define UART_RIS_NINEBITRIS 0x00001000
282 #define UART_RIS_OERIS 0x00000400
283 #define UART_RIS_BERIS 0x00000200
284 #define UART_RIS_PERIS 0x00000100
285 #define UART_RIS_FERIS 0x00000080
286 #define UART_RIS_RTRIS 0x00000040
287 #define UART_RIS_TXRIS 0x00000020
288 #define UART_RIS_RXRIS 0x00000010
289 #define UART_RIS_CTSRIS 0x00000002
295 #define UART_MIS_LME5MIS 0x00008000
296 #define UART_MIS_LME1MIS 0x00004000
297 #define UART_MIS_LMSBMIS 0x00002000
298 #define UART_MIS_NINEBITMIS 0x00001000
299 #define UART_MIS_OEMIS 0x00000400
300 #define UART_MIS_BEMIS 0x00000200
301 #define UART_MIS_PEMIS 0x00000100
302 #define UART_MIS_FEMIS 0x00000080
303 #define UART_MIS_RTMIS 0x00000040
304 #define UART_MIS_TXMIS 0x00000020
305 #define UART_MIS_RXMIS 0x00000010
306 #define UART_MIS_CTSMIS 0x00000002
312 #define UART_ICR_LME5IC 0x00008000
313 #define UART_ICR_LME1IC 0x00004000
314 #define UART_ICR_LMSBIC 0x00002000
315 #define UART_ICR_NINEBITIC 0x00001000
316 #define UART_ICR_OEIC 0x00000400
317 #define UART_ICR_BEIC 0x00000200
318 #define UART_ICR_PEIC 0x00000100
319 #define UART_ICR_FEIC 0x00000080
320 #define UART_ICR_RTIC 0x00000040
321 #define UART_ICR_TXIC 0x00000020
322 #define UART_ICR_RXIC 0x00000010
323 #define UART_ICR_CTSIC 0x00000002
329 #define UART_DMACTL_DMAERR 0x00000004
330 #define UART_DMACTL_TXDMAE 0x00000002
331 #define UART_DMACTL_RXDMAE 0x00000001
337 #define UART_LCTL_BLEN 0x00000030
338 #define UART_LCTL_MASTER 0x00000001
344 #define UART_LSS_TSS 0x0000FFFF
350 #define UART_LTIM_TIMER 0x0000FFFF
356 #define UART_NINEBITADDR_NINEBITEN 0x00008000
357 #define UART_NINEBITADDR_ADDR 0x000000FF
363 #define UART_NINEBITAMASK_RANGE 0x0000FF00
364 #define UART_NINEBITAMASK_MASK 0x000000FF
370 #define UART_PP_NB 0x00000002
371 #define UART_PP_SC 0x00000001
377 #define UART_CC_CS 0x00000007