libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
gpio.h
Go to the documentation of this file.
1/** @defgroup gpio_defines General Purpose I/O Defines
2
3@brief <b>Defined Constants and Types for the LPC43xx General Purpose I/O</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) 2010 Uwe Hermann <uwe@hermann-uwe.de>
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_GPIO_H
36#define LPC43XX_GPIO_H
37
38/**@{*/
39
42
43/* --- Convenience macros -------------------------------------------------- */
44
45/* GPIO port base addresses (for convenience) */
46#define GPIO0 (GPIO_PORT_BASE + 0x2000)
47#define GPIO1 (GPIO_PORT_BASE + 0x2004)
48#define GPIO2 (GPIO_PORT_BASE + 0x2008)
49#define GPIO3 (GPIO_PORT_BASE + 0x200C)
50#define GPIO4 (GPIO_PORT_BASE + 0x2010)
51#define GPIO5 (GPIO_PORT_BASE + 0x2014)
52#define GPIO6 (GPIO_PORT_BASE + 0x2018)
53#define GPIO7 (GPIO_PORT_BASE + 0x201C)
54
55/* GPIO number definitions (for convenience) */
56#define GPIOPIN0 (1 << 0)
57#define GPIOPIN1 (1 << 1)
58#define GPIOPIN2 (1 << 2)
59#define GPIOPIN3 (1 << 3)
60#define GPIOPIN4 (1 << 4)
61#define GPIOPIN5 (1 << 5)
62#define GPIOPIN6 (1 << 6)
63#define GPIOPIN7 (1 << 7)
64#define GPIOPIN8 (1 << 8)
65#define GPIOPIN9 (1 << 9)
66#define GPIOPIN10 (1 << 10)
67#define GPIOPIN11 (1 << 11)
68#define GPIOPIN12 (1 << 12)
69#define GPIOPIN13 (1 << 13)
70#define GPIOPIN14 (1 << 14)
71#define GPIOPIN15 (1 << 15)
72#define GPIOPIN16 (1 << 16)
73#define GPIOPIN17 (1 << 17)
74#define GPIOPIN18 (1 << 18)
75#define GPIOPIN19 (1 << 19)
76#define GPIOPIN20 (1 << 20)
77#define GPIOPIN21 (1 << 21)
78#define GPIOPIN22 (1 << 22)
79#define GPIOPIN23 (1 << 23)
80#define GPIOPIN24 (1 << 24)
81#define GPIOPIN25 (1 << 25)
82#define GPIOPIN26 (1 << 26)
83#define GPIOPIN27 (1 << 27)
84#define GPIOPIN28 (1 << 28)
85#define GPIOPIN29 (1 << 29)
86#define GPIOPIN30 (1 << 30)
87#define GPIOPIN31 (1 << 31)
88
89/* --- GPIO registers ------------------------------------------------------ */
90
91/* GPIO pin interrupts */
92
93/* Pin Interrupt Mode register */
94#define GPIO_PIN_INTERRUPT_ISEL MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x000)
95
96/* Pin interrupt level (rising edge) interrupt enable register */
97#define GPIO_PIN_INTERRUPT_IENR MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x004)
98
99/* Pin interrupt level (rising edge) interrupt set register */
100#define GPIO_PIN_INTERRUPT_SIENR MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x008)
101
102/* Pin interrupt level (rising edge interrupt) clear register */
103#define GPIO_PIN_INTERRUPT_CIENR MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x00C)
104
105/* Pin interrupt active level (falling edge) interrupt enable register */
106#define GPIO_PIN_INTERRUPT_IENF MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x010)
107
108/* Pin interrupt active level (falling edge) interrupt set register */
109#define GPIO_PIN_INTERRUPT_SIENF MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x014)
110
111/* Pin interrupt active level (falling edge) interrupt clear register */
112#define GPIO_PIN_INTERRUPT_CIENF MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x018)
113
114/* Pin interrupt rising edge register */
115#define GPIO_PIN_INTERRUPT_RISE MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x01C)
116
117/* Pin interrupt falling edge register */
118#define GPIO_PIN_INTERRUPT_FALL MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x020)
119
120/* Pin interrupt status register */
121#define GPIO_PIN_INTERRUPT_IST MMIO32(GPIO_PIN_INTERRUPT_BASE + 0x024)
122
123/* GPIO GROUP0 interrupt */
124
125/* GPIO grouped interrupt control register */
126#define GPIO_GROUP0_INTERRUPT_CTRL \
127 MMIO32(GPIO_GROUP0_INTERRUPT_BASE + 0x000)
128
129/* GPIO grouped interrupt port [0..7] polarity register */
130#define GPIO_GROUP0_INTERRUPT_PORT_POL(x) \
131 MMIO32(GPIO_GROUP0_INTERRUPT_BASE + 0x020 + ((x)*4))
132
133/* GPIO grouped interrupt port [0..7] enable register */
134#define GPIO_GROUP0_INTERRUPT_PORT_ENA(x) \
135 MMIO32(GPIO_GROUP0_INTERRUPT_BASE + 0x040 + ((x)*4))
136
137/* GPIO GROUP1 interrupt */
138
139/* GPIO grouped interrupt control register */
140#define GPIO_GROUP1_INTERRUPT_CTRL \
141 MMIO32(GPIO_GROUP1_INTERRUPT_BASE + 0x000)
142
143/* GPIO grouped interrupt port [0..7] polarity register */
144#define GPIO_GROUP1_INTERRUPT_PORT_POL(x) \
145 MMIO32(GPIO_GROUP1_INTERRUPT_BASE + 0x020 + ((x)*4))
146
147/* GPIO grouped interrupt port [0..7] enable register */
148#define GPIO_GROUP1_INTERRUPT_PORT_ENA(x) \
149 MMIO32(GPIO_GROUP1_INTERRUPT_BASE + 0x040 + ((x)*4))
150
151/* Byte pin registers port 0; pins PIO0_0 to PIO0_31 (R/W) */
152#define GPIO_B0 (GPIO_PORT_BASE + 0x0000)
153#define GPIO_B1 (GPIO_PORT_BASE + 0x0001)
154#define GPIO_B2 (GPIO_PORT_BASE + 0x0002)
155#define GPIO_B3 (GPIO_PORT_BASE + 0x0003)
156#define GPIO_B4 (GPIO_PORT_BASE + 0x0004)
157#define GPIO_B5 (GPIO_PORT_BASE + 0x0005)
158#define GPIO_B6 (GPIO_PORT_BASE + 0x0006)
159#define GPIO_B7 (GPIO_PORT_BASE + 0x0007)
160#define GPIO_B8 (GPIO_PORT_BASE + 0x0008)
161#define GPIO_B9 (GPIO_PORT_BASE + 0x0009)
162#define GPIO_B10 (GPIO_PORT_BASE + 0x000A)
163#define GPIO_B11 (GPIO_PORT_BASE + 0x000B)
164#define GPIO_B12 (GPIO_PORT_BASE + 0x000C)
165#define GPIO_B13 (GPIO_PORT_BASE + 0x000D)
166#define GPIO_B14 (GPIO_PORT_BASE + 0x000E)
167#define GPIO_B15 (GPIO_PORT_BASE + 0x000F)
168#define GPIO_B16 (GPIO_PORT_BASE + 0x0010)
169#define GPIO_B17 (GPIO_PORT_BASE + 0x0011)
170#define GPIO_B18 (GPIO_PORT_BASE + 0x0012)
171#define GPIO_B19 (GPIO_PORT_BASE + 0x0013)
172#define GPIO_B20 (GPIO_PORT_BASE + 0x0014)
173#define GPIO_B21 (GPIO_PORT_BASE + 0x0015)
174#define GPIO_B22 (GPIO_PORT_BASE + 0x0016)
175#define GPIO_B23 (GPIO_PORT_BASE + 0x0017)
176#define GPIO_B24 (GPIO_PORT_BASE + 0x0018)
177#define GPIO_B25 (GPIO_PORT_BASE + 0x0019)
178#define GPIO_B26 (GPIO_PORT_BASE + 0x001A)
179#define GPIO_B27 (GPIO_PORT_BASE + 0x001B)
180#define GPIO_B28 (GPIO_PORT_BASE + 0x001C)
181#define GPIO_B29 (GPIO_PORT_BASE + 0x001D)
182#define GPIO_B30 (GPIO_PORT_BASE + 0x001E)
183#define GPIO_B31 (GPIO_PORT_BASE + 0x001F)
184
185/* Byte pin registers port 1 (R/W) */
186#define GPIO_B32 (GPIO_PORT_BASE + 0x0020)
187#define GPIO_B33 (GPIO_PORT_BASE + 0x0021)
188#define GPIO_B34 (GPIO_PORT_BASE + 0x0022)
189#define GPIO_B35 (GPIO_PORT_BASE + 0x0023)
190#define GPIO_B36 (GPIO_PORT_BASE + 0x0024)
191#define GPIO_B37 (GPIO_PORT_BASE + 0x0025)
192#define GPIO_B38 (GPIO_PORT_BASE + 0x0026)
193#define GPIO_B39 (GPIO_PORT_BASE + 0x0027)
194#define GPIO_B40 (GPIO_PORT_BASE + 0x0028)
195#define GPIO_B41 (GPIO_PORT_BASE + 0x0029)
196#define GPIO_B42 (GPIO_PORT_BASE + 0x002A)
197#define GPIO_B43 (GPIO_PORT_BASE + 0x002B)
198#define GPIO_B44 (GPIO_PORT_BASE + 0x002C)
199#define GPIO_B45 (GPIO_PORT_BASE + 0x002D)
200#define GPIO_B46 (GPIO_PORT_BASE + 0x002E)
201#define GPIO_B47 (GPIO_PORT_BASE + 0x002F)
202#define GPIO_B48 (GPIO_PORT_BASE + 0x0030)
203#define GPIO_B49 (GPIO_PORT_BASE + 0x0031)
204#define GPIO_B50 (GPIO_PORT_BASE + 0x0032)
205#define GPIO_B51 (GPIO_PORT_BASE + 0x0033)
206#define GPIO_B52 (GPIO_PORT_BASE + 0x0034)
207#define GPIO_B53 (GPIO_PORT_BASE + 0x0035)
208#define GPIO_B54 (GPIO_PORT_BASE + 0x0036)
209#define GPIO_B55 (GPIO_PORT_BASE + 0x0037)
210#define GPIO_B56 (GPIO_PORT_BASE + 0x0038)
211#define GPIO_B57 (GPIO_PORT_BASE + 0x0039)
212#define GPIO_B58 (GPIO_PORT_BASE + 0x003A)
213#define GPIO_B59 (GPIO_PORT_BASE + 0x003B)
214#define GPIO_B60 (GPIO_PORT_BASE + 0x003C)
215#define GPIO_B61 (GPIO_PORT_BASE + 0x003D)
216#define GPIO_B62 (GPIO_PORT_BASE + 0x003E)
217#define GPIO_B63 (GPIO_PORT_BASE + 0x003F)
218
219/* Byte pin registers port 2 (R/W) */
220#define GPIO_B64 (GPIO_PORT_BASE + 0x0040)
221#define GPIO_B65 (GPIO_PORT_BASE + 0x0041)
222#define GPIO_B66 (GPIO_PORT_BASE + 0x0042)
223#define GPIO_B67 (GPIO_PORT_BASE + 0x0043)
224#define GPIO_B68 (GPIO_PORT_BASE + 0x0044)
225#define GPIO_B69 (GPIO_PORT_BASE + 0x0045)
226#define GPIO_B70 (GPIO_PORT_BASE + 0x0046)
227#define GPIO_B71 (GPIO_PORT_BASE + 0x0047)
228#define GPIO_B72 (GPIO_PORT_BASE + 0x0048)
229#define GPIO_B73 (GPIO_PORT_BASE + 0x0049)
230#define GPIO_B74 (GPIO_PORT_BASE + 0x004A)
231#define GPIO_B75 (GPIO_PORT_BASE + 0x004B)
232#define GPIO_B76 (GPIO_PORT_BASE + 0x004C)
233#define GPIO_B77 (GPIO_PORT_BASE + 0x004D)
234#define GPIO_B78 (GPIO_PORT_BASE + 0x004E)
235#define GPIO_B79 (GPIO_PORT_BASE + 0x004F)
236#define GPIO_B80 (GPIO_PORT_BASE + 0x0050)
237#define GPIO_B81 (GPIO_PORT_BASE + 0x0051)
238#define GPIO_B82 (GPIO_PORT_BASE + 0x0052)
239#define GPIO_B83 (GPIO_PORT_BASE + 0x0053)
240#define GPIO_B84 (GPIO_PORT_BASE + 0x0054)
241#define GPIO_B85 (GPIO_PORT_BASE + 0x0055)
242#define GPIO_B86 (GPIO_PORT_BASE + 0x0056)
243#define GPIO_B87 (GPIO_PORT_BASE + 0x0057)
244#define GPIO_B88 (GPIO_PORT_BASE + 0x0058)
245#define GPIO_B89 (GPIO_PORT_BASE + 0x0059)
246#define GPIO_B90 (GPIO_PORT_BASE + 0x005A)
247#define GPIO_B91 (GPIO_PORT_BASE + 0x005B)
248#define GPIO_B92 (GPIO_PORT_BASE + 0x005C)
249#define GPIO_B93 (GPIO_PORT_BASE + 0x005D)
250#define GPIO_B94 (GPIO_PORT_BASE + 0x005E)
251#define GPIO_B95 (GPIO_PORT_BASE + 0x005F)
252
253/* Byte pin registers port 3 (R/W) */
254#define GPIO_B96 (GPIO_PORT_BASE + 0x0060)
255#define GPIO_B97 (GPIO_PORT_BASE + 0x0061)
256#define GPIO_B98 (GPIO_PORT_BASE + 0x0062)
257#define GPIO_B99 (GPIO_PORT_BASE + 0x0063)
258#define GPIO_B100 (GPIO_PORT_BASE + 0x0064)
259#define GPIO_B101 (GPIO_PORT_BASE + 0x0065)
260#define GPIO_B102 (GPIO_PORT_BASE + 0x0066)
261#define GPIO_B103 (GPIO_PORT_BASE + 0x0067)
262#define GPIO_B104 (GPIO_PORT_BASE + 0x0068)
263#define GPIO_B105 (GPIO_PORT_BASE + 0x0069)
264#define GPIO_B106 (GPIO_PORT_BASE + 0x006A)
265#define GPIO_B107 (GPIO_PORT_BASE + 0x006B)
266#define GPIO_B108 (GPIO_PORT_BASE + 0x006C)
267#define GPIO_B109 (GPIO_PORT_BASE + 0x006D)
268#define GPIO_B110 (GPIO_PORT_BASE + 0x006E)
269#define GPIO_B111 (GPIO_PORT_BASE + 0x006F)
270#define GPIO_B112 (GPIO_PORT_BASE + 0x0070)
271#define GPIO_B113 (GPIO_PORT_BASE + 0x0071)
272#define GPIO_B114 (GPIO_PORT_BASE + 0x0072)
273#define GPIO_B115 (GPIO_PORT_BASE + 0x0073)
274#define GPIO_B116 (GPIO_PORT_BASE + 0x0074)
275#define GPIO_B117 (GPIO_PORT_BASE + 0x0075)
276#define GPIO_B118 (GPIO_PORT_BASE + 0x0076)
277#define GPIO_B119 (GPIO_PORT_BASE + 0x0077)
278#define GPIO_B120 (GPIO_PORT_BASE + 0x0078)
279#define GPIO_B121 (GPIO_PORT_BASE + 0x0079)
280#define GPIO_B122 (GPIO_PORT_BASE + 0x007A)
281#define GPIO_B123 (GPIO_PORT_BASE + 0x007B)
282#define GPIO_B124 (GPIO_PORT_BASE + 0x007C)
283#define GPIO_B125 (GPIO_PORT_BASE + 0x007D)
284#define GPIO_B126 (GPIO_PORT_BASE + 0x007E)
285#define GPIO_B127 (GPIO_PORT_BASE + 0x007F)
286
287/* Byte pin registers port 4 (R/W) */
288#define GPIO_B128 (GPIO_PORT_BASE + 0x0080)
289#define GPIO_B129 (GPIO_PORT_BASE + 0x0081)
290#define GPIO_B130 (GPIO_PORT_BASE + 0x0082)
291#define GPIO_B131 (GPIO_PORT_BASE + 0x0083)
292#define GPIO_B132 (GPIO_PORT_BASE + 0x0084)
293#define GPIO_B133 (GPIO_PORT_BASE + 0x0085)
294#define GPIO_B134 (GPIO_PORT_BASE + 0x0086)
295#define GPIO_B135 (GPIO_PORT_BASE + 0x0087)
296#define GPIO_B136 (GPIO_PORT_BASE + 0x0088)
297#define GPIO_B137 (GPIO_PORT_BASE + 0x0089)
298#define GPIO_B138 (GPIO_PORT_BASE + 0x008A)
299#define GPIO_B139 (GPIO_PORT_BASE + 0x008B)
300#define GPIO_B140 (GPIO_PORT_BASE + 0x008C)
301#define GPIO_B141 (GPIO_PORT_BASE + 0x008D)
302#define GPIO_B142 (GPIO_PORT_BASE + 0x008E)
303#define GPIO_B143 (GPIO_PORT_BASE + 0x008F)
304#define GPIO_B144 (GPIO_PORT_BASE + 0x0090)
305#define GPIO_B145 (GPIO_PORT_BASE + 0x0091)
306#define GPIO_B146 (GPIO_PORT_BASE + 0x0092)
307#define GPIO_B147 (GPIO_PORT_BASE + 0x0093)
308#define GPIO_B148 (GPIO_PORT_BASE + 0x0094)
309#define GPIO_B149 (GPIO_PORT_BASE + 0x0095)
310#define GPIO_B150 (GPIO_PORT_BASE + 0x0096)
311#define GPIO_B151 (GPIO_PORT_BASE + 0x0097)
312#define GPIO_B152 (GPIO_PORT_BASE + 0x0098)
313#define GPIO_B153 (GPIO_PORT_BASE + 0x0099)
314#define GPIO_B154 (GPIO_PORT_BASE + 0x009A)
315#define GPIO_B155 (GPIO_PORT_BASE + 0x009B)
316#define GPIO_B156 (GPIO_PORT_BASE + 0x009C)
317#define GPIO_B157 (GPIO_PORT_BASE + 0x009D)
318#define GPIO_B158 (GPIO_PORT_BASE + 0x009E)
319#define GPIO_B159 (GPIO_PORT_BASE + 0x009F)
320
321/* Byte pin registers port 5 (R/W) */
322#define GPIO_B160 (GPIO_PORT_BASE + 0x00A0)
323#define GPIO_B161 (GPIO_PORT_BASE + 0x00A1)
324#define GPIO_B162 (GPIO_PORT_BASE + 0x00A2)
325#define GPIO_B163 (GPIO_PORT_BASE + 0x00A3)
326#define GPIO_B164 (GPIO_PORT_BASE + 0x00A4)
327#define GPIO_B165 (GPIO_PORT_BASE + 0x00A5)
328#define GPIO_B166 (GPIO_PORT_BASE + 0x00A6)
329#define GPIO_B167 (GPIO_PORT_BASE + 0x00A7)
330#define GPIO_B168 (GPIO_PORT_BASE + 0x00A8)
331#define GPIO_B169 (GPIO_PORT_BASE + 0x00A9)
332#define GPIO_B170 (GPIO_PORT_BASE + 0x00AA)
333#define GPIO_B171 (GPIO_PORT_BASE + 0x00AB)
334#define GPIO_B172 (GPIO_PORT_BASE + 0x00AC)
335#define GPIO_B173 (GPIO_PORT_BASE + 0x00AD)
336#define GPIO_B174 (GPIO_PORT_BASE + 0x00AE)
337#define GPIO_B175 (GPIO_PORT_BASE + 0x00AF)
338#define GPIO_B176 (GPIO_PORT_BASE + 0x00B0)
339#define GPIO_B177 (GPIO_PORT_BASE + 0x00B1)
340#define GPIO_B178 (GPIO_PORT_BASE + 0x00B2)
341#define GPIO_B179 (GPIO_PORT_BASE + 0x00B3)
342#define GPIO_B180 (GPIO_PORT_BASE + 0x00B4)
343#define GPIO_B181 (GPIO_PORT_BASE + 0x00B5)
344#define GPIO_B182 (GPIO_PORT_BASE + 0x00B6)
345#define GPIO_B183 (GPIO_PORT_BASE + 0x00B7)
346#define GPIO_B184 (GPIO_PORT_BASE + 0x00B8)
347#define GPIO_B185 (GPIO_PORT_BASE + 0x00B9)
348#define GPIO_B186 (GPIO_PORT_BASE + 0x00BA)
349#define GPIO_B187 (GPIO_PORT_BASE + 0x00BB)
350#define GPIO_B188 (GPIO_PORT_BASE + 0x00BC)
351#define GPIO_B189 (GPIO_PORT_BASE + 0x00BD)
352#define GPIO_B190 (GPIO_PORT_BASE + 0x00BE)
353#define GPIO_B191 (GPIO_PORT_BASE + 0x00BF)
354
355/* Byte pin registers port 6 (R/W) */
356#define GPIO_B192 (GPIO_PORT_BASE + 0x00C0)
357#define GPIO_B193 (GPIO_PORT_BASE + 0x00C1)
358#define GPIO_B194 (GPIO_PORT_BASE + 0x00C2)
359#define GPIO_B195 (GPIO_PORT_BASE + 0x00C3)
360#define GPIO_B196 (GPIO_PORT_BASE + 0x00C4)
361#define GPIO_B197 (GPIO_PORT_BASE + 0x00C5)
362#define GPIO_B198 (GPIO_PORT_BASE + 0x00C6)
363#define GPIO_B199 (GPIO_PORT_BASE + 0x00C7)
364#define GPIO_B200 (GPIO_PORT_BASE + 0x00C8)
365#define GPIO_B201 (GPIO_PORT_BASE + 0x00C9)
366#define GPIO_B202 (GPIO_PORT_BASE + 0x00CA)
367#define GPIO_B203 (GPIO_PORT_BASE + 0x00CB)
368#define GPIO_B204 (GPIO_PORT_BASE + 0x00CC)
369#define GPIO_B205 (GPIO_PORT_BASE + 0x00CD)
370#define GPIO_B206 (GPIO_PORT_BASE + 0x00CE)
371#define GPIO_B207 (GPIO_PORT_BASE + 0x00CF)
372#define GPIO_B208 (GPIO_PORT_BASE + 0x00D0)
373#define GPIO_B209 (GPIO_PORT_BASE + 0x00D1)
374#define GPIO_B210 (GPIO_PORT_BASE + 0x00D2)
375#define GPIO_B211 (GPIO_PORT_BASE + 0x00D3)
376#define GPIO_B212 (GPIO_PORT_BASE + 0x00D4)
377#define GPIO_B213 (GPIO_PORT_BASE + 0x00D5)
378#define GPIO_B214 (GPIO_PORT_BASE + 0x00D6)
379#define GPIO_B215 (GPIO_PORT_BASE + 0x00D7)
380#define GPIO_B216 (GPIO_PORT_BASE + 0x00D8)
381#define GPIO_B217 (GPIO_PORT_BASE + 0x00D9)
382#define GPIO_B218 (GPIO_PORT_BASE + 0x00DA)
383#define GPIO_B219 (GPIO_PORT_BASE + 0x00DB)
384#define GPIO_B220 (GPIO_PORT_BASE + 0x00DC)
385#define GPIO_B221 (GPIO_PORT_BASE + 0x00DD)
386#define GPIO_B222 (GPIO_PORT_BASE + 0x00DE)
387#define GPIO_B223 (GPIO_PORT_BASE + 0x00DF)
388
389/* Byte pin registers port 7 (R/W) */
390#define GPIO_B224 (GPIO_PORT_BASE + 0x00E0)
391#define GPIO_B225 (GPIO_PORT_BASE + 0x00E1)
392#define GPIO_B226 (GPIO_PORT_BASE + 0x00E2)
393#define GPIO_B227 (GPIO_PORT_BASE + 0x00E3)
394#define GPIO_B228 (GPIO_PORT_BASE + 0x00E4)
395#define GPIO_B229 (GPIO_PORT_BASE + 0x00E5)
396#define GPIO_B230 (GPIO_PORT_BASE + 0x00E6)
397#define GPIO_B231 (GPIO_PORT_BASE + 0x00E7)
398#define GPIO_B232 (GPIO_PORT_BASE + 0x00E8)
399#define GPIO_B233 (GPIO_PORT_BASE + 0x00E9)
400#define GPIO_B234 (GPIO_PORT_BASE + 0x00EA)
401#define GPIO_B235 (GPIO_PORT_BASE + 0x00EB)
402#define GPIO_B236 (GPIO_PORT_BASE + 0x00EC)
403#define GPIO_B237 (GPIO_PORT_BASE + 0x00ED)
404#define GPIO_B238 (GPIO_PORT_BASE + 0x00EE)
405#define GPIO_B239 (GPIO_PORT_BASE + 0x00EF)
406#define GPIO_B240 (GPIO_PORT_BASE + 0x00F0)
407#define GPIO_B241 (GPIO_PORT_BASE + 0x00F1)
408#define GPIO_B242 (GPIO_PORT_BASE + 0x00F2)
409#define GPIO_B243 (GPIO_PORT_BASE + 0x00F3)
410#define GPIO_B244 (GPIO_PORT_BASE + 0x00F4)
411#define GPIO_B245 (GPIO_PORT_BASE + 0x00F5)
412#define GPIO_B246 (GPIO_PORT_BASE + 0x00F6)
413#define GPIO_B247 (GPIO_PORT_BASE + 0x00F7)
414#define GPIO_B248 (GPIO_PORT_BASE + 0x00F8)
415#define GPIO_B249 (GPIO_PORT_BASE + 0x00F9)
416#define GPIO_B250 (GPIO_PORT_BASE + 0x00FA)
417#define GPIO_B251 (GPIO_PORT_BASE + 0x00FB)
418#define GPIO_B252 (GPIO_PORT_BASE + 0x00FC)
419#define GPIO_B253 (GPIO_PORT_BASE + 0x00FD)
420#define GPIO_B254 (GPIO_PORT_BASE + 0x00FE)
421#define GPIO_B255 (GPIO_PORT_BASE + 0x00FF)
422
423/* Word pin registers port 0 (R/W) */
424#define GPIO_W0 (GPIO_PORT_BASE + 0x1000)
425#define GPIO_W1 (GPIO_PORT_BASE + 0x1004)
426#define GPIO_W2 (GPIO_PORT_BASE + 0x1008)
427#define GPIO_W3 (GPIO_PORT_BASE + 0x100C)
428#define GPIO_W4 (GPIO_PORT_BASE + 0x1010)
429#define GPIO_W5 (GPIO_PORT_BASE + 0x1014)
430#define GPIO_W6 (GPIO_PORT_BASE + 0x1018)
431#define GPIO_W7 (GPIO_PORT_BASE + 0x101C)
432#define GPIO_W8 (GPIO_PORT_BASE + 0x1020)
433#define GPIO_W9 (GPIO_PORT_BASE + 0x1024)
434#define GPIO_W10 (GPIO_PORT_BASE + 0x1028)
435#define GPIO_W11 (GPIO_PORT_BASE + 0x102C)
436#define GPIO_W12 (GPIO_PORT_BASE + 0x1030)
437#define GPIO_W13 (GPIO_PORT_BASE + 0x1034)
438#define GPIO_W14 (GPIO_PORT_BASE + 0x1038)
439#define GPIO_W15 (GPIO_PORT_BASE + 0x103C)
440#define GPIO_W16 (GPIO_PORT_BASE + 0x1040)
441#define GPIO_W17 (GPIO_PORT_BASE + 0x1044)
442#define GPIO_W18 (GPIO_PORT_BASE + 0x1048)
443#define GPIO_W19 (GPIO_PORT_BASE + 0x104C)
444#define GPIO_W20 (GPIO_PORT_BASE + 0x1050)
445#define GPIO_W21 (GPIO_PORT_BASE + 0x1054)
446#define GPIO_W22 (GPIO_PORT_BASE + 0x1058)
447#define GPIO_W23 (GPIO_PORT_BASE + 0x105C)
448#define GPIO_W24 (GPIO_PORT_BASE + 0x1060)
449#define GPIO_W25 (GPIO_PORT_BASE + 0x1064)
450#define GPIO_W26 (GPIO_PORT_BASE + 0x1068)
451#define GPIO_W27 (GPIO_PORT_BASE + 0x106C)
452#define GPIO_W28 (GPIO_PORT_BASE + 0x1070)
453#define GPIO_W29 (GPIO_PORT_BASE + 0x1074)
454#define GPIO_W30 (GPIO_PORT_BASE + 0x1078)
455#define GPIO_W31 (GPIO_PORT_BASE + 0x107C)
456
457/* Word pin registers port 1 (R/W) */
458#define GPIO_W32 (GPIO_PORT_BASE + 0x1080)
459#define GPIO_W33 (GPIO_PORT_BASE + 0x1084)
460#define GPIO_W34 (GPIO_PORT_BASE + 0x1088)
461#define GPIO_W35 (GPIO_PORT_BASE + 0x108C)
462#define GPIO_W36 (GPIO_PORT_BASE + 0x1090)
463#define GPIO_W37 (GPIO_PORT_BASE + 0x1094)
464#define GPIO_W38 (GPIO_PORT_BASE + 0x1098)
465#define GPIO_W39 (GPIO_PORT_BASE + 0x109C)
466#define GPIO_W40 (GPIO_PORT_BASE + 0x10A0)
467#define GPIO_W41 (GPIO_PORT_BASE + 0x10A4)
468#define GPIO_W42 (GPIO_PORT_BASE + 0x10A8)
469#define GPIO_W43 (GPIO_PORT_BASE + 0x10AC)
470#define GPIO_W44 (GPIO_PORT_BASE + 0x10B0)
471#define GPIO_W45 (GPIO_PORT_BASE + 0x10B4)
472#define GPIO_W46 (GPIO_PORT_BASE + 0x10B8)
473#define GPIO_W47 (GPIO_PORT_BASE + 0x10BC)
474#define GPIO_W48 (GPIO_PORT_BASE + 0x10C0)
475#define GPIO_W49 (GPIO_PORT_BASE + 0x10C4)
476#define GPIO_W50 (GPIO_PORT_BASE + 0x10C8)
477#define GPIO_W51 (GPIO_PORT_BASE + 0x10CC)
478#define GPIO_W52 (GPIO_PORT_BASE + 0x10D0)
479#define GPIO_W53 (GPIO_PORT_BASE + 0x10D4)
480#define GPIO_W54 (GPIO_PORT_BASE + 0x10D8)
481#define GPIO_W55 (GPIO_PORT_BASE + 0x10DC)
482#define GPIO_W56 (GPIO_PORT_BASE + 0x10E0)
483#define GPIO_W57 (GPIO_PORT_BASE + 0x10E4)
484#define GPIO_W58 (GPIO_PORT_BASE + 0x10E8)
485#define GPIO_W59 (GPIO_PORT_BASE + 0x10EC)
486#define GPIO_W60 (GPIO_PORT_BASE + 0x10F0)
487#define GPIO_W61 (GPIO_PORT_BASE + 0x10F4)
488#define GPIO_W62 (GPIO_PORT_BASE + 0x10F8)
489#define GPIO_W63 (GPIO_PORT_BASE + 0x10FC)
490
491/* Word pin registers port 2 (R/W) */
492#define GPIO_W64 (GPIO_PORT_BASE + 0x1100)
493#define GPIO_W65 (GPIO_PORT_BASE + 0x1104)
494#define GPIO_W66 (GPIO_PORT_BASE + 0x1108)
495#define GPIO_W67 (GPIO_PORT_BASE + 0x110C)
496#define GPIO_W68 (GPIO_PORT_BASE + 0x1110)
497#define GPIO_W69 (GPIO_PORT_BASE + 0x1114)
498#define GPIO_W70 (GPIO_PORT_BASE + 0x1118)
499#define GPIO_W71 (GPIO_PORT_BASE + 0x111C)
500#define GPIO_W72 (GPIO_PORT_BASE + 0x1120)
501#define GPIO_W73 (GPIO_PORT_BASE + 0x1124)
502#define GPIO_W74 (GPIO_PORT_BASE + 0x1128)
503#define GPIO_W75 (GPIO_PORT_BASE + 0x112C)
504#define GPIO_W76 (GPIO_PORT_BASE + 0x1130)
505#define GPIO_W77 (GPIO_PORT_BASE + 0x1134)
506#define GPIO_W78 (GPIO_PORT_BASE + 0x1138)
507#define GPIO_W79 (GPIO_PORT_BASE + 0x113C)
508#define GPIO_W80 (GPIO_PORT_BASE + 0x1140)
509#define GPIO_W81 (GPIO_PORT_BASE + 0x1144)
510#define GPIO_W82 (GPIO_PORT_BASE + 0x1148)
511#define GPIO_W83 (GPIO_PORT_BASE + 0x114C)
512#define GPIO_W84 (GPIO_PORT_BASE + 0x1150)
513#define GPIO_W85 (GPIO_PORT_BASE + 0x1154)
514#define GPIO_W86 (GPIO_PORT_BASE + 0x1158)
515#define GPIO_W87 (GPIO_PORT_BASE + 0x115C)
516#define GPIO_W88 (GPIO_PORT_BASE + 0x1160)
517#define GPIO_W89 (GPIO_PORT_BASE + 0x1164)
518#define GPIO_W90 (GPIO_PORT_BASE + 0x1168)
519#define GPIO_W91 (GPIO_PORT_BASE + 0x116C)
520#define GPIO_W92 (GPIO_PORT_BASE + 0x1170)
521#define GPIO_W93 (GPIO_PORT_BASE + 0x1174)
522#define GPIO_W94 (GPIO_PORT_BASE + 0x1178)
523#define GPIO_W95 (GPIO_PORT_BASE + 0x117C)
524
525/* Word pin registers port 3 (R/W) */
526#define GPIO_W96 (GPIO_PORT_BASE + 0x1180)
527#define GPIO_W97 (GPIO_PORT_BASE + 0x1184)
528#define GPIO_W98 (GPIO_PORT_BASE + 0x1188)
529#define GPIO_W99 (GPIO_PORT_BASE + 0x118C)
530#define GPIO_W100 (GPIO_PORT_BASE + 0x1190)
531#define GPIO_W101 (GPIO_PORT_BASE + 0x1194)
532#define GPIO_W102 (GPIO_PORT_BASE + 0x1198)
533#define GPIO_W103 (GPIO_PORT_BASE + 0x119C)
534#define GPIO_W104 (GPIO_PORT_BASE + 0x11A0)
535#define GPIO_W105 (GPIO_PORT_BASE + 0x11A4)
536#define GPIO_W106 (GPIO_PORT_BASE + 0x11A8)
537#define GPIO_W107 (GPIO_PORT_BASE + 0x11AC)
538#define GPIO_W108 (GPIO_PORT_BASE + 0x11B0)
539#define GPIO_W109 (GPIO_PORT_BASE + 0x11B4)
540#define GPIO_W110 (GPIO_PORT_BASE + 0x11B8)
541#define GPIO_W111 (GPIO_PORT_BASE + 0x11BC)
542#define GPIO_W112 (GPIO_PORT_BASE + 0x11C0)
543#define GPIO_W113 (GPIO_PORT_BASE + 0x11C4)
544#define GPIO_W114 (GPIO_PORT_BASE + 0x11C8)
545#define GPIO_W115 (GPIO_PORT_BASE + 0x11CC)
546#define GPIO_W116 (GPIO_PORT_BASE + 0x11D0)
547#define GPIO_W117 (GPIO_PORT_BASE + 0x11D4)
548#define GPIO_W118 (GPIO_PORT_BASE + 0x11D8)
549#define GPIO_W119 (GPIO_PORT_BASE + 0x11DC)
550#define GPIO_W120 (GPIO_PORT_BASE + 0x11E0)
551#define GPIO_W121 (GPIO_PORT_BASE + 0x11E4)
552#define GPIO_W122 (GPIO_PORT_BASE + 0x11E8)
553#define GPIO_W123 (GPIO_PORT_BASE + 0x11EC)
554#define GPIO_W124 (GPIO_PORT_BASE + 0x11F0)
555#define GPIO_W125 (GPIO_PORT_BASE + 0x11F4)
556#define GPIO_W126 (GPIO_PORT_BASE + 0x11F8)
557#define GPIO_W127 (GPIO_PORT_BASE + 0x11FC)
558
559/* Word pin registers port 4 (R/W) */
560#define GPIO_W128 (GPIO_PORT_BASE + 0x1200)
561#define GPIO_W129 (GPIO_PORT_BASE + 0x1204)
562#define GPIO_W130 (GPIO_PORT_BASE + 0x1208)
563#define GPIO_W131 (GPIO_PORT_BASE + 0x120C)
564#define GPIO_W132 (GPIO_PORT_BASE + 0x1210)
565#define GPIO_W133 (GPIO_PORT_BASE + 0x1214)
566#define GPIO_W134 (GPIO_PORT_BASE + 0x1218)
567#define GPIO_W135 (GPIO_PORT_BASE + 0x121C)
568#define GPIO_W136 (GPIO_PORT_BASE + 0x1220)
569#define GPIO_W137 (GPIO_PORT_BASE + 0x1224)
570#define GPIO_W138 (GPIO_PORT_BASE + 0x1228)
571#define GPIO_W139 (GPIO_PORT_BASE + 0x122C)
572#define GPIO_W140 (GPIO_PORT_BASE + 0x1230)
573#define GPIO_W141 (GPIO_PORT_BASE + 0x1234)
574#define GPIO_W142 (GPIO_PORT_BASE + 0x1238)
575#define GPIO_W143 (GPIO_PORT_BASE + 0x123C)
576#define GPIO_W144 (GPIO_PORT_BASE + 0x1240)
577#define GPIO_W145 (GPIO_PORT_BASE + 0x1244)
578#define GPIO_W146 (GPIO_PORT_BASE + 0x1248)
579#define GPIO_W147 (GPIO_PORT_BASE + 0x124C)
580#define GPIO_W148 (GPIO_PORT_BASE + 0x1250)
581#define GPIO_W149 (GPIO_PORT_BASE + 0x1254)
582#define GPIO_W150 (GPIO_PORT_BASE + 0x1258)
583#define GPIO_W151 (GPIO_PORT_BASE + 0x125C)
584#define GPIO_W152 (GPIO_PORT_BASE + 0x1260)
585#define GPIO_W153 (GPIO_PORT_BASE + 0x1264)
586#define GPIO_W154 (GPIO_PORT_BASE + 0x1268)
587#define GPIO_W155 (GPIO_PORT_BASE + 0x126C)
588#define GPIO_W156 (GPIO_PORT_BASE + 0x1270)
589#define GPIO_W157 (GPIO_PORT_BASE + 0x1274)
590#define GPIO_W158 (GPIO_PORT_BASE + 0x1278)
591#define GPIO_W159 (GPIO_PORT_BASE + 0x127C)
592
593/* Word pin registers port 5 (R/W) */
594#define GPIO_W160 (GPIO_PORT_BASE + 0x1280)
595#define GPIO_W161 (GPIO_PORT_BASE + 0x1284)
596#define GPIO_W162 (GPIO_PORT_BASE + 0x1288)
597#define GPIO_W163 (GPIO_PORT_BASE + 0x128C)
598#define GPIO_W164 (GPIO_PORT_BASE + 0x1290)
599#define GPIO_W165 (GPIO_PORT_BASE + 0x1294)
600#define GPIO_W166 (GPIO_PORT_BASE + 0x1298)
601#define GPIO_W167 (GPIO_PORT_BASE + 0x129C)
602#define GPIO_W168 (GPIO_PORT_BASE + 0x12A0)
603#define GPIO_W169 (GPIO_PORT_BASE + 0x12A4)
604#define GPIO_W170 (GPIO_PORT_BASE + 0x12A8)
605#define GPIO_W171 (GPIO_PORT_BASE + 0x12AC)
606#define GPIO_W172 (GPIO_PORT_BASE + 0x12B0)
607#define GPIO_W173 (GPIO_PORT_BASE + 0x12B4)
608#define GPIO_W174 (GPIO_PORT_BASE + 0x12B8)
609#define GPIO_W175 (GPIO_PORT_BASE + 0x12BC)
610#define GPIO_W176 (GPIO_PORT_BASE + 0x12C0)
611#define GPIO_W177 (GPIO_PORT_BASE + 0x12C4)
612#define GPIO_W178 (GPIO_PORT_BASE + 0x12C8)
613#define GPIO_W179 (GPIO_PORT_BASE + 0x12CC)
614#define GPIO_W180 (GPIO_PORT_BASE + 0x12D0)
615#define GPIO_W181 (GPIO_PORT_BASE + 0x12D4)
616#define GPIO_W182 (GPIO_PORT_BASE + 0x12D8)
617#define GPIO_W183 (GPIO_PORT_BASE + 0x12DC)
618#define GPIO_W184 (GPIO_PORT_BASE + 0x12E0)
619#define GPIO_W185 (GPIO_PORT_BASE + 0x12E4)
620#define GPIO_W186 (GPIO_PORT_BASE + 0x12E8)
621#define GPIO_W187 (GPIO_PORT_BASE + 0x12EC)
622#define GPIO_W188 (GPIO_PORT_BASE + 0x12F0)
623#define GPIO_W189 (GPIO_PORT_BASE + 0x12F4)
624#define GPIO_W190 (GPIO_PORT_BASE + 0x12F8)
625#define GPIO_W191 (GPIO_PORT_BASE + 0x12FC)
626
627/* Word pin registers port 6 (R/W) */
628#define GPIO_W192 (GPIO_PORT_BASE + 0x1300)
629#define GPIO_W193 (GPIO_PORT_BASE + 0x1304)
630#define GPIO_W194 (GPIO_PORT_BASE + 0x1308)
631#define GPIO_W195 (GPIO_PORT_BASE + 0x130C)
632#define GPIO_W196 (GPIO_PORT_BASE + 0x1310)
633#define GPIO_W197 (GPIO_PORT_BASE + 0x1314)
634#define GPIO_W198 (GPIO_PORT_BASE + 0x1318)
635#define GPIO_W199 (GPIO_PORT_BASE + 0x131C)
636#define GPIO_W200 (GPIO_PORT_BASE + 0x1320)
637#define GPIO_W201 (GPIO_PORT_BASE + 0x1324)
638#define GPIO_W202 (GPIO_PORT_BASE + 0x1328)
639#define GPIO_W203 (GPIO_PORT_BASE + 0x132C)
640#define GPIO_W204 (GPIO_PORT_BASE + 0x1330)
641#define GPIO_W205 (GPIO_PORT_BASE + 0x1334)
642#define GPIO_W206 (GPIO_PORT_BASE + 0x1338)
643#define GPIO_W207 (GPIO_PORT_BASE + 0x133C)
644#define GPIO_W208 (GPIO_PORT_BASE + 0x1340)
645#define GPIO_W209 (GPIO_PORT_BASE + 0x1344)
646#define GPIO_W210 (GPIO_PORT_BASE + 0x1348)
647#define GPIO_W211 (GPIO_PORT_BASE + 0x134C)
648#define GPIO_W212 (GPIO_PORT_BASE + 0x1350)
649#define GPIO_W213 (GPIO_PORT_BASE + 0x1354)
650#define GPIO_W214 (GPIO_PORT_BASE + 0x1358)
651#define GPIO_W215 (GPIO_PORT_BASE + 0x135C)
652#define GPIO_W216 (GPIO_PORT_BASE + 0x1360)
653#define GPIO_W217 (GPIO_PORT_BASE + 0x1364)
654#define GPIO_W218 (GPIO_PORT_BASE + 0x1368)
655#define GPIO_W219 (GPIO_PORT_BASE + 0x136C)
656#define GPIO_W220 (GPIO_PORT_BASE + 0x1370)
657#define GPIO_W221 (GPIO_PORT_BASE + 0x1374)
658#define GPIO_W222 (GPIO_PORT_BASE + 0x1378)
659#define GPIO_W223 (GPIO_PORT_BASE + 0x137C)
660
661/* Word pin registers port 7 (R/W) */
662#define GPIO_W224 (GPIO_PORT_BASE + 0x1380)
663#define GPIO_W225 (GPIO_PORT_BASE + 0x1384)
664#define GPIO_W226 (GPIO_PORT_BASE + 0x1388)
665#define GPIO_W227 (GPIO_PORT_BASE + 0x138C)
666#define GPIO_W228 (GPIO_PORT_BASE + 0x1390)
667#define GPIO_W229 (GPIO_PORT_BASE + 0x1394)
668#define GPIO_W230 (GPIO_PORT_BASE + 0x1398)
669#define GPIO_W231 (GPIO_PORT_BASE + 0x139C)
670#define GPIO_W232 (GPIO_PORT_BASE + 0x13A0)
671#define GPIO_W233 (GPIO_PORT_BASE + 0x13A4)
672#define GPIO_W234 (GPIO_PORT_BASE + 0x13A8)
673#define GPIO_W235 (GPIO_PORT_BASE + 0x13AC)
674#define GPIO_W236 (GPIO_PORT_BASE + 0x13B0)
675#define GPIO_W237 (GPIO_PORT_BASE + 0x13B4)
676#define GPIO_W238 (GPIO_PORT_BASE + 0x13B8)
677#define GPIO_W239 (GPIO_PORT_BASE + 0x13BC)
678#define GPIO_W240 (GPIO_PORT_BASE + 0x13C0)
679#define GPIO_W241 (GPIO_PORT_BASE + 0x13C4)
680#define GPIO_W242 (GPIO_PORT_BASE + 0x13C8)
681#define GPIO_W243 (GPIO_PORT_BASE + 0x13CC)
682#define GPIO_W244 (GPIO_PORT_BASE + 0x13D0)
683#define GPIO_W245 (GPIO_PORT_BASE + 0x13D4)
684#define GPIO_W246 (GPIO_PORT_BASE + 0x13D8)
685#define GPIO_W247 (GPIO_PORT_BASE + 0x13DC)
686#define GPIO_W248 (GPIO_PORT_BASE + 0x13E0)
687#define GPIO_W249 (GPIO_PORT_BASE + 0x13E4)
688#define GPIO_W250 (GPIO_PORT_BASE + 0x13E8)
689#define GPIO_W251 (GPIO_PORT_BASE + 0x13EC)
690#define GPIO_W252 (GPIO_PORT_BASE + 0x13F0)
691#define GPIO_W253 (GPIO_PORT_BASE + 0x13F4)
692#define GPIO_W254 (GPIO_PORT_BASE + 0x13F8)
693#define GPIO_W255 (GPIO_PORT_BASE + 0x13FC)
694
695/* GPIO data direction register (GPIOn_DIR) */
696#define GPIO_DIR(port) MMIO32((port) + 0x00)
697#define GPIO0_DIR GPIO_DIR(GPIO0)
698#define GPIO1_DIR GPIO_DIR(GPIO1)
699#define GPIO2_DIR GPIO_DIR(GPIO2)
700#define GPIO3_DIR GPIO_DIR(GPIO3)
701#define GPIO4_DIR GPIO_DIR(GPIO4)
702#define GPIO5_DIR GPIO_DIR(GPIO5)
703#define GPIO6_DIR GPIO_DIR(GPIO6)
704#define GPIO7_DIR GPIO_DIR(GPIO7)
705
706/* GPIO fast mask register (GPIOn_MASK) */
707#define GPIO_MASK(port) MMIO32((port) + 0x80)
708#define GPIO0_MASK GPIO_MASK(GPIO0)
709#define GPIO1_MASK GPIO_MASK(GPIO1)
710#define GPIO2_MASK GPIO_MASK(GPIO2)
711#define GPIO3_MASK GPIO_MASK(GPIO3)
712#define GPIO4_MASK GPIO_MASK(GPIO4)
713#define GPIO5_MASK GPIO_MASK(GPIO5)
714#define GPIO6_MASK GPIO_MASK(GPIO6)
715#define GPIO7_MASK GPIO_MASK(GPIO7)
716
717/* GPIO port pin value register (GPIOn_PIN) */
718#define GPIO_PIN(port) MMIO32((port) + 0x100)
719#define GPIO0_PIN GPIO_PIN(GPIO0)
720#define GPIO1_PIN GPIO_PIN(GPIO1)
721#define GPIO2_PIN GPIO_PIN(GPIO2)
722#define GPIO3_PIN GPIO_PIN(GPIO3)
723#define GPIO4_PIN GPIO_PIN(GPIO4)
724#define GPIO5_PIN GPIO_PIN(GPIO5)
725#define GPIO6_PIN GPIO_PIN(GPIO6)
726#define GPIO7_PIN GPIO_PIN(GPIO7)
727
728/* GPIO port masked pin value register (GPIOn_MPIN) */
729#define GPIO_MPIN(port) MMIO32((port) + 0x180)
730#define GPIO0_MPIN GPIO_MPIN(GPIO0)
731#define GPIO1_MPIN GPIO_MPIN(GPIO1)
732#define GPIO2_MPIN GPIO_MPIN(GPIO2)
733#define GPIO3_MPIN GPIO_MPIN(GPIO3)
734#define GPIO4_MPIN GPIO_MPIN(GPIO4)
735#define GPIO5_MPIN GPIO_MPIN(GPIO5)
736#define GPIO6_MPIN GPIO_MPIN(GPIO6)
737#define GPIO7_MPIN GPIO_MPIN(GPIO7)
738
739/* GPIO port output set register (GPIOn_SET) */
740#define GPIO_SET(port) MMIO32((port) + 0x200)
741#define GPIO0_SET GPIO_SET(GPIO0)
742#define GPIO1_SET GPIO_SET(GPIO1)
743#define GPIO2_SET GPIO_SET(GPIO2)
744#define GPIO3_SET GPIO_SET(GPIO3)
745#define GPIO4_SET GPIO_SET(GPIO4)
746#define GPIO5_SET GPIO_SET(GPIO5)
747#define GPIO6_SET GPIO_SET(GPIO6)
748#define GPIO7_SET GPIO_SET(GPIO7)
749
750/* GPIO port output clear register (GPIOn_CLR) */
751#define GPIO_CLR(port) MMIO32((port) + 0x280)
752#define GPIO0_CLR GPIO_CLR(GPIO0)
753#define GPIO1_CLR GPIO_CLR(GPIO1)
754#define GPIO2_CLR GPIO_CLR(GPIO2)
755#define GPIO3_CLR GPIO_CLR(GPIO3)
756#define GPIO4_CLR GPIO_CLR(GPIO4)
757#define GPIO5_CLR GPIO_CLR(GPIO5)
758#define GPIO6_CLR GPIO_CLR(GPIO6)
759#define GPIO7_CLR GPIO_CLR(GPIO7)
760
761/* GPIO port toggle register (GPIOn_NOT) */
762#define GPIO_NOT(port) MMIO32((port) + 0x300)
763#define GPIO0_NOT GPIO_NOT(GPIO0)
764#define GPIO1_NOT GPIO_NOT(GPIO1)
765#define GPIO2_NOT GPIO_NOT(GPIO2)
766#define GPIO3_NOT GPIO_NOT(GPIO3)
767#define GPIO4_NOT GPIO_NOT(GPIO4)
768#define GPIO5_NOT GPIO_NOT(GPIO5)
769#define GPIO6_NOT GPIO_NOT(GPIO6)
770#define GPIO7_NOT GPIO_NOT(GPIO7)
771
772/* TODO interrupts */
773
775
776void gpio_set(uint32_t gpioport, uint32_t gpios);
777void gpio_clear(uint32_t gpioport, uint32_t gpios);
778void gpio_toggle(uint32_t gpioport, uint32_t gpios);
779
781
782/**@}*/
783
784#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void gpio_set(uint32_t gpioport, uint32_t gpios)
void gpio_clear(uint32_t gpioport, uint32_t gpios)
void gpio_toggle(uint32_t gpioport, uint32_t gpios)