libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
scu.h
Go to the documentation of this file.
1/** @defgroup scu_defines System Control Unit Defines
2
3@brief <b>Defined Constants and Types for the LPC43xx System Control Unit</b>
4
5@ingroup LPC43xx_defines
6
7@version 1.0.0
8
9@author @htmlonly &copy; @endhtmlonly 2012 Michael Ossmann <mike@ossmann.com>
10
11@date 10 March 2013
12
13LGPL 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* Copyright (C) 2012 Benjamin Vernoux <titanmkd@gmail.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_SCU_H
36#define LPC43XX_SCU_H
37
38/**@{*/
39
42
43/* --- Convenience macros -------------------------------------------------- */
44
45/* Pin group base addresses */
46#define PIN_GROUP0 (SCU_BASE + 0x000)
47#define PIN_GROUP1 (SCU_BASE + 0x080)
48#define PIN_GROUP2 (SCU_BASE + 0x100)
49#define PIN_GROUP3 (SCU_BASE + 0x180)
50#define PIN_GROUP4 (SCU_BASE + 0x200)
51#define PIN_GROUP5 (SCU_BASE + 0x280)
52#define PIN_GROUP6 (SCU_BASE + 0x300)
53#define PIN_GROUP7 (SCU_BASE + 0x380)
54#define PIN_GROUP8 (SCU_BASE + 0x400)
55#define PIN_GROUP9 (SCU_BASE + 0x480)
56#define PIN_GROUPA (SCU_BASE + 0x500)
57#define PIN_GROUPB (SCU_BASE + 0x580)
58#define PIN_GROUPC (SCU_BASE + 0x600)
59#define PIN_GROUPD (SCU_BASE + 0x680)
60#define PIN_GROUPE (SCU_BASE + 0x700)
61#define PIN_GROUPF (SCU_BASE + 0x780)
62
63#define PIN0 0x000
64#define PIN1 0x004
65#define PIN2 0x008
66#define PIN3 0x00C
67#define PIN4 0x010
68#define PIN5 0x014
69#define PIN6 0x018
70#define PIN7 0x01C
71#define PIN8 0x020
72#define PIN9 0x024
73#define PIN10 0x028
74#define PIN11 0x02C
75#define PIN12 0x030
76#define PIN13 0x034
77#define PIN14 0x038
78#define PIN15 0x03C
79#define PIN16 0x040
80#define PIN17 0x044
81#define PIN18 0x048
82#define PIN19 0x04C
83#define PIN20 0x050
84
85
86/* --- SCU registers ------------------------------------------------------- */
87
88/* Pin configuration registers */
89
90#define SCU_SFS(group, pin) MMIO32((group) + (pin))
91
92/* Pins P0_n */
93#define SCU_SFSP0_0 SCU_SFS(PIN_GROUP0, PIN0)
94#define SCU_SFSP0_1 SCU_SFS(PIN_GROUP0, PIN1)
95
96/* Pins P1_n */
97#define SCU_SFSP1_0 SCU_SFS(PIN_GROUP1, PIN0)
98#define SCU_SFSP1_1 SCU_SFS(PIN_GROUP1, PIN1)
99#define SCU_SFSP1_2 SCU_SFS(PIN_GROUP1, PIN2)
100#define SCU_SFSP1_3 SCU_SFS(PIN_GROUP1, PIN3)
101#define SCU_SFSP1_4 SCU_SFS(PIN_GROUP1, PIN4)
102#define SCU_SFSP1_5 SCU_SFS(PIN_GROUP1, PIN5)
103#define SCU_SFSP1_6 SCU_SFS(PIN_GROUP1, PIN6)
104#define SCU_SFSP1_7 SCU_SFS(PIN_GROUP1, PIN7)
105#define SCU_SFSP1_8 SCU_SFS(PIN_GROUP1, PIN8)
106#define SCU_SFSP1_9 SCU_SFS(PIN_GROUP1, PIN9)
107#define SCU_SFSP1_10 SCU_SFS(PIN_GROUP1, PIN10)
108#define SCU_SFSP1_11 SCU_SFS(PIN_GROUP1, PIN11)
109#define SCU_SFSP1_12 SCU_SFS(PIN_GROUP1, PIN12)
110#define SCU_SFSP1_13 SCU_SFS(PIN_GROUP1, PIN13)
111#define SCU_SFSP1_14 SCU_SFS(PIN_GROUP1, PIN14)
112#define SCU_SFSP1_15 SCU_SFS(PIN_GROUP1, PIN15)
113#define SCU_SFSP1_16 SCU_SFS(PIN_GROUP1, PIN16)
114#define SCU_SFSP1_17 SCU_SFS(PIN_GROUP1, PIN17)
115#define SCU_SFSP1_18 SCU_SFS(PIN_GROUP1, PIN18)
116#define SCU_SFSP1_19 SCU_SFS(PIN_GROUP1, PIN19)
117#define SCU_SFSP1_20 SCU_SFS(PIN_GROUP1, PIN20)
118
119/* Pins P2_n */
120#define SCU_SFSP2_0 SCU_SFS(PIN_GROUP2, PIN0)
121#define SCU_SFSP2_1 SCU_SFS(PIN_GROUP2, PIN1)
122#define SCU_SFSP2_2 SCU_SFS(PIN_GROUP2, PIN2)
123#define SCU_SFSP2_3 SCU_SFS(PIN_GROUP2, PIN3)
124#define SCU_SFSP2_4 SCU_SFS(PIN_GROUP2, PIN4)
125#define SCU_SFSP2_5 SCU_SFS(PIN_GROUP2, PIN5)
126#define SCU_SFSP2_6 SCU_SFS(PIN_GROUP2, PIN6)
127#define SCU_SFSP2_7 SCU_SFS(PIN_GROUP2, PIN7)
128#define SCU_SFSP2_8 SCU_SFS(PIN_GROUP2, PIN8)
129#define SCU_SFSP2_9 SCU_SFS(PIN_GROUP2, PIN9)
130#define SCU_SFSP2_10 SCU_SFS(PIN_GROUP2, PIN10)
131#define SCU_SFSP2_11 SCU_SFS(PIN_GROUP2, PIN11)
132#define SCU_SFSP2_12 SCU_SFS(PIN_GROUP2, PIN12)
133#define SCU_SFSP2_13 SCU_SFS(PIN_GROUP2, PIN13)
134
135/* Pins P3_n */
136#define SCU_SFSP3_0 SCU_SFS(PIN_GROUP3, PIN0)
137#define SCU_SFSP3_1 SCU_SFS(PIN_GROUP3, PIN1)
138#define SCU_SFSP3_2 SCU_SFS(PIN_GROUP3, PIN2)
139#define SCU_SFSP3_3 SCU_SFS(PIN_GROUP3, PIN3)
140#define SCU_SFSP3_4 SCU_SFS(PIN_GROUP3, PIN4)
141#define SCU_SFSP3_5 SCU_SFS(PIN_GROUP3, PIN5)
142#define SCU_SFSP3_6 SCU_SFS(PIN_GROUP3, PIN6)
143#define SCU_SFSP3_7 SCU_SFS(PIN_GROUP3, PIN7)
144#define SCU_SFSP3_8 SCU_SFS(PIN_GROUP3, PIN8)
145
146/* Pins P4_n */
147#define SCU_SFSP4_0 SCU_SFS(PIN_GROUP4, PIN0)
148#define SCU_SFSP4_1 SCU_SFS(PIN_GROUP4, PIN1)
149#define SCU_SFSP4_2 SCU_SFS(PIN_GROUP4, PIN2)
150#define SCU_SFSP4_3 SCU_SFS(PIN_GROUP4, PIN3)
151#define SCU_SFSP4_4 SCU_SFS(PIN_GROUP4, PIN4)
152#define SCU_SFSP4_5 SCU_SFS(PIN_GROUP4, PIN5)
153#define SCU_SFSP4_6 SCU_SFS(PIN_GROUP4, PIN6)
154#define SCU_SFSP4_7 SCU_SFS(PIN_GROUP4, PIN7)
155#define SCU_SFSP4_8 SCU_SFS(PIN_GROUP4, PIN8)
156#define SCU_SFSP4_9 SCU_SFS(PIN_GROUP4, PIN9)
157#define SCU_SFSP4_10 SCU_SFS(PIN_GROUP4, PIN10)
158
159/* Pins P5_n */
160#define SCU_SFSP5_0 SCU_SFS(PIN_GROUP5, PIN0)
161#define SCU_SFSP5_1 SCU_SFS(PIN_GROUP5, PIN1)
162#define SCU_SFSP5_2 SCU_SFS(PIN_GROUP5, PIN2)
163#define SCU_SFSP5_3 SCU_SFS(PIN_GROUP5, PIN3)
164#define SCU_SFSP5_4 SCU_SFS(PIN_GROUP5, PIN4)
165#define SCU_SFSP5_5 SCU_SFS(PIN_GROUP5, PIN5)
166#define SCU_SFSP5_6 SCU_SFS(PIN_GROUP5, PIN6)
167#define SCU_SFSP5_7 SCU_SFS(PIN_GROUP5, PIN7)
168
169/* Pins P6_n */
170#define SCU_SFSP6_0 SCU_SFS(PIN_GROUP6, PIN0)
171#define SCU_SFSP6_1 SCU_SFS(PIN_GROUP6, PIN1)
172#define SCU_SFSP6_2 SCU_SFS(PIN_GROUP6, PIN2)
173#define SCU_SFSP6_3 SCU_SFS(PIN_GROUP6, PIN3)
174#define SCU_SFSP6_4 SCU_SFS(PIN_GROUP6, PIN4)
175#define SCU_SFSP6_5 SCU_SFS(PIN_GROUP6, PIN5)
176#define SCU_SFSP6_6 SCU_SFS(PIN_GROUP6, PIN6)
177#define SCU_SFSP6_7 SCU_SFS(PIN_GROUP6, PIN7)
178#define SCU_SFSP6_8 SCU_SFS(PIN_GROUP6, PIN8)
179#define SCU_SFSP6_9 SCU_SFS(PIN_GROUP6, PIN9)
180#define SCU_SFSP6_10 SCU_SFS(PIN_GROUP6, PIN10)
181#define SCU_SFSP6_11 SCU_SFS(PIN_GROUP6, PIN11)
182#define SCU_SFSP6_12 SCU_SFS(PIN_GROUP6, PIN12)
183
184/* Pins P7_n */
185#define SCU_SFSP7_0 SCU_SFS(PIN_GROUP7, PIN0)
186#define SCU_SFSP7_1 SCU_SFS(PIN_GROUP7, PIN1)
187#define SCU_SFSP7_2 SCU_SFS(PIN_GROUP7, PIN2)
188#define SCU_SFSP7_3 SCU_SFS(PIN_GROUP7, PIN3)
189#define SCU_SFSP7_4 SCU_SFS(PIN_GROUP7, PIN4)
190#define SCU_SFSP7_5 SCU_SFS(PIN_GROUP7, PIN5)
191#define SCU_SFSP7_6 SCU_SFS(PIN_GROUP7, PIN6)
192#define SCU_SFSP7_7 SCU_SFS(PIN_GROUP7, PIN7)
193
194/* Pins P8_n */
195#define SCU_SFSP8_0 SCU_SFS(PIN_GROUP8, PIN0)
196#define SCU_SFSP8_1 SCU_SFS(PIN_GROUP8, PIN1)
197#define SCU_SFSP8_2 SCU_SFS(PIN_GROUP8, PIN2)
198#define SCU_SFSP8_3 SCU_SFS(PIN_GROUP8, PIN3)
199#define SCU_SFSP8_4 SCU_SFS(PIN_GROUP8, PIN4)
200#define SCU_SFSP8_5 SCU_SFS(PIN_GROUP8, PIN5)
201#define SCU_SFSP8_6 SCU_SFS(PIN_GROUP8, PIN6)
202#define SCU_SFSP8_7 SCU_SFS(PIN_GROUP8, PIN7)
203#define SCU_SFSP8_8 SCU_SFS(PIN_GROUP8, PIN8)
204
205/* Pins P9_n */
206#define SCU_SFSP9_0 SCU_SFS(PIN_GROUP9, PIN0)
207#define SCU_SFSP9_1 SCU_SFS(PIN_GROUP9, PIN1)
208#define SCU_SFSP9_2 SCU_SFS(PIN_GROUP9, PIN2)
209#define SCU_SFSP9_3 SCU_SFS(PIN_GROUP9, PIN3)
210#define SCU_SFSP9_4 SCU_SFS(PIN_GROUP9, PIN4)
211#define SCU_SFSP9_5 SCU_SFS(PIN_GROUP9, PIN5)
212#define SCU_SFSP9_6 SCU_SFS(PIN_GROUP9, PIN6)
213
214/* Pins PA_n */
215#define SCU_SFSPA_0 SCU_SFS(PIN_GROUPA, PIN0)
216#define SCU_SFSPA_1 SCU_SFS(PIN_GROUPA, PIN1)
217#define SCU_SFSPA_2 SCU_SFS(PIN_GROUPA, PIN2)
218#define SCU_SFSPA_3 SCU_SFS(PIN_GROUPA, PIN3)
219#define SCU_SFSPA_4 SCU_SFS(PIN_GROUPA, PIN4)
220
221/* Pins PB_n */
222#define SCU_SFSPB_0 SCU_SFS(PIN_GROUPB, PIN0)
223#define SCU_SFSPB_1 SCU_SFS(PIN_GROUPB, PIN1)
224#define SCU_SFSPB_2 SCU_SFS(PIN_GROUPB, PIN2)
225#define SCU_SFSPB_3 SCU_SFS(PIN_GROUPB, PIN3)
226#define SCU_SFSPB_4 SCU_SFS(PIN_GROUPB, PIN4)
227#define SCU_SFSPB_5 SCU_SFS(PIN_GROUPB, PIN5)
228#define SCU_SFSPB_6 SCU_SFS(PIN_GROUPB, PIN6)
229
230/* Pins PC_n */
231#define SCU_SFSPC_0 SCU_SFS(PIN_GROUPC, PIN0)
232#define SCU_SFSPC_1 SCU_SFS(PIN_GROUPC, PIN1)
233#define SCU_SFSPC_2 SCU_SFS(PIN_GROUPC, PIN2)
234#define SCU_SFSPC_3 SCU_SFS(PIN_GROUPC, PIN3)
235#define SCU_SFSPC_4 SCU_SFS(PIN_GROUPC, PIN4)
236#define SCU_SFSPC_5 SCU_SFS(PIN_GROUPC, PIN5)
237#define SCU_SFSPC_6 SCU_SFS(PIN_GROUPC, PIN6)
238#define SCU_SFSPC_7 SCU_SFS(PIN_GROUPC, PIN7)
239#define SCU_SFSPC_8 SCU_SFS(PIN_GROUPC, PIN8)
240#define SCU_SFSPC_9 SCU_SFS(PIN_GROUPC, PIN9)
241#define SCU_SFSPC_10 SCU_SFS(PIN_GROUPC, PIN10)
242#define SCU_SFSPC_11 SCU_SFS(PIN_GROUPC, PIN11)
243#define SCU_SFSPC_12 SCU_SFS(PIN_GROUPC, PIN12)
244#define SCU_SFSPC_13 SCU_SFS(PIN_GROUPC, PIN13)
245#define SCU_SFSPC_14 SCU_SFS(PIN_GROUPC, PIN14)
246
247/* Pins PD_n */
248#define SCU_SFSPD_0 SCU_SFS(PIN_GROUPD, PIN0)
249#define SCU_SFSPD_1 SCU_SFS(PIN_GROUPD, PIN1)
250#define SCU_SFSPD_2 SCU_SFS(PIN_GROUPD, PIN2)
251#define SCU_SFSPD_3 SCU_SFS(PIN_GROUPD, PIN3)
252#define SCU_SFSPD_4 SCU_SFS(PIN_GROUPD, PIN4)
253#define SCU_SFSPD_5 SCU_SFS(PIN_GROUPD, PIN5)
254#define SCU_SFSPD_6 SCU_SFS(PIN_GROUPD, PIN6)
255#define SCU_SFSPD_7 SCU_SFS(PIN_GROUPD, PIN7)
256#define SCU_SFSPD_8 SCU_SFS(PIN_GROUPD, PIN8)
257#define SCU_SFSPD_9 SCU_SFS(PIN_GROUPD, PIN9)
258#define SCU_SFSPD_10 SCU_SFS(PIN_GROUPD, PIN10)
259#define SCU_SFSPD_11 SCU_SFS(PIN_GROUPD, PIN11)
260#define SCU_SFSPD_12 SCU_SFS(PIN_GROUPD, PIN12)
261#define SCU_SFSPD_13 SCU_SFS(PIN_GROUPD, PIN13)
262#define SCU_SFSPD_14 SCU_SFS(PIN_GROUPD, PIN14)
263#define SCU_SFSPD_15 SCU_SFS(PIN_GROUPD, PIN15)
264#define SCU_SFSPD_16 SCU_SFS(PIN_GROUPD, PIN16)
265
266/* Pins PE_n */
267#define SCU_SFSPE_0 SCU_SFS(PIN_GROUPE, PIN0)
268#define SCU_SFSPE_1 SCU_SFS(PIN_GROUPE, PIN1)
269#define SCU_SFSPE_2 SCU_SFS(PIN_GROUPE, PIN2)
270#define SCU_SFSPE_3 SCU_SFS(PIN_GROUPE, PIN3)
271#define SCU_SFSPE_4 SCU_SFS(PIN_GROUPE, PIN4)
272#define SCU_SFSPE_5 SCU_SFS(PIN_GROUPE, PIN5)
273#define SCU_SFSPE_6 SCU_SFS(PIN_GROUPE, PIN6)
274#define SCU_SFSPE_7 SCU_SFS(PIN_GROUPE, PIN7)
275#define SCU_SFSPE_8 SCU_SFS(PIN_GROUPE, PIN8)
276#define SCU_SFSPE_9 SCU_SFS(PIN_GROUPE, PIN9)
277#define SCU_SFSPE_10 SCU_SFS(PIN_GROUPE, PIN10)
278#define SCU_SFSPE_11 SCU_SFS(PIN_GROUPE, PIN11)
279#define SCU_SFSPE_12 SCU_SFS(PIN_GROUPE, PIN12)
280#define SCU_SFSPE_13 SCU_SFS(PIN_GROUPE, PIN13)
281#define SCU_SFSPE_14 SCU_SFS(PIN_GROUPE, PIN14)
282#define SCU_SFSPE_15 SCU_SFS(PIN_GROUPE, PIN15)
283
284/* Pins PF_n */
285#define SCU_SFSPF_0 SCU_SFS(PIN_GROUPF, PIN0)
286#define SCU_SFSPF_1 SCU_SFS(PIN_GROUPF, PIN1)
287#define SCU_SFSPF_2 SCU_SFS(PIN_GROUPF, PIN2)
288#define SCU_SFSPF_3 SCU_SFS(PIN_GROUPF, PIN3)
289#define SCU_SFSPF_4 SCU_SFS(PIN_GROUPF, PIN4)
290#define SCU_SFSPF_5 SCU_SFS(PIN_GROUPF, PIN5)
291#define SCU_SFSPF_6 SCU_SFS(PIN_GROUPF, PIN6)
292#define SCU_SFSPF_7 SCU_SFS(PIN_GROUPF, PIN7)
293#define SCU_SFSPF_8 SCU_SFS(PIN_GROUPF, PIN8)
294#define SCU_SFSPF_9 SCU_SFS(PIN_GROUPF, PIN9)
295#define SCU_SFSPF_10 SCU_SFS(PIN_GROUPF, PIN10)
296#define SCU_SFSPF_11 SCU_SFS(PIN_GROUPF, PIN11)
297
298/* CLKn pins */
299#define SCU_SFSCLK0 MMIO32(SCU_BASE + 0xC00)
300#define SCU_SFSCLK1 MMIO32(SCU_BASE + 0xC04)
301#define SCU_SFSCLK2 MMIO32(SCU_BASE + 0xC08)
302#define SCU_SFSCLK3 MMIO32(SCU_BASE + 0xC0C)
303
304/* USB1 USB1_DP/USB1_DM pins and I2C-bus open-drain pins */
305#define SCU_SFSUSB MMIO32(SCU_BASE + 0xC80)
306#define SCU_SFSI2C0 MMIO32(SCU_BASE + 0xC84)
307
308/* ADC pin select registers */
309
310/* ADC0 function select register */
311#define SCU_ENAIO0 MMIO32(SCU_BASE + 0xC88)
312
313/* ADC1 function select register */
314#define SCU_ENAIO1 MMIO32(SCU_BASE + 0xC8C)
315
316/* Analog function select register */
317#define SCU_ENAIO2 MMIO32(SCU_BASE + 0xC90)
318
319/* EMC clock delay register */
320#define SCU_EMCDELAYCLK MMIO32(SCU_BASE + 0xD00)
321
322/* Pin interrupt select registers */
323
324/* Pin interrupt select register for pin interrupts 0 to 3 */
325#define SCU_PINTSEL0 MMIO32(SCU_BASE + 0xE00)
326
327/* Pin interrupt select register for pin interrupts 4 to 7 */
328#define SCU_PINTSEL1 MMIO32(SCU_BASE + 0xE04)
329
330/**************************/
331/* SCU I2C0 Configuration */
332/**************************/
333/*
334* Select input glitch filter time constant for the SCL pin.
335* 0 = 50 ns glitch filter.
336* 1 = 3ns glitch filter.
337*/
338#define SCU_SCL_EFP (BIT0)
339
340/* BIT1 Reserved. Always write a 0 to this bit. */
341
342/*
343* Select I2C mode for the SCL pin.
344* 0 = Standard/Fast mode transmit.
345* 1 = Fast-mode Plus transmit.
346*/
347#define SCU_SCL_EHD (BIT2)
348
349/*
350* Enable the input receiver for the SCL pin.
351* Always write a 1 to this bit when using the
352* I2C0.
353* 0 = Disabled.
354* 1 = Enabled.
355*/
356#define SCU_SCL_EZI_EN (BIT3)
357
358/* BIT4-6 Reserved. */
359
360/*
361* Enable or disable input glitch filter for the
362* SCL pin. The filter time constant is
363* determined by bit EFP.
364* 0 = Enable input filter.
365* 1 = Disable input filter.
366*/
367#define SCU_SCL_ZIF_DIS (BIT7)
368
369/*
370* Select input glitch filter time constant for the SDA pin.
371* 0 = 50 ns glitch filter.
372* 1 = 3ns glitch filter.
373*/
374#define SCU_SDA_EFP (BIT8)
375
376/* BIT9 Reserved. Always write a 0 to this bit. */
377
378/*
379* Select I2C mode for the SDA pin.
380* 0 = Standard/Fast mode transmit.
381* 1 = Fast-mode Plus transmit.
382*/
383#define SCU_SDA_EHD (BIT10)
384
385/*
386* Enable the input receiver for the SDA pin.
387* Always write a 1 to this bit when using the
388* I2C0.
389* 0 = Disabled.
390* 1 = Enabled.
391*/
392#define SCU_SDA_EZI_EN (BIT11)
393
394/* BIT 12-14 - Reserved */
395
396/*
397* Enable or disable input glitch filter for the
398* SDA pin. The filter time constant is
399* determined by bit SDA_EFP.
400* 0 = Enable input filter.
401* 1 = Disable input filter.
402*/
403#define SCU_SDA_ZIF_DIS (BIT15)
404
405/* Standard mode for I2C SCL/SDA Standard/Fast mode */
406#define SCU_I2C0_NOMINAL (SCU_SCL_EZI_EN | SCU_SDA_EZI_EN)
407
408/* Standard mode for I2C SCL/SDA Fast-mode Plus transmit */
409#define SCU_I2C0_FAST (SCU_SCL_EFP | SCU_SCL_EHD | SCU_SCL_EZI_EN | \
410 SCU_SCL_ZIF_DIS | SCU_SDA_EFP | SCU_SDA_EHD | \
411 SCU_SDA_EZI_EN)
412
413/*
414* SCU PIN Normal Drive:
415* The configuration registers for normal-drive pins control the following pins:
416* - P0_0 and P0_1
417* - P1_0 to P1_16 and P1_18 to P1_20
418* - P2_0 to P2_2 and P2_6 to P2_13
419* - P3_0 to P3_2 and P3_4 to P3_8
420* - P4_0 to P4_10
421* - P5_0 to P5_7
422* - P6_0 to P6_12
423* - P7_0 to P7_7
424* - P8_3 to P8_8
425* - P9_0 to P9_6
426* - PA_0 and PA_4
427* - PB_0 to PB_6
428* - PC_0 to PC_14
429* - PE_0 to PE_15
430* - PF_0 to PF_11
431*
432* Pin configuration registers for High-Drive pins.
433* The configuration registers for high-drive pins control the following pins:
434* - P1_17
435* - P2_3 to P2_5
436* - P8_0 to P8_2
437* - PA_1 to PA_3
438*
439* Pin configuration registers for High-Speed pins.
440* This register controls the following pins:
441* - P3_3 and pins CLK0 to CLK3.
442*/
443typedef enum {
444 /* Group Port 0 */
447
448 /* Group Port 1 */
466
467 /* P1_17 is High-Drive pin */
469
473
474 /* Group Port 2 */
478
479 /* P2_3 to P2_5 are High-Drive pins */
483
492
493 /* Group Port 3 */
497
498 /* P3_3 is High-Speed pin */
500
506
507 /* Group Port 4 */
519
520 /* Group Port 5 */
529
530 /* Group Port 6 */
544
545 /* Group Port 7 */
554
555 /* Group Port 8 */
556 /* P8_0 to P8_2 are High-Drive pins */
560
567
568 /* Group Port 9 */
576
577 /* Group Port A */
579 /* PA_1 to PA_3 are Normal & High-Drive Pins */
584
585 /* Group Port B */
593
594 /* Group Port C */
610
611 /* Group Port D (seems not configurable through SCU, not defined in
612 * UM10503.pdf Rev.1, keep it here)
613 */
631
632 /* Group Port E */
649
650 /* Group Port F */
663
664 /* Group Clock 0 to 3 High-Speed pins */
665 CLK0 = (SCU_BASE + 0xC00),
666 CLK1 = (SCU_BASE + 0xC04),
667 CLK2 = (SCU_BASE + 0xC08),
668 CLK3 = (SCU_BASE + 0xC0C)
669
671
672/*
673* Pin Configuration to be used for scu_pinmux() parameter scu_conf
674* For normal-drive pins, high-drive pins, high-speed pins
675*/
676/*
677* Function BIT0 to 2.
678* Common to normal-drive pins, high-drive pins, high-speed pins.
679*/
680#define SCU_CONF_FUNCTION0 (0x0)
681#define SCU_CONF_FUNCTION1 (0x1)
682#define SCU_CONF_FUNCTION2 (0x2)
683#define SCU_CONF_FUNCTION3 (0x3)
684#define SCU_CONF_FUNCTION4 (0x4)
685#define SCU_CONF_FUNCTION5 (0x5)
686#define SCU_CONF_FUNCTION6 (0x6)
687#define SCU_CONF_FUNCTION7 (0x7)
688
689/*
690* Enable pull-down resistor at pad
691* By default=0 Disable pull-down.
692* Available to normal-drive pins, high-drive pins, high-speed pins
693*/
694#define SCU_CONF_EPD_EN_PULLDOWN (BIT3)
695
696/*
697* Disable pull-up resistor at pad.
698* By default=0 the pull-up resistor is enabled at reset.
699* Available to normal-drive pins, high-drive pins, high-speed pins
700*/
701#define SCU_CONF_EPUN_DIS_PULLUP (BIT4)
702
703/*
704* Select Slew Rate.
705* By Default=0 Slow.
706* Available to normal-drive and high-speed pins, reserved for high-drive pins.
707*/
708#define SCU_CONF_EHS_FAST (BIT5)
709
710/*
711* Input buffer enable.
712* By Default=0 Disable Input Buffer.
713* The input buffer is disabled by default at reset and must be enabled for
714* receiving(in normal/highspeed-drive) or to transfer data from the I/O buffer
715* to the pad(in high-drive pins).
716* Available to normal-drive pins, high-drive pins, high-speed pins.
717*/
718#define SCU_CONF_EZI_EN_IN_BUFFER (BIT6)
719
720/*
721* Input glitch filter. Disable the input glitch filter for clocking signals
722* higher than 30 MHz.
723* Available to normal-drive pins, high-drive pins, high-speed pins.
724*/
725#define SCU_CONF_ZIF_DIS_IN_GLITCH_FILT (BIT7)
726
727/*
728* Select drive strength. (default=0 Normal-drive: 4 mA drive strength) (BIT8/9).
729* Available to high-drive pins, reserved for others.
730*/
731#define SCU_CONF_EHD_NORMAL_DRIVE_8MILLIA (0x100)
732#define SCU_CONF_EHD_NORMAL_DRIVE_14MILLIA (0x200)
733#define SCU_CONF_EHD_NORMAL_DRIVE_20MILLIA (0x300)
734
735/* BIT10 to 31 are Reserved */
736
737/* Configuration for different I/O pins types */
738#define SCU_EMC_IO (SCU_CONF_EPD_EN_PULLDOWN | \
739 SCU_CONF_EHS_FAST | \
740 SCU_CONF_EZI_EN_IN_BUFFER | \
741 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
742#define SCU_LCD (SCU_CONF_EPUN_DIS_PULLUP | \
743 SCU_CONF_EHS_FAST | \
744 SCU_CONF_EZI_EN_IN_BUFFER | \
745 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
746#define SCU_CLK_IN (SCU_CONF_EPD_EN_PULLDOWN | \
747 SCU_CONF_EHS_FAST | \
748 SCU_CONF_EZI_EN_IN_BUFFER | \
749 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
750#define SCU_CLK_OUT (SCU_CONF_EPD_EN_PULLDOWN | \
751 SCU_CONF_EHS_FAST | \
752 SCU_CONF_EZI_EN_IN_BUFFER | \
753 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
754#define SCU_GPIO_PUP (SCU_CONF_EZI_EN_IN_BUFFER)
755#define SCU_GPIO_PDN (SCU_CONF_EPUN_DIS_PULLUP | \
756 SCU_CONF_EPD_EN_PULLDOWN | \
757 SCU_CONF_EZI_EN_IN_BUFFER)
758#define SCU_GPIO_NOPULL (SCU_CONF_EPUN_DIS_PULLUP | \
759 SCU_CONF_EZI_EN_IN_BUFFER)
760#define SCU_GPIO_FAST (SCU_CONF_EPUN_DIS_PULLUP | \
761 SCU_CONF_EHS_FAST | \
762 SCU_CONF_EZI_EN_IN_BUFFER | \
763 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
764#define SCU_UART_RX_TX (SCU_CONF_EPUN_DIS_PULLUP | \
765 SCU_CONF_EPD_EN_PULLDOWN | \
766 SCU_CONF_EZI_EN_IN_BUFFER)
767#define SCU_SSP_IO (SCU_CONF_EPUN_DIS_PULLUP | \
768 SCU_CONF_EHS_FAST | \
769 SCU_CONF_EZI_EN_IN_BUFFER | \
770 SCU_CONF_ZIF_DIS_IN_GLITCH_FILT)
771
773
774void scu_pinmux(scu_grp_pin_t group_pin, uint32_t scu_conf);
775
777
778/**@}*/
779
780#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
#define PIN12
Definition: scu.h:75
#define PIN_GROUP5
Definition: scu.h:51
void scu_pinmux(scu_grp_pin_t group_pin, uint32_t scu_conf)
#define PIN_GROUPC
Definition: scu.h:58
#define PIN_GROUP3
Definition: scu.h:49
#define PIN_GROUPA
Definition: scu.h:56
#define PIN18
Definition: scu.h:81
#define PIN_GROUP9
Definition: scu.h:55
#define PIN_GROUPD
Definition: scu.h:59
#define PIN_GROUP1
Definition: scu.h:47
#define PIN1
Definition: scu.h:64
#define PIN13
Definition: scu.h:76
#define PIN_GROUPB
Definition: scu.h:57
#define PIN_GROUP4
Definition: scu.h:50
#define PIN_GROUP0
Definition: scu.h:46
#define PIN8
Definition: scu.h:71
#define PIN0
Definition: scu.h:63
#define PIN2
Definition: scu.h:65
#define PIN17
Definition: scu.h:80
#define PIN_GROUP2
Definition: scu.h:48
scu_grp_pin_t
Definition: scu.h:443
#define PIN4
Definition: scu.h:67
#define PIN14
Definition: scu.h:77
#define PIN9
Definition: scu.h:72
#define PIN_GROUPE
Definition: scu.h:60
#define PIN16
Definition: scu.h:79
#define PIN15
Definition: scu.h:78
#define PIN6
Definition: scu.h:69
#define PIN20
Definition: scu.h:83
#define PIN_GROUPF
Definition: scu.h:61
#define PIN_GROUP8
Definition: scu.h:54
#define PIN3
Definition: scu.h:66
#define PIN10
Definition: scu.h:73
#define PIN5
Definition: scu.h:68
#define PIN11
Definition: scu.h:74
#define PIN_GROUP6
Definition: scu.h:52
#define PIN_GROUP7
Definition: scu.h:53
#define PIN7
Definition: scu.h:70
#define PIN19
Definition: scu.h:82
@ P1_9
Definition: scu.h:458
@ P1_10
Definition: scu.h:459
@ P6_5
Definition: scu.h:536
@ PE_0
Definition: scu.h:633
@ PE_12
Definition: scu.h:645
@ PD_4
Definition: scu.h:618
@ P4_6
Definition: scu.h:514
@ PB_4
Definition: scu.h:590
@ PF_5
Definition: scu.h:656
@ PD_13
Definition: scu.h:627
@ PD_8
Definition: scu.h:622
@ P8_1
Definition: scu.h:558
@ P2_9
Definition: scu.h:487
@ P1_16
Definition: scu.h:465
@ P2_2
Definition: scu.h:477
@ P1_2
Definition: scu.h:451
@ PD_1
Definition: scu.h:615
@ PC_14
Definition: scu.h:609
@ PB_0
Definition: scu.h:586
@ P6_8
Definition: scu.h:539
@ PF_9
Definition: scu.h:660
@ PF_2
Definition: scu.h:653
@ P1_6
Definition: scu.h:455
@ PC_9
Definition: scu.h:604
@ P8_8
Definition: scu.h:566
@ P6_9
Definition: scu.h:540
@ P4_2
Definition: scu.h:510
@ P4_5
Definition: scu.h:513
@ P8_0
Definition: scu.h:557
@ P3_5
Definition: scu.h:502
@ P0_0
Definition: scu.h:445
@ P1_4
Definition: scu.h:453
@ P3_4
Definition: scu.h:501
@ PD_10
Definition: scu.h:624
@ P7_3
Definition: scu.h:549
@ P3_0
Definition: scu.h:494
@ P1_14
Definition: scu.h:463
@ PC_4
Definition: scu.h:599
@ P7_2
Definition: scu.h:548
@ P8_2
Definition: scu.h:559
@ PD_3
Definition: scu.h:617
@ P6_2
Definition: scu.h:533
@ P2_1
Definition: scu.h:476
@ PE_4
Definition: scu.h:637
@ PA_0
Definition: scu.h:578
@ PD_11
Definition: scu.h:625
@ P9_2
Definition: scu.h:571
@ PD_12
Definition: scu.h:626
@ PE_2
Definition: scu.h:635
@ P6_1
Definition: scu.h:532
@ P5_4
Definition: scu.h:525
@ CLK3
Definition: scu.h:668
@ P2_5
Definition: scu.h:482
@ P6_4
Definition: scu.h:535
@ P1_11
Definition: scu.h:460
@ PD_14
Definition: scu.h:628
@ PE_9
Definition: scu.h:642
@ P7_4
Definition: scu.h:550
@ P8_6
Definition: scu.h:564
@ P5_2
Definition: scu.h:523
@ PD_5
Definition: scu.h:619
@ PF_0
Definition: scu.h:651
@ CLK1
Definition: scu.h:666
@ P1_7
Definition: scu.h:456
@ PE_11
Definition: scu.h:644
@ P3_7
Definition: scu.h:504
@ P3_3
Definition: scu.h:499
@ P7_0
Definition: scu.h:546
@ P2_10
Definition: scu.h:488
@ P1_15
Definition: scu.h:464
@ PF_3
Definition: scu.h:654
@ PF_7
Definition: scu.h:658
@ P2_7
Definition: scu.h:485
@ PD_0
Definition: scu.h:614
@ P5_6
Definition: scu.h:527
@ P6_7
Definition: scu.h:538
@ P8_5
Definition: scu.h:563
@ P2_8
Definition: scu.h:486
@ P6_0
Definition: scu.h:531
@ PA_1
Definition: scu.h:580
@ PD_2
Definition: scu.h:616
@ P6_6
Definition: scu.h:537
@ P5_1
Definition: scu.h:522
@ P5_0
Definition: scu.h:521
@ PC_5
Definition: scu.h:600
@ P9_3
Definition: scu.h:572
@ PC_3
Definition: scu.h:598
@ PD_7
Definition: scu.h:621
@ P4_8
Definition: scu.h:516
@ PB_6
Definition: scu.h:592
@ P4_3
Definition: scu.h:511
@ PF_11
Definition: scu.h:662
@ PA_4
Definition: scu.h:583
@ CLK0
Definition: scu.h:665
@ P7_6
Definition: scu.h:552
@ P1_18
Definition: scu.h:470
@ PE_7
Definition: scu.h:640
@ PA_2
Definition: scu.h:581
@ PC_6
Definition: scu.h:601
@ P2_11
Definition: scu.h:489
@ P7_7
Definition: scu.h:553
@ P5_5
Definition: scu.h:526
@ PB_2
Definition: scu.h:588
@ P0_1
Definition: scu.h:446
@ P3_8
Definition: scu.h:505
@ PF_8
Definition: scu.h:659
@ P9_1
Definition: scu.h:570
@ PB_1
Definition: scu.h:587
@ PE_3
Definition: scu.h:636
@ P7_1
Definition: scu.h:547
@ P6_12
Definition: scu.h:543
@ PC_13
Definition: scu.h:608
@ P2_4
Definition: scu.h:481
@ P1_0
Definition: scu.h:449
@ PE_1
Definition: scu.h:634
@ PC_11
Definition: scu.h:606
@ P5_7
Definition: scu.h:528
@ PD_6
Definition: scu.h:620
@ P1_13
Definition: scu.h:462
@ P1_1
Definition: scu.h:450
@ P4_10
Definition: scu.h:518
@ P4_9
Definition: scu.h:517
@ P6_3
Definition: scu.h:534
@ P4_0
Definition: scu.h:508
@ P4_1
Definition: scu.h:509
@ PD_9
Definition: scu.h:623
@ PE_8
Definition: scu.h:641
@ CLK2
Definition: scu.h:667
@ P5_3
Definition: scu.h:524
@ P8_3
Definition: scu.h:561
@ P9_0
Definition: scu.h:569
@ P2_12
Definition: scu.h:490
@ PE_5
Definition: scu.h:638
@ PF_1
Definition: scu.h:652
@ PE_13
Definition: scu.h:646
@ P1_3
Definition: scu.h:452
@ PC_7
Definition: scu.h:602
@ PF_6
Definition: scu.h:657
@ P9_6
Definition: scu.h:575
@ P8_7
Definition: scu.h:565
@ P3_2
Definition: scu.h:496
@ PD_16
Definition: scu.h:630
@ PF_4
Definition: scu.h:655
@ PC_8
Definition: scu.h:603
@ P6_11
Definition: scu.h:542
@ PE_6
Definition: scu.h:639
@ P1_17
Definition: scu.h:468
@ P6_10
Definition: scu.h:541
@ P1_12
Definition: scu.h:461
@ PB_5
Definition: scu.h:591
@ P1_5
Definition: scu.h:454
@ PC_1
Definition: scu.h:596
@ P1_19
Definition: scu.h:471
@ P9_4
Definition: scu.h:573
@ PC_10
Definition: scu.h:605
@ PD_15
Definition: scu.h:629
@ PF_10
Definition: scu.h:661
@ PE_10
Definition: scu.h:643
@ P2_3
Definition: scu.h:480
@ PB_3
Definition: scu.h:589
@ PC_2
Definition: scu.h:597
@ P8_4
Definition: scu.h:562
@ P2_13
Definition: scu.h:491
@ P3_1
Definition: scu.h:495
@ PA_3
Definition: scu.h:582
@ P1_20
Definition: scu.h:472
@ P4_7
Definition: scu.h:515
@ PC_0
Definition: scu.h:595
@ P2_0
Definition: scu.h:475
@ PC_12
Definition: scu.h:607
@ PE_14
Definition: scu.h:647
@ P1_8
Definition: scu.h:457
@ P9_5
Definition: scu.h:574
@ P4_4
Definition: scu.h:512
@ P2_6
Definition: scu.h:484
@ P7_5
Definition: scu.h:551
@ PE_15
Definition: scu.h:648
@ P3_6
Definition: scu.h:503
#define SCU_BASE