libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
gpdma.h
Go to the documentation of this file.
1
/** @defgroup gpdma_defines General Purpose DMA Defines
2
*
3
* @brief <b>Defined Constants and Types for the LPC43xx General Purpose DMA</b>
4
*
5
* @ingroup LPC43xx_defines
6
*
7
* @version 1.0.0
8
*
9
* @author @htmlonly © @endhtmlonly 2012 Michael Ossmann <mike@ossmann.com>
10
*
11
* @date 10 March 2013
12
*
13
* LGPL License Terms @ref lgpl_license
14
*/
15
/*
16
* This file is part of the libopencm3 project.
17
*
18
* Copyright (C) 2012 Michael Ossmann <mike@ossmann.com>
19
*
20
* This library is free software: you can redistribute it and/or modify
21
* it under the terms of the GNU Lesser General Public License as published by
22
* the Free Software Foundation, either version 3 of the License, or
23
* (at your option) any later version.
24
*
25
* This library is distributed in the hope that it will be useful,
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
* GNU Lesser General Public License for more details.
29
*
30
* You should have received a copy of the GNU Lesser General Public License
31
* along with this library. If not, see <http://www.gnu.org/licenses/>.
32
*/
33
34
#ifndef LPC43XX_GPDMA_H
35
#define LPC43XX_GPDMA_H
36
37
/**@{*/
38
39
#include <
libopencm3/cm3/common.h
>
40
#include <
libopencm3/lpc43xx/memorymap.h
>
41
42
/* --- GPDMA registers ----------------------------------------------------- */
43
44
/* General registers */
45
46
/* DMA Interrupt Status Register */
47
#define GPDMA_INTSTAT MMIO32(GPDMA_BASE + 0x000)
48
49
/* DMA Interrupt Terminal Count Request Status Register */
50
#define GPDMA_INTTCSTAT MMIO32(GPDMA_BASE + 0x004)
51
52
/* DMA Interrupt Terminal Count Request Clear Register */
53
#define GPDMA_INTTCCLEAR MMIO32(GPDMA_BASE + 0x008)
54
55
/* DMA Interrupt Error Status Register */
56
#define GPDMA_INTERRSTAT MMIO32(GPDMA_BASE + 0x00C)
57
58
/* DMA Interrupt Error Clear Register */
59
#define GPDMA_INTERRCLR MMIO32(GPDMA_BASE + 0x010)
60
61
/* DMA Raw Interrupt Terminal Count Status Register */
62
#define GPDMA_RAWINTTCSTAT MMIO32(GPDMA_BASE + 0x014)
63
64
/* DMA Raw Error Interrupt Status Register */
65
#define GPDMA_RAWINTERRSTAT MMIO32(GPDMA_BASE + 0x018)
66
67
/* DMA Enabled Channel Register */
68
#define GPDMA_ENBLDCHNS MMIO32(GPDMA_BASE + 0x01C)
69
70
/* DMA Software Burst Request Register */
71
#define GPDMA_SOFTBREQ MMIO32(GPDMA_BASE + 0x020)
72
73
/* DMA Software Single Request Register */
74
#define GPDMA_SOFTSREQ MMIO32(GPDMA_BASE + 0x024)
75
76
/* DMA Software Last Burst Request Register */
77
#define GPDMA_SOFTLBREQ MMIO32(GPDMA_BASE + 0x028)
78
79
/* DMA Software Last Single Request Register */
80
#define GPDMA_SOFTLSREQ MMIO32(GPDMA_BASE + 0x02C)
81
82
/* DMA Configuration Register */
83
#define GPDMA_CONFIG MMIO32(GPDMA_BASE + 0x030)
84
85
/* DMA Synchronization Register */
86
#define GPDMA_SYNC MMIO32(GPDMA_BASE + 0x034)
87
88
89
/* Channel registers */
90
91
/* Source Address Register */
92
#define GPDMA_CSRCADDR(channel) MMIO32(GPDMA_BASE + 0x100 + \
93
(channel * 0x20))
94
#define GPDMA_C0SRCADDR GPDMA_CSRCADDR(0)
95
#define GPDMA_C1SRCADDR GPDMA_CSRCADDR(1)
96
#define GPDMA_C2SRCADDR GPDMA_CSRCADDR(2)
97
#define GPDMA_C3SRCADDR GPDMA_CSRCADDR(3)
98
#define GPDMA_C4SRCADDR GPDMA_CSRCADDR(4)
99
#define GPDMA_C5SRCADDR GPDMA_CSRCADDR(5)
100
#define GPDMA_C6SRCADDR GPDMA_CSRCADDR(6)
101
#define GPDMA_C7SRCADDR GPDMA_CSRCADDR(7)
102
103
/* Destination Address Register */
104
#define GPDMA_CDESTADDR(channel) MMIO32(GPDMA_BASE + 0x104 + \
105
(channel * 0x20))
106
#define GPDMA_C0DESTADDR GPDMA_CDESTADDR(0)
107
#define GPDMA_C1DESTADDR GPDMA_CDESTADDR(1)
108
#define GPDMA_C2DESTADDR GPDMA_CDESTADDR(2)
109
#define GPDMA_C3DESTADDR GPDMA_CDESTADDR(3)
110
#define GPDMA_C4DESTADDR GPDMA_CDESTADDR(4)
111
#define GPDMA_C5DESTADDR GPDMA_CDESTADDR(5)
112
#define GPDMA_C6DESTADDR GPDMA_CDESTADDR(6)
113
#define GPDMA_C7DESTADDR GPDMA_CDESTADDR(7)
114
115
/* Linked List Item Register */
116
#define GPDMA_CLLI(channel) MMIO32(GPDMA_BASE + 0x108 + \
117
(channel * 0x20))
118
#define GPDMA_C0LLI GPDMA_CLLI(0)
119
#define GPDMA_C1LLI GPDMA_CLLI(1)
120
#define GPDMA_C2LLI GPDMA_CLLI(2)
121
#define GPDMA_C3LLI GPDMA_CLLI(3)
122
#define GPDMA_C4LLI GPDMA_CLLI(4)
123
#define GPDMA_C5LLI GPDMA_CLLI(5)
124
#define GPDMA_C6LLI GPDMA_CLLI(6)
125
#define GPDMA_C7LLI GPDMA_CLLI(7)
126
127
/* Control Register */
128
#define GPDMA_CCONTROL(channel) MMIO32(GPDMA_BASE + 0x10C + \
129
(channel * 0x20))
130
#define GPDMA_C0CONTROL GPDMA_CCONTROL(0)
131
#define GPDMA_C1CONTROL GPDMA_CCONTROL(1)
132
#define GPDMA_C2CONTROL GPDMA_CCONTROL(2)
133
#define GPDMA_C3CONTROL GPDMA_CCONTROL(3)
134
#define GPDMA_C4CONTROL GPDMA_CCONTROL(4)
135
#define GPDMA_C5CONTROL GPDMA_CCONTROL(5)
136
#define GPDMA_C6CONTROL GPDMA_CCONTROL(6)
137
#define GPDMA_C7CONTROL GPDMA_CCONTROL(7)
138
139
/* Configuration Register */
140
#define GPDMA_CCONFIG(channel) MMIO32(GPDMA_BASE + 0x110 + \
141
(channel * 0x20))
142
#define GPDMA_C0CONFIG GPDMA_CCONFIG(0)
143
#define GPDMA_C1CONFIG GPDMA_CCONFIG(1)
144
#define GPDMA_C2CONFIG GPDMA_CCONFIG(2)
145
#define GPDMA_C3CONFIG GPDMA_CCONFIG(3)
146
#define GPDMA_C4CONFIG GPDMA_CCONFIG(4)
147
#define GPDMA_C5CONFIG GPDMA_CCONFIG(5)
148
#define GPDMA_C6CONFIG GPDMA_CCONFIG(6)
149
#define GPDMA_C7CONFIG GPDMA_CCONFIG(7)
150
151
/* --- Common fields -------------------------------------------- */
152
153
#define GPDMA_CSRCADDR_SRCADDR_SHIFT (0)
154
#define GPDMA_CSRCADDR_SRCADDR_MASK (0xffffffff << GPDMA_CSRCADDR_SRCADDR_SHIFT)
155
#define GPDMA_CSRCADDR_SRCADDR(x) ((x) << GPDMA_CSRCADDR_SRCADDR_SHIFT)
156
157
#define GPDMA_CDESTADDR_DESTADDR_SHIFT (0)
158
#define GPDMA_CDESTADDR_DESTADDR_MASK \
159
(0xffffffff << GPDMA_CDESTADDR_DESTADDR_SHIFT)
160
#define GPDMA_CDESTADDR_DESTADDR(x) ((x) << GPDMA_CDESTADDR_DESTADDR_SHIFT)
161
162
#define GPDMA_CLLI_LM_SHIFT (0)
163
#define GPDMA_CLLI_LM_MASK (0x1 << GPDMA_CLLI_LM_SHIFT)
164
#define GPDMA_CLLI_LM(x) ((x) << GPDMA_CLLI_LM_SHIFT)
165
166
#define GPDMA_CLLI_LLI_SHIFT (2)
167
#define GPDMA_CLLI_LLI_MASK (0x3fffffff << GPDMA_CLLI_LLI_SHIFT)
168
#define GPDMA_CLLI_LLI(x) ((x) << GPDMA_CLLI_LLI_SHIFT)
169
170
#define GPDMA_CCONTROL_TRANSFERSIZE_SHIFT (0)
171
#define GPDMA_CCONTROL_TRANSFERSIZE_MASK \
172
(0xfff << GPDMA_CCONTROL_TRANSFERSIZE_SHIFT)
173
#define GPDMA_CCONTROL_TRANSFERSIZE(x) \
174
((x) << GPDMA_CCONTROL_TRANSFERSIZE_SHIFT)
175
176
#define GPDMA_CCONTROL_SBSIZE_SHIFT (12)
177
#define GPDMA_CCONTROL_SBSIZE_MASK (0x7 << GPDMA_CCONTROL_SBSIZE_SHIFT)
178
#define GPDMA_CCONTROL_SBSIZE(x) ((x) << GPDMA_CCONTROL_SBSIZE_SHIFT)
179
180
#define GPDMA_CCONTROL_DBSIZE_SHIFT (15)
181
#define GPDMA_CCONTROL_DBSIZE_MASK (0x7 << GPDMA_CCONTROL_DBSIZE_SHIFT)
182
#define GPDMA_CCONTROL_DBSIZE(x) ((x) << GPDMA_CCONTROL_DBSIZE_SHIFT)
183
184
#define GPDMA_CCONTROL_SWIDTH_SHIFT (18)
185
#define GPDMA_CCONTROL_SWIDTH_MASK (0x7 << GPDMA_CCONTROL_SWIDTH_SHIFT)
186
#define GPDMA_CCONTROL_SWIDTH(x) ((x) << GPDMA_CCONTROL_SWIDTH_SHIFT)
187
188
#define GPDMA_CCONTROL_DWIDTH_SHIFT (21)
189
#define GPDMA_CCONTROL_DWIDTH_MASK (0x7 << GPDMA_CCONTROL_DWIDTH_SHIFT)
190
#define GPDMA_CCONTROL_DWIDTH(x) ((x) << GPDMA_CCONTROL_DWIDTH_SHIFT)
191
192
#define GPDMA_CCONTROL_S_SHIFT (24)
193
#define GPDMA_CCONTROL_S_MASK (0x1 << GPDMA_CCONTROL_S_SHIFT)
194
#define GPDMA_CCONTROL_S(x) ((x) << GPDMA_CCONTROL_S_SHIFT)
195
196
#define GPDMA_CCONTROL_D_SHIFT (25)
197
#define GPDMA_CCONTROL_D_MASK (0x1 << GPDMA_CCONTROL_D_SHIFT)
198
#define GPDMA_CCONTROL_D(x) ((x) << GPDMA_CCONTROL_D_SHIFT)
199
200
#define GPDMA_CCONTROL_SI_SHIFT (26)
201
#define GPDMA_CCONTROL_SI_MASK (0x1 << GPDMA_CCONTROL_SI_SHIFT)
202
#define GPDMA_CCONTROL_SI(x) ((x) << GPDMA_CCONTROL_SI_SHIFT)
203
204
#define GPDMA_CCONTROL_DI_SHIFT (27)
205
#define GPDMA_CCONTROL_DI_MASK (0x1 << GPDMA_CCONTROL_DI_SHIFT)
206
#define GPDMA_CCONTROL_DI(x) ((x) << GPDMA_CCONTROL_DI_SHIFT)
207
208
#define GPDMA_CCONTROL_PROT1_SHIFT (28)
209
#define GPDMA_CCONTROL_PROT1_MASK (0x1 << GPDMA_CCONTROL_PROT1_SHIFT)
210
#define GPDMA_CCONTROL_PROT1(x) ((x) << GPDMA_CCONTROL_PROT1_SHIFT)
211
212
#define GPDMA_CCONTROL_PROT2_SHIFT (29)
213
#define GPDMA_CCONTROL_PROT2_MASK (0x1 << GPDMA_CCONTROL_PROT2_SHIFT)
214
#define GPDMA_CCONTROL_PROT2(x) ((x) << GPDMA_CCONTROL_PROT2_SHIFT)
215
216
#define GPDMA_CCONTROL_PROT3_SHIFT (30)
217
#define GPDMA_CCONTROL_PROT3_MASK (0x1 << GPDMA_CCONTROL_PROT3_SHIFT)
218
#define GPDMA_CCONTROL_PROT3(x) ((x) << GPDMA_CCONTROL_PROT3_SHIFT)
219
220
#define GPDMA_CCONTROL_I_SHIFT (31)
221
#define GPDMA_CCONTROL_I_MASK (0x1 << GPDMA_CCONTROL_I_SHIFT)
222
#define GPDMA_CCONTROL_I(x) ((x) << GPDMA_CCONTROL_I_SHIFT)
223
224
#define GPDMA_CCONFIG_E_SHIFT (0)
225
#define GPDMA_CCONFIG_E_MASK (0x1 << GPDMA_CCONFIG_E_SHIFT)
226
#define GPDMA_CCONFIG_E(x) ((x) << GPDMA_CCONFIG_E_SHIFT)
227
228
#define GPDMA_CCONFIG_SRCPERIPHERAL_SHIFT (1)
229
#define GPDMA_CCONFIG_SRCPERIPHERAL_MASK \
230
(0x1f << GPDMA_CCONFIG_SRCPERIPHERAL_SHIFT)
231
#define GPDMA_CCONFIG_SRCPERIPHERAL(x) \
232
((x) << GPDMA_CCONFIG_SRCPERIPHERAL_SHIFT)
233
234
#define GPDMA_CCONFIG_DESTPERIPHERAL_SHIFT (6)
235
#define GPDMA_CCONFIG_DESTPERIPHERAL_MASK \
236
(0x1f << GPDMA_CCONFIG_DESTPERIPHERAL_SHIFT)
237
#define GPDMA_CCONFIG_DESTPERIPHERAL(x) \
238
((x) << GPDMA_CCONFIG_DESTPERIPHERAL_SHIFT)
239
240
#define GPDMA_CCONFIG_FLOWCNTRL_SHIFT (11)
241
#define GPDMA_CCONFIG_FLOWCNTRL_MASK (0x7 << GPDMA_CCONFIG_FLOWCNTRL_SHIFT)
242
#define GPDMA_CCONFIG_FLOWCNTRL(x) ((x) << GPDMA_CCONFIG_FLOWCNTRL_SHIFT)
243
244
#define GPDMA_CCONFIG_IE_SHIFT (14)
245
#define GPDMA_CCONFIG_IE_MASK (0x1 << GPDMA_CCONFIG_IE_SHIFT)
246
#define GPDMA_CCONFIG_IE(x) ((x) << GPDMA_CCONFIG_IE_SHIFT)
247
248
#define GPDMA_CCONFIG_ITC_SHIFT (15)
249
#define GPDMA_CCONFIG_ITC_MASK (0x1 << GPDMA_CCONFIG_ITC_SHIFT)
250
#define GPDMA_CCONFIG_ITC(x) ((x) << GPDMA_CCONFIG_ITC_SHIFT)
251
252
#define GPDMA_CCONFIG_L_SHIFT (16)
253
#define GPDMA_CCONFIG_L_MASK (0x1 << GPDMA_CCONFIG_L_SHIFT)
254
#define GPDMA_CCONFIG_L(x) ((x) << GPDMA_CCONFIG_L_SHIFT)
255
256
#define GPDMA_CCONFIG_A_SHIFT (17)
257
#define GPDMA_CCONFIG_A_MASK (0x1 << GPDMA_CCONFIG_A_SHIFT)
258
#define GPDMA_CCONFIG_A(x) ((x) << GPDMA_CCONFIG_A_SHIFT)
259
260
#define GPDMA_CCONFIG_H_SHIFT (18)
261
#define GPDMA_CCONFIG_H_MASK (0x1 << GPDMA_CCONFIG_H_SHIFT)
262
#define GPDMA_CCONFIG_H(x) ((x) << GPDMA_CCONFIG_H_SHIFT)
263
264
/* --- AUTO-GENERATED STUFF FOLLOWS ----------------------------- */
265
266
/* --- GPDMA_NTSTAT values -------------------------------------- */
267
268
/* INTSTAT: Status of DMA channel interrupts after masking */
269
#define GPDMA_NTSTAT_INTSTAT_SHIFT (0)
270
#define GPDMA_NTSTAT_INTSTAT_MASK (0xff << GPDMA_NTSTAT_INTSTAT_SHIFT)
271
#define GPDMA_NTSTAT_INTSTAT(x) ((x) << GPDMA_NTSTAT_INTSTAT_SHIFT)
272
273
/* --- GPDMA_INTTCSTAT values ----------------------------------- */
274
275
/* INTTCSTAT: Terminal count interrupt request status for DMA channels */
276
#define GPDMA_INTTCSTAT_INTTCSTAT_SHIFT (0)
277
#define GPDMA_INTTCSTAT_INTTCSTAT_MASK (0xff << GPDMA_INTTCSTAT_INTTCSTAT_SHIFT)
278
#define GPDMA_INTTCSTAT_INTTCSTAT(x) ((x) << GPDMA_INTTCSTAT_INTTCSTAT_SHIFT)
279
280
/* --- GPDMA_INTTCCLEAR values ---------------------------------- */
281
282
/* INTTCCLEAR: Allows clearing the Terminal count interrupt request (IntTCStat)
283
for DMA channels */
284
#define GPDMA_INTTCCLEAR_INTTCCLEAR_SHIFT (0)
285
#define GPDMA_INTTCCLEAR_INTTCCLEAR_MASK \
286
(0xff << GPDMA_INTTCCLEAR_INTTCCLEAR_SHIFT)
287
#define GPDMA_INTTCCLEAR_INTTCCLEAR(x) \
288
((x) << GPDMA_INTTCCLEAR_INTTCCLEAR_SHIFT)
289
290
/* --- GPDMA_INTERRSTAT values ---------------------------------- */
291
292
/* INTERRSTAT: Interrupt error status for DMA channels */
293
#define GPDMA_INTERRSTAT_INTERRSTAT_SHIFT (0)
294
#define GPDMA_INTERRSTAT_INTERRSTAT_MASK \
295
(0xff << GPDMA_INTERRSTAT_INTERRSTAT_SHIFT)
296
#define GPDMA_INTERRSTAT_INTERRSTAT(x) \
297
((x) << GPDMA_INTERRSTAT_INTERRSTAT_SHIFT)
298
299
/* --- GPDMA_INTERRCLR values ----------------------------------- */
300
301
/* INTERRCLR: Writing a 1 clears the error interrupt request (IntErrStat)
302
for DMA channels */
303
#define GPDMA_INTERRCLR_INTERRCLR_SHIFT (0)
304
#define GPDMA_INTERRCLR_INTERRCLR_MASK \
305
(0xff << GPDMA_INTERRCLR_INTERRCLR_SHIFT)
306
#define GPDMA_INTERRCLR_INTERRCLR(x) \
307
((x) << GPDMA_INTERRCLR_INTERRCLR_SHIFT)
308
309
/* --- GPDMA_RAWINTTCSTAT values -------------------------------- */
310
311
/* RAWINTTCSTAT: Status of the terminal count interrupt for DMA channels
312
prior to masking */
313
#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT_SHIFT (0)
314
#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT_MASK \
315
(0xff << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT_SHIFT)
316
#define GPDMA_RAWINTTCSTAT_RAWINTTCSTAT(x) \
317
((x) << GPDMA_RAWINTTCSTAT_RAWINTTCSTAT_SHIFT)
318
319
/* --- GPDMA_RAWINTERRSTAT values ------------------------------- */
320
321
/* RAWINTERRSTAT: Status of the error interrupt for DMA channels prior to
322
masking */
323
#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT_SHIFT (0)
324
#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT_MASK \
325
(0xff << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT_SHIFT)
326
#define GPDMA_RAWINTERRSTAT_RAWINTERRSTAT(x) \
327
((x) << GPDMA_RAWINTERRSTAT_RAWINTERRSTAT_SHIFT)
328
329
/* --- GPDMA_ENBLDCHNS values ----------------------------------- */
330
331
/* ENABLEDCHANNELS: Enable status for DMA channels */
332
#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS_SHIFT (0)
333
#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS_MASK \
334
(0xff << GPDMA_ENBLDCHNS_ENABLEDCHANNELS_SHIFT)
335
#define GPDMA_ENBLDCHNS_ENABLEDCHANNELS(x) \
336
((x) << GPDMA_ENBLDCHNS_ENABLEDCHANNELS_SHIFT)
337
338
/* --- GPDMA_SOFTBREQ values ------------------------------------ */
339
340
/* SOFTBREQ: Software burst request flags for each of 16 possible sources */
341
#define GPDMA_SOFTBREQ_SOFTBREQ_SHIFT (0)
342
#define GPDMA_SOFTBREQ_SOFTBREQ_MASK (0xffff << GPDMA_SOFTBREQ_SOFTBREQ_SHIFT)
343
#define GPDMA_SOFTBREQ_SOFTBREQ(x) ((x) << GPDMA_SOFTBREQ_SOFTBREQ_SHIFT)
344
345
/* --- GPDMA_SOFTSREQ values ------------------------------------ */
346
347
/* SOFTSREQ: Software single transfer request flags for each of 16 possible
348
sources */
349
#define GPDMA_SOFTSREQ_SOFTSREQ_SHIFT (0)
350
#define GPDMA_SOFTSREQ_SOFTSREQ_MASK (0xffff << GPDMA_SOFTSREQ_SOFTSREQ_SHIFT)
351
#define GPDMA_SOFTSREQ_SOFTSREQ(x) ((x) << GPDMA_SOFTSREQ_SOFTSREQ_SHIFT)
352
353
/* --- GPDMA_SOFTLBREQ values ----------------------------------- */
354
355
/* SOFTLBREQ: Software last burst request flags for each of 16 possible
356
sources */
357
#define GPDMA_SOFTLBREQ_SOFTLBREQ_SHIFT (0)
358
#define GPDMA_SOFTLBREQ_SOFTLBREQ_MASK \
359
(0xffff << GPDMA_SOFTLBREQ_SOFTLBREQ_SHIFT)
360
#define GPDMA_SOFTLBREQ_SOFTLBREQ(x) \
361
((x) << GPDMA_SOFTLBREQ_SOFTLBREQ_SHIFT)
362
363
/* --- GPDMA_SOFTLSREQ values ----------------------------------- */
364
365
/* SOFTLSREQ: Software last single transfer request flags for each of 16
366
possible sources */
367
#define GPDMA_SOFTLSREQ_SOFTLSREQ_SHIFT (0)
368
#define GPDMA_SOFTLSREQ_SOFTLSREQ_MASK \
369
(0xffff << GPDMA_SOFTLSREQ_SOFTLSREQ_SHIFT)
370
#define GPDMA_SOFTLSREQ_SOFTLSREQ(x) \
371
((x) << GPDMA_SOFTLSREQ_SOFTLSREQ_SHIFT)
372
373
/* --- GPDMA_CONFIG values -------------------------------------- */
374
375
/* E: DMA Controller enable */
376
#define GPDMA_CONFIG_E_SHIFT (0)
377
#define GPDMA_CONFIG_E_MASK (0x1 << GPDMA_CONFIG_E_SHIFT)
378
#define GPDMA_CONFIG_E(x) ((x) << GPDMA_CONFIG_E_SHIFT)
379
380
/* M0: AHB Master 0 endianness configuration */
381
#define GPDMA_CONFIG_M0_SHIFT (1)
382
#define GPDMA_CONFIG_M0_MASK (0x1 << GPDMA_CONFIG_M0_SHIFT)
383
#define GPDMA_CONFIG_M0(x) ((x) << GPDMA_CONFIG_M0_SHIFT)
384
385
/* M1: AHB Master 1 endianness configuration */
386
#define GPDMA_CONFIG_M1_SHIFT (2)
387
#define GPDMA_CONFIG_M1_MASK (0x1 << GPDMA_CONFIG_M1_SHIFT)
388
#define GPDMA_CONFIG_M1(x) ((x) << GPDMA_CONFIG_M1_SHIFT)
389
390
/* --- GPDMA_SYNC values ---------------------------------------- */
391
392
/* DMACSYNC: Controls the synchronization logic for DMA request signals */
393
#define GPDMA_SYNC_DMACSYNC_SHIFT (0)
394
#define GPDMA_SYNC_DMACSYNC_MASK (0xffff << GPDMA_SYNC_DMACSYNC_SHIFT)
395
#define GPDMA_SYNC_DMACSYNC(x) ((x) << GPDMA_SYNC_DMACSYNC_SHIFT)
396
397
/* --- GPDMA_C[0..7]SRCADDR values ----------------------------------- */
398
399
/* SRCADDR: DMA source address */
400
#define GPDMA_CxSRCADDR_SRCADDR_SHIFT (0)
401
#define GPDMA_CxSRCADDR_SRCADDR_MASK \
402
(0xffffffff << GPDMA_CxSRCADDR_SRCADDR_SHIFT)
403
#define GPDMA_CxSRCADDR_SRCADDR(x) ((x) << GPDMA_CxSRCADDR_SRCADDR_SHIFT)
404
405
/* --- GPDMA_C[0..7]DESTADDR values ---------------------------------- */
406
407
/* DESTADDR: DMA source address */
408
#define GPDMA_CxDESTADDR_DESTADDR_SHIFT (0)
409
#define GPDMA_CxDESTADDR_DESTADDR_MASK \
410
(0xffffffff << GPDMA_CxDESTADDR_DESTADDR_SHIFT)
411
#define GPDMA_CxDESTADDR_DESTADDR(x) ((x) << GPDMA_CxDESTADDR_DESTADDR_SHIFT)
412
413
/* --- GPDMA_C[0..7]LLI values --------------------------------------- */
414
415
/* LM: AHB master select for loading the next LLI */
416
#define GPDMA_CxLLI_LM_SHIFT (0)
417
#define GPDMA_CxLLI_LM_MASK (0x1 << GPDMA_CxLLI_LM_SHIFT)
418
#define GPDMA_CxLLI_LM(x) ((x) << GPDMA_CxLLI_LM_SHIFT)
419
420
/* LLI: Linked list item */
421
#define GPDMA_CxLLI_LLI_SHIFT (2)
422
#define GPDMA_CxLLI_LLI_MASK (0x3fffffff << GPDMA_CxLLI_LLI_SHIFT)
423
#define GPDMA_CxLLI_LLI(x) ((x) << GPDMA_CxLLI_LLI_SHIFT)
424
425
/* --- GPDMA_C[0..7]CONTROL values ----------------------------------- */
426
427
/* TRANSFERSIZE: Transfer size in number of transfers */
428
#define GPDMA_CxCONTROL_TRANSFERSIZE_SHIFT (0)
429
#define GPDMA_CxCONTROL_TRANSFERSIZE_MASK \
430
(0xfff << GPDMA_CxCONTROL_TRANSFERSIZE_SHIFT)
431
#define GPDMA_CxCONTROL_TRANSFERSIZE(x) \
432
((x) << GPDMA_CxCONTROL_TRANSFERSIZE_SHIFT)
433
434
/* SBSIZE: Source burst size */
435
#define GPDMA_CxCONTROL_SBSIZE_SHIFT (12)
436
#define GPDMA_CxCONTROL_SBSIZE_MASK (0x7 << GPDMA_CxCONTROL_SBSIZE_SHIFT)
437
#define GPDMA_CxCONTROL_SBSIZE(x) ((x) << GPDMA_CxCONTROL_SBSIZE_SHIFT)
438
439
/* DBSIZE: Destination burst size */
440
#define GPDMA_CxCONTROL_DBSIZE_SHIFT (15)
441
#define GPDMA_CxCONTROL_DBSIZE_MASK (0x7 << GPDMA_CxCONTROL_DBSIZE_SHIFT)
442
#define GPDMA_CxCONTROL_DBSIZE(x) ((x) << GPDMA_CxCONTROL_DBSIZE_SHIFT)
443
444
/* SWIDTH: Source transfer width */
445
#define GPDMA_CxCONTROL_SWIDTH_SHIFT (18)
446
#define GPDMA_CxCONTROL_SWIDTH_MASK (0x7 << GPDMA_CxCONTROL_SWIDTH_SHIFT)
447
#define GPDMA_CxCONTROL_SWIDTH(x) ((x) << GPDMA_CxCONTROL_SWIDTH_SHIFT)
448
449
/* DWIDTH: Destination transfer width */
450
#define GPDMA_CxCONTROL_DWIDTH_SHIFT (21)
451
#define GPDMA_CxCONTROL_DWIDTH_MASK (0x7 << GPDMA_CxCONTROL_DWIDTH_SHIFT)
452
#define GPDMA_CxCONTROL_DWIDTH(x) ((x) << GPDMA_CxCONTROL_DWIDTH_SHIFT)
453
454
/* S: Source AHB master select */
455
#define GPDMA_CxCONTROL_S_SHIFT (24)
456
#define GPDMA_CxCONTROL_S_MASK (0x1 << GPDMA_CxCONTROL_S_SHIFT)
457
#define GPDMA_CxCONTROL_S(x) ((x) << GPDMA_CxCONTROL_S_SHIFT)
458
459
/* D: Destination AHB master select */
460
#define GPDMA_CxCONTROL_D_SHIFT (25)
461
#define GPDMA_CxCONTROL_D_MASK (0x1 << GPDMA_CxCONTROL_D_SHIFT)
462
#define GPDMA_CxCONTROL_D(x) ((x) << GPDMA_CxCONTROL_D_SHIFT)
463
464
/* SI: Source increment */
465
#define GPDMA_CxCONTROL_SI_SHIFT (26)
466
#define GPDMA_CxCONTROL_SI_MASK (0x1 << GPDMA_CxCONTROL_SI_SHIFT)
467
#define GPDMA_Cx0CONTROL_SI(x) ((x) << GPDMA_CxCONTROL_SI_SHIFT)
468
469
/* DI: Destination increment */
470
#define GPDMA_CxCONTROL_DI_SHIFT (27)
471
#define GPDMA_CxCONTROL_DI_MASK (0x1 << GPDMA_CxCONTROL_DI_SHIFT)
472
#define GPDMA_CxCONTROL_DI(x) ((x) << GPDMA_CxCONTROL_DI_SHIFT)
473
474
/* PROT1: This information is provided to the peripheral during a DMA bus
475
access and indicates that the access is in user mode or privileged mode */
476
#define GPDMA_CxCONTROL_PROT1_SHIFT (28)
477
#define GPDMA_CxCONTROL_PROT1_MASK (0x1 << GPDMA_CxCONTROL_PROT1_SHIFT)
478
#define GPDMA_CxCONTROL_PROT1(x) ((x) << GPDMA_CxCONTROL_PROT1_SHIFT)
479
480
/* PROT2: This information is provided to the peripheral during a DMA bus
481
access and indicates to the peripheral that the access is bufferable or not
482
bufferable */
483
#define GPDMA_CxCONTROL_PROT2_SHIFT (29)
484
#define GPDMA_CxCONTROL_PROT2_MASK (0x1 << GPDMA_CxCONTROL_PROT2_SHIFT)
485
#define GPDMA_CxCONTROL_PROT2(x) ((x) << GPDMA_CxCONTROL_PROT2_SHIFT)
486
487
/* PROT3: This information is provided to the peripheral during a DMA bus
488
access and indicates to the peripheral that the access is cacheable or not
489
cacheable */
490
#define GPDMA_CxCONTROL_PROT3_SHIFT (30)
491
#define GPDMA_CxCONTROL_PROT3_MASK (0x1 << GPDMA_CxCONTROL_PROT3_SHIFT)
492
#define GPDMA_CxCONTROL_PROT3(x) ((x) << GPDMA_CxCONTROL_PROT3_SHIFT)
493
494
/* I: Terminal count interrupt enable bit */
495
#define GPDMA_CxCONTROL_I_SHIFT (31)
496
#define GPDMA_CxCONTROL_I_MASK (0x1 << GPDMA_CxCONTROL_I_SHIFT)
497
#define GPDMA_CxCONTROL_I(x) ((x) << GPDMA_CxCONTROL_I_SHIFT)
498
499
/* --- GPDMA_C[0..7]CONFIG values ------------------------------------ */
500
501
/* E: Channel enable */
502
#define GPDMA_CxCONFIG_E_SHIFT (0)
503
#define GPDMA_CxCONFIG_E_MASK (0x1 << GPDMA_CxCONFIG_E_SHIFT)
504
#define GPDMA_CxCONFIG_E(x) ((x) << GPDMA_CxCONFIG_E_SHIFT)
505
506
/* SRCPERIPHERAL: Source peripheral */
507
#define GPDMA_CxCONFIG_SRCPERIPHERAL_SHIFT (1)
508
#define GPDMA_CxCONFIG_SRCPERIPHERAL_MASK \
509
(0x1f << GPDMA_CxCONFIG_SRCPERIPHERAL_SHIFT)
510
#define GPDMA_CxCONFIG_SRCPERIPHERAL(x) \
511
((x) << GPDMA_CxCONFIG_SRCPERIPHERAL_SHIFT)
512
513
/* DESTPERIPHERAL: Destination peripheral */
514
#define GPDMA_CxCONFIG_DESTPERIPHERAL_SHIFT (6)
515
#define GPDMA_CxCONFIG_DESTPERIPHERAL_MASK \
516
(0x1f << GPDMA_CxCONFIG_DESTPERIPHERAL_SHIFT)
517
#define GPDMA_CxCONFIG_DESTPERIPHERAL(x) \
518
((x) << GPDMA_CxCONFIG_DESTPERIPHERAL_SHIFT)
519
520
/* FLOWCNTRL: Flow control and transfer type */
521
#define GPDMA_CxCONFIG_FLOWCNTRL_SHIFT (11)
522
#define GPDMA_CxCONFIG_FLOWCNTRL_MASK (0x7 << GPDMA_CxCONFIG_FLOWCNTRL_SHIFT)
523
#define GPDMA_CxCONFIG_FLOWCNTRL(x) ((x) << GPDMA_CxCONFIG_FLOWCNTRL_SHIFT)
524
525
/* IE: Interrupt error mask */
526
#define GPDMA_CxCONFIG_IE_SHIFT (14)
527
#define GPDMA_CxCONFIG_IE_MASK (0x1 << GPDMA_CxCONFIG_IE_SHIFT)
528
#define GPDMA_CxCONFIG_IE(x) ((x) << GPDMA_CxCONFIG_IE_SHIFT)
529
530
/* ITC: Terminal count interrupt mask */
531
#define GPDMA_CxCONFIG_ITC_SHIFT (15)
532
#define GPDMA_CxCONFIG_ITC_MASK (0x1 << GPDMA_CxCONFIG_ITC_SHIFT)
533
#define GPDMA_CxCONFIG_ITC(x) ((x) << GPDMA_CxCONFIG_ITC_SHIFT)
534
535
/* L: Lock */
536
#define GPDMA_CxCONFIG_L_SHIFT (16)
537
#define GPDMA_CxCONFIG_L_MASK (0x1 << GPDMA_CxCONFIG_L_SHIFT)
538
#define GPDMA_CxCONFIG_L(x) ((x) << GPDMA_CxCONFIG_L_SHIFT)
539
540
/* A: Active */
541
#define GPDMA_CxCONFIG_A_SHIFT (17)
542
#define GPDMA_CxCONFIG_A_MASK (0x1 << GPDMA_CxCONFIG_A_SHIFT)
543
#define GPDMA_CxCONFIG_A(x) ((x) << GPDMA_CxCONFIG_A_SHIFT)
544
545
/* H: Halt */
546
#define GPDMA_CxCONFIG_H_SHIFT (18)
547
#define GPDMA_CxCONFIG_H_MASK (0x1 << GPDMA_CxCONFIG_H_SHIFT)
548
#define GPDMA_CxCONFIG_H(x) ((x) << GPDMA_CxCONFIG_H_SHIFT)
549
550
/**@}*/
551
552
#endif
common.h
memorymap.h
include
libopencm3
lpc43xx
gpdma.h
Generated on Tue Mar 7 2023 16:13:01 for libopencm3 by
1.9.4