AM263Px MCU+ SDK: pinmux.h Source File

| AM263Px MCU+ SDK 26.00.00 |

pinmux/am263px/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_AM263PX_H_
64 #define PINMUX_AM263PX_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_OSPI0_CSN0 (0x00000000U)
150 #define PIN_OSPI0_CSN1 (0x00000004U)
151 #define PIN_OSPI0_CLK (0x00000008U)
152 #define PIN_OSPI0_D0 (0x0000000CU)
153 #define PIN_OSPI0_D1 (0x00000010U)
154 #define PIN_OSPI0_D2 (0x00000014U)
155 #define PIN_OSPI0_D3 (0x00000018U)
156 #define PIN_MCAN0_RX (0x0000001CU)
157 #define PIN_MCAN0_TX (0x00000020U)
158 #define PIN_MCAN1_RX (0x00000024U)
159 #define PIN_MCAN1_TX (0x00000028U)
160 #define PIN_SPI0_CS0 (0x0000002CU)
161 #define PIN_SPI0_CLK (0x00000030U)
162 #define PIN_SPI0_D0 (0x00000034U)
163 #define PIN_SPI0_D1 (0x00000038U)
164 #define PIN_SPI1_CS0 (0x0000003CU)
165 #define PIN_SPI1_CLK (0x00000040U)
166 #define PIN_SPI1_D0 (0x00000044U)
167 #define PIN_SPI1_D1 (0x00000048U)
168 #define PIN_LIN1_RXD (0x0000004CU)
169 #define PIN_LIN1_TXD (0x00000050U)
170 #define PIN_LIN2_RXD (0x00000054U)
171 #define PIN_LIN2_TXD (0x00000058U)
172 #define PIN_I2C1_SCL (0x0000005CU)
173 #define PIN_I2C1_SDA (0x00000060U)
174 #define PIN_UART0_RTSN (0x00000064U)
175 #define PIN_UART0_CTSN (0x00000068U)
176 #define PIN_UART0_RXD (0x0000006CU)
177 #define PIN_UART0_TXD (0x00000070U)
178 #define PIN_RGMII1_RXC (0x00000074U)
179 #define PIN_RGMII1_RX_CTL (0x00000078U)
180 #define PIN_RGMII1_RD0 (0x0000007CU)
181 #define PIN_RGMII1_RD1 (0x00000080U)
182 #define PIN_RGMII1_RD2 (0x00000084U)
183 #define PIN_RGMII1_RD3 (0x00000088U)
184 #define PIN_RGMII1_TXC (0x0000008CU)
185 #define PIN_RGMII1_TX_CTL (0x00000090U)
186 #define PIN_RGMII1_TD0 (0x00000094U)
187 #define PIN_RGMII1_TD1 (0x00000098U)
188 #define PIN_RGMII1_TD2 (0x0000009CU)
189 #define PIN_RGMII1_TD3 (0x000000A0U)
190 #define PIN_MDIO_MDIO (0x000000A4U)
191 #define PIN_MDIO_MDC (0x000000A8U)
192 #define PIN_EPWM0_A (0x000000ACU)
193 #define PIN_EPWM0_B (0x000000B0U)
194 #define PIN_EPWM1_A (0x000000B4U)
195 #define PIN_EPWM1_B (0x000000B8U)
196 #define PIN_EPWM2_A (0x000000BCU)
197 #define PIN_EPWM2_B (0x000000C0U)
198 #define PIN_EPWM3_A (0x000000C4U)
199 #define PIN_EPWM3_B (0x000000C8U)
200 #define PIN_EPWM4_A (0x000000CCU)
201 #define PIN_EPWM4_B (0x000000D0U)
202 #define PIN_EPWM5_A (0x000000D4U)
203 #define PIN_EPWM5_B (0x000000D8U)
204 #define PIN_EPWM6_A (0x000000DCU)
205 #define PIN_EPWM6_B (0x000000E0U)
206 #define PIN_EPWM7_A (0x000000E4U)
207 #define PIN_EPWM7_B (0x000000E8U)
208 #define PIN_EPWM8_A (0x000000ECU)
209 #define PIN_EPWM8_B (0x000000F0U)
210 #define PIN_EPWM9_A (0x000000F4U)
211 #define PIN_EPWM9_B (0x000000F8U)
212 #define PIN_EPWM10_A (0x000000FCU)
213 #define PIN_EPWM10_B (0x00000100U)
214 #define PIN_EPWM11_A (0x00000104U)
215 #define PIN_EPWM11_B (0x00000108U)
216 #define PIN_EPWM12_A (0x0000010CU)
217 #define PIN_EPWM12_B (0x00000110U)
218 #define PIN_EPWM13_A (0x00000114U)
219 #define PIN_EPWM13_B (0x00000118U)
220 #define PIN_EPWM14_A (0x0000011CU)
221 #define PIN_EPWM14_B (0x00000120U)
222 #define PIN_EPWM15_A (0x00000124U)
223 #define PIN_EPWM15_B (0x00000128U)
224 #define PIN_UART1_RXD (0x0000012CU)
225 #define PIN_UART1_TXD (0x00000130U)
226 #define PIN_MMC_CLK (0x00000134U)
227 #define PIN_MMC_CMD (0x00000138U)
228 #define PIN_MMC_DAT0 (0x0000013CU)
229 #define PIN_MMC_DAT1 (0x00000140U)
230 #define PIN_MMC_DAT2 (0x00000144U)
231 #define PIN_MMC_DAT3 (0x00000148U)
232 #define PIN_MMC_SDWP (0x0000014CU)
233 #define PIN_MMC_SDCD (0x00000150U)
234 #define PIN_PR0_MDIO_MDIO (0x00000154U)
235 #define PIN_PR0_MDIO_MDC (0x00000158U)
236 #define PIN_PR0_PRU0_GPIO5 (0x0000015CU)
237 #define PIN_PR0_PRU0_GPIO9 (0x00000160U)
238 #define PIN_PR0_PRU0_GPIO10 (0x00000164U)
239 #define PIN_PR0_PRU0_GPIO8 (0x00000168U)
240 #define PIN_PR0_PRU0_GPIO6 (0x0000016CU)
241 #define PIN_PR0_PRU0_GPIO4 (0x00000170U)
242 #define PIN_PR0_PRU0_GPIO0 (0x00000174U)
243 #define PIN_PR0_PRU0_GPIO1 (0x00000178U)
244 #define PIN_PR0_PRU0_GPIO2 (0x0000017CU)
245 #define PIN_PR0_PRU0_GPIO3 (0x00000180U)
246 #define PIN_PR0_PRU0_GPIO16 (0x00000184U)
247 #define PIN_PR0_PRU0_GPIO15 (0x00000188U)
248 #define PIN_PR0_PRU0_GPIO11 (0x0000018CU)
249 #define PIN_PR0_PRU0_GPIO12 (0x00000190U)
250 #define PIN_PR0_PRU0_GPIO13 (0x00000194U)
251 #define PIN_PR0_PRU0_GPIO14 (0x00000198U)
252 #define PIN_PR0_PRU1_GPIO5 (0x0000019CU)
253 #define PIN_PR0_PRU1_GPIO9 (0x000001A0U)
254 #define PIN_PR0_PRU1_GPIO10 (0x000001A4U)
255 #define PIN_PR0_PRU1_GPIO8 (0x000001A8U)
256 #define PIN_PR0_PRU1_GPIO6 (0x000001ACU)
257 #define PIN_PR0_PRU1_GPIO4 (0x000001B0U)
258 #define PIN_PR0_PRU1_GPIO0 (0x000001B4U)
259 #define PIN_PR0_PRU1_GPIO1 (0x000001B8U)
260 #define PIN_PR0_PRU1_GPIO2 (0x000001BCU)
261 #define PIN_PR0_PRU1_GPIO3 (0x000001C0U)
262 #define PIN_PR0_PRU1_GPIO16 (0x000001C4U)
263 #define PIN_PR0_PRU1_GPIO15 (0x000001C8U)
264 #define PIN_PR0_PRU1_GPIO11 (0x000001CCU)
265 #define PIN_PR0_PRU1_GPIO12 (0x000001D0U)
266 #define PIN_PR0_PRU1_GPIO13 (0x000001D4U)
267 #define PIN_PR0_PRU1_GPIO14 (0x000001D8U)
268 #define PIN_PR0_PRU1_GPIO19 (0x000001DCU)
269 #define PIN_PR0_PRU1_GPIO18 (0x000001E0U)
270 #define PIN_EXT_REFCLK0 (0x000001E4U)
271 #define PIN_SDFM0_CLK0 (0x000001E8U)
272 #define PIN_SDFM0_D0 (0x000001ECU)
273 #define PIN_SDFM0_CLK1 (0x000001F0U)
274 #define PIN_SDFM0_D1 (0x000001F4U)
275 #define PIN_SDFM0_CLK2 (0x000001F8U)
276 #define PIN_SDFM0_D2 (0x000001FCU)
277 #define PIN_SDFM0_CLK3 (0x00000200U)
278 #define PIN_SDFM0_D3 (0x00000204U)
279 #define PIN_EQEP0_A (0x00000208U)
280 #define PIN_EQEP0_B (0x0000020CU)
281 #define PIN_EQEP0_STROBE (0x00000210U)
282 #define PIN_EQEP0_INDEX (0x00000214U)
283 #define PIN_I2C0_SDA (0x00000218U)
284 #define PIN_I2C0_SCL (0x0000021CU)
285 #define PIN_MCAN2_TX (0x00000220U)
286 #define PIN_MCAN2_RX (0x00000224U)
287 #define PIN_CLKOUT0 (0x00000228U)
288 #define PIN_RESET_REQZ (0x0000022CU)
289 #define PIN_SAFETY_ERRORN (0x00000230U)
290 #define PIN_TDI (0x00000234U)
291 #define PIN_TDO (0x00000238U)
292 #define PIN_TMS (0x0000023CU)
293 #define PIN_TCK (0x00000240U)
294 #define PIN_QSPI_CLKLB (0x00000244U)
295
304 #define PIN_GPIO0 (0x00000000U)
305 #define PIN_GPIO1 (0x00000004U)
306 #define PIN_GPIO2 (0x00000008U)
307 #define PIN_GPIO3 (0x0000000CU)
308 #define PIN_GPIO4 (0x00000010U)
309 #define PIN_GPIO5 (0x00000014U)
310 #define PIN_GPIO7 (0x0000001CU)
311 #define PIN_GPIO8 (0x00000020U)
312 #define PIN_GPIO9 (0x00000024U)
313 #define PIN_GPIO10 (0x00000028U)
314 #define PIN_GPIO6 (0x00000018U)
315 #define PIN_GPIO64 (0x00000100U)
316 #define PIN_GPIO65 (0x00000104U)
317 #define PIN_GPIO66 (0x00000108U)
318 #define PIN_GPIO67 (0x0000010CU)
319 #define PIN_GPIO68 (0x00000110U)
320 #define PIN_GPIO69 (0x00000114U)
321 #define PIN_GPIO70 (0x00000118U)
322 #define PIN_GPIO75 (0x0000012CU)
323 #define PIN_GPIO76 (0x00000130U)
324 #define PIN_GPIO19 (0x0000004CU)
325 #define PIN_GPIO20 (0x00000050U)
326
329 /* ========================================================================== */
330 /* Structures and Enums */
331 /* ========================================================================== */
332
334 typedef struct Pinmux_PerCfg
335 {
336 int16_t offset;
340 uint32_t settings;
350 } Pinmux_PerCfg_t;
351
352 /* ========================================================================== */
353 /* Global Variables Declarations */
354 /* ========================================================================== */
355
356 /* None */
357
358 /* ========================================================================== */
359 /* Function Declarations */
360 /* ========================================================================== */
361
372 void Pinmux_config(const Pinmux_PerCfg_t *pinmuxCfg, uint32_t domainId);
373
382 void Pinmux_qualPeriodConfig(uint32_t qualGroupIndex, uint8_t qualPeriod);
383
387 void Pinmux_enableUserMode(void);
388
392 void Pinmux_disableUserMode(void);
393
394 /* ========================================================================== */
395 /* Static Function Definitions */
396 /* ========================================================================== */
397
398 /* None */
399
400 #ifdef __cplusplus
401 }
402 #endif
403
404 #endif /* #ifndef PINMUX_AM64X_H_ */
405
Pinmux_PerCfg_t
Structure defining the pin configuration parameters.
Definition: pinmux/am263px/pinmux.h:335
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/am263px/pinmux.h:336
Pinmux_PerCfg_t::settings
uint32_t settings
Definition: pinmux/am263px/pinmux.h:340
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.