libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
creg.h
Go to the documentation of this file.
1
/** @defgroup creg_defines Configuration Registers Defines
2
3
@brief <b>Defined Constants and Types for the LPC43xx Configuration
4
Registers</b>
5
6
@ingroup LPC43xx_defines
7
8
@version 1.0.0
9
10
@author @htmlonly © @endhtmlonly 2012 Michael Ossmann <mike@ossmann.com>
11
12
@date 10 March 2013
13
14
LGPL License Terms @ref lgpl_license
15
*/
16
/*
17
* This file is part of the libopencm3 project.
18
*
19
* Copyright (C) 2012 Michael Ossmann <mike@ossmann.com>
20
*
21
* This library is free software: you can redistribute it and/or modify
22
* it under the terms of the GNU Lesser General Public License as published by
23
* the Free Software Foundation, either version 3 of the License, or
24
* (at your option) any later version.
25
*
26
* This library is distributed in the hope that it will be useful,
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
* GNU Lesser General Public License for more details.
30
*
31
* You should have received a copy of the GNU Lesser General Public License
32
* along with this library. If not, see <http://www.gnu.org/licenses/>.
33
*/
34
35
#ifndef LPC43XX_CREG_H
36
#define LPC43XX_CREG_H
37
38
/**@{*/
39
40
#include <
libopencm3/cm3/common.h
>
41
#include <
libopencm3/lpc43xx/memorymap.h
>
42
43
/* --- CREG registers ----------------------------------------------------- */
44
45
/*
46
* Chip configuration register 32 kHz oscillator output and BOD control
47
* register
48
*/
49
#define CREG_CREG0 MMIO32(CREG_BASE + 0x004)
50
51
/* ARM Cortex-M4 memory mapping */
52
#define CREG_M4MEMMAP MMIO32(CREG_BASE + 0x100)
53
54
/* Chip configuration register 1 */
55
#define CREG_CREG1 MMIO32(CREG_BASE + 0x108)
56
57
/* Chip configuration register 2 */
58
#define CREG_CREG2 MMIO32(CREG_BASE + 0x10C)
59
60
/* Chip configuration register 3 */
61
#define CREG_CREG3 MMIO32(CREG_BASE + 0x110)
62
63
/* Chip configuration register 4 */
64
#define CREG_CREG4 MMIO32(CREG_BASE + 0x114)
65
66
/* Chip configuration register 5 */
67
#define CREG_CREG5 MMIO32(CREG_BASE + 0x118)
68
69
/* DMA muxing control */
70
#define CREG_DMAMUX MMIO32(CREG_BASE + 0x11C)
71
72
/* Flash accelerator configuration register for flash bank A */
73
#define CREG_FLASHCFGA MMIO32(CREG_BASE + 0x120)
74
75
/* Flash accelerator configuration register for flash bank B */
76
#define CREG_FLASHCFGB MMIO32(CREG_BASE + 0x124)
77
78
/* ETB RAM configuration */
79
#define CREG_ETBCFG MMIO32(CREG_BASE + 0x128)
80
81
/*
82
* Chip configuration register 6. Controls multiple functions: Ethernet
83
* interface, SCT output, I2S0/1 inputs, EMC clock.
84
*/
85
#define CREG_CREG6 MMIO32(CREG_BASE + 0x12C)
86
87
/* Cortex-M4 TXEV event clear */
88
#define CREG_M4TXEVENT MMIO32(CREG_BASE + 0x130)
89
90
/* Part ID (Boundary scan ID code, read-only) */
91
#define CREG_CHIPID MMIO32(CREG_BASE + 0x200)
92
93
/* Cortex-M0 TXEV event clear */
94
#define CREG_M0TXEVENT MMIO32(CREG_BASE + 0x400)
95
96
/* ARM Cortex-M0 memory mapping */
97
#define CREG_M0APPMEMMAP MMIO32(CREG_BASE + 0x404)
98
99
/* USB0 frame length adjust register */
100
#define CREG_USB0FLADJ MMIO32(CREG_BASE + 0x500)
101
102
/* USB1 frame length adjust register */
103
#define CREG_USB1FLADJ MMIO32(CREG_BASE + 0x600)
104
105
/* --- CREG_CREG0 values ---------------------------------------- */
106
107
/* EN1KHZ: Enable 1 kHz output */
108
#define CREG_CREG0_EN1KHZ_SHIFT (0)
109
#define CREG_CREG0_EN1KHZ (1 << CREG_CREG0_EN1KHZ_SHIFT)
110
111
/* EN32KHZ: Enable 32 kHz output */
112
#define CREG_CREG0_EN32KHZ_SHIFT (1)
113
#define CREG_CREG0_EN32KHZ (1 << CREG_CREG0_EN32KHZ_SHIFT)
114
115
/* RESET32KHZ: 32 kHz oscillator reset */
116
#define CREG_CREG0_RESET32KHZ_SHIFT (2)
117
#define CREG_CREG0_RESET32KHZ (1 << CREG_CREG0_RESET32KHZ_SHIFT)
118
119
/* PD32KHZ: 32 kHz power control */
120
#define CREG_CREG0_PD32KHZ_SHIFT (3)
121
#define CREG_CREG0_PD32KHZ (1 << CREG_CREG0_PD32KHZ_SHIFT)
122
123
/* USB0PHY: USB0 PHY power control */
124
#define CREG_CREG0_USB0PHY_SHIFT (5)
125
#define CREG_CREG0_USB0PHY (1 << CREG_CREG0_USB0PHY_SHIFT)
126
127
/* ALARMCTRL: RTC_ALARM pin output control */
128
#define CREG_CREG0_ALARMCTRL_SHIFT (6)
129
#define CREG_CREG0_ALARMCTRL_MASK (0x3 << CREG_CREG0_ALARMCTRL_SHIFT)
130
#define CREG_CREG0_ALARMCTRL(x) ((x) << CREG_CREG0_ALARMCTRL_SHIFT)
131
132
/* BODLVL1: BOD trip level to generate an interrupt */
133
#define CREG_CREG0_BODLVL1_SHIFT (8)
134
#define CREG_CREG0_BODLVL1_MASK (0x3 << CREG_CREG0_BODLVL1_SHIFT)
135
#define CREG_CREG0_BODLVL1(x) ((x) << CREG_CREG0_BODLVL1_SHIFT)
136
137
/* BODLVL2: BOD trip level to generate a reset */
138
#define CREG_CREG0_BODLVL2_SHIFT (10)
139
#define CREG_CREG0_BODLVL2_MASK (0x3 << CREG_CREG0_BODLVL2_SHIFT)
140
#define CREG_CREG0_BODLVL2(x) ((x) << CREG_CREG0_BODLVL2_SHIFT)
141
142
/* SAMPLECTRL: SAMPLE pin input/output control */
143
#define CREG_CREG0_SAMPLECTRL_SHIFT (12)
144
#define CREG_CREG0_SAMPLECTRL_MASK (0x3 << CREG_CREG0_SAMPLECTRL_SHIFT)
145
#define CREG_CREG0_SAMPLECTRL(x) ((x) << CREG_CREG0_SAMPLECTRL_SHIFT)
146
147
/* WAKEUP0CTRL: WAKEUP0 pin input/output control */
148
#define CREG_CREG0_WAKEUP0CTRL_SHIFT (14)
149
#define CREG_CREG0_WAKEUP0CTRL_MASK (0x3 << CREG_CREG0_WAKEUP0CTRL_SHIFT)
150
#define CREG_CREG0_WAKEUP0CTRL(x) ((x) << CREG_CREG0_WAKEUP0CTRL_SHIFT)
151
152
/* WAKEUP1CTRL: WAKEUP1 pin input/output control */
153
#define CREG_CREG0_WAKEUP1CTRL_SHIFT (16)
154
#define CREG_CREG0_WAKEUP1CTRL_MASK (0x3 << CREG_CREG0_WAKEUP1CTRL_SHIFT)
155
#define CREG_CREG0_WAKEUP1CTRL(x) ((x) << CREG_CREG0_WAKEUP1CTRL_SHIFT)
156
157
/* --- CREG_M4MEMMAP values ------------------------------------- */
158
159
/* M4MAP: Shadow address when accessing memory at address 0x00000000 */
160
#define CREG_M4MEMMAP_M4MAP_SHIFT (12)
161
#define CREG_M4MEMMAP_M4MAP_MASK (0xfffff << CREG_M4MEMMAP_M4MAP_SHIFT)
162
#define CREG_M4MEMMAP_M4MAP(x) ((x) << CREG_M4MEMMAP_M4MAP_SHIFT)
163
164
/* --- CREG_CREG5 values ---------------------------------------- */
165
166
/* M4TAPSEL: JTAG debug select for M4 core */
167
#define CREG_CREG5_M4TAPSEL_SHIFT (6)
168
#define CREG_CREG5_M4TAPSEL (1 << CREG_CREG5_M4TAPSEL_SHIFT)
169
170
/* M0APPTAPSEL: JTAG debug select for M0 co-processor */
171
#define CREG_CREG5_M0APPTAPSEL_SHIFT (9)
172
#define CREG_CREG5_M0APPTAPSEL (1 << CREG_CREG5_M0APPTAPSEL_SHIFT)
173
174
/* --- CREG_DMAMUX values --------------------------------------- */
175
176
/* DMAMUXPER0: Select DMA to peripheral connection for DMA peripheral 0 */
177
#define CREG_DMAMUX_DMAMUXPER0_SHIFT (0)
178
#define CREG_DMAMUX_DMAMUXPER0_MASK (0x3 << CREG_DMAMUX_DMAMUXPER0_SHIFT)
179
#define CREG_DMAMUX_DMAMUXPER0(x) ((x) << CREG_DMAMUX_DMAMUXPER0_SHIFT)
180
181
/* DMAMUXPER1: Select DMA to peripheral connection for DMA peripheral 1 */
182
#define CREG_DMAMUX_DMAMUXPER1_SHIFT (2)
183
#define CREG_DMAMUX_DMAMUXPER1_MASK (0x3 << CREG_DMAMUX_DMAMUXPER1_SHIFT)
184
#define CREG_DMAMUX_DMAMUXPER1(x) ((x) << CREG_DMAMUX_DMAMUXPER1_SHIFT)
185
186
/* DMAMUXPER2: Select DMA to peripheral connection for DMA peripheral 2 */
187
#define CREG_DMAMUX_DMAMUXPER2_SHIFT (4)
188
#define CREG_DMAMUX_DMAMUXPER2_MASK (0x3 << CREG_DMAMUX_DMAMUXPER2_SHIFT)
189
#define CREG_DMAMUX_DMAMUXPER2(x) ((x) << CREG_DMAMUX_DMAMUXPER2_SHIFT)
190
191
/* DMAMUXPER3: Select DMA to peripheral connection for DMA peripheral 3 */
192
#define CREG_DMAMUX_DMAMUXPER3_SHIFT (6)
193
#define CREG_DMAMUX_DMAMUXPER3_MASK (0x3 << CREG_DMAMUX_DMAMUXPER3_SHIFT)
194
#define CREG_DMAMUX_DMAMUXPER3(x) ((x) << CREG_DMAMUX_DMAMUXPER3_SHIFT)
195
196
/* DMAMUXPER4: Select DMA to peripheral connection for DMA peripheral 4 */
197
#define CREG_DMAMUX_DMAMUXPER4_SHIFT (8)
198
#define CREG_DMAMUX_DMAMUXPER4_MASK (0x3 << CREG_DMAMUX_DMAMUXPER4_SHIFT)
199
#define CREG_DMAMUX_DMAMUXPER4(x) ((x) << CREG_DMAMUX_DMAMUXPER4_SHIFT)
200
201
/* DMAMUXPER5: Select DMA to peripheral connection for DMA peripheral 5 */
202
#define CREG_DMAMUX_DMAMUXPER5_SHIFT (10)
203
#define CREG_DMAMUX_DMAMUXPER5_MASK (0x3 << CREG_DMAMUX_DMAMUXPER5_SHIFT)
204
#define CREG_DMAMUX_DMAMUXPER5(x) ((x) << CREG_DMAMUX_DMAMUXPER5_SHIFT)
205
206
/* DMAMUXPER6: Select DMA to peripheral connection for DMA peripheral 6 */
207
#define CREG_DMAMUX_DMAMUXPER6_SHIFT (12)
208
#define CREG_DMAMUX_DMAMUXPER6_MASK (0x3 << CREG_DMAMUX_DMAMUXPER6_SHIFT)
209
#define CREG_DMAMUX_DMAMUXPER6(x) ((x) << CREG_DMAMUX_DMAMUXPER6_SHIFT)
210
211
/* DMAMUXPER7: Select DMA to peripheral connection for DMA peripheral 7 */
212
#define CREG_DMAMUX_DMAMUXPER7_SHIFT (14)
213
#define CREG_DMAMUX_DMAMUXPER7_MASK (0x3 << CREG_DMAMUX_DMAMUXPER7_SHIFT)
214
#define CREG_DMAMUX_DMAMUXPER7(x) ((x) << CREG_DMAMUX_DMAMUXPER7_SHIFT)
215
216
/* DMAMUXPER8: Select DMA to peripheral connection for DMA peripheral 8 */
217
#define CREG_DMAMUX_DMAMUXPER8_SHIFT (16)
218
#define CREG_DMAMUX_DMAMUXPER8_MASK (0x3 << CREG_DMAMUX_DMAMUXPER8_SHIFT)
219
#define CREG_DMAMUX_DMAMUXPER8(x) ((x) << CREG_DMAMUX_DMAMUXPER8_SHIFT)
220
221
/* DMAMUXPER9: Select DMA to peripheral connection for DMA peripheral 9 */
222
#define CREG_DMAMUX_DMAMUXPER9_SHIFT (18)
223
#define CREG_DMAMUX_DMAMUXPER9_MASK (0x3 << CREG_DMAMUX_DMAMUXPER9_SHIFT)
224
#define CREG_DMAMUX_DMAMUXPER9(x) ((x) << CREG_DMAMUX_DMAMUXPER9_SHIFT)
225
226
/* DMAMUXPER10: Select DMA to peripheral connection for DMA peripheral 10 */
227
#define CREG_DMAMUX_DMAMUXPER10_SHIFT (20)
228
#define CREG_DMAMUX_DMAMUXPER10_MASK (0x3 << CREG_DMAMUX_DMAMUXPER10_SHIFT)
229
#define CREG_DMAMUX_DMAMUXPER10(x) ((x) << CREG_DMAMUX_DMAMUXPER10_SHIFT)
230
231
/* DMAMUXPER11: Select DMA to peripheral connection for DMA peripheral 11 */
232
#define CREG_DMAMUX_DMAMUXPER11_SHIFT (22)
233
#define CREG_DMAMUX_DMAMUXPER11_MASK (0x3 << CREG_DMAMUX_DMAMUXPER11_SHIFT)
234
#define CREG_DMAMUX_DMAMUXPER11(x) ((x) << CREG_DMAMUX_DMAMUXPER11_SHIFT)
235
236
/* DMAMUXPER12: Select DMA to peripheral connection for DMA peripheral 12 */
237
#define CREG_DMAMUX_DMAMUXPER12_SHIFT (24)
238
#define CREG_DMAMUX_DMAMUXPER12_MASK (0x3 << CREG_DMAMUX_DMAMUXPER12_SHIFT)
239
#define CREG_DMAMUX_DMAMUXPER12(x) ((x) << CREG_DMAMUX_DMAMUXPER12_SHIFT)
240
241
/* DMAMUXPER13: Select DMA to peripheral connection for DMA peripheral 13 */
242
#define CREG_DMAMUX_DMAMUXPER13_SHIFT (26)
243
#define CREG_DMAMUX_DMAMUXPER13_MASK (0x3 << CREG_DMAMUX_DMAMUXPER13_SHIFT)
244
#define CREG_DMAMUX_DMAMUXPER13(x) ((x) << CREG_DMAMUX_DMAMUXPER13_SHIFT)
245
246
/* DMAMUXPER14: Select DMA to peripheral connection for DMA peripheral 14 */
247
#define CREG_DMAMUX_DMAMUXPER14_SHIFT (28)
248
#define CREG_DMAMUX_DMAMUXPER14_MASK (0x3 << CREG_DMAMUX_DMAMUXPER14_SHIFT)
249
#define CREG_DMAMUX_DMAMUXPER14(x) ((x) << CREG_DMAMUX_DMAMUXPER14_SHIFT)
250
251
/* DMAMUXPER15: Select DMA to peripheral connection for DMA peripheral 15 */
252
#define CREG_DMAMUX_DMAMUXPER15_SHIFT (30)
253
#define CREG_DMAMUX_DMAMUXPER15_MASK (0x3 << CREG_DMAMUX_DMAMUXPER15_SHIFT)
254
#define CREG_DMAMUX_DMAMUXPER15(x) ((x) << CREG_DMAMUX_DMAMUXPER15_SHIFT)
255
256
/* --- CREG_FLASHCFGA values ------------------------------------ */
257
258
/* FLASHTIM: Flash access time. The value of this field plus 1 gives the number
259
* of BASE_M4_CLK clocks used for a flash access */
260
#define CREG_FLASHCFGA_FLASHTIM_SHIFT (12)
261
#define CREG_FLASHCFGA_FLASHTIM_MASK (0xf << CREG_FLASHCFGA_FLASHTIM_SHIFT)
262
#define CREG_FLASHCFGA_FLASHTIM(x) ((x) << CREG_FLASHCFGA_FLASHTIM_SHIFT)
263
264
/* POW: Flash bank A power control */
265
#define CREG_FLASHCFGA_POW_SHIFT (31)
266
#define CREG_FLASHCFGA_POW (1 << CREG_FLASHCFGA_POW_SHIFT)
267
268
/* --- CREG_FLASHCFGB values ------------------------------------ */
269
270
/* FLASHTIM: Flash access time. The value of this field plus 1 gives the number
271
* of BASE_M4_CLK clocks used for a flash access */
272
#define CREG_FLASHCFGB_FLASHTIM_SHIFT (12)
273
#define CREG_FLASHCFGB_FLASHTIM_MASK (0xf << CREG_FLASHCFGB_FLASHTIM_SHIFT)
274
#define CREG_FLASHCFGB_FLASHTIM(x) ((x) << CREG_FLASHCFGB_FLASHTIM_SHIFT)
275
276
/* POW: Flash bank B power control */
277
#define CREG_FLASHCFGB_POW_SHIFT (31)
278
#define CREG_FLASHCFGB_POW (1 << CREG_FLASHCFGB_POW_SHIFT)
279
280
/* --- CREG_ETBCFG values --------------------------------------- */
281
282
/* ETB: Select SRAM interface */
283
#define CREG_ETBCFG_ETB_SHIFT (0)
284
#define CREG_ETBCFG_ETB (1 << CREG_ETBCFG_ETB_SHIFT)
285
286
/* --- CREG_CREG6 values ---------------------------------------- */
287
288
/* ETHMODE: Selects the Ethernet mode. Reset the ethernet after changing the
289
* PHY interface */
290
#define CREG_CREG6_ETHMODE_SHIFT (0)
291
#define CREG_CREG6_ETHMODE_MASK (0x7 << CREG_CREG6_ETHMODE_SHIFT)
292
#define CREG_CREG6_ETHMODE(x) ((x) << CREG_CREG6_ETHMODE_SHIFT)
293
294
/* CTOUTCTRL: Selects the functionality of the SCT outputs */
295
#define CREG_CREG6_CTOUTCTRL_SHIFT (4)
296
#define CREG_CREG6_CTOUTCTRL (1 << CREG_CREG6_CTOUTCTRL_SHIFT)
297
298
/* I2S0_TX_SCK_IN_SEL: I2S0_TX_SCK input select */
299
#define CREG_CREG6_I2S0_TX_SCK_IN_SEL_SHIFT (12)
300
#define CREG_CREG6_I2S0_TX_SCK_IN_SEL (1 << CREG_CREG6_I2S0_TX_SCK_IN_SEL_SHIFT)
301
302
/* I2S0_RX_SCK_IN_SEL: I2S0_RX_SCK input select */
303
#define CREG_CREG6_I2S0_RX_SCK_IN_SEL_SHIFT (13)
304
#define CREG_CREG6_I2S0_RX_SCK_IN_SEL (1 << CREG_CREG6_I2S0_RX_SCK_IN_SEL_SHIFT)
305
306
/* I2S1_TX_SCK_IN_SEL: I2S1_TX_SCK input select */
307
#define CREG_CREG6_I2S1_TX_SCK_IN_SEL_SHIFT (14)
308
#define CREG_CREG6_I2S1_TX_SCK_IN_SEL (1 << CREG_CREG6_I2S1_TX_SCK_IN_SEL_SHIFT)
309
310
/* I2S1_RX_SCK_IN_SEL: I2S1_RX_SCK input select */
311
#define CREG_CREG6_I2S1_RX_SCK_IN_SEL_SHIFT (15)
312
#define CREG_CREG6_I2S1_RX_SCK_IN_SEL (1 << CREG_CREG6_I2S1_RX_SCK_IN_SEL_SHIFT)
313
314
/* EMC_CLK_SEL: EMC_CLK divided clock select */
315
#define CREG_CREG6_EMC_CLK_SEL_SHIFT (16)
316
#define CREG_CREG6_EMC_CLK_SEL (1 << CREG_CREG6_EMC_CLK_SEL_SHIFT)
317
318
/* --- CREG_M4TXEVENT values ------------------------------------ */
319
320
/* TXEVCLR: Cortex-M4 TXEV event */
321
#define CREG_M4TXEVENT_TXEVCLR_SHIFT (0)
322
#define CREG_M4TXEVENT_TXEVCLR (1 << CREG_M4TXEVENT_TXEVCLR_SHIFT)
323
324
/* --- CREG_M0TXEVENT values ------------------------------------ */
325
326
/* TXEVCLR: Cortex-M0 TXEV event */
327
#define CREG_M0TXEVENT_TXEVCLR_SHIFT (0)
328
#define CREG_M0TXEVENT_TXEVCLR (1 << CREG_M0TXEVENT_TXEVCLR_SHIFT)
329
330
/* --- CREG_M0APPMEMMAP values ---------------------------------- */
331
332
/* M0APPMAP: Shadow address when accessing memory at address 0x00000000 */
333
#define CREG_M0APPMEMMAP_M0APPMAP_SHIFT (12)
334
#define CREG_M0APPMEMMAP_M0APPMAP_MASK \
335
(0xfffff << CREG_M0APPMEMMAP_M0APPMAP_SHIFT)
336
#define CREG_M0APPMEMMAP_M0APPMAP(x) ((x) << CREG_M0APPMEMMAP_M0APPMAP_SHIFT)
337
338
/* --- CREG_USB0FLADJ values ------------------------------------ */
339
340
/* FLTV: Frame length timing value */
341
#define CREG_USB0FLADJ_FLTV_SHIFT (0)
342
#define CREG_USB0FLADJ_FLTV_MASK (0x3f << CREG_USB0FLADJ_FLTV_SHIFT)
343
#define CREG_USB0FLADJ_FLTV(x) ((x) << CREG_USB0FLADJ_FLTV_SHIFT)
344
345
/* --- CREG_USB1FLADJ values ------------------------------------ */
346
347
/* FLTV: Frame length timing value */
348
#define CREG_USB1FLADJ_FLTV_SHIFT (0)
349
#define CREG_USB1FLADJ_FLTV_MASK (0x3f << CREG_USB1FLADJ_FLTV_SHIFT)
350
#define CREG_USB1FLADJ_FLTV(x) ((x) << CREG_USB1FLADJ_FLTV_SHIFT)
351
352
/**@}*/
353
354
#endif
common.h
memorymap.h
include
libopencm3
lpc43xx
creg.h
Generated on Tue Mar 7 2023 16:13:01 for libopencm3 by
1.9.4