2 * -------------------------------------------
3 * CC3220 SDK - v0.10.00.00
4 * -------------------------------------------
6 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
20 * Neither the name of Texas Instruments Incorporated nor the names of
21 * its contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //*****************************************************************************
41 // Defines and Macros for the pin mux module
43 //*****************************************************************************
48 //*****************************************************************************
50 // If building with a C++ compiler, make all of the definitions in this header
53 //*****************************************************************************
59 //*****************************************************************************
60 // Macros Defining Pins
61 //*****************************************************************************
63 #define PIN_01 0x00000000
64 #define PIN_02 0x00000001
65 #define PIN_03 0x00000002
66 #define PIN_04 0x00000003
67 #define PIN_05 0x00000004
68 #define PIN_06 0x00000005
69 #define PIN_07 0x00000006
70 #define PIN_08 0x00000007
71 #define PIN_11 0x0000000A
72 #define PIN_12 0x0000000B
73 #define PIN_13 0x0000000C
74 #define PIN_14 0x0000000D
75 #define PIN_15 0x0000000E
76 #define PIN_16 0x0000000F
77 #define PIN_17 0x00000010
78 #define PIN_18 0x00000011
79 #define PIN_19 0x00000012
80 #define PIN_20 0x00000013
81 #define PIN_21 0x00000014
82 #define PIN_45 0x0000002C
83 #define PIN_46 0x0000002D
84 #define PIN_47 0x0000002E
85 #define PIN_48 0x0000002F
86 #define PIN_49 0x00000030
87 #define PIN_50 0x00000031
88 #define PIN_52 0x00000033
89 #define PIN_53 0x00000034
90 #define PIN_55 0x00000036
91 #define PIN_56 0x00000037
92 #define PIN_57 0x00000038
93 #define PIN_58 0x00000039
94 #define PIN_59 0x0000003A
95 #define PIN_60 0x0000003B
96 #define PIN_61 0x0000003C
97 #define PIN_62 0x0000003D
98 #define PIN_63 0x0000003E
99 #define PIN_64 0x0000003F
103 //*****************************************************************************
104 // Macros that can be used with PinConfigSet(), PinTypeGet(), PinStrengthGet()
105 //*****************************************************************************
107 #define PIN_MODE_0 0x00000000
108 #define PIN_MODE_1 0x00000001
109 #define PIN_MODE_2 0x00000002
110 #define PIN_MODE_3 0x00000003
111 #define PIN_MODE_4 0x00000004
112 #define PIN_MODE_5 0x00000005
113 #define PIN_MODE_6 0x00000006
114 #define PIN_MODE_7 0x00000007
115 #define PIN_MODE_8 0x00000008
116 #define PIN_MODE_9 0x00000009
117 #define PIN_MODE_10 0x0000000A
118 #define PIN_MODE_11 0x0000000B
119 #define PIN_MODE_12 0x0000000C
120 #define PIN_MODE_13 0x0000000D
121 #define PIN_MODE_14 0x0000000E
122 #define PIN_MODE_15 0x0000000F
123 // Note : PIN_MODE_255 is a dummy define for pinmux utility code generation
124 // PIN_MODE_255 should never be used in any user code.
125 #define PIN_MODE_255 0x000000FF
127 //*****************************************************************************
128 // Macros that can be used with PinDirModeSet() and returned from
130 //*****************************************************************************
131 #define PIN_DIR_MODE_IN 0x00000C00 // Pin is input
132 #define PIN_DIR_MODE_OUT 0x00000800 // Pin is output
133 #define PIN_DIR_MODE_HW 0x00000000 // Pin is peripheral function
135 //*****************************************************************************
136 // Macros that can be used with PinConfigSet()
137 //*****************************************************************************
138 #define PIN_STRENGTH_2MA 0x00000020
139 #define PIN_STRENGTH_4MA 0x00000040
140 #define PIN_STRENGTH_6MA 0x00000060
142 #define PIN_TYPE_STD 0x00000000
143 #define PIN_TYPE_STD_PU 0x00000100
144 #define PIN_TYPE_STD_PD 0x00000200
146 #define PIN_TYPE_OD 0x00000010
147 #define PIN_TYPE_OD_PU 0x00000110
148 #define PIN_TYPE_OD_PD 0x00000210
149 #define PIN_TYPE_ANALOG 0x10000000
151 //*****************************************************************************
152 // Macros that can be used with PinHysteresisSet()
153 //*****************************************************************************
154 #define PIN_HYSTERESIS_OFF 0x00000000
155 #define PIN_HYSTERESIS_10 0x00000004
156 #define PIN_HYSTERESIS_20 0x0000000C
157 #define PIN_HYSTERESIS_30 0x00000014
158 #define PIN_HYSTERESIS_40 0x0000001C
161 //*****************************************************************************
163 // API Function prototypes
165 //*****************************************************************************
166 extern void PinModeSet(unsigned long ulPin, unsigned long ulPinMode);
167 extern void PinDirModeSet(unsigned long ulPin, unsigned long ulPinIO);
168 extern unsigned long PinDirModeGet(unsigned long ulPin);
169 extern unsigned long PinModeGet(unsigned long ulPin);
170 extern void PinConfigGet(unsigned long ulPin,unsigned long *pulPinStrength,
171 unsigned long *pulPinType);
172 extern void PinConfigSet(unsigned long ulPin,unsigned long ulPinStrength,
173 unsigned long ulPinType);
174 extern void PinTypeUART(unsigned long ulPin,unsigned long ulPinMode);
175 extern void PinTypeI2C(unsigned long ulPin,unsigned long ulPinMode);
176 extern void PinTypeSPI(unsigned long ulPin,unsigned long ulPinMode);
177 extern void PinTypeI2S(unsigned long ulPin,unsigned long ulPinMode);
178 extern void PinTypeTimer(unsigned long ulPin,unsigned long ulPinMode);
179 extern void PinTypeCamera(unsigned long ulPin,unsigned long ulPinMode);
180 extern void PinTypeGPIO(unsigned long ulPin,unsigned long ulPinMode,
181 tBoolean bOpenDrain);
182 extern void PinTypeADC(unsigned long ulPin,unsigned long ulPinMode);
183 extern void PinTypeSDHost(unsigned long ulPin,unsigned long ulPinMode);
184 extern void PinHysteresisSet(unsigned long ulHysteresis);
185 extern void PinLockLevelSet(unsigned long ulPin, unsigned char ucLevel);
186 extern void PinLock(unsigned long ulOutEnable);
187 extern void PinUnlock(void);
188 extern unsigned long PinToPadGet(unsigned long ulPin);
189 extern unsigned long PinFromPadGet(unsigned long ulPad);