xWRL6432 MMWAVE-L-SDK  05.04.00.01
pinmux/v0/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 
58 #ifndef PINMUX_XWRL64XX_H_
59 #define PINMUX_XWRL64XX_H_
60 
61 /* ========================================================================== */
62 /* Include Files */
63 /* ========================================================================== */
64 
65 #include <stdint.h>
66 #include <stdbool.h>
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
72 /* ========================================================================== */
73 /* Macros & Typedefs */
74 /* ========================================================================== */
75 
82 #define PINMUX_DOMAIN_ID_MAIN (0U)
83 
84 #define PINMUX_DOMAIN_ID_MCU (1U)
85 
88 #define PINMUX_END (0xFFFFFFFFU)
89 
90 #define PIN_MODE(mode) (mode)
91 
92 #define PIN_PULL_DISABLE (0x1U << 8U)
93 
94 #define PIN_PULL_DIRECTION (0x1U << 9U)
95 
101 #define PIN_PAD_AA (0x00000000U)
102 #define PIN_PAD_AB (0x00000004U)
103 #define PIN_PAD_AC (0x00000008U)
104 #define PIN_PAD_AD (0x0000000CU)
105 #define PIN_PAD_AE (0x00000010U)
106 #define PIN_PAD_AF (0x00000014U)
107 #define PIN_PAD_AG (0x00000018U)
108 #define PIN_PAD_AH (0x0000001CU)
109 #define PIN_PAD_AI (0x00000020U)
110 #define PIN_PAD_AJ (0x00000024U)
111 #define PIN_PAD_AK (0x00000028U)
112 #define PIN_PAD_AL (0x0000002CU)
113 #define PIN_PAD_AM (0x00000030U)
114 #define PIN_PAD_AN (0x00000034U)
115 #define PIN_PAD_AO (0x00000038U)
116 #define PIN_PAD_AP (0x0000003CU)
117 #define PIN_PAD_AQ (0x00000040U)
118 #define PIN_PAD_AR (0x00000044U)
119 #define PIN_PAD_AS (0x00000048U)
120 #define PIN_PAD_AT (0x0000004CU)
121 #define PIN_PAD_AU (0x00000050U)
122 #define PIN_PAD_AV (0x00000054U)
123 #define PIN_PAD_AW (0x00000058U)
124 #define PIN_PAD_AX (0x0000005CU)
125 
126 
127 /* pin names */
129 #define PIN_OVERRIDE_INPUT_ENABLE (0x1 << 5U)
130 #define PIN_OVERRIDE_INPUT_ENABLE_CTRL (0x1 << 4U)
131 
132 #define PIN_OVERRIDE_OUTPUT_DISABLE (0x1 << 7U)
133 #define PIN_OVERRIDE_OUTPUT_DISABLE_CTRL (0x1 << 6U)
134 
136 #define PIN_SLEW_RATE_HIGH (0x0U << 10U)
137 
138 #define PIN_SLEW_RATE_LOW (0x1U << 10U)
139 
140 
143 /* ========================================================================== */
144 /* Structures and Enums */
145 /* ========================================================================== */
146 
148 typedef struct Pinmux_PerCfg
149 {
150  uint32_t offset;
154  uint32_t settings;
166 
167 typedef struct PadToPin
168 {
169  uint32_t Pad;
170 
171  uint32_t gpioNum;
172 
173  uint32_t mode;
174 }PadToPin_t;
175 
176 /* ========================================================================== */
177 /* Global Variables Declarations */
178 /* ========================================================================== */
179 
180 /* None */
181 
182 /* ========================================================================== */
183 /* Function Declarations */
184 /* ========================================================================== */
185 
195 void Pinmux_config(const Pinmux_PerCfg_t *pinmuxCfg, uint32_t domainId);
196 uint32_t Pinmux_Read(uint32_t pinOffset);
197 uint32_t Pinmux_getMode(uint32_t pad);
198 uint32_t Pinmux_getPinNum(uint32_t pad);
199 
210 void Pinmux_inputoverride(uint32_t offset, bool state);
211 
222 void Pinmux_outputoverride(uint32_t offset, bool state);
223 /* ========================================================================== */
224 /* Static Function Definitions */
225 /* ========================================================================== */
226 
227 /* None */
228 
229 #ifdef __cplusplus
230 }
231 #endif
232 
233 #endif /* #ifndef PINMUX_AM64X_H_ */
234 
Pinmux_PerCfg_t
Structure defining the pin configuration parameters.
Definition: pinmux/v0/pinmux.h:149
Pinmux_config
void Pinmux_config(const Pinmux_PerCfg_t *pinmuxCfg, uint32_t domainId)
This API configures the pinmux based on the domain.
Pinmux_inputoverride
void Pinmux_inputoverride(uint32_t offset, bool state)
This API is used to override input enable.
PadToPin_t
Definition: pinmux/v0/pinmux.h:168
Pinmux_Read
uint32_t Pinmux_Read(uint32_t pinOffset)
Pinmux_PerCfg_t::offset
uint32_t offset
Definition: pinmux/v0/pinmux.h:150
PadToPin_t::Pad
uint32_t Pad
Definition: pinmux/v0/pinmux.h:169
Pinmux_getMode
uint32_t Pinmux_getMode(uint32_t pad)
Pinmux_PerCfg_t::settings
uint32_t settings
Definition: pinmux/v0/pinmux.h:154
Pinmux_getPinNum
uint32_t Pinmux_getPinNum(uint32_t pad)
PadToPin_t::mode
uint32_t mode
Definition: pinmux/v0/pinmux.h:173
Pinmux_outputoverride
void Pinmux_outputoverride(uint32_t offset, bool state)
This API configures pin output override.
PadToPin_t::gpioNum
uint32_t gpioNum
Definition: pinmux/v0/pinmux.h:171