AM261x MCU+ SDK: pinmux.h Source File

| AM261x MCU+ SDK 26.00.00 |

pinmux/am261x/pinmux.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2021 Texas Instruments Incorporated
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
63 #ifndef PINMUX_AM261X_H_
64 #define PINMUX_AM261X_H_
65
66 /* ========================================================================== */
67 /* Include Files */
68 /* ========================================================================== */
69
70 #include <stdint.h>
71
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
75
76 /* ========================================================================== */
77 /* Macros & Typedefs */
78 /* ========================================================================== */
79
85 #define PINMUX_DOMAIN_ID_MAIN (0U)
86
89 #define PINMUX_END (-1)
90
91 #define PIN_MODE(mode) ((uint32_t) mode)
92
94 #define PIN_FORCE_INPUT_ENABLE (((uint32_t) 0x1U) << 4U)
95
96 #define PIN_FORCE_INPUT_DISABLE (((uint32_t) 0x3U) << 4U)
97
98 #define PIN_FORCE_OUTPUT_ENABLE (((uint32_t) 0x1U) << 6U)
99
100 #define PIN_FORCE_OUTPUT_DISABLE (((uint32_t) 0x3U) << 6U)
101
103 #define PIN_PULL_DISABLE (((uint32_t) 0x1U) << 8U)
104
105 #define PIN_PULL_UP (((uint32_t) 0x1U) << 9U)
106
107 #define PIN_PULL_DOWN (((uint32_t) 0x0U) << 9U)
108
110 #define PIN_SLEW_RATE_HIGH (((uint32_t) 0x0U) << 10U)
111
112 #define PIN_SLEW_RATE_LOW (((uint32_t) 0x1U) << 10U)
113
115 #define PIN_GPIO_R5SS0_0 (((uint32_t) 0x0U) << 16U)
116
117 #define PIN_GPIO_R5SS0_1 (((uint32_t) 0x1U) << 16U)
118
119 #define PIN_GPIO_R5SS1_0 (((uint32_t) 0x2U) << 16U)
120
121 #define PIN_GPIO_R5SS1_1 (((uint32_t) 0x3U) << 16U)
122
124 #define PIN_QUAL_GRP_MAX_INDEX (17U)
125
126 #define PIN_QUAL_GROUP_CFG_START (CSL_IOMUX_QUAL_GRP_0_CFG_REG)
127
129 #define PIN_QUAL_SYNC (((uint32_t) 0x0U) << 18U)
130
131 #define PIN_QUAL_3SAMPLE (((uint32_t) 0x1U) << 18U)
132
133 #define PIN_QUAL_6SAMPLE (((uint32_t) 0x2U) << 18U)
134
135 #define PIN_QUAL_ASYNC (((uint32_t) 0x3U) << 18U)
136
138 #define PIN_INVERT (((uint32_t) 0x1U) << 20U)
139
140 #define PIN_NON_INVERT (((uint32_t) 0x0U) << 20U)
141
142
149 #define PIN_GPIO0 (0x00000000U)
150 #define PIN_GPIO1 (0x00000004U)
151 #define PIN_GPIO2 (0x00000008U)
152 #define PIN_GPIO3 (0x0000000CU)
153 #define PIN_GPIO4 (0x00000010U)
154 #define PIN_GPIO5 (0x00000014U)
155 #define PIN_GPIO6 (0x00000018U)
156 #define PIN_GPIO7 (0x0000001CU)
157 #define PIN_GPIO8 (0x00000020U)
158 #define PIN_GPIO9 (0x00000024U)
159 #define PIN_GPIO10 (0x00000028U)
160 #define PIN_GPIO11 (0x0000002CU)
161 #define PIN_GPIO12 (0x00000030U)
162 #define PIN_GPIO13 (0x00000034U)
163 #define PIN_GPIO14 (0x00000038U)
164 #define PIN_GPIO15 (0x0000003CU)
165 #define PIN_GPIO16 (0x00000040U)
166 #define PIN_GPIO17 (0x00000044U)
167 #define PIN_GPIO18 (0x00000048U)
168 #define PIN_GPIO19 (0x0000004CU)
169 #define PIN_GPIO20 (0x00000050U)
170 #define PIN_GPIO21 (0x00000054U)
171 #define PIN_GPIO22 (0x00000058U)
172 #define PIN_GPIO23 (0x0000005CU)
173 #define PIN_GPIO24 (0x00000060U)
174 #define PIN_GPIO25 (0x00000064U)
175 #define PIN_GPIO26 (0x00000068U)
176 #define PIN_GPIO27 (0x0000006CU)
177 #define PIN_GPIO28 (0x00000070U)
178 #define PIN_GPIO29 (0x00000074U)
179 #define PIN_GPIO30 (0x00000078U)
180 #define PIN_GPIO31 (0x0000007CU)
181 #define PIN_GPIO32 (0x00000080U)
182 #define PIN_GPIO33 (0x00000084U)
183 #define PIN_GPIO34 (0x00000088U)
184 #define PIN_GPIO35 (0x0000008CU)
185 #define PIN_GPIO36 (0x00000090U)
186 #define PIN_GPIO37 (0x00000094U)
187 #define PIN_GPIO38 (0x00000098U)
188 #define PIN_GPIO39 (0x0000009CU)
189 #define PIN_GPIO40 (0x000000A0U)
190 #define PIN_GPIO41 (0x000000A4U)
191 #define PIN_GPIO42 (0x000000A8U)
192 #define PIN_GPIO43 (0x000000ACU)
193 #define PIN_GPIO44 (0x000000B0U)
194 #define PIN_GPIO45 (0x000000B4U)
195 #define PIN_GPIO46 (0x000000B8U)
196 #define PIN_GPIO47 (0x000000BCU)
197 #define PIN_GPIO48 (0x000000C0U)
198 #define PIN_GPIO49 (0x000000C4U)
199 #define PIN_GPIO50 (0x000000C8U)
200 #define PIN_GPIO51 (0x000000CCU)
201 #define PIN_GPIO52 (0x000000D0U)
202 #define PIN_GPIO53 (0x000000D4U)
203 #define PIN_GPIO54 (0x000000D8U)
204 #define PIN_GPIO55 (0x000000DCU)
205 #define PIN_GPIO56 (0x000000E0U)
206 #define PIN_GPIO57 (0x000000E4U)
207 #define PIN_GPIO58 (0x000000E8U)
208 #define PIN_GPIO59 (0x000000ECU)
209 #define PIN_GPIO60 (0x000000F0U)
210 #define PIN_GPIO61 (0x000000F4U)
211 #define PIN_GPIO62 (0x000000F8U)
212 #define PIN_GPIO63 (0x000000FCU)
213 #define PIN_GPIO64 (0x00000100U)
214 #define PIN_GPIO65 (0x00000104U)
215 #define PIN_GPIO66 (0x00000108U)
216 #define PIN_GPIO67 (0x0000010CU)
217 #define PIN_GPIO68 (0x00000110U)
218 #define PIN_GPIO69 (0x00000114U)
219 #define PIN_GPIO70 (0x00000118U)
220 #define PIN_GPIO71 (0x0000011CU)
221 #define PIN_GPIO72 (0x00000120U)
222 #define PIN_GPIO73 (0x00000124U)
223 #define PIN_GPIO74 (0x00000128U)
224 #define PIN_GPIO75 (0x0000012CU)
225 #define PIN_GPIO76 (0x00000130U)
226 #define PIN_GPIO77 (0x00000134U)
227 #define PIN_GPIO78 (0x00000138U)
228 #define PIN_GPIO79 (0x0000013CU)
229 #define PIN_GPIO80 (0x00000140U)
230 #define PIN_GPIO81 (0x00000144U)
231 #define PIN_GPIO82 (0x00000148U)
232 #define PIN_GPIO83 (0x0000014CU)
233 #define PIN_GPIO84 (0x00000150U)
234 #define PIN_GPIO85 (0x00000154U)
235 #define PIN_GPIO86 (0x00000158U)
236 #define PIN_GPIO87 (0x0000015CU)
237 #define PIN_GPIO88 (0x00000160U)
238 #define PIN_GPIO89 (0x00000164U)
239 #define PIN_GPIO90 (0x00000168U)
240 #define PIN_GPIO91 (0x0000016CU)
241 #define PIN_GPIO92 (0x00000170U)
242 #define PIN_GPIO93 (0x00000174U)
243 #define PIN_GPIO94 (0x00000178U)
244 #define PIN_GPIO95 (0x0000017CU)
245 #define PIN_GPIO96 (0x00000180U)
246 #define PIN_GPIO97 (0x00000184U)
247 #define PIN_GPIO98 (0x00000188U)
248 #define PIN_GPIO99 (0x0000018CU)
249 #define PIN_GPIO100 (0x00000190U)
250 #define PIN_GPIO101 (0x00000194U)
251 #define PIN_GPIO102 (0x00000198U)
252 #define PIN_GPIO103 (0x0000019CU)
253 #define PIN_GPIO104 (0x000001A0U)
254 #define PIN_GPIO105 (0x000001A4U)
255 #define PIN_GPIO106 (0x000001A8U)
256 #define PIN_GPIO107 (0x000001ACU)
257 #define PIN_GPIO108 (0x000001B0U)
258 #define PIN_GPIO109 (0x000001B4U)
259 #define PIN_GPIO110 (0x000001B8U)
260 #define PIN_GPIO111 (0x000001BCU)
261 #define PIN_GPIO112 (0x000001C0U)
262 #define PIN_GPIO113 (0x000001C4U)
263 #define PIN_GPIO114 (0x000001C8U)
264 #define PIN_GPIO115 (0x000001CCU)
265 #define PIN_GPIO116 (0x000001D0U)
266 #define PIN_GPIO117 (0x000001D4U)
267 #define PIN_GPIO118 (0x000001D8U)
268 #define PIN_GPIO119 (0x000001DCU)
269 #define PIN_GPIO120 (0x000001E0U)
270 #define PIN_GPIO121 (0x000001E4U)
271 #define PIN_GPIO122 (0x000001E8U)
272 #define PIN_GPIO123 (0x000001ECU)
273 #define PIN_GPIO124 (0x000001F0U)
274 #define PIN_GPIO125 (0x000001F4U)
275 #define PIN_GPIO126 (0x000001F8U)
276 #define PIN_GPIO127 (0x000001FCU)
277 #define PIN_GPIO128 (0x00000200U)
278 #define PIN_GPIO129 (0x00000204U)
279 #define PIN_GPIO130 (0x00000208U)
280 #define PIN_GPIO131 (0x0000020CU)
281 #define PIN_GPIO132 (0x00000210U)
282 #define PIN_GPIO133 (0x00000214U)
283 #define PIN_GPIO134 (0x00000218U)
284 #define PIN_GPIO135 (0x0000021CU)
285 #define PIN_GPIO136 (0x00000220U)
286 #define PIN_GPIO137 (0x00000224U)
287 #define PIN_GPIO138 (0x00000228U)
288 #define PIN_GPIO139 (0x0000022CU)
289 #define PIN_GPIO140 (0x00000230U)
290 #define PIN_WARMRSTn (0x00000234U)
291 #define PIN_SAFETY_ERRORn (0x00000238U)
292 #define PIN_TDI (0x0000023CU)
293 #define PIN_TDO (0x00000240U)
294 #define PIN_TMS (0x00000244U)
295 #define PIN_TCK (0x00000248U)
296 #define PIN_OSPI0_CLKLB (0x0000024CU)
297 #define PIN_OSPI1_CLKLB (0x00000250U)
298 #define PIN_PORz (0x00000254U)
299 #define PIN_XTAL_XI (0x00000258U)
300 #define PIN_XTAL_XO (0x0000025CU)
301 #define PIN_ADC0_AIN0 (0x00000260U)
302 #define PIN_ADC0_AIN1 (0x00000264U)
303 #define PIN_ADC0_AIN2 (0x00000268U)
304 #define PIN_ADC0_AIN3 (0x0000026CU)
305 #define PIN_ADC0_AIN4 (0x00000270U)
306 #define PIN_ADC0_AIN5 (0x00000274U)
307 #define PIN_ADC0_AIN6 (0x00000278U)
308 #define PIN_ADC1_AIN0 (0x0000027CU)
309 #define PIN_ADC1_AIN1 (0x00000280U)
310 #define PIN_ADC1_AIN2 (0x00000284U)
311 #define PIN_ADC1_AIN3 (0x00000288U)
312 #define PIN_ADC1_AIN4 (0x0000028CU)
313 #define PIN_ADC1_AIN5 (0x00000290U)
314 #define PIN_ADC1_AIN6 (0x00000294U)
315 #define PIN_ADC2_AIN0 (0x00000298U)
316 #define PIN_ADC2_AIN1 (0x0000029CU)
317 #define PIN_ADC2_AIN2 (0x000002A0U)
318 #define PIN_ADC2_AIN3 (0x000002A4U)
319 #define PIN_ADC2_AIN4 (0x000002A8U)
320 #define PIN_ADC2_AIN5 (0x000002ACU)
321 #define PIN_ADC2_AIN6 (0x000002B0U)
322 #define PIN_ADC3_AIN0 (0x000002B4U)
323 #define PIN_ADC3_AIN1 (0x000002B8U)
324 #define PIN_ADC3_AIN2 (0x000002BCU)
325 #define PIN_ADC3_AIN3 (0x000002C0U)
326 #define PIN_ADC3_AIN4 (0x000002C4U)
327 #define PIN_ADC3_AIN5 (0x000002C8U)
328 #define PIN_ADC4_AIN0 (0x000002CCU)
329 #define PIN_ADC4_AIN1 (0x000002D0U)
330 #define PIN_ADC4_AIN2 (0x000002D4U)
331 #define PIN_ADC4_AIN3 (0x000002D8U)
332 #define PIN_ADC4_AIN4 (0x000002DCU)
333 #define PIN_ADC4_AIN5 (0x000002E0U)
334 #define PIN_ADC_VREFHISRC0 (0x000002E4U)
335 #define PIN_ADC_VREFLOSRC0 (0x000002E8U)
336 #define PIN_ADC_VREFHI0 (0x000002ECU)
337 #define PIN_ADC_VREFLO0 (0x000002F0U)
338 #define PIN_ADC_VREFHI1 (0x000002F4U)
339 #define PIN_ADC_VREFLO1 (0x000002F8U)
340 #define PIN_ADC_VREFHI2 (0x000002FCU)
341 #define PIN_ADC_VREFLO2 (0x00000300U)
342 #define PIN_ADC_VREFHISRC1 (0x00000304U)
343 #define PIN_ADC_VREFLOSRC1 (0x00000308U)
344 #define PIN_ADC_VREFHI3 (0x0000030CU)
345 #define PIN_ADC_VREFLO3 (0x00000310U)
346 #define PIN_ADC_VREFHI4 (0x00000314U)
347 #define PIN_ADC_VREFLO4 (0x00000318U)
348 #define PIN_ADC_CAL0 (0x0000031CU)
349 #define PIN_ADC_CAL1 (0x00000320U)
350 #define PIN_DAC_VREF0 (0x00000324U)
351 #define PIN_DAC_VREF1 (0x00000328U)
352 #define PIN_DAC_OUT (0x0000032CU)
353 #define PIN_TEMPCAL (0x00000330U)
354 #define PIN_VSYS_MON (0x00000334U)
355 #define PIN_ATESTV0 (0x00000338U)
356 #define PIN_ATESTV1 (0x0000033CU)
357 #define PIN_PMUBYPASS (0x00000340U)
358 #define PIN_USB0_CE (0x00000344U)
359 #define PIN_SDADC0_DP (0x00000348U)
360 #define PIN_SDADC0_DM (0x0000034CU)
361 #define PIN_ADC_CAL2 (0x00000350U)
362 #define PIN_ADC_R0_AIN0 (0x00000354U)
363 #define PIN_ADC_R0_AIN1 (0x00000358U)
364 #define PIN_ADC_R0_AIN2 (0x0000035CU)
365 #define PIN_ADC_R0_AIN3 (0x00000360U)
366 #define PIN_ADC_VREFLO5 (0x00000364U)
367 #define PIN_ADC_VREFHI5 (0x00000368U)
368 #define PIN_ADC_VREFLO6 (0x0000036CU)
369 #define PIN_ADC_VREFHI6 (0x00000370U)
370 #define PIN_ADC_R1_AIN0 (0x00000374U)
371 #define PIN_ADC_R1_AIN1 (0x00000378U)
372 #define PIN_ADC_R1_AIN2 (0x0000037CU)
373 #define PIN_ADC_R1_AIN3 (0x00000380U)
374 #define PIN_ADC_CAL3 (0x00000384U)
375
378 /* ========================================================================== */
379 /* Structures and Enums */
380 /* ========================================================================== */
381
383 typedef struct Pinmux_PerCfg
384 {
385 int16_t offset;
389 uint32_t settings;
399 } Pinmux_PerCfg_t;
400
401 /* ========================================================================== */
402 /* Global Variables Declarations */
403 /* ========================================================================== */
404
405 /* None */
406
407 /* ========================================================================== */
408 /* Function Declarations */
409 /* ========================================================================== */
410
421 void Pinmux_config(const Pinmux_PerCfg_t *pinmuxCfg, uint32_t domainId);
422
431 void Pinmux_qualPeriodConfig(uint32_t qualGroupIndex, uint8_t qualPeriod);
432
436 void Pinmux_enableUserMode(void);
437
441 void Pinmux_disableUserMode(void);
442
443 /* ========================================================================== */
444 /* Static Function Definitions */
445 /* ========================================================================== */
446
447 /* None */
448
449 #ifdef __cplusplus
450 }
451 #endif
452
453 #endif /* #ifndef PINMUX_AM64X_H_ */
454
Pinmux_PerCfg_t
Structure defining the pin configuration parameters.
Definition: pinmux/am261x/pinmux.h:384
Pinmux_config
void Pinmux_config(const Pinmux_PerCfg_t *pinmuxCfg, uint32_t domainId)
This API configures the pinmux based on the domain.
Pinmux_PerCfg_t::offset
int16_t offset
Definition: pinmux/am261x/pinmux.h:385
Pinmux_PerCfg_t::settings
uint32_t settings
Definition: pinmux/am261x/pinmux.h:389
Pinmux_enableUserMode
void Pinmux_enableUserMode(void)
This API enables user mode access to the IOMUX register space.
Pinmux_qualPeriodConfig
void Pinmux_qualPeriodConfig(uint32_t qualGroupIndex, uint8_t qualPeriod)
This API configures the Qualification period for a specific GPIO Pin group.
Pinmux_disableUserMode
void Pinmux_disableUserMode(void)
This API disables user mode access to the IOMUX register space.