64 #include <inc/hw_types.h>
65 #include <inc/hw_memmap.h>
66 #include <inc/hw_ioc.h>
67 #include <inc/hw_ints.h>
86 #define IOCPortConfigureSet NOROM_IOCPortConfigureSet
87 #define IOCPortConfigureGet NOROM_IOCPortConfigureGet
88 #define IOCIOShutdownSet NOROM_IOCIOShutdownSet
89 #define IOCIOModeSet NOROM_IOCIOModeSet
90 #define IOCIOIntSet NOROM_IOCIOIntSet
91 #define IOCIOPortPullSet NOROM_IOCIOPortPullSet
92 #define IOCIOHystSet NOROM_IOCIOHystSet
93 #define IOCIOInputSet NOROM_IOCIOInputSet
94 #define IOCIOSlewCtrlSet NOROM_IOCIOSlewCtrlSet
95 #define IOCIODrvStrengthSet NOROM_IOCIODrvStrengthSet
96 #define IOCIOPortIdSet NOROM_IOCIOPortIdSet
97 #define IOCIntEnable NOROM_IOCIntEnable
98 #define IOCIntDisable NOROM_IOCIntDisable
99 #define IOCPinTypeGpioInput NOROM_IOCPinTypeGpioInput
100 #define IOCPinTypeGpioOutput NOROM_IOCPinTypeGpioOutput
101 #define IOCPinTypeUart NOROM_IOCPinTypeUart
102 #define IOCPinTypeSsiMaster NOROM_IOCPinTypeSsiMaster
103 #define IOCPinTypeSsiSlave NOROM_IOCPinTypeSsiSlave
104 #define IOCPinTypeI2c NOROM_IOCPinTypeI2c
105 #define IOCPinTypeSpis NOROM_IOCPinTypeSpis
106 #define IOCPinTypeAux NOROM_IOCPinTypeAux
114 #define NUM_IO_MAX 32
121 #define IOID_0 0x00000000 // IO Id 0
122 #define IOID_1 0x00000001 // IO Id 1
123 #define IOID_2 0x00000002 // IO Id 2
124 #define IOID_3 0x00000003 // IO Id 3
125 #define IOID_4 0x00000004 // IO Id 4
126 #define IOID_5 0x00000005 // IO Id 5
127 #define IOID_6 0x00000006 // IO Id 6
128 #define IOID_7 0x00000007 // IO Id 7
129 #define IOID_8 0x00000008 // IO Id 8
130 #define IOID_9 0x00000009 // IO Id 9
131 #define IOID_10 0x0000000A // IO Id 10
132 #define IOID_11 0x0000000B // IO Id 11
133 #define IOID_12 0x0000000C // IO Id 12
134 #define IOID_13 0x0000000D // IO Id 13
135 #define IOID_14 0x0000000E // IO Id 14
136 #define IOID_15 0x0000000F // IO Id 15
137 #define IOID_16 0x00000010 // IO Id 16
138 #define IOID_17 0x00000011 // IO Id 17
139 #define IOID_18 0x00000012 // IO Id 18
140 #define IOID_19 0x00000013 // IO Id 19
141 #define IOID_20 0x00000014 // IO Id 20
142 #define IOID_21 0x00000015 // IO Id 21
143 #define IOID_22 0x00000016 // IO Id 22
144 #define IOID_23 0x00000017 // IO Id 23
145 #define IOID_24 0x00000018 // IO Id 24
146 #define IOID_25 0x00000019 // IO Id 25
147 #define IOID_26 0x0000001A // IO Id 26
148 #define IOID_27 0x0000001B // IO Id 27
149 #define IOID_28 0x0000001C // IO Id 28
150 #define IOID_29 0x0000001D // IO Id 29
151 #define IOID_30 0x0000001E // IO Id 30
152 #define IOID_31 0x0000001F // IO Id 31
153 #define IOID_UNUSED 0xFFFFFFFF // Unused IO Id
155 #define IOC_IOID_MASK 0x000000FF // IOC IO Id bit mask
162 #define NUM_IO_PORTS 56
169 #define IOC_PORT_GPIO 0x00000000 // Default general purpose IO usage
170 #define IOC_PORT_AON_SCS 0x00000001 // AON SPI-S SCS Pin
171 #define IOC_PORT_AON_SCK 0x00000002 // AON SPI-S SCK Pin
172 #define IOC_PORT_AON_SDI 0x00000003 // AON SPI-S SDI Pin
173 #define IOC_PORT_AON_SDO 0x00000004 // AON SPI-S SDO Pin
174 #define IOC_PORT_AON_CLK32K 0x00000007 // AON External 32kHz clock
175 #define IOC_PORT_AUX_IO 0x00000008 // AUX IO Pin
176 #define IOC_PORT_MCU_SSI0_RX 0x00000009 // MCU SSI0 Receive Pin
177 #define IOC_PORT_MCU_SSI0_TX 0x0000000A // MCU SSI0 Transmit Pin
178 #define IOC_PORT_MCU_SSI0_FSS 0x0000000B // MCU SSI0 FSS Pin
179 #define IOC_PORT_MCU_SSI0_CLK 0x0000000C // MCU SSI0 Clock Pin
180 #define IOC_PORT_MCU_I2C_MSSDA 0x0000000D // MCU I2C Data Pin
181 #define IOC_PORT_MCU_I2C_MSSCL 0x0000000E // MCU I2C Clock Pin
182 #define IOC_PORT_MCU_UART0_RX 0x0000000F // MCU UART0 Receive Pin
183 #define IOC_PORT_MCU_UART0_TX 0x00000010 // MCU UART0 Transmit Pin
184 #define IOC_PORT_MCU_UART0_CTS 0x00000011 // MCU UART0 Clear To Send Pin
185 #define IOC_PORT_MCU_UART0_RTS 0x00000012 // MCU UART0 Request To Send Pin
186 #define IOC_PORT_MCU_PORT_EVENT0 0x00000017 // MCU PORT EVENT 0
187 #define IOC_PORT_MCU_PORT_EVENT1 0x00000018 // MCU PORT EVENT 1
188 #define IOC_PORT_MCU_PORT_EVENT2 0x00000019 // MCU PORT EVENT 2
189 #define IOC_PORT_MCU_PORT_EVENT3 0x0000001A // MCU PORT EVENT 3
190 #define IOC_PORT_MCU_PORT_EVENT4 0x0000001B // MCU PORT EVENT 4
191 #define IOC_PORT_MCU_PORT_EVENT5 0x0000001C // MCU PORT EVENT 5
192 #define IOC_PORT_MCU_PORT_EVENT6 0x0000001D // MCU PORT EVENT 6
193 #define IOC_PORT_MCU_PORT_EVENT7 0x0000001E // MCU PORT EVENT 7
194 #define IOC_PORT_MCU_SWV 0x00000020 // Serial Wire Viewer
195 #define IOC_PORT_MCU_SSI1_RX 0x00000021 // MCU SSI1 Receive Pin
196 #define IOC_PORT_MCU_SSI1_TX 0x00000022 // MCU SSI1 Transmit Pin
197 #define IOC_PORT_MCU_SSI1_FSS 0x00000023 // MCU SSI1 FSS Pin
198 #define IOC_PORT_MCU_SSI1_CLK 0x00000024 // MCU SSI1 Clock Pin
199 #define IOC_PORT_MCU_I2S_AD0 0x00000025 // MCU I2S Data Pin 0
200 #define IOC_PORT_MCU_I2S_AD1 0x00000026 // MCU I2S Data Pin 1
201 #define IOC_PORT_MCU_I2S_WCLK 0x00000027 // MCU I2S Frame/Word Clock
202 #define IOC_PORT_MCU_I2S_BCLK 0x00000028 // MCU I2S Bit Clock
203 #define IOC_PORT_MCU_I2S_MCLK 0x00000029 // MCU I2S Master clock 2
204 #define IOC_PORT_RFC_TRC 0x0000002E // RF Core Tracer
205 #define IOC_PORT_RFC_GPO0 0x0000002F // RC Core Data Out Pin 0
206 #define IOC_PORT_RFC_GPO1 0x00000030 // RC Core Data Out Pin 1
207 #define IOC_PORT_RFC_GPO2 0x00000031 // RC Core Data Out Pin 2
208 #define IOC_PORT_RFC_GPO3 0x00000032 // RC Core Data Out Pin 3
209 #define IOC_PORT_RFC_GPI0 0x00000033 // RC Core Data In Pin 0
210 #define IOC_PORT_RFC_GPI1 0x00000034 // RC Core Data In Pin 1
217 #define IOC_SLEW_ENABLE 0x00001000
218 #define IOC_SLEW_DISABLE 0x00000000
219 #define IOC_INPUT_ENABLE 0x20000000
220 #define IOC_INPUT_DISABLE 0x00000000
221 #define IOC_HYST_ENABLE 0x40000000
222 #define IOC_HYST_DISABLE 0x00000000
229 #define IOC_NO_WAKE_UP 0x00000000
230 #define IOC_WAKE_ON_LOW 0x10000000
231 #define IOC_WAKE_ON_HIGH 0x18000000
238 #define IOC_IOMODE_NORMAL 0x00000000 // Normal Input/Output
239 #define IOC_IOMODE_INV 0x01000000 // Inverted Input/Output
240 #define IOC_IOMODE_OPEN_DRAIN_NORMAL \
241 0x04000000 // Open Drain, Normal Input/Output
242 #define IOC_IOMODE_OPEN_DRAIN_INV \
243 0x05000000 // Open Drain, Inverted
245 #define IOC_IOMODE_OPEN_SRC_NORMAL \
246 0x06000000 // Open Source, Normal Input/Output
247 #define IOC_IOMODE_OPEN_SRC_INV \
248 0x07000000 // Open Source, Inverted
256 #define IOC_NO_EDGE 0x00000000 // No edge detection
257 #define IOC_FALLING_EDGE 0x00010000 // Edge detection on falling edge
258 #define IOC_RISING_EDGE 0x00020000 // Edge detection on rising edge
259 #define IOC_BOTH_EDGES 0x00030000 // Edge detection on both edges
260 #define IOC_INT_ENABLE 0x00040000 // Enable interrupt on edge detect
261 #define IOC_INT_DISABLE 0x00000000 // Disable interrupt on edge detect
262 #define IOC_INT_M 0x00070000 // Int config mask
269 #define IOC_NO_IOPULL 0x00006000 // No IO pull
270 #define IOC_IOPULL_UP 0x00004000 // Pull up
271 #define IOC_IOPULL_DOWN 0x00002000 // Pull down
272 #define IOC_IOPULL_M 0x00006000 // Pull config mask
273 #define IOC_IOPULL_M 0x00006000
280 #define IOC_CURRENT_2MA 0x00000000 // 2mA drive strength
281 #define IOC_CURRENT_4MA 0x00000400 // 4mA drive strength
282 #define IOC_CURRENT_8MA 0x00000800 // 4 or 8mA drive strength
284 #define IOC_STRENGTH_AUTO 0x00000000 // Automatic Drive Strength
286 #define IOC_STRENGTH_MAX 0x00000300 // Maximum Drive Strength
288 #define IOC_STRENGTH_MED 0x00000200 // Medium Drive Strength
290 #define IOC_STRENGTH_MIN 0x00000100 // Minimum Drive Strength
297 #define IOC_STD_INPUT (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
298 IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
299 IOC_HYST_DISABLE | IOC_NO_EDGE | \
300 IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
301 IOC_NO_WAKE_UP | IOC_INPUT_ENABLE )
302 #define IOC_STD_OUTPUT (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
303 IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
304 IOC_HYST_DISABLE | IOC_NO_EDGE | \
305 IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
306 IOC_NO_WAKE_UP | IOC_INPUT_DISABLE )
429 uint32_t ui32IOConfig);
493 extern void IOCIOModeSet(uint32_t ui32IOId, uint32_t ui32IOMode);
517 extern void IOCIOIntSet(uint32_t ui32IOId, uint32_t ui32Int,
518 uint32_t ui32EdgeDet);
557 extern void IOCIOHystSet(uint32_t ui32IOId, uint32_t ui32Hysteresis);
576 extern void IOCIOInputSet(uint32_t ui32IOId, uint32_t ui32Input);
634 uint32_t ui32DrvStrength);
694 extern void IOCIOPortIdSet(uint32_t ui32IOId, uint32_t ui32PortId);
845 __STATIC_INLINE uint32_t
956 uint32_t ui32Tx, uint32_t ui32Cts,
989 uint32_t ui32Tx, uint32_t ui32Fss,
1018 uint32_t ui32Tx, uint32_t ui32Fss,
1040 extern void IOCPinTypeI2c(uint32_t ui32Base, uint32_t ui32Data,
1071 extern void IOCPinTypeSpis(uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss,
1102 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
1104 #ifdef ROM_IOCPortConfigureSet
1105 #undef IOCPortConfigureSet
1106 #define IOCPortConfigureSet ROM_IOCPortConfigureSet
1108 #ifdef ROM_IOCPortConfigureGet
1109 #undef IOCPortConfigureGet
1110 #define IOCPortConfigureGet ROM_IOCPortConfigureGet
1112 #ifdef ROM_IOCIOShutdownSet
1113 #undef IOCIOShutdownSet
1114 #define IOCIOShutdownSet ROM_IOCIOShutdownSet
1116 #ifdef ROM_IOCIOModeSet
1118 #define IOCIOModeSet ROM_IOCIOModeSet
1120 #ifdef ROM_IOCIOIntSet
1122 #define IOCIOIntSet ROM_IOCIOIntSet
1124 #ifdef ROM_IOCIOPortPullSet
1125 #undef IOCIOPortPullSet
1126 #define IOCIOPortPullSet ROM_IOCIOPortPullSet
1128 #ifdef ROM_IOCIOHystSet
1130 #define IOCIOHystSet ROM_IOCIOHystSet
1132 #ifdef ROM_IOCIOInputSet
1133 #undef IOCIOInputSet
1134 #define IOCIOInputSet ROM_IOCIOInputSet
1136 #ifdef ROM_IOCIOSlewCtrlSet
1137 #undef IOCIOSlewCtrlSet
1138 #define IOCIOSlewCtrlSet ROM_IOCIOSlewCtrlSet
1140 #ifdef ROM_IOCIODrvStrengthSet
1141 #undef IOCIODrvStrengthSet
1142 #define IOCIODrvStrengthSet ROM_IOCIODrvStrengthSet
1144 #ifdef ROM_IOCIOPortIdSet
1145 #undef IOCIOPortIdSet
1146 #define IOCIOPortIdSet ROM_IOCIOPortIdSet
1148 #ifdef ROM_IOCIntEnable
1150 #define IOCIntEnable ROM_IOCIntEnable
1152 #ifdef ROM_IOCIntDisable
1153 #undef IOCIntDisable
1154 #define IOCIntDisable ROM_IOCIntDisable
1156 #ifdef ROM_IOCPinTypeGpioInput
1157 #undef IOCPinTypeGpioInput
1158 #define IOCPinTypeGpioInput ROM_IOCPinTypeGpioInput
1160 #ifdef ROM_IOCPinTypeGpioOutput
1161 #undef IOCPinTypeGpioOutput
1162 #define IOCPinTypeGpioOutput ROM_IOCPinTypeGpioOutput
1164 #ifdef ROM_IOCPinTypeUart
1165 #undef IOCPinTypeUart
1166 #define IOCPinTypeUart ROM_IOCPinTypeUart
1168 #ifdef ROM_IOCPinTypeSsiMaster
1169 #undef IOCPinTypeSsiMaster
1170 #define IOCPinTypeSsiMaster ROM_IOCPinTypeSsiMaster
1172 #ifdef ROM_IOCPinTypeSsiSlave
1173 #undef IOCPinTypeSsiSlave
1174 #define IOCPinTypeSsiSlave ROM_IOCPinTypeSsiSlave
1176 #ifdef ROM_IOCPinTypeI2c
1177 #undef IOCPinTypeI2c
1178 #define IOCPinTypeI2c ROM_IOCPinTypeI2c
1180 #ifdef ROM_IOCPinTypeSpis
1181 #undef IOCPinTypeSpis
1182 #define IOCPinTypeSpis ROM_IOCPinTypeSpis
1184 #ifdef ROM_IOCPinTypeAux
1185 #undef IOCPinTypeAux
1186 #define IOCPinTypeAux ROM_IOCPinTypeAux
void IOCIntDisable(uint32_t ui32IOId)
Disables individual IO edge interrupt sources.
void IOCIOSlewCtrlSet(uint32_t ui32IOId, uint32_t ui32SlewEnable)
Enable/disable the slew control on an IO port.
void IOCPinTypeSsiMaster(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss, uint32_t ui32Clk)
Configure a set of IOs for standard SSI peripheral master control.
void IOCPinTypeI2c(uint32_t ui32Base, uint32_t ui32Data, uint32_t ui32Clk)
Configure a set of IOs for standard I2C peripheral control.
void IOCIOShutdownSet(uint32_t ui32IOId, uint32_t ui32IOShutdown)
Set wake-up on an IO port.
void IOCPinTypeSsiSlave(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss, uint32_t ui32Clk)
Configure a set of IOs for standard SSI peripheral slave control.
void IOCIOHystSet(uint32_t ui32IOId, uint32_t ui32Hysteresis)
Configure hysteresis on and IO port.
void IOCIOInputSet(uint32_t ui32IOId, uint32_t ui32Input)
Enable/disable IO port as input.
void IOCIntEnable(uint32_t ui32IOId)
Enables individual IO edge detect interrupt.
static uint32_t IOCIntStatus(uint32_t ui32IOId)
Returns the status of the IO interrupts.
void IOCIODrvStrengthSet(uint32_t ui32IOId, uint32_t ui32IOCurrent, uint32_t ui32DrvStrength)
Configure the drive strength source and current mode of an IO port.
static uint32_t GPIOEventGet(uint32_t ui32Pin)
Get the event status of a specific pin.
static void GPIOEventClear(uint32_t ui32Pins)
Clear an IO event on a pin.
void IOCPinTypeAux(uint32_t ui32IOId)
Configure an IO for AUX control.
void IOCIOIntSet(uint32_t ui32IOId, uint32_t ui32Int, uint32_t ui32EdgeDet)
Setup interrupt detection on an IO Port.
uint32_t IOCPortConfigureGet(uint32_t ui32IOId)
Get the configuration of an IO port.
void IOCPortConfigureSet(uint32_t ui32IOId, uint32_t ui32PortId, uint32_t ui32IOConfig)
Set the configuration of an IO port.
void IOCPinTypeGpioOutput(uint32_t ui32IOId)
Setup an IO for standard GPIO output.
static void IOCIntUnregister(void)
Unregisters an interrupt handler for a IO edge interrupt.
void IOCIOPortIdSet(uint32_t ui32IOId, uint32_t ui32PortId)
Setup the Port ID for this IO.
void IOCPinTypeGpioInput(uint32_t ui32IOId)
Setup an IO for standard GPIO input.
void IntUnregister(uint32_t ui32Interrupt)
Unregisters the function to be called when an interrupt occurs.
static void IOCIntClear(uint32_t ui32IOId)
Clears the IO edge interrupt source.
void IOCPinTypeUart(uint32_t ui32Base, uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Cts, uint32_t ui32Rts)
Configure a set of IOs for standard UART peripheral control.
void IOCIOModeSet(uint32_t ui32IOId, uint32_t ui32IOMode)
Set the IO Mode of an IO Port.
void IntDisable(uint32_t ui32Interrupt)
Disables an interrupt.
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Registers a function to be called when an interrupt occurs.
static void IOCIntRegister(void(*pfnHandler)(void))
Register an interrupt handler for an IO edge interrupt.
void IOCIOPortPullSet(uint32_t ui32IOId, uint32_t ui32Pull)
Set the pull on an IO port.
void IntEnable(uint32_t ui32Interrupt)
Enables an interrupt.
void IOCPinTypeSpis(uint32_t ui32Rx, uint32_t ui32Tx, uint32_t ui32Fss, uint32_t ui32Clk)
Configure a set of IOs for standard SPIS peripheral control.