[processor-sdk/pdk.git] / packages / ti / board / diag / exp_header / build / am64x_evm / gpio_test_header_config.c
1 /******************************************************************************\r
2 * Copyright (c) 2020 Texas Instruments Incorporated - http://www.ti.com\r
3 *\r
4 * Redistribution and use in source and binary forms, with or without\r
5 * modification, are permitted provided that the following conditions\r
6 * are met:\r
7 *\r
8 * Redistributions of source code must retain the above copyright\r
9 * notice, this list of conditions and the following disclaimer.\r
10 *\r
11 * Redistributions in binary form must reproduce the above copyright\r
12 * notice, this list of conditions and the following disclaimer in the\r
13 * documentation and/or other materials provided with the\r
14 * distribution.\r
15 *\r
16 * Neither the name of Texas Instruments Incorporated nor the names of\r
17 * its contributors may be used to endorse or promote products derived\r
18 * from this software without specific prior written permission.\r
19 *\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31 *\r
32 *****************************************************************************/\r
33 \r
34 /**\r
35 * \file gpio_test_header_config.c\r
36 *\r
37 * \brief GPIO test header configuration file.\r
38 *\r
39 */\r
40 #include <stdio.h>\r
41 #include <ti/drv/gpio/GPIO.h>\r
42 #include <ti/csl/soc.h>\r
43 #include <ti/drv/gpio/soc/GPIO_soc.h>\r
44 \r
45 /*\r
46 Port and pin number mask for GPIO.\r
47 Bits 7-0: Pin number and Bits 15-8: Port number */\r
48 \r
49 #define PIN1 (0x0128) /* GPIO1_40/GPIO1_51 */\r
50 #define PIN2 (0x0133)\r
51 \r
52 #define PIN3 (0x0129) /* GPIO1_41/GPIO1_50 */\r
53 #define PIN4 (0x0132)\r
54 \r
55 #define PIN5 (0x0108) /* GPIO1_8/GPIO1_28 */\r
56 #define PIN6 (0x011C)\r
57 \r
58 #define PIN7 (0x0102) /* GPIO1_2/GPIO1_21 */\r
59 #define PIN8 (0x0115)\r
60 \r
61 #define PIN9 (0x0103) /* GPIO1_3/GPIO1_20 */\r
62 #define PIN10 (0x0114)\r
63 \r
64 #define PIN11 (0x0104) /* GPIO1_4/GPIO1_7 */\r
65 #define PIN12 (0x0107)\r
66 \r
67 #define PIN13 (0x010C) /* GPIO1_12/GPIO1_17 */\r
68 #define PIN14 (0x0111)\r
69 \r
70 #define PIN15 (0x0124) /* GPIO1_36/GPIO1_18 */\r
71 #define PIN16 (0x0112)\r
72 \r
73 #define PIN17 (0x001E) /* GPIO0_30/GPIO1_19 */\r
74 #define PIN18 (0x0113)\r
75 \r
76 #define PIN19 (0x0024) /* GPIO0_36/GPIO1_0 */\r
77 #define PIN20 (0x0100)\r
78 \r
79 #define PIN21 (0x0018) /* GPIO0_24/GPIO1_24 */\r
80 #define PIN22 (0x0118)\r
81 \r
82 #define PIN23 (0x0017) /* GPIO0_23/GPIO1_11 */\r
83 #define PIN24 (0x010B)\r
84 \r
85 #define PIN25 (0x0120) /* GPIO1_32/GPIO0_29 */\r
86 #define PIN26 (0x001D)\r
87 \r
88 #define PIN27 (0x0019) /* GPIO0_25/GPIO0_35 */\r
89 #define PIN28 (0x0023)\r
90 \r
91 #define PIN29 (0x001F) /* GPIO0_31/GPIO1_10 */\r
92 #define PIN30 (0x010A)\r
93 \r
94 #define PIN31 (0x0131) /* GPIO1_49/GPIO1_13 */\r
95 #define PIN32 (0x010D)\r
96 \r
97 #define PIN33 (0x0105) /* GPIO1_5/GPIO1_23 */\r
98 #define PIN34 (0x0117)\r
99 \r
100 #define PIN35 (0x010E) /* GPIO1_14/GPIO1_6 */\r
101 #define PIN36 (0x0106)\r
102 \r
103 #define PIN37 (0x0123) /* GPIO1_35/GPIO1_22 */\r
104 #define PIN38 (0x0116)\r
105 \r
106 #define PIN39 (0x0054) /* GPIO0_84/GPIO0_17 */\r
107 #define PIN40 (0x0011)\r
108 \r
109 #define PIN41 (0x0053) /* GPIO0_83/GPIO0_27 */\r
110 #define PIN42 (0x001B)\r
111 \r
112 #define PIN43 (0x0020) /* GPIO0_32/GPIO0_22 */\r
113 #define PIN44 (0x0016)\r
114 \r
115 #define PIN45 (0x0022) /* GPIO0_34/GPIO0_43 */\r
116 #define PIN46 (0x002B)\r
117 \r
118 #define PIN47 (0x0025) /* GPIO0_37/GPIO0_44 */\r
119 #define PIN48 (0x002C)\r
120 \r
121 #define PIN49 (0x0027) /* GPIO0_39/GPIO1_37 */\r
122 #define PIN50 (0x0125)\r
123 \r
124 #define PIN51 (0x0127) /* GPIO1_39/GPIO1_63 */\r
125 #define PIN52 (0x013F)\r
126 \r
127 #define PIN53 (0x012F) /* GPIO1_47/GPIO1_33 */\r
128 #define PIN54 (0x0121)\r
129 \r
130 #define PIN55 (0x0130) /* GPIO1_48/GPIO1_25 */\r
131 #define PIN56 (0x0119)\r
132 \r
133 #define PIN57 (0x011F) /* GPIO1_31/GPIO0_16 */\r
134 #define PIN58 (0x0010)\r
135 \r
136 #define PIN59 (0x010F) /* GPIO1_15/GPIO0_82 */\r
137 #define PIN60 (0x0052)\r
138 \r
139 #define PIN61 (0x001C) /* GPIO0_28/GPIO0_40 */\r
140 #define PIN62 (0x0028)\r
141 \r
142 #define PIN63 (0x0021) /* GPIO0_33/GPIO1_60 */\r
143 #define PIN64 (0x013C)\r
144 \r
145 #define PIN65 (0x0126) /* GPIO1_38/GPIO1_62 */\r
146 #define PIN66 (0x013E)\r
147 \r
148 #define PIN67 (0x0101) /* GPIO1_1/GPIO1_26 */\r
149 #define PIN68 (0x011A)\r
150 \r
151 #define PIN69 (0x0110) /* GPIO1_16/GPIO1_34 */\r
152 #define PIN70 (0x0122)\r
153 \r
154 #define PIN71 (0x0014) /* GPIO0_20/GPIO0_18 */\r
155 #define PIN72 (0x0012)\r
156 \r
157 #define PIN73 (0x002A) /* GPIO0_42/GPIO0_26 */\r
158 #define PIN74 (0x001A)\r
159 \r
160 #define PIN75 (0x011D) /* GPIO1_29/GPIO0_38 */\r
161 #define PIN76 (0x0026)\r
162 \r
163 #define PIN77 (0x013D) /* GPIO1_61/GPIO1_30 */\r
164 #define PIN78 (0x011E)\r
165 \r
166 #define PIN79 (0x000F) /* GPIO0_15/GPIO0_21 */\r
167 #define PIN80 (0x0015)\r
168 \r
169 #define PIN81 (0x0140) /* GPIO1_64/GPIO1_65 */\r
170 #define PIN82 (0x0141)\r
171 \r
172 #define PIN83 (0x012F) /* GPIO1_27/GPIO0_41/GPIO1_9 */\r
173 #define PIN84 (0x0029)\r
174 #define PIN85 (0x0109)\r
175 /* Safety Connector Pins */\r
176 #define PIN86 (0x0204) /* MCU_GPIO0_4/MCU_GPIO0_13 */\r
177 #define PIN87 (0x020D)\r
178 \r
179 #define PIN88 (0x020A) /* MCU_GPIO0_10/MCU_GPIO0_6 */\r
180 #define PIN89 (0x0206)\r
181 \r
182 #define PIN90 (0x0210) /* MCU_GPIO0_16/MCU_GPIO0_21 */\r
183 #define PIN91 (0x0215)\r
184 \r
185 #define PIN92 (0x0209) /* MCU_GPIO0_9/MCU_GPIO0_11 */\r
186 #define PIN93 (0x020B)\r
187 \r
188 #define PIN94 (0x0214) /* MCU_GPIO0_20/MCU_GPIO0_15 */\r
189 #define PIN95 (0x020F)\r
190 \r
191 #define PIN96 (0x020C) /* MCU_GPIO0_12/MCU_GPIO0_7 */\r
192 #define PIN97 (0x0207)\r
193 \r
194 #define PIN98 (0x0208) /* MCU_GPIO0_8/MCU_GPIO0_14 */\r
195 #define PIN99 (0x020D)\r
196 \r
197 #define PIN100 (0x0211) /* MCU_GPIO0_17/MCU_GPIO0_22 */\r
198 #define PIN101 (0x0216)\r
199 \r
200 #define PIN102 (0x0212) /* MCU_GPIO0_18/MCU_GPIO0_19 */\r
201 #define PIN103 (0x0213)\r
202 \r
203 /* GPIO Driver board specific pin configuration structure */\r
204 GPIO_PinConfig gpioPinConfigs[] = {\r
205 /* pin Mux Line PROFI_UART_SEL */\r
206 PIN1 | GPIO_CFG_OUTPUT,\r
207 PIN2 | GPIO_CFG_INPUT,\r
208 PIN3 | GPIO_CFG_OUTPUT,\r
209 PIN4 | GPIO_CFG_INPUT,\r
210 PIN5 | GPIO_CFG_OUTPUT,\r
211 PIN6 | GPIO_CFG_INPUT,\r
212 PIN7 | GPIO_CFG_OUTPUT,\r
213 PIN8 | GPIO_CFG_INPUT,\r
214 PIN9 | GPIO_CFG_OUTPUT,\r
215 PIN10 | GPIO_CFG_INPUT,\r
216 PIN11 | GPIO_CFG_OUTPUT,\r
217 PIN12 | GPIO_CFG_INPUT,\r
218 PIN13 | GPIO_CFG_OUTPUT,\r
219 PIN14 | GPIO_CFG_INPUT,\r
220 PIN15 | GPIO_CFG_OUTPUT,\r
221 PIN16 | GPIO_CFG_INPUT,\r
222 PIN17 | GPIO_CFG_OUTPUT,\r
223 PIN18 | GPIO_CFG_INPUT,\r
224 PIN19 | GPIO_CFG_OUTPUT,\r
225 PIN20 | GPIO_CFG_INPUT,\r
226 PIN21 | GPIO_CFG_OUTPUT,\r
227 PIN22 | GPIO_CFG_INPUT,\r
228 PIN23 | GPIO_CFG_OUTPUT,\r
229 PIN24 | GPIO_CFG_INPUT,\r
230 PIN25 | GPIO_CFG_OUTPUT,\r
231 PIN26 | GPIO_CFG_INPUT,\r
232 PIN27 | GPIO_CFG_OUTPUT,\r
233 PIN28 | GPIO_CFG_INPUT,\r
234 PIN29 | GPIO_CFG_OUTPUT,\r
235 PIN30 | GPIO_CFG_INPUT,\r
236 PIN31 | GPIO_CFG_OUTPUT,\r
237 PIN32 | GPIO_CFG_INPUT,\r
238 PIN33 | GPIO_CFG_OUTPUT,\r
239 PIN34 | GPIO_CFG_INPUT,\r
240 PIN35 | GPIO_CFG_OUTPUT,\r
241 PIN36 | GPIO_CFG_INPUT,\r
242 PIN37 | GPIO_CFG_OUTPUT,\r
243 PIN38 | GPIO_CFG_INPUT,\r
244 PIN39 | GPIO_CFG_OUTPUT,\r
245 PIN40 | GPIO_CFG_INPUT,\r
246 PIN41 | GPIO_CFG_OUTPUT,\r
247 PIN42 | GPIO_CFG_INPUT,\r
248 PIN43 | GPIO_CFG_OUTPUT,\r
249 PIN44 | GPIO_CFG_INPUT,\r
250 PIN45 | GPIO_CFG_OUTPUT,\r
251 PIN46 | GPIO_CFG_INPUT,\r
252 PIN47 | GPIO_CFG_OUTPUT,\r
253 PIN48 | GPIO_CFG_INPUT,\r
254 PIN49 | GPIO_CFG_OUTPUT,\r
255 PIN50 | GPIO_CFG_INPUT,\r
256 PIN51 | GPIO_CFG_OUTPUT,\r
257 PIN52 | GPIO_CFG_INPUT,\r
258 PIN53 | GPIO_CFG_OUTPUT,\r
259 PIN54 | GPIO_CFG_INPUT,\r
260 PIN55 | GPIO_CFG_OUTPUT,\r
261 PIN56 | GPIO_CFG_INPUT,\r
262 PIN57 | GPIO_CFG_OUTPUT,\r
263 PIN58 | GPIO_CFG_INPUT,\r
264 PIN59 | GPIO_CFG_OUTPUT,\r
265 PIN60 | GPIO_CFG_INPUT,\r
266 PIN61 | GPIO_CFG_OUTPUT,\r
267 PIN62 | GPIO_CFG_INPUT,\r
268 PIN63 | GPIO_CFG_OUTPUT,\r
269 PIN64 | GPIO_CFG_INPUT,\r
270 PIN65 | GPIO_CFG_OUTPUT,\r
271 PIN66 | GPIO_CFG_INPUT,\r
272 PIN67 | GPIO_CFG_OUTPUT,\r
273 PIN68 | GPIO_CFG_INPUT,\r
274 PIN69 | GPIO_CFG_OUTPUT,\r
275 PIN70 | GPIO_CFG_INPUT,\r
276 PIN71 | GPIO_CFG_OUTPUT,\r
277 PIN72 | GPIO_CFG_INPUT,\r
278 PIN73 | GPIO_CFG_OUTPUT,\r
279 PIN74 | GPIO_CFG_INPUT,\r
280 PIN75 | GPIO_CFG_OUTPUT,\r
281 PIN76 | GPIO_CFG_INPUT,\r
282 PIN77 | GPIO_CFG_OUTPUT,\r
283 PIN78 | GPIO_CFG_INPUT,\r
284 PIN79 | GPIO_CFG_OUTPUT,\r
285 PIN80 | GPIO_CFG_INPUT,\r
286 PIN81 | GPIO_CFG_OUTPUT,\r
287 PIN82 | GPIO_CFG_INPUT,\r
288 PIN83 | GPIO_CFG_OUTPUT,\r
289 PIN84 | GPIO_CFG_INPUT,\r
290 PIN85 | GPIO_CFG_INPUT,\r
291 /* Safety Connector Pins */\r
292 PIN86 | GPIO_CFG_OUTPUT,\r
293 PIN87 | GPIO_CFG_INPUT,\r
294 PIN88 | GPIO_CFG_OUTPUT,\r
295 PIN89 | GPIO_CFG_INPUT,\r
296 PIN90 | GPIO_CFG_OUTPUT,\r
297 PIN91 | GPIO_CFG_INPUT,\r
298 PIN92 | GPIO_CFG_OUTPUT,\r
299 PIN93 | GPIO_CFG_INPUT,\r
300 PIN94 | GPIO_CFG_OUTPUT,\r
301 PIN95 | GPIO_CFG_INPUT,\r
302 PIN96 | GPIO_CFG_OUTPUT,\r
303 PIN97 | GPIO_CFG_INPUT,\r
304 PIN98 | GPIO_CFG_OUTPUT,\r
305 PIN99 | GPIO_CFG_INPUT,\r
306 PIN100 | GPIO_CFG_OUTPUT,\r
307 PIN101 | GPIO_CFG_INPUT,\r
308 PIN102 | GPIO_CFG_OUTPUT,\r
309 PIN103 | GPIO_CFG_INPUT,\r
310 \r
311 };\r
312 \r
313 /* GPIO Driver call back functions */\r
314 GPIO_CallbackFxn gpioCallbackFunctions[] = {\r
315 NULL,\r
316 };\r
317 \r
318 /* GPIO Driver configuration structure */\r
319 GPIO_v0_Config GPIO_v0_config = {\r
320 gpioPinConfigs,\r
321 gpioCallbackFunctions,\r
322 sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),\r
323 sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),\r
324 0,\r
325 };\r