4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
33 * \author Francesco Sacchi <batt@develer.com>
35 * LPC23xx I/O registers.
41 #include <cfg/compiler.h>
43 /* Vectored Interrupt Controller (VIC) */
44 #define VIC_BASE_ADDR 0xFFFFF000
45 #define VICIRQStatus (*(reg32_t *)(VIC_BASE_ADDR + 0x000))
46 #define VICFIQStatus (*(reg32_t *)(VIC_BASE_ADDR + 0x004))
47 #define VICRawIntr (*(reg32_t *)(VIC_BASE_ADDR + 0x008))
48 #define VICIntSelect (*(reg32_t *)(VIC_BASE_ADDR + 0x00C))
49 #define VICIntEnable (*(reg32_t *)(VIC_BASE_ADDR + 0x010))
50 #define VICIntEnClr (*(reg32_t *)(VIC_BASE_ADDR + 0x014))
51 #define VICSoftInt (*(reg32_t *)(VIC_BASE_ADDR + 0x018))
52 #define VICSoftIntClr (*(reg32_t *)(VIC_BASE_ADDR + 0x01C))
53 #define VICProtection (*(reg32_t *)(VIC_BASE_ADDR + 0x020))
54 #define VICSWPrioMask (*(reg32_t *)(VIC_BASE_ADDR + 0x024))
56 #define VICVectAddr0 (*(reg32_t *)(VIC_BASE_ADDR + 0x100))
57 #define VICVectAddr1 (*(reg32_t *)(VIC_BASE_ADDR + 0x104))
58 #define VICVectAddr2 (*(reg32_t *)(VIC_BASE_ADDR + 0x108))
59 #define VICVectAddr3 (*(reg32_t *)(VIC_BASE_ADDR + 0x10C))
60 #define VICVectAddr4 (*(reg32_t *)(VIC_BASE_ADDR + 0x110))
61 #define VICVectAddr5 (*(reg32_t *)(VIC_BASE_ADDR + 0x114))
62 #define VICVectAddr6 (*(reg32_t *)(VIC_BASE_ADDR + 0x118))
63 #define VICVectAddr7 (*(reg32_t *)(VIC_BASE_ADDR + 0x11C))
64 #define VICVectAddr8 (*(reg32_t *)(VIC_BASE_ADDR + 0x120))
65 #define VICVectAddr9 (*(reg32_t *)(VIC_BASE_ADDR + 0x124))
66 #define VICVectAddr10 (*(reg32_t *)(VIC_BASE_ADDR + 0x128))
67 #define VICVectAddr11 (*(reg32_t *)(VIC_BASE_ADDR + 0x12C))
68 #define VICVectAddr12 (*(reg32_t *)(VIC_BASE_ADDR + 0x130))
69 #define VICVectAddr13 (*(reg32_t *)(VIC_BASE_ADDR + 0x134))
70 #define VICVectAddr14 (*(reg32_t *)(VIC_BASE_ADDR + 0x138))
71 #define VICVectAddr15 (*(reg32_t *)(VIC_BASE_ADDR + 0x13C))
72 #define VICVectAddr16 (*(reg32_t *)(VIC_BASE_ADDR + 0x140))
73 #define VICVectAddr17 (*(reg32_t *)(VIC_BASE_ADDR + 0x144))
74 #define VICVectAddr18 (*(reg32_t *)(VIC_BASE_ADDR + 0x148))
75 #define VICVectAddr19 (*(reg32_t *)(VIC_BASE_ADDR + 0x14C))
76 #define VICVectAddr20 (*(reg32_t *)(VIC_BASE_ADDR + 0x150))
77 #define VICVectAddr21 (*(reg32_t *)(VIC_BASE_ADDR + 0x154))
78 #define VICVectAddr22 (*(reg32_t *)(VIC_BASE_ADDR + 0x158))
79 #define VICVectAddr23 (*(reg32_t *)(VIC_BASE_ADDR + 0x15C))
80 #define VICVectAddr24 (*(reg32_t *)(VIC_BASE_ADDR + 0x160))
81 #define VICVectAddr25 (*(reg32_t *)(VIC_BASE_ADDR + 0x164))
82 #define VICVectAddr26 (*(reg32_t *)(VIC_BASE_ADDR + 0x168))
83 #define VICVectAddr27 (*(reg32_t *)(VIC_BASE_ADDR + 0x16C))
84 #define VICVectAddr28 (*(reg32_t *)(VIC_BASE_ADDR + 0x170))
85 #define VICVectAddr29 (*(reg32_t *)(VIC_BASE_ADDR + 0x174))
86 #define VICVectAddr30 (*(reg32_t *)(VIC_BASE_ADDR + 0x178))
87 #define VICVectAddr31 (*(reg32_t *)(VIC_BASE_ADDR + 0x17C))
89 /* The name convention below is from previous LPC2000 family MCUs, in LPC23xx/24xx,
90 these registers are known as "VICVectPriority(x)". */
91 #define VICVectCntl0 (*(reg32_t *)(VIC_BASE_ADDR + 0x200))
92 #define VICVectCntl1 (*(reg32_t *)(VIC_BASE_ADDR + 0x204))
93 #define VICVectCntl2 (*(reg32_t *)(VIC_BASE_ADDR + 0x208))
94 #define VICVectCntl3 (*(reg32_t *)(VIC_BASE_ADDR + 0x20C))
95 #define VICVectCntl4 (*(reg32_t *)(VIC_BASE_ADDR + 0x210))
96 #define VICVectCntl5 (*(reg32_t *)(VIC_BASE_ADDR + 0x214))
97 #define VICVectCntl6 (*(reg32_t *)(VIC_BASE_ADDR + 0x218))
98 #define VICVectCntl7 (*(reg32_t *)(VIC_BASE_ADDR + 0x21C))
99 #define VICVectCntl8 (*(reg32_t *)(VIC_BASE_ADDR + 0x220))
100 #define VICVectCntl9 (*(reg32_t *)(VIC_BASE_ADDR + 0x224))
101 #define VICVectCntl10 (*(reg32_t *)(VIC_BASE_ADDR + 0x228))
102 #define VICVectCntl11 (*(reg32_t *)(VIC_BASE_ADDR + 0x22C))
103 #define VICVectCntl12 (*(reg32_t *)(VIC_BASE_ADDR + 0x230))
104 #define VICVectCntl13 (*(reg32_t *)(VIC_BASE_ADDR + 0x234))
105 #define VICVectCntl14 (*(reg32_t *)(VIC_BASE_ADDR + 0x238))
106 #define VICVectCntl15 (*(reg32_t *)(VIC_BASE_ADDR + 0x23C))
107 #define VICVectCntl16 (*(reg32_t *)(VIC_BASE_ADDR + 0x240))
108 #define VICVectCntl17 (*(reg32_t *)(VIC_BASE_ADDR + 0x244))
109 #define VICVectCntl18 (*(reg32_t *)(VIC_BASE_ADDR + 0x248))
110 #define VICVectCntl19 (*(reg32_t *)(VIC_BASE_ADDR + 0x24C))
111 #define VICVectCntl20 (*(reg32_t *)(VIC_BASE_ADDR + 0x250))
112 #define VICVectCntl21 (*(reg32_t *)(VIC_BASE_ADDR + 0x254))
113 #define VICVectCntl22 (*(reg32_t *)(VIC_BASE_ADDR + 0x258))
114 #define VICVectCntl23 (*(reg32_t *)(VIC_BASE_ADDR + 0x25C))
115 #define VICVectCntl24 (*(reg32_t *)(VIC_BASE_ADDR + 0x260))
116 #define VICVectCntl25 (*(reg32_t *)(VIC_BASE_ADDR + 0x264))
117 #define VICVectCntl26 (*(reg32_t *)(VIC_BASE_ADDR + 0x268))
118 #define VICVectCntl27 (*(reg32_t *)(VIC_BASE_ADDR + 0x26C))
119 #define VICVectCntl28 (*(reg32_t *)(VIC_BASE_ADDR + 0x270))
120 #define VICVectCntl29 (*(reg32_t *)(VIC_BASE_ADDR + 0x274))
121 #define VICVectCntl30 (*(reg32_t *)(VIC_BASE_ADDR + 0x278))
122 #define VICVectCntl31 (*(reg32_t *)(VIC_BASE_ADDR + 0x27C))
124 #define VICVectAddr (*(reg32_t *)(VIC_BASE_ADDR + 0xF00))
127 /* Pin Connect Block */
128 #define PINSEL_BASE_ADDR 0xE002C000
129 #define PINSEL0 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x00))
130 #define PINSEL1 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x04))
131 #define PINSEL2 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x08))
132 #define PINSEL3 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x0C))
133 #define PINSEL4 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x10))
134 #define PINSEL5 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x14))
135 #define PINSEL6 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x18))
136 #define PINSEL7 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x1C))
137 #define PINSEL8 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x20))
138 #define PINSEL9 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x24))
139 #define PINSEL10 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x28))
141 #define PINMODE0 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x40))
142 #define PINMODE1 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x44))
143 #define PINMODE2 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x48))
144 #define PINMODE3 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x4C))
145 #define PINMODE4 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x50))
146 #define PINMODE5 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x54))
147 #define PINMODE6 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x58))
148 #define PINMODE7 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x5C))
149 #define PINMODE8 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x60))
150 #define PINMODE9 (*(reg32_t *)(PINSEL_BASE_ADDR + 0x64))
152 /* General Purpose Input/Output (GPIO) */
153 #define GPIO_BASE_ADDR 0xE0028000
154 #define IOPIN0 (*(reg32_t *)(GPIO_BASE_ADDR + 0x00))
155 #define IOSET0 (*(reg32_t *)(GPIO_BASE_ADDR + 0x04))
156 #define IODIR0 (*(reg32_t *)(GPIO_BASE_ADDR + 0x08))
157 #define IOCLR0 (*(reg32_t *)(GPIO_BASE_ADDR + 0x0C))
158 #define IOPIN1 (*(reg32_t *)(GPIO_BASE_ADDR + 0x10))
159 #define IOSET1 (*(reg32_t *)(GPIO_BASE_ADDR + 0x14))
160 #define IODIR1 (*(reg32_t *)(GPIO_BASE_ADDR + 0x18))
161 #define IOCLR1 (*(reg32_t *)(GPIO_BASE_ADDR + 0x1C))
163 /* GPIO Interrupt Registers */
164 #define IO0_INT_EN_R (*(reg32_t *)(GPIO_BASE_ADDR + 0x90))
165 #define IO0_INT_EN_F (*(reg32_t *)(GPIO_BASE_ADDR + 0x94))
166 #define IO0_INT_STAT_R (*(reg32_t *)(GPIO_BASE_ADDR + 0x84))
167 #define IO0_INT_STAT_F (*(reg32_t *)(GPIO_BASE_ADDR + 0x88))
168 #define IO0_INT_CLR (*(reg32_t *)(GPIO_BASE_ADDR + 0x8C))
170 #define IO2_INT_EN_R (*(reg32_t *)(GPIO_BASE_ADDR + 0xB0))
171 #define IO2_INT_EN_F (*(reg32_t *)(GPIO_BASE_ADDR + 0xB4))
172 #define IO2_INT_STAT_R (*(reg32_t *)(GPIO_BASE_ADDR + 0xA4))
173 #define IO2_INT_STAT_F (*(reg32_t *)(GPIO_BASE_ADDR + 0xA8))
174 #define IO2_INT_CLR (*(reg32_t *)(GPIO_BASE_ADDR + 0xAC))
176 #define IO_INT_STAT (*(reg32_t *)(GPIO_BASE_ADDR + 0x80))
178 #define PARTCFG_BASE_ADDR 0x3FFF8000
179 #define PARTCFG (*(reg32_t *)(PARTCFG_BASE_ADDR + 0x00))
182 #define FIO_BASE_ADDR 0x3FFFC000
183 #define FIO0DIR (*(reg32_t *)(FIO_BASE_ADDR + 0x00))
184 #define FIO0MASK (*(reg32_t *)(FIO_BASE_ADDR + 0x10))
185 #define FIO0PIN (*(reg32_t *)(FIO_BASE_ADDR + 0x14))
186 #define FIO0SET (*(reg32_t *)(FIO_BASE_ADDR + 0x18))
187 #define FIO0CLR (*(reg32_t *)(FIO_BASE_ADDR + 0x1C))
189 #define FIO1DIR (*(reg32_t *)(FIO_BASE_ADDR + 0x20))
190 #define FIO1MASK (*(reg32_t *)(FIO_BASE_ADDR + 0x30))
191 #define FIO1PIN (*(reg32_t *)(FIO_BASE_ADDR + 0x34))
192 #define FIO1SET (*(reg32_t *)(FIO_BASE_ADDR + 0x38))
193 #define FIO1CLR (*(reg32_t *)(FIO_BASE_ADDR + 0x3C))
195 #define FIO2DIR (*(reg32_t *)(FIO_BASE_ADDR + 0x40))
196 #define FIO2MASK (*(reg32_t *)(FIO_BASE_ADDR + 0x50))
197 #define FIO2PIN (*(reg32_t *)(FIO_BASE_ADDR + 0x54))
198 #define FIO2SET (*(reg32_t *)(FIO_BASE_ADDR + 0x58))
199 #define FIO2CLR (*(reg32_t *)(FIO_BASE_ADDR + 0x5C))
201 #define FIO3DIR (*(reg32_t *)(FIO_BASE_ADDR + 0x60))
202 #define FIO3MASK (*(reg32_t *)(FIO_BASE_ADDR + 0x70))
203 #define FIO3PIN (*(reg32_t *)(FIO_BASE_ADDR + 0x74))
204 #define FIO3SET (*(reg32_t *)(FIO_BASE_ADDR + 0x78))
205 #define FIO3CLR (*(reg32_t *)(FIO_BASE_ADDR + 0x7C))
207 #define FIO4DIR (*(reg32_t *)(FIO_BASE_ADDR + 0x80))
208 #define FIO4MASK (*(reg32_t *)(FIO_BASE_ADDR + 0x90))
209 #define FIO4PIN (*(reg32_t *)(FIO_BASE_ADDR + 0x94))
210 #define FIO4SET (*(reg32_t *)(FIO_BASE_ADDR + 0x98))
211 #define FIO4CLR (*(reg32_t *)(FIO_BASE_ADDR + 0x9C))
213 /* FIOs can be accessed through WORD, HALF-WORD or BYTE. */
214 #define FIO0DIR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x00))
215 #define FIO1DIR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x20))
216 #define FIO2DIR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x40))
217 #define FIO3DIR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x60))
218 #define FIO4DIR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x80))
220 #define FIO0DIR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x01))
221 #define FIO1DIR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x21))
222 #define FIO2DIR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x41))
223 #define FIO3DIR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x61))
224 #define FIO4DIR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x81))
226 #define FIO0DIR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x02))
227 #define FIO1DIR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x22))
228 #define FIO2DIR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x42))
229 #define FIO3DIR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x62))
230 #define FIO4DIR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x82))
232 #define FIO0DIR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x03))
233 #define FIO1DIR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x23))
234 #define FIO2DIR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x43))
235 #define FIO3DIR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x63))
236 #define FIO4DIR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x83))
238 #define FIO0DIRL (*(reg16_t *)(FIO_BASE_ADDR + 0x00))
239 #define FIO1DIRL (*(reg16_t *)(FIO_BASE_ADDR + 0x20))
240 #define FIO2DIRL (*(reg16_t *)(FIO_BASE_ADDR + 0x40))
241 #define FIO3DIRL (*(reg16_t *)(FIO_BASE_ADDR + 0x60))
242 #define FIO4DIRL (*(reg16_t *)(FIO_BASE_ADDR + 0x80))
244 #define FIO0DIRU (*(reg16_t *)(FIO_BASE_ADDR + 0x02))
245 #define FIO1DIRU (*(reg16_t *)(FIO_BASE_ADDR + 0x22))
246 #define FIO2DIRU (*(reg16_t *)(FIO_BASE_ADDR + 0x42))
247 #define FIO3DIRU (*(reg16_t *)(FIO_BASE_ADDR + 0x62))
248 #define FIO4DIRU (*(reg16_t *)(FIO_BASE_ADDR + 0x82))
250 #define FIO0MASK0 (*(reg8_t *)(FIO_BASE_ADDR + 0x10))
251 #define FIO1MASK0 (*(reg8_t *)(FIO_BASE_ADDR + 0x30))
252 #define FIO2MASK0 (*(reg8_t *)(FIO_BASE_ADDR + 0x50))
253 #define FIO3MASK0 (*(reg8_t *)(FIO_BASE_ADDR + 0x70))
254 #define FIO4MASK0 (*(reg8_t *)(FIO_BASE_ADDR + 0x90))
256 #define FIO0MASK1 (*(reg8_t *)(FIO_BASE_ADDR + 0x11))
257 #define FIO1MASK1 (*(reg8_t *)(FIO_BASE_ADDR + 0x21))
258 #define FIO2MASK1 (*(reg8_t *)(FIO_BASE_ADDR + 0x51))
259 #define FIO3MASK1 (*(reg8_t *)(FIO_BASE_ADDR + 0x71))
260 #define FIO4MASK1 (*(reg8_t *)(FIO_BASE_ADDR + 0x91))
262 #define FIO0MASK2 (*(reg8_t *)(FIO_BASE_ADDR + 0x12))
263 #define FIO1MASK2 (*(reg8_t *)(FIO_BASE_ADDR + 0x32))
264 #define FIO2MASK2 (*(reg8_t *)(FIO_BASE_ADDR + 0x52))
265 #define FIO3MASK2 (*(reg8_t *)(FIO_BASE_ADDR + 0x72))
266 #define FIO4MASK2 (*(reg8_t *)(FIO_BASE_ADDR + 0x92))
268 #define FIO0MASK3 (*(reg8_t *)(FIO_BASE_ADDR + 0x13))
269 #define FIO1MASK3 (*(reg8_t *)(FIO_BASE_ADDR + 0x33))
270 #define FIO2MASK3 (*(reg8_t *)(FIO_BASE_ADDR + 0x53))
271 #define FIO3MASK3 (*(reg8_t *)(FIO_BASE_ADDR + 0x73))
272 #define FIO4MASK3 (*(reg8_t *)(FIO_BASE_ADDR + 0x93))
274 #define FIO0MASKL (*(reg16_t *)(FIO_BASE_ADDR + 0x10))
275 #define FIO1MASKL (*(reg16_t *)(FIO_BASE_ADDR + 0x30))
276 #define FIO2MASKL (*(reg16_t *)(FIO_BASE_ADDR + 0x50))
277 #define FIO3MASKL (*(reg16_t *)(FIO_BASE_ADDR + 0x70))
278 #define FIO4MASKL (*(reg16_t *)(FIO_BASE_ADDR + 0x90))
280 #define FIO0MASKU (*(reg16_t *)(FIO_BASE_ADDR + 0x12))
281 #define FIO1MASKU (*(reg16_t *)(FIO_BASE_ADDR + 0x32))
282 #define FIO2MASKU (*(reg16_t *)(FIO_BASE_ADDR + 0x52))
283 #define FIO3MASKU (*(reg16_t *)(FIO_BASE_ADDR + 0x72))
284 #define FIO4MASKU (*(reg16_t *)(FIO_BASE_ADDR + 0x92))
286 #define FIO0PIN0 (*(reg8_t *)(FIO_BASE_ADDR + 0x14))
287 #define FIO1PIN0 (*(reg8_t *)(FIO_BASE_ADDR + 0x34))
288 #define FIO2PIN0 (*(reg8_t *)(FIO_BASE_ADDR + 0x54))
289 #define FIO3PIN0 (*(reg8_t *)(FIO_BASE_ADDR + 0x74))
290 #define FIO4PIN0 (*(reg8_t *)(FIO_BASE_ADDR + 0x94))
292 #define FIO0PIN1 (*(reg8_t *)(FIO_BASE_ADDR + 0x15))
293 #define FIO1PIN1 (*(reg8_t *)(FIO_BASE_ADDR + 0x25))
294 #define FIO2PIN1 (*(reg8_t *)(FIO_BASE_ADDR + 0x55))
295 #define FIO3PIN1 (*(reg8_t *)(FIO_BASE_ADDR + 0x75))
296 #define FIO4PIN1 (*(reg8_t *)(FIO_BASE_ADDR + 0x95))
298 #define FIO0PIN2 (*(reg8_t *)(FIO_BASE_ADDR + 0x16))
299 #define FIO1PIN2 (*(reg8_t *)(FIO_BASE_ADDR + 0x36))
300 #define FIO2PIN2 (*(reg8_t *)(FIO_BASE_ADDR + 0x56))
301 #define FIO3PIN2 (*(reg8_t *)(FIO_BASE_ADDR + 0x76))
302 #define FIO4PIN2 (*(reg8_t *)(FIO_BASE_ADDR + 0x96))
304 #define FIO0PIN3 (*(reg8_t *)(FIO_BASE_ADDR + 0x17))
305 #define FIO1PIN3 (*(reg8_t *)(FIO_BASE_ADDR + 0x37))
306 #define FIO2PIN3 (*(reg8_t *)(FIO_BASE_ADDR + 0x57))
307 #define FIO3PIN3 (*(reg8_t *)(FIO_BASE_ADDR + 0x77))
308 #define FIO4PIN3 (*(reg8_t *)(FIO_BASE_ADDR + 0x97))
310 #define FIO0PINL (*(reg16_t *)(FIO_BASE_ADDR + 0x14))
311 #define FIO1PINL (*(reg16_t *)(FIO_BASE_ADDR + 0x34))
312 #define FIO2PINL (*(reg16_t *)(FIO_BASE_ADDR + 0x54))
313 #define FIO3PINL (*(reg16_t *)(FIO_BASE_ADDR + 0x74))
314 #define FIO4PINL (*(reg16_t *)(FIO_BASE_ADDR + 0x94))
316 #define FIO0PINU (*(reg16_t *)(FIO_BASE_ADDR + 0x16))
317 #define FIO1PINU (*(reg16_t *)(FIO_BASE_ADDR + 0x36))
318 #define FIO2PINU (*(reg16_t *)(FIO_BASE_ADDR + 0x56))
319 #define FIO3PINU (*(reg16_t *)(FIO_BASE_ADDR + 0x76))
320 #define FIO4PINU (*(reg16_t *)(FIO_BASE_ADDR + 0x96))
322 #define FIO0SET0 (*(reg8_t *)(FIO_BASE_ADDR + 0x18))
323 #define FIO1SET0 (*(reg8_t *)(FIO_BASE_ADDR + 0x38))
324 #define FIO2SET0 (*(reg8_t *)(FIO_BASE_ADDR + 0x58))
325 #define FIO3SET0 (*(reg8_t *)(FIO_BASE_ADDR + 0x78))
326 #define FIO4SET0 (*(reg8_t *)(FIO_BASE_ADDR + 0x98))
328 #define FIO0SET1 (*(reg8_t *)(FIO_BASE_ADDR + 0x19))
329 #define FIO1SET1 (*(reg8_t *)(FIO_BASE_ADDR + 0x29))
330 #define FIO2SET1 (*(reg8_t *)(FIO_BASE_ADDR + 0x59))
331 #define FIO3SET1 (*(reg8_t *)(FIO_BASE_ADDR + 0x79))
332 #define FIO4SET1 (*(reg8_t *)(FIO_BASE_ADDR + 0x99))
334 #define FIO0SET2 (*(reg8_t *)(FIO_BASE_ADDR + 0x1A))
335 #define FIO1SET2 (*(reg8_t *)(FIO_BASE_ADDR + 0x3A))
336 #define FIO2SET2 (*(reg8_t *)(FIO_BASE_ADDR + 0x5A))
337 #define FIO3SET2 (*(reg8_t *)(FIO_BASE_ADDR + 0x7A))
338 #define FIO4SET2 (*(reg8_t *)(FIO_BASE_ADDR + 0x9A))
340 #define FIO0SET3 (*(reg8_t *)(FIO_BASE_ADDR + 0x1B))
341 #define FIO1SET3 (*(reg8_t *)(FIO_BASE_ADDR + 0x3B))
342 #define FIO2SET3 (*(reg8_t *)(FIO_BASE_ADDR + 0x5B))
343 #define FIO3SET3 (*(reg8_t *)(FIO_BASE_ADDR + 0x7B))
344 #define FIO4SET3 (*(reg8_t *)(FIO_BASE_ADDR + 0x9B))
346 #define FIO0SETL (*(reg16_t *)(FIO_BASE_ADDR + 0x18))
347 #define FIO1SETL (*(reg16_t *)(FIO_BASE_ADDR + 0x38))
348 #define FIO2SETL (*(reg16_t *)(FIO_BASE_ADDR + 0x58))
349 #define FIO3SETL (*(reg16_t *)(FIO_BASE_ADDR + 0x78))
350 #define FIO4SETL (*(reg16_t *)(FIO_BASE_ADDR + 0x98))
352 #define FIO0SETU (*(reg16_t *)(FIO_BASE_ADDR + 0x1A))
353 #define FIO1SETU (*(reg16_t *)(FIO_BASE_ADDR + 0x3A))
354 #define FIO2SETU (*(reg16_t *)(FIO_BASE_ADDR + 0x5A))
355 #define FIO3SETU (*(reg16_t *)(FIO_BASE_ADDR + 0x7A))
356 #define FIO4SETU (*(reg16_t *)(FIO_BASE_ADDR + 0x9A))
358 #define FIO0CLR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x1C))
359 #define FIO1CLR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x3C))
360 #define FIO2CLR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x5C))
361 #define FIO3CLR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x7C))
362 #define FIO4CLR0 (*(reg8_t *)(FIO_BASE_ADDR + 0x9C))
364 #define FIO0CLR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x1D))
365 #define FIO1CLR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x2D))
366 #define FIO2CLR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x5D))
367 #define FIO3CLR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x7D))
368 #define FIO4CLR1 (*(reg8_t *)(FIO_BASE_ADDR + 0x9D))
370 #define FIO0CLR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x1E))
371 #define FIO1CLR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x3E))
372 #define FIO2CLR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x5E))
373 #define FIO3CLR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x7E))
374 #define FIO4CLR2 (*(reg8_t *)(FIO_BASE_ADDR + 0x9E))
376 #define FIO0CLR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x1F))
377 #define FIO1CLR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x3F))
378 #define FIO2CLR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x5F))
379 #define FIO3CLR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x7F))
380 #define FIO4CLR3 (*(reg8_t *)(FIO_BASE_ADDR + 0x9F))
382 #define FIO0CLRL (*(reg16_t *)(FIO_BASE_ADDR + 0x1C))
383 #define FIO1CLRL (*(reg16_t *)(FIO_BASE_ADDR + 0x3C))
384 #define FIO2CLRL (*(reg16_t *)(FIO_BASE_ADDR + 0x5C))
385 #define FIO3CLRL (*(reg16_t *)(FIO_BASE_ADDR + 0x7C))
386 #define FIO4CLRL (*(reg16_t *)(FIO_BASE_ADDR + 0x9C))
388 #define FIO0CLRU (*(reg16_t *)(FIO_BASE_ADDR + 0x1E))
389 #define FIO1CLRU (*(reg16_t *)(FIO_BASE_ADDR + 0x3E))
390 #define FIO2CLRU (*(reg16_t *)(FIO_BASE_ADDR + 0x5E))
391 #define FIO3CLRU (*(reg16_t *)(FIO_BASE_ADDR + 0x7E))
392 #define FIO4CLRU (*(reg16_t *)(FIO_BASE_ADDR + 0x9E))
395 /* System Control Block(SCB) modules include Memory Accelerator Module,
396 Phase Locked Loop, VPB divider, Power Control, External Interrupt,
397 Reset, and Code Security/Debugging */
398 #define SCB_BASE_ADDR 0xE01FC000
400 /* Memory Accelerator Module (MAM) */
401 #define MAMCR (*(reg32_t *)(SCB_BASE_ADDR + 0x000))
402 #define MAMTIM (*(reg32_t *)(SCB_BASE_ADDR + 0x004))
403 #define MEMMAP (*(reg32_t *)(SCB_BASE_ADDR + 0x040))
405 /* Phase Locked Loop (PLL) */
406 #define PLLCON (*(reg32_t *)(SCB_BASE_ADDR + 0x080))
407 #define PLLCFG (*(reg32_t *)(SCB_BASE_ADDR + 0x084))
408 #define PLLSTAT (*(reg32_t *)(SCB_BASE_ADDR + 0x088))
409 #define PLLFEED (*(reg32_t *)(SCB_BASE_ADDR + 0x08C))
412 #define PCON (*(reg32_t *)(SCB_BASE_ADDR + 0x0C0))
413 #define PCONP (*(reg32_t *)(SCB_BASE_ADDR + 0x0C4))
414 #define PCONP_PCI2C0 7
415 #define PCONP_PCI2C1 19
416 #define PCONP_PCI2C2 26
420 // #define APBDIV (*(reg32_t *)(SCB_BASE_ADDR + 0x100))
421 #define CCLKCFG (*(reg32_t *)(SCB_BASE_ADDR + 0x104))
422 #define USBCLKCFG (*(reg32_t *)(SCB_BASE_ADDR + 0x108))
423 #define CLKSRCSEL (*(reg32_t *)(SCB_BASE_ADDR + 0x10C))
424 #define PCLKSEL0 (*(reg32_t *)(SCB_BASE_ADDR + 0x1A8))
425 #define PCLKSEL1 (*(reg32_t *)(SCB_BASE_ADDR + 0x1AC))
427 /* External Interrupts */
428 #define EXTINT (*(reg32_t *)(SCB_BASE_ADDR + 0x140))
429 #define INTWAKE (*(reg32_t *)(SCB_BASE_ADDR + 0x144))
430 #define EXTMODE (*(reg32_t *)(SCB_BASE_ADDR + 0x148))
431 #define EXTPOLAR (*(reg32_t *)(SCB_BASE_ADDR + 0x14C))
433 /* Reset, reset source identification */
434 #define RSIR (*(reg32_t *)(SCB_BASE_ADDR + 0x180))
436 /* RSID, code security protection */
437 #define CSPR (*(reg32_t *)(SCB_BASE_ADDR + 0x184))
439 /* AHB configuration */
440 #define AHBCFG1 (*(reg32_t *)(SCB_BASE_ADDR + 0x188))
441 #define AHBCFG2 (*(reg32_t *)(SCB_BASE_ADDR + 0x18C))
443 /* System Controls and Status */
444 #define SCS (*(reg32_t *)(SCB_BASE_ADDR + 0x1A0))
446 /* MPMC(EMC) registers, note: all the external memory controller(EMC) registers
447 are for LPC24xx only. */
448 #define STATIC_MEM0_BASE 0x80000000
449 #define STATIC_MEM1_BASE 0x81000000
450 #define STATIC_MEM2_BASE 0x82000000
451 #define STATIC_MEM3_BASE 0x83000000
453 #define DYNAMIC_MEM0_BASE 0xA0000000
454 #define DYNAMIC_MEM1_BASE 0xB0000000
455 #define DYNAMIC_MEM2_BASE 0xC0000000
456 #define DYNAMIC_MEM3_BASE 0xD0000000
458 /* External Memory Controller (EMC) */
459 #define EMC_BASE_ADDR 0xFFE08000
460 #define EMC_CTRL (*(reg32_t *)(EMC_BASE_ADDR + 0x000))
461 #define EMC_STAT (*(reg32_t *)(EMC_BASE_ADDR + 0x004))
462 #define EMC_CONFIG (*(reg32_t *)(EMC_BASE_ADDR + 0x008))
464 /* Dynamic RAM access registers */
465 #define EMC_DYN_CTRL (*(reg32_t *)(EMC_BASE_ADDR + 0x020))
466 #define EMC_DYN_RFSH (*(reg32_t *)(EMC_BASE_ADDR + 0x024))
467 #define EMC_DYN_RD_CFG (*(reg32_t *)(EMC_BASE_ADDR + 0x028))
468 #define EMC_DYN_RP (*(reg32_t *)(EMC_BASE_ADDR + 0x030))
469 #define EMC_DYN_RAS (*(reg32_t *)(EMC_BASE_ADDR + 0x034))
470 #define EMC_DYN_SREX (*(reg32_t *)(EMC_BASE_ADDR + 0x038))
471 #define EMC_DYN_APR (*(reg32_t *)(EMC_BASE_ADDR + 0x03C))
472 #define EMC_DYN_DAL (*(reg32_t *)(EMC_BASE_ADDR + 0x040))
473 #define EMC_DYN_WR (*(reg32_t *)(EMC_BASE_ADDR + 0x044))
474 #define EMC_DYN_RC (*(reg32_t *)(EMC_BASE_ADDR + 0x048))
475 #define EMC_DYN_RFC (*(reg32_t *)(EMC_BASE_ADDR + 0x04C))
476 #define EMC_DYN_XSR (*(reg32_t *)(EMC_BASE_ADDR + 0x050))
477 #define EMC_DYN_RRD (*(reg32_t *)(EMC_BASE_ADDR + 0x054))
478 #define EMC_DYN_MRD (*(reg32_t *)(EMC_BASE_ADDR + 0x058))
480 #define EMC_DYN_CFG0 (*(reg32_t *)(EMC_BASE_ADDR + 0x100))
481 #define EMC_DYN_RASCAS0 (*(reg32_t *)(EMC_BASE_ADDR + 0x104))
482 #define EMC_DYN_CFG1 (*(reg32_t *)(EMC_BASE_ADDR + 0x140))
483 #define EMC_DYN_RASCAS1 (*(reg32_t *)(EMC_BASE_ADDR + 0x144))
484 #define EMC_DYN_CFG2 (*(reg32_t *)(EMC_BASE_ADDR + 0x160))
485 #define EMC_DYN_RASCAS2 (*(reg32_t *)(EMC_BASE_ADDR + 0x164))
486 #define EMC_DYN_CFG3 (*(reg32_t *)(EMC_BASE_ADDR + 0x180))
487 #define EMC_DYN_RASCAS3 (*(reg32_t *)(EMC_BASE_ADDR + 0x184))
489 /* static RAM access registers */
490 #define EMC_STA_CFG0 (*(reg32_t *)(EMC_BASE_ADDR + 0x200))
491 #define EMC_STA_WAITWEN0 (*(reg32_t *)(EMC_BASE_ADDR + 0x204))
492 #define EMC_STA_WAITOEN0 (*(reg32_t *)(EMC_BASE_ADDR + 0x208))
493 #define EMC_STA_WAITRD0 (*(reg32_t *)(EMC_BASE_ADDR + 0x20C))
494 #define EMC_STA_WAITPAGE0 (*(reg32_t *)(EMC_BASE_ADDR + 0x210))
495 #define EMC_STA_WAITWR0 (*(reg32_t *)(EMC_BASE_ADDR + 0x214))
496 #define EMC_STA_WAITTURN0 (*(reg32_t *)(EMC_BASE_ADDR + 0x218))
498 #define EMC_STA_CFG1 (*(reg32_t *)(EMC_BASE_ADDR + 0x220))
499 #define EMC_STA_WAITWEN1 (*(reg32_t *)(EMC_BASE_ADDR + 0x224))
500 #define EMC_STA_WAITOEN1 (*(reg32_t *)(EMC_BASE_ADDR + 0x228))
501 #define EMC_STA_WAITRD1 (*(reg32_t *)(EMC_BASE_ADDR + 0x22C))
502 #define EMC_STA_WAITPAGE1 (*(reg32_t *)(EMC_BASE_ADDR + 0x230))
503 #define EMC_STA_WAITWR1 (*(reg32_t *)(EMC_BASE_ADDR + 0x234))
504 #define EMC_STA_WAITTURN1 (*(reg32_t *)(EMC_BASE_ADDR + 0x238))
506 #define EMC_STA_CFG2 (*(reg32_t *)(EMC_BASE_ADDR + 0x240))
507 #define EMC_STA_WAITWEN2 (*(reg32_t *)(EMC_BASE_ADDR + 0x244))
508 #define EMC_STA_WAITOEN2 (*(reg32_t *)(EMC_BASE_ADDR + 0x248))
509 #define EMC_STA_WAITRD2 (*(reg32_t *)(EMC_BASE_ADDR + 0x24C))
510 #define EMC_STA_WAITPAGE2 (*(reg32_t *)(EMC_BASE_ADDR + 0x250))
511 #define EMC_STA_WAITWR2 (*(reg32_t *)(EMC_BASE_ADDR + 0x254))
512 #define EMC_STA_WAITTURN2 (*(reg32_t *)(EMC_BASE_ADDR + 0x258))
514 #define EMC_STA_CFG3 (*(reg32_t *)(EMC_BASE_ADDR + 0x260))
515 #define EMC_STA_WAITWEN3 (*(reg32_t *)(EMC_BASE_ADDR + 0x264))
516 #define EMC_STA_WAITOEN3 (*(reg32_t *)(EMC_BASE_ADDR + 0x268))
517 #define EMC_STA_WAITRD3 (*(reg32_t *)(EMC_BASE_ADDR + 0x26C))
518 #define EMC_STA_WAITPAGE3 (*(reg32_t *)(EMC_BASE_ADDR + 0x270))
519 #define EMC_STA_WAITWR3 (*(reg32_t *)(EMC_BASE_ADDR + 0x274))
520 #define EMC_STA_WAITTURN3 (*(reg32_t *)(EMC_BASE_ADDR + 0x278))
522 #define EMC_STA_EXT_WAIT (*(reg32_t *)(EMC_BASE_ADDR + 0x880))
526 #define TMR0_BASE_ADDR 0xE0004000
527 #define T0IR (*(reg32_t *)(TMR0_BASE_ADDR + 0x00))
528 #define T0TCR (*(reg32_t *)(TMR0_BASE_ADDR + 0x04))
529 #define T0TC (*(reg32_t *)(TMR0_BASE_ADDR + 0x08))
530 #define T0PR (*(reg32_t *)(TMR0_BASE_ADDR + 0x0C))
531 #define T0PC (*(reg32_t *)(TMR0_BASE_ADDR + 0x10))
532 #define T0MCR (*(reg32_t *)(TMR0_BASE_ADDR + 0x14))
533 #define T0MR0 (*(reg32_t *)(TMR0_BASE_ADDR + 0x18))
534 #define T0MR1 (*(reg32_t *)(TMR0_BASE_ADDR + 0x1C))
535 #define T0MR2 (*(reg32_t *)(TMR0_BASE_ADDR + 0x20))
536 #define T0MR3 (*(reg32_t *)(TMR0_BASE_ADDR + 0x24))
537 #define T0CCR (*(reg32_t *)(TMR0_BASE_ADDR + 0x28))
538 #define T0CR0 (*(reg32_t *)(TMR0_BASE_ADDR + 0x2C))
539 #define T0CR1 (*(reg32_t *)(TMR0_BASE_ADDR + 0x30))
540 #define T0CR2 (*(reg32_t *)(TMR0_BASE_ADDR + 0x34))
541 #define T0CR3 (*(reg32_t *)(TMR0_BASE_ADDR + 0x38))
542 #define T0EMR (*(reg32_t *)(TMR0_BASE_ADDR + 0x3C))
543 #define T0CTCR (*(reg32_t *)(TMR0_BASE_ADDR + 0x70))
546 #define TMR1_BASE_ADDR 0xE0008000
547 #define T1IR (*(reg32_t *)(TMR1_BASE_ADDR + 0x00))
548 #define T1TCR (*(reg32_t *)(TMR1_BASE_ADDR + 0x04))
549 #define T1TC (*(reg32_t *)(TMR1_BASE_ADDR + 0x08))
550 #define T1PR (*(reg32_t *)(TMR1_BASE_ADDR + 0x0C))
551 #define T1PC (*(reg32_t *)(TMR1_BASE_ADDR + 0x10))
552 #define T1MCR (*(reg32_t *)(TMR1_BASE_ADDR + 0x14))
553 #define T1MR0 (*(reg32_t *)(TMR1_BASE_ADDR + 0x18))
554 #define T1MR1 (*(reg32_t *)(TMR1_BASE_ADDR + 0x1C))
555 #define T1MR2 (*(reg32_t *)(TMR1_BASE_ADDR + 0x20))
556 #define T1MR3 (*(reg32_t *)(TMR1_BASE_ADDR + 0x24))
557 #define T1CCR (*(reg32_t *)(TMR1_BASE_ADDR + 0x28))
558 #define T1CR0 (*(reg32_t *)(TMR1_BASE_ADDR + 0x2C))
559 #define T1CR1 (*(reg32_t *)(TMR1_BASE_ADDR + 0x30))
560 #define T1CR2 (*(reg32_t *)(TMR1_BASE_ADDR + 0x34))
561 #define T1CR3 (*(reg32_t *)(TMR1_BASE_ADDR + 0x38))
562 #define T1EMR (*(reg32_t *)(TMR1_BASE_ADDR + 0x3C))
563 #define T1CTCR (*(reg32_t *)(TMR1_BASE_ADDR + 0x70))
566 #define TMR2_BASE_ADDR 0xE0070000
567 #define T2IR (*(reg32_t *)(TMR2_BASE_ADDR + 0x00))
568 #define T2TCR (*(reg32_t *)(TMR2_BASE_ADDR + 0x04))
569 #define T2TC (*(reg32_t *)(TMR2_BASE_ADDR + 0x08))
570 #define T2PR (*(reg32_t *)(TMR2_BASE_ADDR + 0x0C))
571 #define T2PC (*(reg32_t *)(TMR2_BASE_ADDR + 0x10))
572 #define T2MCR (*(reg32_t *)(TMR2_BASE_ADDR + 0x14))
573 #define T2MR0 (*(reg32_t *)(TMR2_BASE_ADDR + 0x18))
574 #define T2MR1 (*(reg32_t *)(TMR2_BASE_ADDR + 0x1C))
575 #define T2MR2 (*(reg32_t *)(TMR2_BASE_ADDR + 0x20))
576 #define T2MR3 (*(reg32_t *)(TMR2_BASE_ADDR + 0x24))
577 #define T2CCR (*(reg32_t *)(TMR2_BASE_ADDR + 0x28))
578 #define T2CR0 (*(reg32_t *)(TMR2_BASE_ADDR + 0x2C))
579 #define T2CR1 (*(reg32_t *)(TMR2_BASE_ADDR + 0x30))
580 #define T2CR2 (*(reg32_t *)(TMR2_BASE_ADDR + 0x34))
581 #define T2CR3 (*(reg32_t *)(TMR2_BASE_ADDR + 0x38))
582 #define T2EMR (*(reg32_t *)(TMR2_BASE_ADDR + 0x3C))
583 #define T2CTCR (*(reg32_t *)(TMR2_BASE_ADDR + 0x70))
586 #define TMR3_BASE_ADDR 0xE0074000
587 #define T3IR (*(reg32_t *)(TMR3_BASE_ADDR + 0x00))
588 #define T3TCR (*(reg32_t *)(TMR3_BASE_ADDR + 0x04))
589 #define T3TC (*(reg32_t *)(TMR3_BASE_ADDR + 0x08))
590 #define T3PR (*(reg32_t *)(TMR3_BASE_ADDR + 0x0C))
591 #define T3PC (*(reg32_t *)(TMR3_BASE_ADDR + 0x10))
592 #define T3MCR (*(reg32_t *)(TMR3_BASE_ADDR + 0x14))
593 #define T3MR0 (*(reg32_t *)(TMR3_BASE_ADDR + 0x18))
594 #define T3MR1 (*(reg32_t *)(TMR3_BASE_ADDR + 0x1C))
595 #define T3MR2 (*(reg32_t *)(TMR3_BASE_ADDR + 0x20))
596 #define T3MR3 (*(reg32_t *)(TMR3_BASE_ADDR + 0x24))
597 #define T3CCR (*(reg32_t *)(TMR3_BASE_ADDR + 0x28))
598 #define T3CR0 (*(reg32_t *)(TMR3_BASE_ADDR + 0x2C))
599 #define T3CR1 (*(reg32_t *)(TMR3_BASE_ADDR + 0x30))
600 #define T3CR2 (*(reg32_t *)(TMR3_BASE_ADDR + 0x34))
601 #define T3CR3 (*(reg32_t *)(TMR3_BASE_ADDR + 0x38))
602 #define T3EMR (*(reg32_t *)(TMR3_BASE_ADDR + 0x3C))
603 #define T3CTCR (*(reg32_t *)(TMR3_BASE_ADDR + 0x70))
606 /* Pulse Width Modulator (PWM) */
607 #define PWM0_BASE_ADDR 0xE0014000
608 #define PWM0IR (*(reg32_t *)(PWM0_BASE_ADDR + 0x00))
609 #define PWM0TCR (*(reg32_t *)(PWM0_BASE_ADDR + 0x04))
610 #define PWM0TC (*(reg32_t *)(PWM0_BASE_ADDR + 0x08))
611 #define PWM0PR (*(reg32_t *)(PWM0_BASE_ADDR + 0x0C))
612 #define PWM0PC (*(reg32_t *)(PWM0_BASE_ADDR + 0x10))
613 #define PWM0MCR (*(reg32_t *)(PWM0_BASE_ADDR + 0x14))
614 #define PWM0MR0 (*(reg32_t *)(PWM0_BASE_ADDR + 0x18))
615 #define PWM0MR1 (*(reg32_t *)(PWM0_BASE_ADDR + 0x1C))
616 #define PWM0MR2 (*(reg32_t *)(PWM0_BASE_ADDR + 0x20))
617 #define PWM0MR3 (*(reg32_t *)(PWM0_BASE_ADDR + 0x24))
618 #define PWM0CCR (*(reg32_t *)(PWM0_BASE_ADDR + 0x28))
619 #define PWM0CR0 (*(reg32_t *)(PWM0_BASE_ADDR + 0x2C))
620 #define PWM0CR1 (*(reg32_t *)(PWM0_BASE_ADDR + 0x30))
621 #define PWM0CR2 (*(reg32_t *)(PWM0_BASE_ADDR + 0x34))
622 #define PWM0CR3 (*(reg32_t *)(PWM0_BASE_ADDR + 0x38))
623 #define PWM0EMR (*(reg32_t *)(PWM0_BASE_ADDR + 0x3C))
624 #define PWM0MR4 (*(reg32_t *)(PWM0_BASE_ADDR + 0x40))
625 #define PWM0MR5 (*(reg32_t *)(PWM0_BASE_ADDR + 0x44))
626 #define PWM0MR6 (*(reg32_t *)(PWM0_BASE_ADDR + 0x48))
627 #define PWM0PCR (*(reg32_t *)(PWM0_BASE_ADDR + 0x4C))
628 #define PWM0LER (*(reg32_t *)(PWM0_BASE_ADDR + 0x50))
629 #define PWM0CTCR (*(reg32_t *)(PWM0_BASE_ADDR + 0x70))
631 #define PWM1_BASE_ADDR 0xE0018000
632 #define PWM1IR (*(reg32_t *)(PWM1_BASE_ADDR + 0x00))
633 #define PWM1TCR (*(reg32_t *)(PWM1_BASE_ADDR + 0x04))
634 #define PWM1TC (*(reg32_t *)(PWM1_BASE_ADDR + 0x08))
635 #define PWM1PR (*(reg32_t *)(PWM1_BASE_ADDR + 0x0C))
636 #define PWM1PC (*(reg32_t *)(PWM1_BASE_ADDR + 0x10))
637 #define PWM1MCR (*(reg32_t *)(PWM1_BASE_ADDR + 0x14))
638 #define PWM1MR0 (*(reg32_t *)(PWM1_BASE_ADDR + 0x18))
639 #define PWM1MR1 (*(reg32_t *)(PWM1_BASE_ADDR + 0x1C))
640 #define PWM1MR2 (*(reg32_t *)(PWM1_BASE_ADDR + 0x20))
641 #define PWM1MR3 (*(reg32_t *)(PWM1_BASE_ADDR + 0x24))
642 #define PWM1CCR (*(reg32_t *)(PWM1_BASE_ADDR + 0x28))
643 #define PWM1CR0 (*(reg32_t *)(PWM1_BASE_ADDR + 0x2C))
644 #define PWM1CR1 (*(reg32_t *)(PWM1_BASE_ADDR + 0x30))
645 #define PWM1CR2 (*(reg32_t *)(PWM1_BASE_ADDR + 0x34))
646 #define PWM1CR3 (*(reg32_t *)(PWM1_BASE_ADDR + 0x38))
647 #define PWM1EMR (*(reg32_t *)(PWM1_BASE_ADDR + 0x3C))
648 #define PWM1MR4 (*(reg32_t *)(PWM1_BASE_ADDR + 0x40))
649 #define PWM1MR5 (*(reg32_t *)(PWM1_BASE_ADDR + 0x44))
650 #define PWM1MR6 (*(reg32_t *)(PWM1_BASE_ADDR + 0x48))
651 #define PWM1PCR (*(reg32_t *)(PWM1_BASE_ADDR + 0x4C))
652 #define PWM1LER (*(reg32_t *)(PWM1_BASE_ADDR + 0x50))
653 #define PWM1CTCR (*(reg32_t *)(PWM1_BASE_ADDR + 0x70))
656 /* Universal Asynchronous Receiver Transmitter 0 (UART0) */
657 #define UART0_BASE_ADDR 0xE000C000
658 #define U0RBR (*(reg32_t *)(UART0_BASE_ADDR + 0x00))
659 #define U0THR (*(reg32_t *)(UART0_BASE_ADDR + 0x00))
660 #define U0DLL (*(reg32_t *)(UART0_BASE_ADDR + 0x00))
661 #define U0DLM (*(reg32_t *)(UART0_BASE_ADDR + 0x04))
662 #define U0IER (*(reg32_t *)(UART0_BASE_ADDR + 0x04))
663 #define U0IIR (*(reg32_t *)(UART0_BASE_ADDR + 0x08))
664 #define U0FCR (*(reg32_t *)(UART0_BASE_ADDR + 0x08))
665 #define U0LCR (*(reg32_t *)(UART0_BASE_ADDR + 0x0C))
666 #define U0LSR (*(reg32_t *)(UART0_BASE_ADDR + 0x14))
667 #define U0SCR (*(reg32_t *)(UART0_BASE_ADDR + 0x1C))
668 #define U0ACR (*(reg32_t *)(UART0_BASE_ADDR + 0x20))
669 #define U0ICR (*(reg32_t *)(UART0_BASE_ADDR + 0x24))
670 #define U0FDR (*(reg32_t *)(UART0_BASE_ADDR + 0x28))
671 #define U0TER (*(reg32_t *)(UART0_BASE_ADDR + 0x30))
673 /* Universal Asynchronous Receiver Transmitter 1 (UART1) */
674 #define UART1_BASE_ADDR 0xE0010000
675 #define U1RBR (*(reg32_t *)(UART1_BASE_ADDR + 0x00))
676 #define U1THR (*(reg32_t *)(UART1_BASE_ADDR + 0x00))
677 #define U1DLL (*(reg32_t *)(UART1_BASE_ADDR + 0x00))
678 #define U1DLM (*(reg32_t *)(UART1_BASE_ADDR + 0x04))
679 #define U1IER (*(reg32_t *)(UART1_BASE_ADDR + 0x04))
680 #define U1IIR (*(reg32_t *)(UART1_BASE_ADDR + 0x08))
681 #define U1FCR (*(reg32_t *)(UART1_BASE_ADDR + 0x08))
682 #define U1LCR (*(reg32_t *)(UART1_BASE_ADDR + 0x0C))
683 #define U1MCR (*(reg32_t *)(UART1_BASE_ADDR + 0x10))
684 #define U1LSR (*(reg32_t *)(UART1_BASE_ADDR + 0x14))
685 #define U1MSR (*(reg32_t *)(UART1_BASE_ADDR + 0x18))
686 #define U1SCR (*(reg32_t *)(UART1_BASE_ADDR + 0x1C))
687 #define U1ACR (*(reg32_t *)(UART1_BASE_ADDR + 0x20))
688 #define U1FDR (*(reg32_t *)(UART1_BASE_ADDR + 0x28))
689 #define U1TER (*(reg32_t *)(UART1_BASE_ADDR + 0x30))
691 /* Universal Asynchronous Receiver Transmitter 2 (UART2) */
692 #define UART2_BASE_ADDR 0xE0078000
693 #define U2RBR (*(reg32_t *)(UART2_BASE_ADDR + 0x00))
694 #define U2THR (*(reg32_t *)(UART2_BASE_ADDR + 0x00))
695 #define U2DLL (*(reg32_t *)(UART2_BASE_ADDR + 0x00))
696 #define U2DLM (*(reg32_t *)(UART2_BASE_ADDR + 0x04))
697 #define U2IER (*(reg32_t *)(UART2_BASE_ADDR + 0x04))
698 #define U2IIR (*(reg32_t *)(UART2_BASE_ADDR + 0x08))
699 #define U2FCR (*(reg32_t *)(UART2_BASE_ADDR + 0x08))
700 #define U2LCR (*(reg32_t *)(UART2_BASE_ADDR + 0x0C))
701 #define U2LSR (*(reg32_t *)(UART2_BASE_ADDR + 0x14))
702 #define U2SCR (*(reg32_t *)(UART2_BASE_ADDR + 0x1C))
703 #define U2ACR (*(reg32_t *)(UART2_BASE_ADDR + 0x20))
704 #define U2ICR (*(reg32_t *)(UART2_BASE_ADDR + 0x24))
705 #define U2FDR (*(reg32_t *)(UART2_BASE_ADDR + 0x28))
706 #define U2TER (*(reg32_t *)(UART2_BASE_ADDR + 0x30))
708 /* Universal Asynchronous Receiver Transmitter 3 (UART3) */
709 #define UART3_BASE_ADDR 0xE007C000
710 #define U3RBR (*(reg32_t *)(UART3_BASE_ADDR + 0x00))
711 #define U3THR (*(reg32_t *)(UART3_BASE_ADDR + 0x00))
712 #define U3DLL (*(reg32_t *)(UART3_BASE_ADDR + 0x00))
713 #define U3DLM (*(reg32_t *)(UART3_BASE_ADDR + 0x04))
714 #define U3IER (*(reg32_t *)(UART3_BASE_ADDR + 0x04))
715 #define U3IIR (*(reg32_t *)(UART3_BASE_ADDR + 0x08))
716 #define U3FCR (*(reg32_t *)(UART3_BASE_ADDR + 0x08))
717 #define U3LCR (*(reg32_t *)(UART3_BASE_ADDR + 0x0C))
718 #define U3LSR (*(reg32_t *)(UART3_BASE_ADDR + 0x14))
719 #define U3SCR (*(reg32_t *)(UART3_BASE_ADDR + 0x1C))
720 #define U3ACR (*(reg32_t *)(UART3_BASE_ADDR + 0x20))
721 #define U3ICR (*(reg32_t *)(UART3_BASE_ADDR + 0x24))
722 #define U3FDR (*(reg32_t *)(UART3_BASE_ADDR + 0x28))
723 #define U3TER (*(reg32_t *)(UART3_BASE_ADDR + 0x30))
725 /* I2C Interface 0 */
726 #define I2C0_BASE_ADDR 0xE001C000
727 #define I20CONSET (*(reg32_t *)(I2C0_BASE_ADDR + 0x00))
728 #define I20STAT (*(reg32_t *)(I2C0_BASE_ADDR + 0x04))
729 #define I20DAT (*(reg32_t *)(I2C0_BASE_ADDR + 0x08))
730 #define I20ADR (*(reg32_t *)(I2C0_BASE_ADDR + 0x0C))
731 #define I20SCLH (*(reg32_t *)(I2C0_BASE_ADDR + 0x10))
732 #define I20SCLL (*(reg32_t *)(I2C0_BASE_ADDR + 0x14))
733 #define I20CONCLR (*(reg32_t *)(I2C0_BASE_ADDR + 0x18))
735 /* I2C Interface 1 */
736 #define I2C1_BASE_ADDR 0xE005C000
737 #define I21CONSET (*(reg32_t *)(I2C1_BASE_ADDR + 0x00))
738 #define I21STAT (*(reg32_t *)(I2C1_BASE_ADDR + 0x04))
739 #define I21DAT (*(reg32_t *)(I2C1_BASE_ADDR + 0x08))
740 #define I21ADR (*(reg32_t *)(I2C1_BASE_ADDR + 0x0C))
741 #define I21SCLH (*(reg32_t *)(I2C1_BASE_ADDR + 0x10))
742 #define I21SCLL (*(reg32_t *)(I2C1_BASE_ADDR + 0x14))
743 #define I21CONCLR (*(reg32_t *)(I2C1_BASE_ADDR + 0x18))
745 /* I2C Interface 2 */
746 #define I2C2_BASE_ADDR 0xE0080000
747 #define I22CONSET (*(reg32_t *)(I2C2_BASE_ADDR + 0x00))
748 #define I22STAT (*(reg32_t *)(I2C2_BASE_ADDR + 0x04))
749 #define I22DAT (*(reg32_t *)(I2C2_BASE_ADDR + 0x08))
750 #define I22ADR (*(reg32_t *)(I2C2_BASE_ADDR + 0x0C))
751 #define I22SCLH (*(reg32_t *)(I2C2_BASE_ADDR + 0x10))
752 #define I22SCLL (*(reg32_t *)(I2C2_BASE_ADDR + 0x14))
753 #define I22CONCLR (*(reg32_t *)(I2C2_BASE_ADDR + 0x18))
756 /* I2C register definition Clear */
757 #define I2CON_I2ENC 6 // I2C interface Disable bit
758 #define I2CON_STAC 5 // START flag Clear bit
759 #define I2CON_SIC 3 // I2C interrupt Clear bit
760 #define I2CON_AAC 2 // Assert acknowledge Clear bit
762 /* I2C register definition Set */
763 #define I2CON_I2EN 6 // I2C interface enable
764 #define I2CON_STA 5 // START flag Clear bit
765 #define I2CON_STO 4 // STOP flag Clear bit
766 #define I2CON_SI 3 // I2C interrupt Clear bit
767 #define I2CON_AA 2 // Assert acknowledge Clear bit
769 /* I2C Status codes */
770 #define I2C_STAT_ERROR 0x00
771 #define I2C_STAT_UNKNOW 0xF8
772 #define I2C_STAT_SEND 0x08
773 #define I2C_STAT_RESEND 0x10
774 #define I2C_STAT_SLAW_ACK 0x18
775 #define I2C_STAT_SLAW_NACK 0x20
776 #define I2C_STAT_SLAR_ACK 0x40
777 #define I2C_STAT_SLAR_NACK 0x48
778 #define I2C_STAT_DATA_ACK 0x28
779 #define I2C_STAT_DATA_NACK 0x30
780 #define I2C_STAT_RDATA_ACK 0x50
781 #define I2C_STAT_RDATA_NACK 0x58
782 #define I2C_STAT_ARB_LOST 0x38
784 #define I2C0_PCLK_MASK 0xC000
785 #define I2C0_PCLK_DIV8 0xC000
786 #define I2C0_PCLK_DIV4 0x4000
787 #define I2C0_PCLK_OFFSET 14
790 /* I2C pins defines */
791 #define I2C0_PINSEL_MASK 0x3C00000
792 #define I2C0_PINSEL 0x1400000
794 /* SPI0 (Serial Peripheral Interface 0) */
795 #define SPI0_BASE_ADDR 0xE0020000
796 #define S0SPCR (*(reg32_t *)(SPI0_BASE_ADDR + 0x00))
797 #define S0SPSR (*(reg32_t *)(SPI0_BASE_ADDR + 0x04))
798 #define S0SPDR (*(reg32_t *)(SPI0_BASE_ADDR + 0x08))
799 #define S0SPCCR (*(reg32_t *)(SPI0_BASE_ADDR + 0x0C))
800 #define S0SPINT (*(reg32_t *)(SPI0_BASE_ADDR + 0x1C))
802 /* SSP0 Controller */
803 #define SSP0_BASE_ADDR 0xE0068000
804 #define SSP0CR0 (*(reg32_t *)(SSP0_BASE_ADDR + 0x00))
805 #define SSP0CR1 (*(reg32_t *)(SSP0_BASE_ADDR + 0x04))
806 #define SSP0DR (*(reg32_t *)(SSP0_BASE_ADDR + 0x08))
807 #define SSP0SR (*(reg32_t *)(SSP0_BASE_ADDR + 0x0C))
808 #define SSP0CPSR (*(reg32_t *)(SSP0_BASE_ADDR + 0x10))
809 #define SSP0IMSC (*(reg32_t *)(SSP0_BASE_ADDR + 0x14))
810 #define SSP0RIS (*(reg32_t *)(SSP0_BASE_ADDR + 0x18))
811 #define SSP0MIS (*(reg32_t *)(SSP0_BASE_ADDR + 0x1C))
812 #define SSP0ICR (*(reg32_t *)(SSP0_BASE_ADDR + 0x20))
813 #define SSP0DMACR (*(reg32_t *)(SSP0_BASE_ADDR + 0x24))
815 /* SSP1 Controller */
816 #define SSP1_BASE_ADDR 0xE0030000
817 #define SSP1CR0 (*(reg32_t *)(SSP1_BASE_ADDR + 0x00))
818 #define SSP1CR1 (*(reg32_t *)(SSP1_BASE_ADDR + 0x04))
819 #define SSP1DR (*(reg32_t *)(SSP1_BASE_ADDR + 0x08))
820 #define SSP1SR (*(reg32_t *)(SSP1_BASE_ADDR + 0x0C))
821 #define SSP1CPSR (*(reg32_t *)(SSP1_BASE_ADDR + 0x10))
822 #define SSP1IMSC (*(reg32_t *)(SSP1_BASE_ADDR + 0x14))
823 #define SSP1RIS (*(reg32_t *)(SSP1_BASE_ADDR + 0x18))
824 #define SSP1MIS (*(reg32_t *)(SSP1_BASE_ADDR + 0x1C))
825 #define SSP1ICR (*(reg32_t *)(SSP1_BASE_ADDR + 0x20))
826 #define SSP1DMACR (*(reg32_t *)(SSP1_BASE_ADDR + 0x24))
829 /* Real Time Clock */
830 #define RTC_BASE_ADDR 0xE0024000
831 #define RTC_ILR (*(reg32_t *)(RTC_BASE_ADDR + 0x00))
832 #define RTC_CTC (*(reg32_t *)(RTC_BASE_ADDR + 0x04))
833 #define RTC_CCR (*(reg32_t *)(RTC_BASE_ADDR + 0x08))
834 #define RTC_CIIR (*(reg32_t *)(RTC_BASE_ADDR + 0x0C))
835 #define RTC_AMR (*(reg32_t *)(RTC_BASE_ADDR + 0x10))
836 #define RTC_CTIME0 (*(reg32_t *)(RTC_BASE_ADDR + 0x14))
837 #define RTC_CTIME1 (*(reg32_t *)(RTC_BASE_ADDR + 0x18))
838 #define RTC_CTIME2 (*(reg32_t *)(RTC_BASE_ADDR + 0x1C))
839 #define RTC_SEC (*(reg32_t *)(RTC_BASE_ADDR + 0x20))
840 #define RTC_MIN (*(reg32_t *)(RTC_BASE_ADDR + 0x24))
841 #define RTC_HOUR (*(reg32_t *)(RTC_BASE_ADDR + 0x28))
842 #define RTC_DOM (*(reg32_t *)(RTC_BASE_ADDR + 0x2C))
843 #define RTC_DOW (*(reg32_t *)(RTC_BASE_ADDR + 0x30))
844 #define RTC_DOY (*(reg32_t *)(RTC_BASE_ADDR + 0x34))
845 #define RTC_MONTH (*(reg32_t *)(RTC_BASE_ADDR + 0x38))
846 #define RTC_YEAR (*(reg32_t *)(RTC_BASE_ADDR + 0x3C))
847 #define RTC_CISS (*(reg32_t *)(RTC_BASE_ADDR + 0x40))
848 #define RTC_ALSEC (*(reg32_t *)(RTC_BASE_ADDR + 0x60))
849 #define RTC_ALMIN (*(reg32_t *)(RTC_BASE_ADDR + 0x64))
850 #define RTC_ALHOUR (*(reg32_t *)(RTC_BASE_ADDR + 0x68))
851 #define RTC_ALDOM (*(reg32_t *)(RTC_BASE_ADDR + 0x6C))
852 #define RTC_ALDOW (*(reg32_t *)(RTC_BASE_ADDR + 0x70))
853 #define RTC_ALDOY (*(reg32_t *)(RTC_BASE_ADDR + 0x74))
854 #define RTC_ALMON (*(reg32_t *)(RTC_BASE_ADDR + 0x78))
855 #define RTC_ALYEAR (*(reg32_t *)(RTC_BASE_ADDR + 0x7C))
856 #define RTC_PREINT (*(reg32_t *)(RTC_BASE_ADDR + 0x80))
857 #define RTC_PREFRAC (*(reg32_t *)(RTC_BASE_ADDR + 0x84))
860 /* A/D Converter 0 (AD0) */
861 #define AD0_BASE_ADDR 0xE0034000
862 #define AD0CR (*(reg32_t *)(AD0_BASE_ADDR + 0x00))
863 #define AD0GDR (*(reg32_t *)(AD0_BASE_ADDR + 0x04))
864 #define AD0INTEN (*(reg32_t *)(AD0_BASE_ADDR + 0x0C))
865 #define AD0DR0 (*(reg32_t *)(AD0_BASE_ADDR + 0x10))
866 #define AD0DR1 (*(reg32_t *)(AD0_BASE_ADDR + 0x14))
867 #define AD0DR2 (*(reg32_t *)(AD0_BASE_ADDR + 0x18))
868 #define AD0DR3 (*(reg32_t *)(AD0_BASE_ADDR + 0x1C))
869 #define AD0DR4 (*(reg32_t *)(AD0_BASE_ADDR + 0x20))
870 #define AD0DR5 (*(reg32_t *)(AD0_BASE_ADDR + 0x24))
871 #define AD0DR6 (*(reg32_t *)(AD0_BASE_ADDR + 0x28))
872 #define AD0DR7 (*(reg32_t *)(AD0_BASE_ADDR + 0x2C))
873 #define AD0STAT (*(reg32_t *)(AD0_BASE_ADDR + 0x30))
877 #define DAC_BASE_ADDR 0xE006C000
878 #define DACR (*(reg32_t *)(DAC_BASE_ADDR + 0x00))
882 #define WDG_BASE_ADDR 0xE0000000
883 #define WDMOD (*(reg32_t *)(WDG_BASE_ADDR + 0x00))
884 #define WDTC (*(reg32_t *)(WDG_BASE_ADDR + 0x04))
885 #define WDFEED (*(reg32_t *)(WDG_BASE_ADDR + 0x08))
886 #define WDTV (*(reg32_t *)(WDG_BASE_ADDR + 0x0C))
887 #define WDCLKSEL (*(reg32_t *)(WDG_BASE_ADDR + 0x10))
889 /* CAN CONTROLLERS AND ACCEPTANCE FILTER */
890 #define CAN_ACCEPT_BASE_ADDR 0xE003C000
891 #define CAN_AFMR (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x00))
892 #define CAN_SFF_SA (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x04))
893 #define CAN_SFF_GRP_SA (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x08))
894 #define CAN_EFF_SA (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x0C))
895 #define CAN_EFF_GRP_SA (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x10))
896 #define CAN_EOT (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x14))
897 #define CAN_LUT_ERR_ADR (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x18))
898 #define CAN_LUT_ERR (*(reg32_t *)(CAN_ACCEPT_BASE_ADDR + 0x1C))
900 #define CAN_CENTRAL_BASE_ADDR 0xE0040000
901 #define CAN_TX_SR (*(reg32_t *)(CAN_CENTRAL_BASE_ADDR + 0x00))
902 #define CAN_RX_SR (*(reg32_t *)(CAN_CENTRAL_BASE_ADDR + 0x04))
903 #define CAN_MSR (*(reg32_t *)(CAN_CENTRAL_BASE_ADDR + 0x08))
905 #define CAN1_BASE_ADDR 0xE0044000
906 #define CAN1MOD (*(reg32_t *)(CAN1_BASE_ADDR + 0x00))
907 #define CAN1CMR (*(reg32_t *)(CAN1_BASE_ADDR + 0x04))
908 #define CAN1GSR (*(reg32_t *)(CAN1_BASE_ADDR + 0x08))
909 #define CAN1ICR (*(reg32_t *)(CAN1_BASE_ADDR + 0x0C))
910 #define CAN1IER (*(reg32_t *)(CAN1_BASE_ADDR + 0x10))
911 #define CAN1BTR (*(reg32_t *)(CAN1_BASE_ADDR + 0x14))
912 #define CAN1EWL (*(reg32_t *)(CAN1_BASE_ADDR + 0x18))
913 #define CAN1SR (*(reg32_t *)(CAN1_BASE_ADDR + 0x1C))
914 #define CAN1RFS (*(reg32_t *)(CAN1_BASE_ADDR + 0x20))
915 #define CAN1RID (*(reg32_t *)(CAN1_BASE_ADDR + 0x24))
916 #define CAN1RDA (*(reg32_t *)(CAN1_BASE_ADDR + 0x28))
917 #define CAN1RDB (*(reg32_t *)(CAN1_BASE_ADDR + 0x2C))
919 #define CAN1TFI1 (*(reg32_t *)(CAN1_BASE_ADDR + 0x30))
920 #define CAN1TID1 (*(reg32_t *)(CAN1_BASE_ADDR + 0x34))
921 #define CAN1TDA1 (*(reg32_t *)(CAN1_BASE_ADDR + 0x38))
922 #define CAN1TDB1 (*(reg32_t *)(CAN1_BASE_ADDR + 0x3C))
923 #define CAN1TFI2 (*(reg32_t *)(CAN1_BASE_ADDR + 0x40))
924 #define CAN1TID2 (*(reg32_t *)(CAN1_BASE_ADDR + 0x44))
925 #define CAN1TDA2 (*(reg32_t *)(CAN1_BASE_ADDR + 0x48))
926 #define CAN1TDB2 (*(reg32_t *)(CAN1_BASE_ADDR + 0x4C))
927 #define CAN1TFI3 (*(reg32_t *)(CAN1_BASE_ADDR + 0x50))
928 #define CAN1TID3 (*(reg32_t *)(CAN1_BASE_ADDR + 0x54))
929 #define CAN1TDA3 (*(reg32_t *)(CAN1_BASE_ADDR + 0x58))
930 #define CAN1TDB3 (*(reg32_t *)(CAN1_BASE_ADDR + 0x5C))
932 #define CAN2_BASE_ADDR 0xE0048000
933 #define CAN2MOD (*(reg32_t *)(CAN2_BASE_ADDR + 0x00))
934 #define CAN2CMR (*(reg32_t *)(CAN2_BASE_ADDR + 0x04))
935 #define CAN2GSR (*(reg32_t *)(CAN2_BASE_ADDR + 0x08))
936 #define CAN2ICR (*(reg32_t *)(CAN2_BASE_ADDR + 0x0C))
937 #define CAN2IER (*(reg32_t *)(CAN2_BASE_ADDR + 0x10))
938 #define CAN2BTR (*(reg32_t *)(CAN2_BASE_ADDR + 0x14))
939 #define CAN2EWL (*(reg32_t *)(CAN2_BASE_ADDR + 0x18))
940 #define CAN2SR (*(reg32_t *)(CAN2_BASE_ADDR + 0x1C))
941 #define CAN2RFS (*(reg32_t *)(CAN2_BASE_ADDR + 0x20))
942 #define CAN2RID (*(reg32_t *)(CAN2_BASE_ADDR + 0x24))
943 #define CAN2RDA (*(reg32_t *)(CAN2_BASE_ADDR + 0x28))
944 #define CAN2RDB (*(reg32_t *)(CAN2_BASE_ADDR + 0x2C))
946 #define CAN2TFI1 (*(reg32_t *)(CAN2_BASE_ADDR + 0x30))
947 #define CAN2TID1 (*(reg32_t *)(CAN2_BASE_ADDR + 0x34))
948 #define CAN2TDA1 (*(reg32_t *)(CAN2_BASE_ADDR + 0x38))
949 #define CAN2TDB1 (*(reg32_t *)(CAN2_BASE_ADDR + 0x3C))
950 #define CAN2TFI2 (*(reg32_t *)(CAN2_BASE_ADDR + 0x40))
951 #define CAN2TID2 (*(reg32_t *)(CAN2_BASE_ADDR + 0x44))
952 #define CAN2TDA2 (*(reg32_t *)(CAN2_BASE_ADDR + 0x48))
953 #define CAN2TDB2 (*(reg32_t *)(CAN2_BASE_ADDR + 0x4C))
954 #define CAN2TFI3 (*(reg32_t *)(CAN2_BASE_ADDR + 0x50))
955 #define CAN2TID3 (*(reg32_t *)(CAN2_BASE_ADDR + 0x54))
956 #define CAN2TDA3 (*(reg32_t *)(CAN2_BASE_ADDR + 0x58))
957 #define CAN2TDB3 (*(reg32_t *)(CAN2_BASE_ADDR + 0x5C))
960 /* MultiMedia Card Interface(MCI) Controller */
961 #define MCI_BASE_ADDR 0xE008C000
962 #define MCI_POWER (*(reg32_t *)(MCI_BASE_ADDR + 0x00))
963 #define MCI_CLOCK (*(reg32_t *)(MCI_BASE_ADDR + 0x04))
964 #define MCI_ARGUMENT (*(reg32_t *)(MCI_BASE_ADDR + 0x08))
965 #define MCI_COMMAND (*(reg32_t *)(MCI_BASE_ADDR + 0x0C))
966 #define MCI_RESP_CMD (*(reg32_t *)(MCI_BASE_ADDR + 0x10))
967 #define MCI_RESP0 (*(reg32_t *)(MCI_BASE_ADDR + 0x14))
968 #define MCI_RESP1 (*(reg32_t *)(MCI_BASE_ADDR + 0x18))
969 #define MCI_RESP2 (*(reg32_t *)(MCI_BASE_ADDR + 0x1C))
970 #define MCI_RESP3 (*(reg32_t *)(MCI_BASE_ADDR + 0x20))
971 #define MCI_DATA_TMR (*(reg32_t *)(MCI_BASE_ADDR + 0x24))
972 #define MCI_DATA_LEN (*(reg32_t *)(MCI_BASE_ADDR + 0x28))
973 #define MCI_DATA_CTRL (*(reg32_t *)(MCI_BASE_ADDR + 0x2C))
974 #define MCI_DATA_CNT (*(reg32_t *)(MCI_BASE_ADDR + 0x30))
975 #define MCI_STATUS (*(reg32_t *)(MCI_BASE_ADDR + 0x34))
976 #define MCI_CLEAR (*(reg32_t *)(MCI_BASE_ADDR + 0x38))
977 #define MCI_MASK0 (*(reg32_t *)(MCI_BASE_ADDR + 0x3C))
978 #define MCI_MASK1 (*(reg32_t *)(MCI_BASE_ADDR + 0x40))
979 #define MCI_FIFO_CNT (*(reg32_t *)(MCI_BASE_ADDR + 0x48))
980 #define MCI_FIFO (*(reg32_t *)(MCI_BASE_ADDR + 0x80))
983 /* I2S Interface Controller (I2S) */
984 #define I2S_BASE_ADDR 0xE0088000
985 #define I2S_DAO (*(reg32_t *)(I2S_BASE_ADDR + 0x00))
986 #define I2S_DAI (*(reg32_t *)(I2S_BASE_ADDR + 0x04))
987 #define I2S_TX_FIFO (*(reg32_t *)(I2S_BASE_ADDR + 0x08))
988 #define I2S_RX_FIFO (*(reg32_t *)(I2S_BASE_ADDR + 0x0C))
989 #define I2S_STATE (*(reg32_t *)(I2S_BASE_ADDR + 0x10))
990 #define I2S_DMA1 (*(reg32_t *)(I2S_BASE_ADDR + 0x14))
991 #define I2S_DMA2 (*(reg32_t *)(I2S_BASE_ADDR + 0x18))
992 #define I2S_IRQ (*(reg32_t *)(I2S_BASE_ADDR + 0x1C))
993 #define I2S_TXRATE (*(reg32_t *)(I2S_BASE_ADDR + 0x20))
994 #define I2S_RXRATE (*(reg32_t *)(I2S_BASE_ADDR + 0x24))
997 /* General-purpose DMA Controller */
998 #define DMA_BASE_ADDR 0xFFE04000
999 #define GPDMA_INT_STAT (*(reg32_t *)(DMA_BASE_ADDR + 0x000))
1000 #define GPDMA_INT_TCSTAT (*(reg32_t *)(DMA_BASE_ADDR + 0x004))
1001 #define GPDMA_INT_TCCLR (*(reg32_t *)(DMA_BASE_ADDR + 0x008))
1002 #define GPDMA_INT_ERR_STAT (*(reg32_t *)(DMA_BASE_ADDR + 0x00C))
1003 #define GPDMA_INT_ERR_CLR (*(reg32_t *)(DMA_BASE_ADDR + 0x010))
1004 #define GPDMA_RAW_INT_TCSTAT (*(reg32_t *)(DMA_BASE_ADDR + 0x014))
1005 #define GPDMA_RAW_INT_ERR_STAT (*(reg32_t *)(DMA_BASE_ADDR + 0x018))
1006 #define GPDMA_ENABLED_CHNS (*(reg32_t *)(DMA_BASE_ADDR + 0x01C))
1007 #define GPDMA_SOFT_BREQ (*(reg32_t *)(DMA_BASE_ADDR + 0x020))
1008 #define GPDMA_SOFT_SREQ (*(reg32_t *)(DMA_BASE_ADDR + 0x024))
1009 #define GPDMA_SOFT_LBREQ (*(reg32_t *)(DMA_BASE_ADDR + 0x028))
1010 #define GPDMA_SOFT_LSREQ (*(reg32_t *)(DMA_BASE_ADDR + 0x02C))
1011 #define GPDMA_CONFIG (*(reg32_t *)(DMA_BASE_ADDR + 0x030))
1012 #define GPDMA_SYNC (*(reg32_t *)(DMA_BASE_ADDR + 0x034))
1014 /* DMA channel 0 registers */
1015 #define GPDMA_CH0_SRC (*(reg32_t *)(DMA_BASE_ADDR + 0x100))
1016 #define GPDMA_CH0_DEST (*(reg32_t *)(DMA_BASE_ADDR + 0x104))
1017 #define GPDMA_CH0_LLI (*(reg32_t *)(DMA_BASE_ADDR + 0x108))
1018 #define GPDMA_CH0_CTRL (*(reg32_t *)(DMA_BASE_ADDR + 0x10C))
1019 #define GPDMA_CH0_CFG (*(reg32_t *)(DMA_BASE_ADDR + 0x110))
1021 /* DMA channel 1 registers */
1022 #define GPDMA_CH1_SRC (*(reg32_t *)(DMA_BASE_ADDR + 0x120))
1023 #define GPDMA_CH1_DEST (*(reg32_t *)(DMA_BASE_ADDR + 0x124))
1024 #define GPDMA_CH1_LLI (*(reg32_t *)(DMA_BASE_ADDR + 0x128))
1025 #define GPDMA_CH1_CTRL (*(reg32_t *)(DMA_BASE_ADDR + 0x12C))
1026 #define GPDMA_CH1_CFG (*(reg32_t *)(DMA_BASE_ADDR + 0x130))
1029 /* USB Controller */
1030 #define USB_INT_BASE_ADDR 0xE01FC1C0
1031 #define USB_BASE_ADDR 0xFFE0C200 /* USB Base Address */
1033 #define USB_INT_STAT (*(reg32_t *)(USB_INT_BASE_ADDR + 0x00))
1035 /* USB Device Interrupt Registers */
1036 #define DEV_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0x00))
1037 #define DEV_INT_EN (*(reg32_t *)(USB_BASE_ADDR + 0x04))
1038 #define DEV_INT_CLR (*(reg32_t *)(USB_BASE_ADDR + 0x08))
1039 #define DEV_INT_SET (*(reg32_t *)(USB_BASE_ADDR + 0x0C))
1040 #define DEV_INT_PRIO (*(reg32_t *)(USB_BASE_ADDR + 0x2C))
1042 /* USB Device Endpoint Interrupt Registers */
1043 #define EP_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0x30))
1044 #define EP_INT_EN (*(reg32_t *)(USB_BASE_ADDR + 0x34))
1045 #define EP_INT_CLR (*(reg32_t *)(USB_BASE_ADDR + 0x38))
1046 #define EP_INT_SET (*(reg32_t *)(USB_BASE_ADDR + 0x3C))
1047 #define EP_INT_PRIO (*(reg32_t *)(USB_BASE_ADDR + 0x40))
1049 /* USB Device Endpoint Realization Registers */
1050 #define REALIZE_EP (*(reg32_t *)(USB_BASE_ADDR + 0x44))
1051 #define EP_INDEX (*(reg32_t *)(USB_BASE_ADDR + 0x48))
1052 #define MAXPACKET_SIZE (*(reg32_t *)(USB_BASE_ADDR + 0x4C))
1054 /* USB Device Command Reagisters */
1055 #define CMD_CODE (*(reg32_t *)(USB_BASE_ADDR + 0x10))
1056 #define CMD_DATA (*(reg32_t *)(USB_BASE_ADDR + 0x14))
1058 /* USB Device Data Transfer Registers */
1059 #define RX_DATA (*(reg32_t *)(USB_BASE_ADDR + 0x18))
1060 #define TX_DATA (*(reg32_t *)(USB_BASE_ADDR + 0x1C))
1061 #define RX_PLENGTH (*(reg32_t *)(USB_BASE_ADDR + 0x20))
1062 #define TX_PLENGTH (*(reg32_t *)(USB_BASE_ADDR + 0x24))
1063 #define USB_CTRL (*(reg32_t *)(USB_BASE_ADDR + 0x28))
1065 /* USB Device DMA Registers */
1066 #define DMA_REQ_STAT (*(reg32_t *)(USB_BASE_ADDR + 0x50))
1067 #define DMA_REQ_CLR (*(reg32_t *)(USB_BASE_ADDR + 0x54))
1068 #define DMA_REQ_SET (*(reg32_t *)(USB_BASE_ADDR + 0x58))
1069 #define UDCA_HEAD (*(reg32_t *)(USB_BASE_ADDR + 0x80))
1070 #define EP_DMA_STAT (*(reg32_t *)(USB_BASE_ADDR + 0x84))
1071 #define EP_DMA_EN (*(reg32_t *)(USB_BASE_ADDR + 0x88))
1072 #define EP_DMA_DIS (*(reg32_t *)(USB_BASE_ADDR + 0x8C))
1073 #define DMA_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0x90))
1074 #define DMA_INT_EN (*(reg32_t *)(USB_BASE_ADDR + 0x94))
1075 #define EOT_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0xA0))
1076 #define EOT_INT_CLR (*(reg32_t *)(USB_BASE_ADDR + 0xA4))
1077 #define EOT_INT_SET (*(reg32_t *)(USB_BASE_ADDR + 0xA8))
1078 #define NDD_REQ_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0xAC))
1079 #define NDD_REQ_INT_CLR (*(reg32_t *)(USB_BASE_ADDR + 0xB0))
1080 #define NDD_REQ_INT_SET (*(reg32_t *)(USB_BASE_ADDR + 0xB4))
1081 #define SYS_ERR_INT_STAT (*(reg32_t *)(USB_BASE_ADDR + 0xB8))
1082 #define SYS_ERR_INT_CLR (*(reg32_t *)(USB_BASE_ADDR + 0xBC))
1083 #define SYS_ERR_INT_SET (*(reg32_t *)(USB_BASE_ADDR + 0xC0))
1085 /* USB Host and OTG registers are for LPC24xx only */
1086 /* USB Host Controller */
1087 #define USBHC_BASE_ADDR 0xFFE0C000
1088 #define HC_REVISION (*(reg32_t *)(USBHC_BASE_ADDR + 0x00))
1089 #define HC_CONTROL (*(reg32_t *)(USBHC_BASE_ADDR + 0x04))
1090 #define HC_CMD_STAT (*(reg32_t *)(USBHC_BASE_ADDR + 0x08))
1091 #define HC_INT_STAT (*(reg32_t *)(USBHC_BASE_ADDR + 0x0C))
1092 #define HC_INT_EN (*(reg32_t *)(USBHC_BASE_ADDR + 0x10))
1093 #define HC_INT_DIS (*(reg32_t *)(USBHC_BASE_ADDR + 0x14))
1094 #define HC_HCCA (*(reg32_t *)(USBHC_BASE_ADDR + 0x18))
1095 #define HC_PERIOD_CUR_ED (*(reg32_t *)(USBHC_BASE_ADDR + 0x1C))
1096 #define HC_CTRL_HEAD_ED (*(reg32_t *)(USBHC_BASE_ADDR + 0x20))
1097 #define HC_CTRL_CUR_ED (*(reg32_t *)(USBHC_BASE_ADDR + 0x24))
1098 #define HC_BULK_HEAD_ED (*(reg32_t *)(USBHC_BASE_ADDR + 0x28))
1099 #define HC_BULK_CUR_ED (*(reg32_t *)(USBHC_BASE_ADDR + 0x2C))
1100 #define HC_DONE_HEAD (*(reg32_t *)(USBHC_BASE_ADDR + 0x30))
1101 #define HC_FM_INTERVAL (*(reg32_t *)(USBHC_BASE_ADDR + 0x34))
1102 #define HC_FM_REMAINING (*(reg32_t *)(USBHC_BASE_ADDR + 0x38))
1103 #define HC_FM_NUMBER (*(reg32_t *)(USBHC_BASE_ADDR + 0x3C))
1104 #define HC_PERIOD_START (*(reg32_t *)(USBHC_BASE_ADDR + 0x40))
1105 #define HC_LS_THRHLD (*(reg32_t *)(USBHC_BASE_ADDR + 0x44))
1106 #define HC_RH_DESCA (*(reg32_t *)(USBHC_BASE_ADDR + 0x48))
1107 #define HC_RH_DESCB (*(reg32_t *)(USBHC_BASE_ADDR + 0x4C))
1108 #define HC_RH_STAT (*(reg32_t *)(USBHC_BASE_ADDR + 0x50))
1109 #define HC_RH_PORT_STAT1 (*(reg32_t *)(USBHC_BASE_ADDR + 0x54))
1110 #define HC_RH_PORT_STAT2 (*(reg32_t *)(USBHC_BASE_ADDR + 0x58))
1112 /* USB OTG Controller */
1113 #define USBOTG_BASE_ADDR 0xFFE0C100
1114 #define OTG_INT_STAT (*(reg32_t *)(USBOTG_BASE_ADDR + 0x00))
1115 #define OTG_INT_EN (*(reg32_t *)(USBOTG_BASE_ADDR + 0x04))
1116 #define OTG_INT_SET (*(reg32_t *)(USBOTG_BASE_ADDR + 0x08))
1117 #define OTG_INT_CLR (*(reg32_t *)(USBOTG_BASE_ADDR + 0x0C))
1118 /* On LPC23xx, the name is USBPortSel, on LPC24xx, the name is OTG_STAT_CTRL */
1119 #define OTG_STAT_CTRL (*(reg32_t *)(USBOTG_BASE_ADDR + 0x10))
1120 #define OTG_TIMER (*(reg32_t *)(USBOTG_BASE_ADDR + 0x14))
1122 #define USBOTG_I2C_BASE_ADDR 0xFFE0C300
1123 #define OTG_I2C_RX (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x00))
1124 #define OTG_I2C_TX (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x00))
1125 #define OTG_I2C_STS (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x04))
1126 #define OTG_I2C_CTL (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x08))
1127 #define OTG_I2C_CLKHI (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x0C))
1128 #define OTG_I2C_CLKLO (*(reg32_t *)(USBOTG_I2C_BASE_ADDR + 0x10))
1130 /* On LPC23xx, the names are USBClkCtrl and USBClkSt; on LPC24xx, the names are
1131 OTG_CLK_CTRL and OTG_CLK_STAT respectively. */
1132 #define USBOTG_CLK_BASE_ADDR 0xFFE0CFF0
1133 #define OTG_CLK_CTRL (*(reg32_t *)(USBOTG_CLK_BASE_ADDR + 0x04))
1134 #define OTG_CLK_STAT (*(reg32_t *)(USBOTG_CLK_BASE_ADDR + 0x08))
1136 /* Note: below three register name convention is for LPC23xx USB device only, match
1137 with the spec. update in USB Device Section. */
1138 #define USBPortSel (*(reg32_t *)(USBOTG_BASE_ADDR + 0x10))
1139 #define USBClkCtrl (*(reg32_t *)(USBOTG_CLK_BASE_ADDR + 0x04))
1140 #define USBClkSt (*(reg32_t *)(USBOTG_CLK_BASE_ADDR + 0x08))
1142 /* Ethernet MAC (32 bit data bus) -- all registers are RW unless indicated in parentheses */
1143 #define MAC_BASE_ADDR 0xFFE00000 /* AHB Peripheral # 0 */
1144 #define MAC_MAC1 (*(reg32_t *)(MAC_BASE_ADDR + 0x000)) /* MAC config reg 1 */
1145 #define MAC_MAC2 (*(reg32_t *)(MAC_BASE_ADDR + 0x004)) /* MAC config reg 2 */
1146 #define MAC_IPGT (*(reg32_t *)(MAC_BASE_ADDR + 0x008)) /* b2b InterPacketGap reg */
1147 #define MAC_IPGR (*(reg32_t *)(MAC_BASE_ADDR + 0x00C)) /* non b2b InterPacketGap reg */
1148 #define MAC_CLRT (*(reg32_t *)(MAC_BASE_ADDR + 0x010)) /* CoLlision window/ReTry reg */
1149 #define MAC_MAXF (*(reg32_t *)(MAC_BASE_ADDR + 0x014)) /* MAXimum Frame reg */
1150 #define MAC_SUPP (*(reg32_t *)(MAC_BASE_ADDR + 0x018)) /* PHY SUPPort reg */
1151 #define MAC_TEST (*(reg32_t *)(MAC_BASE_ADDR + 0x01C)) /* TEST reg */
1152 #define MAC_MCFG (*(reg32_t *)(MAC_BASE_ADDR + 0x020)) /* MII Mgmt ConFiG reg */
1153 #define MAC_MCMD (*(reg32_t *)(MAC_BASE_ADDR + 0x024)) /* MII Mgmt CoMmanD reg */
1154 #define MAC_MADR (*(reg32_t *)(MAC_BASE_ADDR + 0x028)) /* MII Mgmt ADdRess reg */
1155 #define MAC_MWTD (*(reg32_t *)(MAC_BASE_ADDR + 0x02C)) /* MII Mgmt WriTe Data reg (WO) */
1156 #define MAC_MRDD (*(reg32_t *)(MAC_BASE_ADDR + 0x030)) /* MII Mgmt ReaD Data reg (RO) */
1157 #define MAC_MIND (*(reg32_t *)(MAC_BASE_ADDR + 0x034)) /* MII Mgmt INDicators reg (RO) */
1159 #define MAC_SA0 (*(reg32_t *)(MAC_BASE_ADDR + 0x040)) /* Station Address 0 reg */
1160 #define MAC_SA1 (*(reg32_t *)(MAC_BASE_ADDR + 0x044)) /* Station Address 1 reg */
1161 #define MAC_SA2 (*(reg32_t *)(MAC_BASE_ADDR + 0x048)) /* Station Address 2 reg */
1163 #define MAC_COMMAND (*(reg32_t *)(MAC_BASE_ADDR + 0x100)) /* Command reg */
1164 #define MAC_STATUS (*(reg32_t *)(MAC_BASE_ADDR + 0x104)) /* Status reg (RO) */
1165 #define MAC_RXDESCRIPTOR (*(reg32_t *)(MAC_BASE_ADDR + 0x108)) /* Rx descriptor base address reg */
1166 #define MAC_RXSTATUS (*(reg32_t *)(MAC_BASE_ADDR + 0x10C)) /* Rx status base address reg */
1167 #define MAC_RXDESCRIPTORNUM (*(reg32_t *)(MAC_BASE_ADDR + 0x110)) /* Rx number of descriptors reg */
1168 #define MAC_RXPRODUCEINDEX (*(reg32_t *)(MAC_BASE_ADDR + 0x114)) /* Rx produce index reg (RO) */
1169 #define MAC_RXCONSUMEINDEX (*(reg32_t *)(MAC_BASE_ADDR + 0x118)) /* Rx consume index reg */
1170 #define MAC_TXDESCRIPTOR (*(reg32_t *)(MAC_BASE_ADDR + 0x11C)) /* Tx descriptor base address reg */
1171 #define MAC_TXSTATUS (*(reg32_t *)(MAC_BASE_ADDR + 0x120)) /* Tx status base address reg */
1172 #define MAC_TXDESCRIPTORNUM (*(reg32_t *)(MAC_BASE_ADDR + 0x124)) /* Tx number of descriptors reg */
1173 #define MAC_TXPRODUCEINDEX (*(reg32_t *)(MAC_BASE_ADDR + 0x128)) /* Tx produce index reg */
1174 #define MAC_TXCONSUMEINDEX (*(reg32_t *)(MAC_BASE_ADDR + 0x12C)) /* Tx consume index reg (RO) */
1176 #define MAC_TSV0 (*(reg32_t *)(MAC_BASE_ADDR + 0x158)) /* Tx status vector 0 reg (RO) */
1177 #define MAC_TSV1 (*(reg32_t *)(MAC_BASE_ADDR + 0x15C)) /* Tx status vector 1 reg (RO) */
1178 #define MAC_RSV (*(reg32_t *)(MAC_BASE_ADDR + 0x160)) /* Rx status vector reg (RO) */
1180 #define MAC_FLOWCONTROLCNT (*(reg32_t *)(MAC_BASE_ADDR + 0x170)) /* Flow control counter reg */
1181 #define MAC_FLOWCONTROLSTS (*(reg32_t *)(MAC_BASE_ADDR + 0x174)) /* Flow control status reg */
1183 #define MAC_RXFILTERCTRL (*(reg32_t *)(MAC_BASE_ADDR + 0x200)) /* Rx filter ctrl reg */
1184 #define MAC_RXFILTERWOLSTS (*(reg32_t *)(MAC_BASE_ADDR + 0x204)) /* Rx filter WoL status reg (RO) */
1185 #define MAC_RXFILTERWOLCLR (*(reg32_t *)(MAC_BASE_ADDR + 0x208)) /* Rx filter WoL clear reg (WO) */
1187 #define MAC_HASHFILTERL (*(reg32_t *)(MAC_BASE_ADDR + 0x210)) /* Hash filter LSBs reg */
1188 #define MAC_HASHFILTERH (*(reg32_t *)(MAC_BASE_ADDR + 0x214)) /* Hash filter MSBs reg */
1190 #define MAC_INTSTATUS (*(reg32_t *)(MAC_BASE_ADDR + 0xFE0)) /* Interrupt status reg (RO) */
1191 #define MAC_INTENABLE (*(reg32_t *)(MAC_BASE_ADDR + 0xFE4)) /* Interrupt enable reg */
1192 #define MAC_INTCLEAR (*(reg32_t *)(MAC_BASE_ADDR + 0xFE8)) /* Interrupt clear reg (WO) */
1193 #define MAC_INTSET (*(reg32_t *)(MAC_BASE_ADDR + 0xFEC)) /* Interrupt set reg (WO) */
1195 #define MAC_POWERDOWN (*(reg32_t *)(MAC_BASE_ADDR + 0xFF4)) /* Power-down reg */
1196 #define MAC_MODULEID (*(reg32_t *)(MAC_BASE_ADDR + 0xFFC)) /* Module ID reg (RO) */
1205 #define INT_UART2 28
1206 #define INT_UART3 29
1208 #endif /* LPC23XX_H */