libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
usart_common.h
Go to the documentation of this file.
1
/** @addtogroup usart_defines
2
*/
3
/*
4
* This file is part of the libopencm3 project.
5
*
6
* Copyright (C) 2015 Kuldeep Singh Dhaka <kuldeepdhaka9@gmail.com>
7
*
8
* This library is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this library. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#pragma once
23
24
#include <
libopencm3/efm32/memorymap.h
>
25
#include <
libopencm3/cm3/common.h
>
26
27
/**@{*/
28
29
#define USART_CTRL(base) MMIO32((base) + 0x000)
30
#define USART_FRAME(base) MMIO32((base) + 0x004)
31
#define USART_TRIGCTRL(base) MMIO32((base) + 0x008)
32
#define USART_CMD(base) MMIO32((base) + 0x00C)
33
#define USART_STATUS(base) MMIO32((base) + 0x010)
34
#define USART_CLKDIV(base) MMIO32((base) + 0x014)
35
#define USART_RXDATAX(base) MMIO32((base) + 0x018)
36
#define USART_RXDATA(base) MMIO32((base) + 0x01C)
37
#define USART_RXDOUBLEX(base) MMIO32((base) + 0x020)
38
#define USART_RXDOUBLE(base) MMIO32((base) + 0x024)
39
#define USART_RXDATAXP(base) MMIO32((base) + 0x028)
40
#define USART_RXDOUBLEXP(base) MMIO32((base) + 0x02C)
41
#define USART_TXDATAX(base) MMIO32((base) + 0x030)
42
#define USART_TXDATA(base) MMIO32((base) + 0x034)
43
#define USART_TXDOUBLEX(base) MMIO32((base) + 0x038)
44
#define USART_TXDOUBLE(base) MMIO32((base) + 0x03C)
45
#define USART_IF(base) MMIO32((base) + 0x040)
46
#define USART_IFS(base) MMIO32((base) + 0x044)
47
#define USART_IFC(base) MMIO32((base) + 0x048)
48
#define USART_IEN(base) MMIO32((base) + 0x04C)
49
#define USART_IRCTRL(base) MMIO32((base) + 0x050)
50
#define USART_ROUTE(base) MMIO32((base) + 0x054)
51
#define USART_INPUT(base) MMIO32((base) + 0x058)
52
#define USART_I2SCTRL(base) MMIO32((base) + 0x05C)
53
54
/* USART_CTRL */
55
#define USART_CTRL_SMSDELAY (1 << 31)
56
#define USART_CTRL_MVDIS (1 << 30)
57
#define USART_CTRL_AUTOTX (1 << 29)
58
#define USART_CTRL_BYTESWAP (1 << 28)
59
60
#define USART_CTRL_TXDELAY_SHIFT (26)
61
#define USART_CTRL_TXDELAY_MASK (0x3 << USART_CTRL_TXDELAY_SHIFT)
62
#define USART_CTRL_TXDELAY(v) \
63
(((v) << USART_CTRL_TXDELAY_SHIFT) & USART_CTRL_TXDELAY_MASK)
64
#define USART_CTRL_TXDELAY_NONE 0
65
#define USART_CTRL_TXDELAY_SINGLE 1
66
#define USART_CTRL_TXDELAY_DOUBLE 2
67
#define USART_CTRL_TXDELAY_TRIPLE 3
68
69
#define USART_CTRL_SSSEARLY (1 << 25)
70
#define USART_CTRL_ERRSTX (1 << 24)
71
#define USART_CTRL_ERRSRX (1 << 23)
72
#define USART_CTRL_ERRSDMA (1 << 22)
73
#define USART_CTRL_BIT8DV (1 << 21)
74
#define USART_CTRL_SKIPPERRF (1 << 20)
75
#define USART_CTRL_SCRETRANS (1 << 19)
76
#define USART_CTRL_SCMODE (1 << 18)
77
#define USART_CTRL_AUTOTRI (1 << 17)
78
#define USART_CTRL_AUTOCS (1 << 16)
79
#define USART_CTRL_CSINV (1 << 15)
80
#define USART_CTRL_TXINV (1 << 14)
81
#define USART_CTRL_RXINV (1 << 13)
82
#define USART_CTRL_TXBIL (1 << 12)
83
#define USART_CTRL_CSMA (1 << 11)
84
#define USART_CTRL_MSBF (1 << 10)
85
#define USART_CTRL_CLKPHA (1 << 9)
86
#define USART_CTRL_CLKPOL (1 << 8)
87
88
#define USART_CTRL_OVS_SHIFT (5)
89
#define USART_CTRL_OVS_MASK (0x3 << USART_CTRL_OVS_SHIFT)
90
#define USART_CTRL_OVS(v) \
91
(((v) << USART_CTRL_OVS_SHIFT) & USART_CTRL_OVS_MASK)
92
#define USART_CTRL_OVS_X16 0
93
#define USART_CTRL_OVS_X8 1
94
#define USART_CTRL_OVS_X6 2
95
#define USART_CTRL_OVS_X4 3
96
97
#define USART_CTRL_MPAB (1 << 4)
98
#define USART_CTRL_MPM (1 << 3)
99
#define USART_CTRL_CCEN (1 << 2)
100
#define USART_CTRL_LOOPBK (1 << 1)
101
#define USART_CTRL_SYNC (1 << 0)
102
103
/* USART_FRAME */
104
105
#define USART_FRAME_STOPBITS_SHIFT (12)
106
#define USART_FRAME_STOPBITS_MASK (0x3 << USART_FRAME_STOPBITS_SHIFT)
107
#define USART_FRAME_STOPBITS(v) \
108
(((v) << USART_FRAME_STOPBITS_SHIFT) & USART_FRAME_STOPBITS_MASK)
109
#define USART_FRAME_STOPBITS_HALF 0
110
#define USART_FRAME_STOPBITS_ONE 1
111
#define USART_FRAME_STOPBITS_ONEANDAHALF 2
112
#define USART_FRAME_STOPBITS_ONE_AND_A_HALF \
113
USART_FRAME_STOPBITS_ONEANDAHALF
114
#define USART_FRAME_STOPBITS_TWO 3
115
116
#define USART_FRAME_PARITY_SHIFT (8)
117
#define USART_FRAME_PARITY_MASK (0x3 << USART_FRAME_PARITY_SHIFT)
118
#define USART_FRAME_PARITY(v) \
119
(((v) << USART_FRAME_PARITY_SHIFT) & USART_FRAME_PARITY_MASK)
120
#define USART_FRAME_PARITY_NONE 0
121
#define USART_FRAME_PARITY_EVEN 2
122
#define USART_FRAME_PARITY_ODD 3
123
124
#define USART_FRAME_DATABITS_SHIFT (0)
125
#define USART_FRAME_DATABITS_MASK (0xF << USART_FRAME_DATABITS_SHIFT)
126
#define USART_FRAME_DATABITS(v) \
127
(((v) << USART_FRAME_DATABITS_SHIFT) & USART_FRAME_DATABITS_MASK)
128
#define USART_FRAME_DATABITS_FOUR 1
129
#define USART_FRAME_DATABITS_FIVE 2
130
#define USART_FRAME_DATABITS_SIX 3
131
#define USART_FRAME_DATABITS_SEVEN 4
132
#define USART_FRAME_DATABITS_EIGHT 5
133
#define USART_FRAME_DATABITS_NINE 6
134
#define USART_FRAME_DATABITS_TEN 7
135
#define USART_FRAME_DATABITS_ELEVEN 8
136
#define USART_FRAME_DATABITS_TWELVE 9
137
#define USART_FRAME_DATABITS_THIRTEEN 10
138
#define USART_FRAME_DATABITS_FOURTEEN 11
139
#define USART_FRAME_DATABITS_FIFTEEN 12
140
#define USART_FRAME_DATABITS_SIXTEEN 13
141
142
/* USART_TRIGCTRL */
143
#define USART_TRIGCTRL_AUTOTXTEN (1 << 6)
144
#define USART_TRIGCTRL_TXTEN (1 << 5)
145
#define USART_TRIGCTRL_RXTEN (1 << 4)
146
147
#define USART_TRIGCTRL_TSEL_SHIFT (8)
148
#define USART_TRIGCTRL_TSEL_MASK (0x3 << USART_TRIGCTRL_TSEL_SHIFT)
149
#define USART_TRIGCTRL_TSEL_PRSCHx(v) \
150
(((v) << USART_TRIGCTRL_TSEL_SHIFT) & USART_TRIGCTRL_TSEL_MASK)
151
#define USART_TRIGCTRL_TSEL_PRSCH0 0
152
#define USART_TRIGCTRL_TSEL_PRSCH1 1
153
#define USART_TRIGCTRL_TSEL_PRSCH2 2
154
#define USART_TRIGCTRL_TSEL_PRSCH3 3
155
#define USART_TRIGCTRL_TSEL_PRSCH4 4
156
#define USART_TRIGCTRL_TSEL_PRSCH5 5
157
#define USART_TRIGCTRL_TSEL_PRSCH6 6
158
#define USART_TRIGCTRL_TSEL_PRSCH7 7
159
160
/* USART_CMD */
161
#define USART_CMD_CLEARRX (1 << 11)
162
#define USART_CMD_CLEARTX (1 << 10)
163
#define USART_CMD_TXTRIDIS (1 << 9)
164
#define USART_CMD_TXTRIEN (1 << 8)
165
#define USART_CMD_RXBLOCKDIS (1 << 7)
166
#define USART_CMD_RXBLOCKEN (1 << 6)
167
#define USART_CMD_MASTERDIS (1 << 5)
168
#define USART_CMD_MASTEREN (1 << 4)
169
#define USART_CMD_TXDIS (1 << 3)
170
#define USART_CMD_TXEN (1 << 2)
171
#define USART_CMD_RXDIS (1 << 1)
172
#define USART_CMD_RXEN (1 << 0)
173
174
/* USART_STATUS */
175
#define USART_STATUS_RXFULLRIGHT (1 << 12)
176
#define USART_STATUS_RXDATAVRIGHT (1 << 11)
177
#define USART_STATUS_TXBSRIGHT (1 << 10)
178
#define USART_STATUS_TXBDRIGHT (1 << 9)
179
#define USART_STATUS_RXFULL (1 << 8)
180
#define USART_STATUS_RXDATAV (1 << 7)
181
#define USART_STATUS_TXBL (1 << 6)
182
#define USART_STATUS_TXC (1 << 5)
183
#define USART_STATUS_TXTRI (1 << 4)
184
#define USART_STATUS_RXBLOCK (1 << 3)
185
#define USART_STATUS_MASTER (1 << 2)
186
#define USART_STATUS_TXENS (1 << 1)
187
#define USART_STATUS_RXENS (1 << 0)
188
189
/* USART_CLKDIV */
190
#define USART_CLKDIV_DIV_SHIFT (6)
191
#define USART_CLKDIV_DIV_MASK (0x7FFF << USART_CLKDIV_DIV_SHIFT)
192
#define USART_CLKDIV_DIV(v) \
193
(((v) << USART_CLKDIV_DIV_SHIFT) & USART_CLKDIV_DIV_MASK)
194
195
/* USART_RXDATAX */
196
#define USART_RXDATAX_FERR (1 << 15)
197
#define USART_RXDATAX_PERR (1 << 14)
198
199
#define USART_RXDATAX_RXDATA_SHIFT (0)
200
#define USART_RXDATAX_RXDATA_MASK (0x1FF << USART_RXDATAX_RXDATA_SHIFT)
201
202
/* USART_RXDOUBLEX */
203
#define USART_RXDOUBLEX_FERR1 (1 << 31)
204
#define USART_RXDOUBLEX_PERR1 (1 << 30)
205
206
#define USART_RXDOUBLEX_RXDATA1_SHIFT (16)
207
#define USART_RXDOUBLEX_RXDATA1_MASK \
208
(0x1FF << USART_RXDOUBLEX_RXDATA1_SHIFT)
209
210
#define USART_RXDOUBLEX_FERR0 (1 << 15)
211
#define USART_RXDOUBLEX_PERR0 (1 << 14)
212
213
#define USART_RXDOUBLEX_RXDATA0_SHIFT (0)
214
#define USART_RXDOUBLEX_RXDATA0_MASK \
215
(0x1FF << USART_RXDOUBLEX_RXDATA1_SHIFT)
216
217
/* USART_RXDOUBLE */
218
#define USART_RXDOUBLE_RXDATA1_SHIFT (8)
219
#define USART_RXDOUBLE_RXDATA1_MASK (0xFF << USART_RXDOUBLE_RXDATA1_SHIFT)
220
221
#define USART_RXDOUBLE_RXDATA0_SHIFT (0)
222
#define USART_RXDOUBLE_RXDATA0_MASK (0xFF << USART_RXDOUBLE_RXDATA0_SHIFT)
223
224
/* USART_RXDATAXP */
225
#define USART_RXDATAXP_FERRP (1 << 15)
226
#define USART_RXDATAXP_PERRP (1 << 14)
227
228
#define USART_RXDATAXP_RXDATAP_SHIFT (0)
229
#define USART_RXDATAXP_RXDATAP_MASK (0x1FF << USART_RXDATAXP_RXDATAP_SHIFT)
230
231
/* USART_RXDOUBLEXP */
232
#define USART_RXDOUBLEXP_FERR1 (1 << 31)
233
#define USART_RXDOUBLEXP_PERR1 (1 << 30)
234
235
#define USART_RXDOUBLEXP_RXDATA1_SHIFT (16)
236
#define USART_RXDOUBLEXP_RXDATA1_MASK \
237
(0x1FF << USART_RXDOUBLEXP_RXDATA1_SHIFT)
238
239
#define USART_RXDOUBLEXP_FERR0 (1 << 15)
240
#define USART_RXDOUBLEXP_PERR0 (1 << 14)
241
242
#define USART_RXDOUBLEXP_RXDATA0_SHIFT (0)
243
#define USART_RXDOUBLEXP_RXDATA0_MASK \
244
(0x1FF << USART_RXDOUBLEXP_RXDATA1_SHIFT)
245
246
/* USART_TXDATAX */
247
#define USART_TXDATAX_RXENAT (1 << 15)
248
#define USART_TXDATAX_TXDISAT (1 << 14)
249
#define USART_TXDATAX_TXBREAK (1 << 13)
250
#define USART_TXDATAX_TXTRIAT (1 << 12)
251
#define USART_TXDATAX_UBRXAT (1 << 11)
252
253
#define USART_TXDATAX_TXDATAX_SHIFT (0)
254
#define USART_TXDATAX_TXDATAX_MASK (0x1FF << USART_TXDATAX_TXDATAX_SHIFT)
255
256
/* USART_TXDOUBLEX */
257
#define USART_TXDOUBLEX_RXENAT1 (1 << 31)
258
#define USART_TXDOUBLEX_TXDISAT1 (1 << 30)
259
#define USART_TXDOUBLEX_TXBREAK1 (1 << 29)
260
#define USART_TXDOUBLEX_TXTRIAT1 (1 << 28)
261
#define USART_TXDOUBLEX_UBRXAT1 (1 << 27)
262
263
#define USART_TXDOUBLEX_TXDATA1_SHIFT (16)
264
#define USART_TXDOUBLEX_TXDATA1_MASK \
265
(0x1FF << USART_TXDOUBLEX_TXDATA1_SHIFT)
266
267
#define USART_TXDOUBLEX_RXENAT0 (1 << 15)
268
#define USART_TXDOUBLEX_TXDISAT0 (1 << 14)
269
#define USART_TXDOUBLEX_TXBREAK0 (1 << 13)
270
#define USART_TXDOUBLEX_TXTRIAT0 (1 << 12)
271
#define USART_TXDOUBLEX_UBRXAT0 (1 << 11)
272
273
#define USART_TXDOUBLEX_TXDATA0_SHIFT (0)
274
#define USART_TXDOUBLEX_TXDATA0_MASK \
275
(0x1FF << USART_TXDOUBLEX_TXDATA0_SHIFT)
276
277
/* USART_TXDOUBLE */
278
#define USART_TXDOUBLE_TXDATA1_SHIFT (8)
279
#define USART_TXDOUBLE_TXDATA1_MASK (0xFF << USART_TXDOUBLE_TXDATA1_SHIFT)
280
281
#define USART_TXDOUBLE_TXDATA0_SHIFT (0)
282
#define USART_TXDOUBLE_TXDATA0_MASK (0xFF << USART_TXDOUBLE_TXDATA0_SHIFT)
283
284
/* USART_IF */
285
#define USART_IF_CCF (1 << 12)
286
#define USART_IF_SSM (1 << 11)
287
#define USART_IF_MPAF (1 << 10)
288
#define USART_IF_FERR (1 << 9)
289
#define USART_IF_PERR (1 << 8)
290
#define USART_IF_TXUF (1 << 7)
291
#define USART_IF_TXOF (1 << 6)
292
#define USART_IF_RXUF (1 << 5)
293
#define USART_IF_RXOF (1 << 4)
294
#define USART_IF_RXFULL (1 << 3)
295
#define USART_IF_RXDATAV (1 << 2)
296
#define USART_IF_TXBL (1 << 1)
297
#define USART_IF_TXC (1 << 0)
298
299
/* USART_IFS */
300
#define USART_IFS_CCF (1 << 12)
301
#define USART_IFS_SSM (1 << 11)
302
#define USART_IFS_MPAF (1 << 10)
303
#define USART_IFS_FERR (1 << 9)
304
#define USART_IFS_PERR (1 << 8)
305
#define USART_IFS_TXUF (1 << 7)
306
#define USART_IFS_TXOF (1 << 6)
307
#define USART_IFS_RXUF (1 << 5)
308
#define USART_IFS_RXOF (1 << 4)
309
#define USART_IFS_RXFULL (1 << 3)
310
#define USART_IFS_RXDATAV (1 << 2)
311
#define USART_IFS_TXBL (1 << 1)
312
#define USART_IFS_TXC (1 << 0)
313
314
/* USART_IFC */
315
#define USART_IFC_CCF (1 << 12)
316
#define USART_IFC_SSM (1 << 11)
317
#define USART_IFC_MPAF (1 << 10)
318
#define USART_IFC_FERR (1 << 9)
319
#define USART_IFC_PERR (1 << 8)
320
#define USART_IFC_TXUF (1 << 7)
321
#define USART_IFC_TXOF (1 << 6)
322
#define USART_IFC_RXUF (1 << 5)
323
#define USART_IFC_RXOF (1 << 4)
324
#define USART_IFC_RXFULL (1 << 3)
325
#define USART_IFC_RXDATAV (1 << 2)
326
#define USART_IFC_TXBL (1 << 1)
327
#define USART_IFC_TXC (1 << 0)
328
329
/* USART_IEN */
330
#define USART_IEN_CCF (1 << 12)
331
#define USART_IEN_SSM (1 << 11)
332
#define USART_IEN_MPAF (1 << 10)
333
#define USART_IEN_FERR (1 << 9)
334
#define USART_IEN_PERR (1 << 8)
335
#define USART_IEN_TXUF (1 << 7)
336
#define USART_IEN_TXOF (1 << 6)
337
#define USART_IEN_RXUF (1 << 5)
338
#define USART_IEN_RXOF (1 << 4)
339
#define USART_IEN_RXFULL (1 << 3)
340
#define USART_IEN_RXDATAV (1 << 2)
341
#define USART_IEN_TXBL (1 << 1)
342
#define USART_IEN_TXC (1 << 0)
343
344
/* USART_IRCTRL */
345
#define USART_IRCTRL_IRPRSEN (1 << 7)
346
347
#define USART_IRCTRL_IRPRSSEL_SHIFT (4)
348
#define USART_IRCTRL_IRPRSSEL_MASK (0x7 << USART_IRCTRL_IRPRSSEL_SHIFT)
349
#define USART_IRCTRL_IRPRSSEL(v) \
350
(((v) << USART_IRCTRL_IRPRSSEL_SHIFT) & USART_IRCTRL_IRPRSSEL_MASK)
351
#define USART_IRCTRL_IRPRSSEL_PRSCHx(x) USART_IRCTRL_IRPRSSEL(x)
352
#define USART_IRCTRL_IRPRSSEL_PRSCH0 0
353
#define USART_IRCTRL_IRPRSSEL_PRSCH1 1
354
#define USART_IRCTRL_IRPRSSEL_PRSCH2 2
355
#define USART_IRCTRL_IRPRSSEL_PRSCH3 3
356
#define USART_IRCTRL_IRPRSSEL_PRSCH4 4
357
#define USART_IRCTRL_IRPRSSEL_PRSCH5 5
358
#define USART_IRCTRL_IRPRSSEL_PRSCH6 6
359
#define USART_IRCTRL_IRPRSSEL_PRSCH7 7
360
361
#define USART_IRCTRL_IRFILT (1 << 3)
362
363
#define USART_IRCTRL_IRPW_SHIFT (1)
364
#define USART_IRCTRL_IRPW_MASK (0x3 << USART_IRCTRL_IRPW_SHIFT)
365
#define USART_IRCTRL_IRPW(v) \
366
(((v) << USART_IRCTRL_IRPW_SHIFT) & USART_IRCTRL_IRPW_MASK)
367
#define USART_IRCTRL_IRPW_ONE 0
368
#define USART_IRCTRL_IRPW_TWO 1
369
#define USART_IRCTRL_IRPW_THREE 2
370
#define USART_IRCTRL_IRPW_FOUR 3
371
372
#define USART_IRCTRL_IREN (1 << 0)
373
374
/* USART_ROUTE */
375
#define USART_ROUTE_LOCATION_SHIFT (8)
376
#define USART_ROUTE_LOCATION_MASK (0x7 << USART_ROUTE_LOCATION_SHIFT)
377
#define USART_ROUTE_LOCATION(v) \
378
(((v) << USART_ROUTE_LOCATION_SHIFT) & USART_ROUTE_LOCATION_MASK)
379
#define USART_ROUTE_LOCATION_LOCx(x) USART_ROUTE_LOCATION(x)
380
#define USART_ROUTE_LOCATION_LOC0 0
381
#define USART_ROUTE_LOCATION_LOC1 1
382
#define USART_ROUTE_LOCATION_LOC2 2
383
#define USART_ROUTE_LOCATION_LOC3 3
384
#define USART_ROUTE_LOCATION_LOC4 4
385
#define USART_ROUTE_LOCATION_LOC5 5
386
387
#define USART_ROUTE_CLKPEN (1 << 3)
388
#define USART_ROUTE_CSPEN (1 << 2)
389
#define USART_ROUTE_TXPEN (1 << 1)
390
#define USART_ROUTE_RXPEN (1 << 0)
391
392
/* USART_INPUT */
393
#define USART_INPUT_RXPRS (1 << 4)
394
395
#define USART_INPUT_RXPRSSEL_SHIFT (0)
396
#define USART_INPUT_RXPRSSEL_MASK (0xF << USART_INPUT_RXPRSSEL_SHIFT)
397
#define USART_INPUT_RXPRSSEL(v) \
398
(((v) << USART_INPUT_RXPRSSEL_SHIFT) & USART_INPUT_RXPRSSEL_MASK)
399
#define USART_INPUT_RXPRSSEL_PRSCHx(x) USART_INPUT_RXPRSSEL(x)
400
#define USART_INPUT_RXPRSSEL_PRSCH0 0
401
#define USART_INPUT_RXPRSSEL_PRSCH1 1
402
#define USART_INPUT_RXPRSSEL_PRSCH2 2
403
#define USART_INPUT_RXPRSSEL_PRSCH3 3
404
#define USART_INPUT_RXPRSSEL_PRSCH4 4
405
#define USART_INPUT_RXPRSSEL_PRSCH5 5
406
#define USART_INPUT_RXPRSSEL_PRSCH6 6
407
#define USART_INPUT_RXPRSSEL_PRSCH7 7
408
#define USART_INPUT_RXPRSSEL_PRSCH8 8
409
#define USART_INPUT_RXPRSSEL_PRSCH9 9
410
#define USART_INPUT_RXPRSSEL_PRSCH10 10
411
#define USART_INPUT_RXPRSSEL_PRSCH11 11
412
413
/* USART_I2SCTRL */
414
#define USART_I2SCTRL_FORMAT_SHIFT (8)
415
#define USART_I2SCTRL_FORMAT_MASK (0x7 << USART_I2SCTRL_FORMAT_SHIFT)
416
#define USART_I2SCTRL_FORMAT(v) \
417
(((v) << USART_I2SCTRL_FORMAT_SHIFT) & USART_I2SCTRL_FORMAT_MASK)
418
#define USART_I2SCTRL_FORMAT_W32D32 0
419
#define USART_I2SCTRL_FORMAT_W32D24M 1
420
#define USART_I2SCTRL_FORMAT_W32D24 2
421
#define USART_I2SCTRL_FORMAT_W32D16 3
422
#define USART_I2SCTRL_FORMAT_W32D8 4
423
#define USART_I2SCTRL_FORMAT_W16D16 5
424
#define USART_I2SCTRL_FORMAT_W16D8 6
425
#define USART_I2SCTRL_FORMAT_W8D8 7
426
427
#define USART_I2SCTRL_DELAY (1 << 4)
428
#define USART_I2SCTRL_DMASPLIT (1 << 3)
429
#define USART_I2SCTRL_JUSTIFY (1 << 2)
430
#define USART_I2SCTRL_MONO (1 << 1)
431
#define USART_I2SCTRL_EN (1 << 0)
432
433
/* USART0 */
434
#define USART0 USART0_BASE
435
#define USART0_CTRL USART_CTRL(USART0)
436
#define USART0_FRAME USART_FRAME(USART0)
437
#define USART0_TRIGCTRL USART_TRIGCTRL(USART0)
438
#define USART0_CMD USART_CMD(USART0)
439
#define USART0_STATUS USART_STATUS(USART0)
440
#define USART0_CLKDIV USART_CLKDIV(USART0)
441
#define USART0_RXDATAX USART_RXDATAX(USART0)
442
#define USART0_RXDATA USART_RXDATA(USART0)
443
#define USART0_RXDOUBLEX USART_RXDOUBLEX(USART0)
444
#define USART0_RXDOUBLE USART_RXDOUBLE(USART0)
445
#define USART0_RXDATAXP USART_RXDATAXP(USART0)
446
#define USART0_RXDOUBLEXP USART_RXDOUBLEXP(USART0)
447
#define USART0_TXDATAX USART_TXDATAX(USART0)
448
#define USART0_TXDATA USART_TXDATA(USART0)
449
#define USART0_TXDOUBLEX USART_TXDOUBLEX(USART0)
450
#define USART0_TXDOUBLE USART_TXDOUBLE(USART0)
451
#define USART0_IF USART_IF(USART0)
452
#define USART0_IFS USART_IFS(USART0)
453
#define USART0_IFC USART_IFC(USART0)
454
#define USART0_IEN USART_IEN(USART0)
455
#define USART0_IRCTRL USART_IRCTRL(USART0)
456
#define USART0_ROUTE USART_ROUTE(USART0)
457
#define USART0_INPUT USART_INPUT(USART0)
458
#define USART0_I2SCTRL USART_I2SCTRL(USART0)
459
460
/* USART1 */
461
#define USART1 USART1_BASE
462
#define USART1_CTRL USART_CTRL(USART1)
463
#define USART1_FRAME USART_FRAME(USART1)
464
#define USART1_TRIGCTRL USART_TRIGCTRL(USART1)
465
#define USART1_CMD USART_CMD(USART1)
466
#define USART1_STATUS USART_STATUS(USART1)
467
#define USART1_CLKDIV USART_CLKDIV(USART1)
468
#define USART1_RXDATAX USART_RXDATAX(USART1)
469
#define USART1_RXDATA USART_RXDATA(USART1)
470
#define USART1_RXDOUBLEX USART_RXDOUBLEX(USART1)
471
#define USART1_RXDOUBLE USART_RXDOUBLE(USART1)
472
#define USART1_RXDATAXP USART_RXDATAXP(USART1)
473
#define USART1_RXDOUBLEXP USART_RXDOUBLEXP(USART1)
474
#define USART1_TXDATAX USART_TXDATAX(USART1)
475
#define USART1_TXDATA USART_TXDATA(USART1)
476
#define USART1_TXDOUBLEX USART_TXDOUBLEX(USART1)
477
#define USART1_TXDOUBLE USART_TXDOUBLE(USART1)
478
#define USART1_IF USART_IF(USART1)
479
#define USART1_IFS USART_IFS(USART1)
480
#define USART1_IFC USART_IFC(USART1)
481
#define USART1_IEN USART_IEN(USART1)
482
#define USART1_IRCTRL USART_IRCTRL(USART1)
483
#define USART1_ROUTE USART_ROUTE(USART1)
484
#define USART1_INPUT USART_INPUT(USART1)
485
#define USART1_I2SCTRL USART_I2SCTRL(USART1)
486
487
/* USART2 */
488
#define USART2 USART2_BASE
489
#define USART2_CTRL USART_CTRL(USART2)
490
#define USART2_FRAME USART_FRAME(USART2)
491
#define USART2_TRIGCTRL USART_TRIGCTRL(USART2)
492
#define USART2_CMD USART_CMD(USART2)
493
#define USART2_STATUS USART_STATUS(USART2)
494
#define USART2_CLKDIV USART_CLKDIV(USART2)
495
#define USART2_RXDATAX USART_RXDATAX(USART2)
496
#define USART2_RXDATA USART_RXDATA(USART2)
497
#define USART2_RXDOUBLEX USART_RXDOUBLEX(USART2)
498
#define USART2_RXDOUBLE USART_RXDOUBLE(USART2)
499
#define USART2_RXDATAXP USART_RXDATAXP(USART2)
500
#define USART2_RXDOUBLEXP USART_RXDOUBLEXP(USART2)
501
#define USART2_TXDATAX USART_TXDATAX(USART2)
502
#define USART2_TXDATA USART_TXDATA(USART2)
503
#define USART2_TXDOUBLEX USART_TXDOUBLEX(USART2)
504
#define USART2_TXDOUBLE USART_TXDOUBLE(USART2)
505
#define USART2_IF USART_IF(USART2)
506
#define USART2_IFS USART_IFS(USART2)
507
#define USART2_IFC USART_IFC(USART2)
508
#define USART2_IEN USART_IEN(USART2)
509
#define USART2_IRCTRL USART_IRCTRL(USART2)
510
#define USART2_ROUTE USART_ROUTE(USART2)
511
#define USART2_INPUT USART_INPUT(USART2)
512
#define USART2_I2SCTRL USART_I2SCTRL(USART2)
513
514
/**@}*/
common.h
memorymap.h
Dispatcher for the base address definitions, depending on the particular Gecko family.
include
libopencm3
efm32
common
usart_common.h
Generated on Tue Mar 7 2023 16:12:44 for libopencm3 by
1.9.4