gpio.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767
  1. //*****************************************************************************
  2. //
  3. // gpio.h - Defines and Macros for GPIO API.
  4. //
  5. // Copyright (c) 2005-2010 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 6459 of the Stellaris Peripheral Driver Library.
  22. //
  23. //*****************************************************************************
  24. #ifndef __GPIO_H__
  25. #define __GPIO_H__
  26. //*****************************************************************************
  27. //
  28. // If building with a C++ compiler, make all of the definitions in this header
  29. // have a C binding.
  30. //
  31. //*****************************************************************************
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. //*****************************************************************************
  37. //
  38. // The following values define the bit field for the ucPins argument to several
  39. // of the APIs.
  40. //
  41. //*****************************************************************************
  42. #define GPIO_PIN_0 0x00000001 // GPIO pin 0
  43. #define GPIO_PIN_1 0x00000002 // GPIO pin 1
  44. #define GPIO_PIN_2 0x00000004 // GPIO pin 2
  45. #define GPIO_PIN_3 0x00000008 // GPIO pin 3
  46. #define GPIO_PIN_4 0x00000010 // GPIO pin 4
  47. #define GPIO_PIN_5 0x00000020 // GPIO pin 5
  48. #define GPIO_PIN_6 0x00000040 // GPIO pin 6
  49. #define GPIO_PIN_7 0x00000080 // GPIO pin 7
  50. //*****************************************************************************
  51. //
  52. // Values that can be passed to GPIODirModeSet as the ulPinIO parameter, and
  53. // returned from GPIODirModeGet.
  54. //
  55. //*****************************************************************************
  56. #define GPIO_DIR_MODE_IN 0x00000000 // Pin is a GPIO input
  57. #define GPIO_DIR_MODE_OUT 0x00000001 // Pin is a GPIO output
  58. #define GPIO_DIR_MODE_HW 0x00000002 // Pin is a peripheral function
  59. //*****************************************************************************
  60. //
  61. // Values that can be passed to GPIOIntTypeSet as the ulIntType parameter, and
  62. // returned from GPIOIntTypeGet.
  63. //
  64. //*****************************************************************************
  65. #define GPIO_FALLING_EDGE 0x00000000 // Interrupt on falling edge
  66. #define GPIO_RISING_EDGE 0x00000004 // Interrupt on rising edge
  67. #define GPIO_BOTH_EDGES 0x00000001 // Interrupt on both edges
  68. #define GPIO_LOW_LEVEL 0x00000002 // Interrupt on low level
  69. #define GPIO_HIGH_LEVEL 0x00000007 // Interrupt on high level
  70. //*****************************************************************************
  71. //
  72. // Values that can be passed to GPIOPadConfigSet as the ulStrength parameter,
  73. // and returned by GPIOPadConfigGet in the *pulStrength parameter.
  74. //
  75. //*****************************************************************************
  76. #define GPIO_STRENGTH_2MA 0x00000001 // 2mA drive strength
  77. #define GPIO_STRENGTH_4MA 0x00000002 // 4mA drive strength
  78. #define GPIO_STRENGTH_8MA 0x00000004 // 8mA drive strength
  79. #define GPIO_STRENGTH_8MA_SC 0x0000000C // 8mA drive with slew rate control
  80. //*****************************************************************************
  81. //
  82. // Values that can be passed to GPIOPadConfigSet as the ulPadType parameter,
  83. // and returned by GPIOPadConfigGet in the *pulPadType parameter.
  84. //
  85. //*****************************************************************************
  86. #define GPIO_PIN_TYPE_STD 0x00000008 // Push-pull
  87. #define GPIO_PIN_TYPE_STD_WPU 0x0000000A // Push-pull with weak pull-up
  88. #define GPIO_PIN_TYPE_STD_WPD 0x0000000C // Push-pull with weak pull-down
  89. #define GPIO_PIN_TYPE_OD 0x00000009 // Open-drain
  90. #define GPIO_PIN_TYPE_OD_WPU 0x0000000B // Open-drain with weak pull-up
  91. #define GPIO_PIN_TYPE_OD_WPD 0x0000000D // Open-drain with weak pull-down
  92. #define GPIO_PIN_TYPE_ANALOG 0x00000000 // Analog comparator
  93. //*****************************************************************************
  94. //
  95. // Values that can be passed to GPIOPinConfigure as the ulPinConfig parameter.
  96. //
  97. //*****************************************************************************
  98. //
  99. // GPIO pin A0
  100. //
  101. #define GPIO_PA0_U0RX 0x00000001
  102. #define GPIO_PA0_I2C1SCL 0x00000008
  103. #define GPIO_PA0_U1RX 0x00000009
  104. //
  105. // GPIO pin A1
  106. //
  107. #define GPIO_PA1_U0TX 0x00000401
  108. #define GPIO_PA1_I2C1SDA 0x00000408
  109. #define GPIO_PA1_U1TX 0x00000409
  110. //
  111. // GPIO pin A2
  112. //
  113. #define GPIO_PA2_SSI0CLK 0x00000801
  114. #define GPIO_PA2_PWM4 0x00000804
  115. #define GPIO_PA2_I2S0RXSD 0x00000809
  116. //
  117. // GPIO pin A3
  118. //
  119. #define GPIO_PA3_SSI0FSS 0x00000c01
  120. #define GPIO_PA3_PWM5 0x00000c04
  121. #define GPIO_PA3_I2S0RXMCLK 0x00000c09
  122. //
  123. // GPIO pin A4
  124. //
  125. #define GPIO_PA4_SSI0RX 0x00001001
  126. #define GPIO_PA4_PWM6 0x00001004
  127. #define GPIO_PA4_CAN0RX 0x00001005
  128. #define GPIO_PA4_I2S0TXSCK 0x00001009
  129. //
  130. // GPIO pin A5
  131. //
  132. #define GPIO_PA5_SSI0TX 0x00001401
  133. #define GPIO_PA5_PWM7 0x00001404
  134. #define GPIO_PA5_CAN0TX 0x00001405
  135. #define GPIO_PA5_I2S0TXWS 0x00001409
  136. //
  137. // GPIO pin A6
  138. //
  139. #define GPIO_PA6_I2C1SCL 0x00001801
  140. #define GPIO_PA6_CCP1 0x00001802
  141. #define GPIO_PA6_PWM0 0x00001804
  142. #define GPIO_PA6_PWM4 0x00001805
  143. #define GPIO_PA6_CAN0RX 0x00001806
  144. #define GPIO_PA6_USB0EPEN 0x00001808
  145. #define GPIO_PA6_U1CTS 0x00001809
  146. //
  147. // GPIO pin A7
  148. //
  149. #define GPIO_PA7_I2C1SDA 0x00001c01
  150. #define GPIO_PA7_CCP4 0x00001c02
  151. #define GPIO_PA7_PWM1 0x00001c04
  152. #define GPIO_PA7_PWM5 0x00001c05
  153. #define GPIO_PA7_CAN0TX 0x00001c06
  154. #define GPIO_PA7_CCP3 0x00001c07
  155. #define GPIO_PA7_USB0PFLT 0x00001c08
  156. #define GPIO_PA7_U1DCD 0x00001c09
  157. //
  158. // GPIO pin B0
  159. //
  160. #define GPIO_PB0_CCP0 0x00010001
  161. #define GPIO_PB0_PWM2 0x00010002
  162. #define GPIO_PB0_U1RX 0x00010005
  163. //
  164. // GPIO pin B1
  165. //
  166. #define GPIO_PB1_CCP2 0x00010401
  167. #define GPIO_PB1_PWM3 0x00010402
  168. #define GPIO_PB1_CCP1 0x00010404
  169. #define GPIO_PB1_U1TX 0x00010405
  170. //
  171. // GPIO pin B2
  172. //
  173. #define GPIO_PB2_I2C0SCL 0x00010801
  174. #define GPIO_PB2_IDX0 0x00010802
  175. #define GPIO_PB2_CCP3 0x00010804
  176. #define GPIO_PB2_CCP0 0x00010805
  177. #define GPIO_PB2_USB0EPEN 0x00010808
  178. //
  179. // GPIO pin B3
  180. //
  181. #define GPIO_PB3_I2C0SDA 0x00010c01
  182. #define GPIO_PB3_FAULT0 0x00010c02
  183. #define GPIO_PB3_FAULT3 0x00010c04
  184. #define GPIO_PB3_USB0PFLT 0x00010c08
  185. //
  186. // GPIO pin B4
  187. //
  188. #define GPIO_PB4_U2RX 0x00011004
  189. #define GPIO_PB4_CAN0RX 0x00011005
  190. #define GPIO_PB4_IDX0 0x00011006
  191. #define GPIO_PB4_U1RX 0x00011007
  192. #define GPIO_PB4_EPI0S23 0x00011008
  193. //
  194. // GPIO pin B5
  195. //
  196. #define GPIO_PB5_C0O 0x00011401
  197. #define GPIO_PB5_CCP5 0x00011402
  198. #define GPIO_PB5_CCP6 0x00011403
  199. #define GPIO_PB5_CCP0 0x00011404
  200. #define GPIO_PB5_CAN0TX 0x00011405
  201. #define GPIO_PB5_CCP2 0x00011406
  202. #define GPIO_PB5_U1TX 0x00011407
  203. #define GPIO_PB5_EPI0S22 0x00011408
  204. //
  205. // GPIO pin B6
  206. //
  207. #define GPIO_PB6_CCP1 0x00011801
  208. #define GPIO_PB6_CCP7 0x00011802
  209. #define GPIO_PB6_C0O 0x00011803
  210. #define GPIO_PB6_FAULT1 0x00011804
  211. #define GPIO_PB6_IDX0 0x00011805
  212. #define GPIO_PB6_CCP5 0x00011806
  213. #define GPIO_PB6_I2S0TXSCK 0x00011809
  214. //
  215. // GPIO pin B7
  216. //
  217. #define GPIO_PB7_NMI 0x00011c04
  218. //
  219. // GPIO pin C0
  220. //
  221. #define GPIO_PC0_TCK 0x00020003
  222. //
  223. // GPIO pin C1
  224. //
  225. #define GPIO_PC1_TMS 0x00020403
  226. //
  227. // GPIO pin C2
  228. //
  229. #define GPIO_PC2_TDI 0x00020803
  230. //
  231. // GPIO pin C3
  232. //
  233. #define GPIO_PC3_TDO 0x00020c03
  234. //
  235. // GPIO pin C4
  236. //
  237. #define GPIO_PC4_CCP5 0x00021001
  238. #define GPIO_PC4_PHA0 0x00021002
  239. #define GPIO_PC4_PWM6 0x00021004
  240. #define GPIO_PC4_CCP2 0x00021005
  241. #define GPIO_PC4_CCP4 0x00021006
  242. #define GPIO_PC4_EPI0S2 0x00021008
  243. #define GPIO_PC4_CCP1 0x00021009
  244. //
  245. // GPIO pin C5
  246. //
  247. #define GPIO_PC5_CCP1 0x00021401
  248. #define GPIO_PC5_C1O 0x00021402
  249. #define GPIO_PC5_C0O 0x00021403
  250. #define GPIO_PC5_FAULT2 0x00021404
  251. #define GPIO_PC5_CCP3 0x00021405
  252. #define GPIO_PC5_USB0EPEN 0x00021406
  253. #define GPIO_PC5_EPI0S3 0x00021408
  254. //
  255. // GPIO pin C6
  256. //
  257. #define GPIO_PC6_CCP3 0x00021801
  258. #define GPIO_PC6_PHB0 0x00021802
  259. #define GPIO_PC6_C2O 0x00021803
  260. #define GPIO_PC6_PWM7 0x00021804
  261. #define GPIO_PC6_U1RX 0x00021805
  262. #define GPIO_PC6_CCP0 0x00021806
  263. #define GPIO_PC6_USB0PFLT 0x00021807
  264. #define GPIO_PC6_EPI0S4 0x00021808
  265. //
  266. // GPIO pin C7
  267. //
  268. #define GPIO_PC7_CCP4 0x00021c01
  269. #define GPIO_PC7_PHB0 0x00021c02
  270. #define GPIO_PC7_CCP0 0x00021c04
  271. #define GPIO_PC7_U1TX 0x00021c05
  272. #define GPIO_PC7_USB0PFLT 0x00021c06
  273. #define GPIO_PC7_C1O 0x00021c07
  274. #define GPIO_PC7_EPI0S5 0x00021c08
  275. //
  276. // GPIO pin D0
  277. //
  278. #define GPIO_PD0_PWM0 0x00030001
  279. #define GPIO_PD0_CAN0RX 0x00030002
  280. #define GPIO_PD0_IDX0 0x00030003
  281. #define GPIO_PD0_U2RX 0x00030004
  282. #define GPIO_PD0_U1RX 0x00030005
  283. #define GPIO_PD0_CCP6 0x00030006
  284. #define GPIO_PD0_I2S0RXSCK 0x00030008
  285. #define GPIO_PD0_U1CTS 0x00030009
  286. //
  287. // GPIO pin D1
  288. //
  289. #define GPIO_PD1_PWM1 0x00030401
  290. #define GPIO_PD1_CAN0TX 0x00030402
  291. #define GPIO_PD1_PHA0 0x00030403
  292. #define GPIO_PD1_U2TX 0x00030404
  293. #define GPIO_PD1_U1TX 0x00030405
  294. #define GPIO_PD1_CCP7 0x00030406
  295. #define GPIO_PD1_I2S0RXWS 0x00030408
  296. #define GPIO_PD1_U1DCD 0x00030409
  297. #define GPIO_PD1_CCP2 0x0003040a
  298. #define GPIO_PD1_PHB1 0x0003040b
  299. //
  300. // GPIO pin D2
  301. //
  302. #define GPIO_PD2_U1RX 0x00030801
  303. #define GPIO_PD2_CCP6 0x00030802
  304. #define GPIO_PD2_PWM2 0x00030803
  305. #define GPIO_PD2_CCP5 0x00030804
  306. #define GPIO_PD2_EPI0S20 0x00030808
  307. //
  308. // GPIO pin D3
  309. //
  310. #define GPIO_PD3_U1TX 0x00030c01
  311. #define GPIO_PD3_CCP7 0x00030c02
  312. #define GPIO_PD3_PWM3 0x00030c03
  313. #define GPIO_PD3_CCP0 0x00030c04
  314. #define GPIO_PD3_EPI0S21 0x00030c08
  315. //
  316. // GPIO pin D4
  317. //
  318. #define GPIO_PD4_CCP0 0x00031001
  319. #define GPIO_PD4_CCP3 0x00031002
  320. #define GPIO_PD4_I2S0RXSD 0x00031008
  321. #define GPIO_PD4_U1RI 0x00031009
  322. #define GPIO_PD4_EPI0S19 0x0003100a
  323. //
  324. // GPIO pin D5
  325. //
  326. #define GPIO_PD5_CCP2 0x00031401
  327. #define GPIO_PD5_CCP4 0x00031402
  328. #define GPIO_PD5_I2S0RXMCLK 0x00031408
  329. #define GPIO_PD5_U2RX 0x00031409
  330. #define GPIO_PD5_EPI0S28 0x0003140a
  331. //
  332. // GPIO pin D6
  333. //
  334. #define GPIO_PD6_FAULT0 0x00031801
  335. #define GPIO_PD6_I2S0TXSCK 0x00031808
  336. #define GPIO_PD6_U2TX 0x00031809
  337. #define GPIO_PD6_EPI0S29 0x0003180a
  338. //
  339. // GPIO pin D7
  340. //
  341. #define GPIO_PD7_IDX0 0x00031c01
  342. #define GPIO_PD7_C0O 0x00031c02
  343. #define GPIO_PD7_CCP1 0x00031c03
  344. #define GPIO_PD7_I2S0TXWS 0x00031c08
  345. #define GPIO_PD7_U1DTR 0x00031c09
  346. #define GPIO_PD7_EPI0S30 0x00031c0a
  347. //
  348. // GPIO pin E0
  349. //
  350. #define GPIO_PE0_PWM4 0x00040001
  351. #define GPIO_PE0_SSI1CLK 0x00040002
  352. #define GPIO_PE0_CCP3 0x00040003
  353. #define GPIO_PE0_EPI0S8 0x00040008
  354. #define GPIO_PE0_USB0PFLT 0x00040009
  355. //
  356. // GPIO pin E1
  357. //
  358. #define GPIO_PE1_PWM5 0x00040401
  359. #define GPIO_PE1_SSI1FSS 0x00040402
  360. #define GPIO_PE1_FAULT0 0x00040403
  361. #define GPIO_PE1_CCP2 0x00040404
  362. #define GPIO_PE1_CCP6 0x00040405
  363. #define GPIO_PE1_EPI0S9 0x00040408
  364. //
  365. // GPIO pin E2
  366. //
  367. #define GPIO_PE2_CCP4 0x00040801
  368. #define GPIO_PE2_SSI1RX 0x00040802
  369. #define GPIO_PE2_PHB1 0x00040803
  370. #define GPIO_PE2_PHA0 0x00040804
  371. #define GPIO_PE2_CCP2 0x00040805
  372. #define GPIO_PE2_EPI0S24 0x00040808
  373. //
  374. // GPIO pin E3
  375. //
  376. #define GPIO_PE3_CCP1 0x00040c01
  377. #define GPIO_PE3_SSI1TX 0x00040c02
  378. #define GPIO_PE3_PHA1 0x00040c03
  379. #define GPIO_PE3_PHB0 0x00040c04
  380. #define GPIO_PE3_CCP7 0x00040c05
  381. #define GPIO_PE3_EPI0S25 0x00040c08
  382. //
  383. // GPIO pin E4
  384. //
  385. #define GPIO_PE4_CCP3 0x00041001
  386. #define GPIO_PE4_FAULT0 0x00041004
  387. #define GPIO_PE4_U2TX 0x00041005
  388. #define GPIO_PE4_CCP2 0x00041006
  389. #define GPIO_PE4_I2S0TXWS 0x00041009
  390. //
  391. // GPIO pin E5
  392. //
  393. #define GPIO_PE5_CCP5 0x00041401
  394. #define GPIO_PE5_I2S0TXSD 0x00041409
  395. //
  396. // GPIO pin E6
  397. //
  398. #define GPIO_PE6_PWM4 0x00041801
  399. #define GPIO_PE6_C1O 0x00041802
  400. #define GPIO_PE6_U1CTS 0x00041809
  401. //
  402. // GPIO pin E7
  403. //
  404. #define GPIO_PE7_PWM5 0x00041c01
  405. #define GPIO_PE7_C2O 0x00041c02
  406. #define GPIO_PE7_U1DCD 0x00041c09
  407. //
  408. // GPIO pin F0
  409. //
  410. #define GPIO_PF0_CAN1RX 0x00050001
  411. #define GPIO_PF0_PHB0 0x00050002
  412. #define GPIO_PF0_PWM0 0x00050003
  413. #define GPIO_PF0_I2S0TXSD 0x00050008
  414. #define GPIO_PF0_U1DSR 0x00050009
  415. //
  416. // GPIO pin F1
  417. //
  418. #define GPIO_PF1_CAN1TX 0x00050401
  419. #define GPIO_PF1_IDX1 0x00050402
  420. #define GPIO_PF1_PWM1 0x00050403
  421. #define GPIO_PF1_I2S0TXMCLK 0x00050408
  422. #define GPIO_PF1_U1RTS 0x00050409
  423. #define GPIO_PF1_CCP3 0x0005040a
  424. //
  425. // GPIO pin F2
  426. //
  427. #define GPIO_PF2_LED1 0x00050801
  428. #define GPIO_PF2_PWM4 0x00050802
  429. #define GPIO_PF2_PWM2 0x00050804
  430. #define GPIO_PF2_SSI1CLK 0x00050809
  431. //
  432. // GPIO pin F3
  433. //
  434. #define GPIO_PF3_LED0 0x00050c01
  435. #define GPIO_PF3_PWM5 0x00050c02
  436. #define GPIO_PF3_PWM3 0x00050c04
  437. #define GPIO_PF3_SSI1FSS 0x00050c09
  438. //
  439. // GPIO pin F4
  440. //
  441. #define GPIO_PF4_CCP0 0x00051001
  442. #define GPIO_PF4_C0O 0x00051002
  443. #define GPIO_PF4_FAULT0 0x00051004
  444. #define GPIO_PF4_EPI0S12 0x00051008
  445. #define GPIO_PF4_SSI1RX 0x00051009
  446. //
  447. // GPIO pin F5
  448. //
  449. #define GPIO_PF5_CCP2 0x00051401
  450. #define GPIO_PF5_C1O 0x00051402
  451. #define GPIO_PF5_EPI0S15 0x00051408
  452. #define GPIO_PF5_SSI1TX 0x00051409
  453. //
  454. // GPIO pin F6
  455. //
  456. #define GPIO_PF6_CCP1 0x00051801
  457. #define GPIO_PF6_C2O 0x00051802
  458. #define GPIO_PF6_PHA0 0x00051804
  459. #define GPIO_PF6_I2S0TXMCLK 0x00051809
  460. #define GPIO_PF6_U1RTS 0x0005180a
  461. //
  462. // GPIO pin F7
  463. //
  464. #define GPIO_PF7_CCP4 0x00051c01
  465. #define GPIO_PF7_PHB0 0x00051c04
  466. #define GPIO_PF7_EPI0S12 0x00051c08
  467. #define GPIO_PF7_FAULT1 0x00051c09
  468. //
  469. // GPIO pin G0
  470. //
  471. #define GPIO_PG0_U2RX 0x00060001
  472. #define GPIO_PG0_PWM0 0x00060002
  473. #define GPIO_PG0_I2C1SCL 0x00060003
  474. #define GPIO_PG0_PWM4 0x00060004
  475. #define GPIO_PG0_USB0EPEN 0x00060007
  476. #define GPIO_PG0_EPI0S13 0x00060008
  477. //
  478. // GPIO pin G1
  479. //
  480. #define GPIO_PG1_U2TX 0x00060401
  481. #define GPIO_PG1_PWM1 0x00060402
  482. #define GPIO_PG1_I2C1SDA 0x00060403
  483. #define GPIO_PG1_PWM5 0x00060404
  484. #define GPIO_PG1_EPI0S14 0x00060408
  485. //
  486. // GPIO pin G2
  487. //
  488. #define GPIO_PG2_PWM0 0x00060801
  489. #define GPIO_PG2_FAULT0 0x00060804
  490. #define GPIO_PG2_IDX1 0x00060808
  491. #define GPIO_PG2_I2S0RXSD 0x00060809
  492. //
  493. // GPIO pin G3
  494. //
  495. #define GPIO_PG3_PWM1 0x00060c01
  496. #define GPIO_PG3_FAULT2 0x00060c04
  497. #define GPIO_PG3_FAULT0 0x00060c08
  498. #define GPIO_PG3_I2S0RXMCLK 0x00060c09
  499. //
  500. // GPIO pin G4
  501. //
  502. #define GPIO_PG4_CCP3 0x00061001
  503. #define GPIO_PG4_FAULT1 0x00061004
  504. #define GPIO_PG4_EPI0S15 0x00061008
  505. #define GPIO_PG4_PWM6 0x00061009
  506. #define GPIO_PG4_U1RI 0x0006100a
  507. //
  508. // GPIO pin G5
  509. //
  510. #define GPIO_PG5_CCP5 0x00061401
  511. #define GPIO_PG5_IDX0 0x00061404
  512. #define GPIO_PG5_FAULT1 0x00061405
  513. #define GPIO_PG5_PWM7 0x00061408
  514. #define GPIO_PG5_I2S0RXSCK 0x00061409
  515. #define GPIO_PG5_U1DTR 0x0006140a
  516. //
  517. // GPIO pin G6
  518. //
  519. #define GPIO_PG6_PHA1 0x00061801
  520. #define GPIO_PG6_PWM6 0x00061804
  521. #define GPIO_PG6_FAULT1 0x00061808
  522. #define GPIO_PG6_I2S0RXWS 0x00061809
  523. #define GPIO_PG6_U1RI 0x0006180a
  524. //
  525. // GPIO pin G7
  526. //
  527. #define GPIO_PG7_PHB1 0x00061c01
  528. #define GPIO_PG7_PWM7 0x00061c04
  529. #define GPIO_PG7_CCP5 0x00061c08
  530. #define GPIO_PG7_EPI0S31 0x00061c09
  531. //
  532. // GPIO pin H0
  533. //
  534. #define GPIO_PH0_CCP6 0x00070001
  535. #define GPIO_PH0_PWM2 0x00070002
  536. #define GPIO_PH0_EPI0S6 0x00070008
  537. #define GPIO_PH0_PWM4 0x00070009
  538. //
  539. // GPIO pin H1
  540. //
  541. #define GPIO_PH1_CCP7 0x00070401
  542. #define GPIO_PH1_PWM3 0x00070402
  543. #define GPIO_PH1_EPI0S7 0x00070408
  544. #define GPIO_PH1_PWM5 0x00070409
  545. //
  546. // GPIO pin H2
  547. //
  548. #define GPIO_PH2_IDX1 0x00070801
  549. #define GPIO_PH2_C1O 0x00070802
  550. #define GPIO_PH2_FAULT3 0x00070804
  551. #define GPIO_PH2_EPI0S1 0x00070808
  552. //
  553. // GPIO pin H3
  554. //
  555. #define GPIO_PH3_PHB0 0x00070c01
  556. #define GPIO_PH3_FAULT0 0x00070c02
  557. #define GPIO_PH3_USB0EPEN 0x00070c04
  558. #define GPIO_PH3_EPI0S0 0x00070c08
  559. //
  560. // GPIO pin H4
  561. //
  562. #define GPIO_PH4_USB0PFLT 0x00071004
  563. #define GPIO_PH4_EPI0S10 0x00071008
  564. #define GPIO_PH4_SSI1CLK 0x0007100b
  565. //
  566. // GPIO pin H5
  567. //
  568. #define GPIO_PH5_EPI0S11 0x00071408
  569. #define GPIO_PH5_FAULT2 0x0007140a
  570. #define GPIO_PH5_SSI1FSS 0x0007140b
  571. //
  572. // GPIO pin H6
  573. //
  574. #define GPIO_PH6_EPI0S26 0x00071808
  575. #define GPIO_PH6_PWM4 0x0007180a
  576. #define GPIO_PH6_SSI1RX 0x0007180b
  577. //
  578. // GPIO pin H7
  579. //
  580. #define GPIO_PH7_EPI0S27 0x00071c08
  581. #define GPIO_PH7_PWM5 0x00071c0a
  582. #define GPIO_PH7_SSI1TX 0x00071c0b
  583. //
  584. // GPIO pin J0
  585. //
  586. #define GPIO_PJ0_EPI0S16 0x00080008
  587. #define GPIO_PJ0_PWM0 0x0008000a
  588. #define GPIO_PJ0_I2C1SCL 0x0008000b
  589. //
  590. // GPIO pin J1
  591. //
  592. #define GPIO_PJ1_EPI0S17 0x00080408
  593. #define GPIO_PJ1_USB0PFLT 0x00080409
  594. #define GPIO_PJ1_PWM1 0x0008040a
  595. #define GPIO_PJ1_I2C1SDA 0x0008040b
  596. //
  597. // GPIO pin J2
  598. //
  599. #define GPIO_PJ2_EPI0S18 0x00080808
  600. #define GPIO_PJ2_CCP0 0x00080809
  601. #define GPIO_PJ2_FAULT0 0x0008080a
  602. //
  603. // GPIO pin J3
  604. //
  605. #define GPIO_PJ3_EPI0S19 0x00080c08
  606. #define GPIO_PJ3_U1CTS 0x00080c09
  607. #define GPIO_PJ3_CCP6 0x00080c0a
  608. //
  609. // GPIO pin J4
  610. //
  611. #define GPIO_PJ4_EPI0S28 0x00081008
  612. #define GPIO_PJ4_U1DCD 0x00081009
  613. #define GPIO_PJ4_CCP4 0x0008100a
  614. //
  615. // GPIO pin J5
  616. //
  617. #define GPIO_PJ5_EPI0S29 0x00081408
  618. #define GPIO_PJ5_U1DSR 0x00081409
  619. #define GPIO_PJ5_CCP2 0x0008140a
  620. //
  621. // GPIO pin J6
  622. //
  623. #define GPIO_PJ6_EPI0S30 0x00081808
  624. #define GPIO_PJ6_U1RTS 0x00081809
  625. #define GPIO_PJ6_CCP1 0x0008180a
  626. //
  627. // GPIO pin J7
  628. //
  629. #define GPIO_PJ7_U1DTR 0x00081c09
  630. #define GPIO_PJ7_CCP0 0x00081c0a
  631. //*****************************************************************************
  632. //
  633. // Prototypes for the APIs.
  634. //
  635. //*****************************************************************************
  636. extern void GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
  637. unsigned long ulPinIO);
  638. extern unsigned long GPIODirModeGet(unsigned long ulPort, unsigned char ucPin);
  639. extern void GPIOIntTypeSet(unsigned long ulPort, unsigned char ucPins,
  640. unsigned long ulIntType);
  641. extern unsigned long GPIOIntTypeGet(unsigned long ulPort, unsigned char ucPin);
  642. extern void GPIOPadConfigSet(unsigned long ulPort, unsigned char ucPins,
  643. unsigned long ulStrength,
  644. unsigned long ulPadType);
  645. extern void GPIOPadConfigGet(unsigned long ulPort, unsigned char ucPin,
  646. unsigned long *pulStrength,
  647. unsigned long *pulPadType);
  648. extern void GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins);
  649. extern void GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins);
  650. extern long GPIOPinIntStatus(unsigned long ulPort, tBoolean bMasked);
  651. extern void GPIOPinIntClear(unsigned long ulPort, unsigned char ucPins);
  652. extern void GPIOPortIntRegister(unsigned long ulPort,
  653. void (*pfnIntHandler)(void));
  654. extern void GPIOPortIntUnregister(unsigned long ulPort);
  655. extern long GPIOPinRead(unsigned long ulPort, unsigned char ucPins);
  656. extern void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins,
  657. unsigned char ucVal);
  658. extern void GPIOPinConfigure(unsigned long ulPinConfig);
  659. extern void GPIOPinTypeADC(unsigned long ulPort, unsigned char ucPins);
  660. extern void GPIOPinTypeCAN(unsigned long ulPort, unsigned char ucPins);
  661. extern void GPIOPinTypeComparator(unsigned long ulPort, unsigned char ucPins);
  662. extern void GPIOPinTypeEPI(unsigned long ulPort, unsigned char ucPins);
  663. extern void GPIOPinTypeEthernetLED(unsigned long ulPort, unsigned char ucPins);
  664. extern void GPIOPinTypeGPIOInput(unsigned long ulPort, unsigned char ucPins);
  665. extern void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins);
  666. extern void GPIOPinTypeGPIOOutputOD(unsigned long ulPort,
  667. unsigned char ucPins);
  668. extern void GPIOPinTypeI2C(unsigned long ulPort, unsigned char ucPins);
  669. extern void GPIOPinTypeI2S(unsigned long ulPort, unsigned char ucPins);
  670. extern void GPIOPinTypePWM(unsigned long ulPort, unsigned char ucPins);
  671. extern void GPIOPinTypeQEI(unsigned long ulPort, unsigned char ucPins);
  672. extern void GPIOPinTypeSSI(unsigned long ulPort, unsigned char ucPins);
  673. extern void GPIOPinTypeTimer(unsigned long ulPort, unsigned char ucPins);
  674. extern void GPIOPinTypeUART(unsigned long ulPort, unsigned char ucPins);
  675. extern void GPIOPinTypeUSBAnalog(unsigned long ulPort, unsigned char ucPins);
  676. extern void GPIOPinTypeUSBDigital(unsigned long ulPort, unsigned char ucPins);
  677. //*****************************************************************************
  678. //
  679. // Mark the end of the C bindings section for C++ compilers.
  680. //
  681. //*****************************************************************************
  682. #ifdef __cplusplus
  683. }
  684. #endif
  685. #endif // __GPIO_H__