hc32f4a0_gpio.h 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408
  1. /**
  2. *******************************************************************************
  3. * @file hc32f4a0_gpio.h
  4. * @brief This file contains all the functions prototypes of the GPIO driver
  5. * library.
  6. @verbatim
  7. Change Logs:
  8. Date Author Notes
  9. 2020-06-12 Zhangxl First version
  10. 2020-09-21 Zhangxl Typo, missing FUNC_I2C3 defintion
  11. 2020-10-27 Zhangxl Revise debug port definition
  12. @endverbatim
  13. *******************************************************************************
  14. * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved.
  15. *
  16. * This software component is licensed by HDSC under BSD 3-Clause license
  17. * (the "License"); You may not use this file except in compliance with the
  18. * License. You may obtain a copy of the License at:
  19. * opensource.org/licenses/BSD-3-Clause
  20. *
  21. *******************************************************************************
  22. */
  23. #ifndef __HC32F4A0_GPIO_H__
  24. #define __HC32F4A0_GPIO_H__
  25. /* C binding of definitions if building with C++ compiler */
  26. #ifdef __cplusplus
  27. extern "C"
  28. {
  29. #endif
  30. /*******************************************************************************
  31. * Include files
  32. ******************************************************************************/
  33. #include "hc32_common.h"
  34. #include "ddl_config.h"
  35. /**
  36. * @addtogroup HC32F4A0_DDL_Driver
  37. * @{
  38. */
  39. /**
  40. * @addtogroup DDL_GPIO
  41. * @{
  42. */
  43. #if (DDL_GPIO_ENABLE == DDL_ON)
  44. /*******************************************************************************
  45. * Global type definitions ('typedef')
  46. ******************************************************************************/
  47. /**
  48. * @defgroup GPIO_Global_Types GPIO Global Types
  49. * @{
  50. */
  51. /**
  52. * @brief GPIO Pin Set and Reset enumeration
  53. */
  54. typedef enum
  55. {
  56. Pin_Reset = 0U, /*!< Pin reset */
  57. Pin_Set = 1U /*!< Pin set */
  58. } en_pin_state_t;
  59. /**
  60. * @brief GPIO Init structure definition
  61. */
  62. typedef struct
  63. {
  64. uint16_t u16PinState; /*!< Set pin state to High or Low, @ref GPIO_PinState_Sel for details */
  65. uint16_t u16PinDir; /*!< Pin mode setting, @ref GPIO_PinDirection_Sel for details */
  66. uint16_t u16PinOType; /*!< Output type setting, @ref GPIO_PinOutType_Sel for details */
  67. uint16_t u16PinDrv; /*!< Pin drive capacity setting, @ref GPIO_PinDrv_Sel for details */
  68. uint16_t u16Latch; /*!< Pin latch setting, @ref GPIO_PinLatch_Sel for details */
  69. uint16_t u16PullUp; /*!< Internal pull-up resistor setting, @ref GPIO_PinPU_Sel for details */
  70. uint16_t u16Invert; /*!< Pin input/output invert setting, @ref GPIO_PinInvert_Sel */
  71. uint16_t u16PinIType; /*!< Input type setting, @ref GPIO_PinInType_Sel */
  72. uint16_t u16ExInt; /*!< External interrupt pin setting, @ref GPIO_PinExInt_Sel for details */
  73. uint16_t u16PinAttr; /*!< Digital or analog attribute setting, @ref GPIO_PinMode_Sel for details */
  74. } stc_gpio_init_t;
  75. /**
  76. * @}
  77. */
  78. /*******************************************************************************
  79. * Global pre-processor symbols/macros ('#define')
  80. ******************************************************************************/
  81. /**
  82. * @defgroup GPIO_Global_Macros GPIO Global Macros
  83. * @{
  84. */
  85. /** @defgroup GPIO_pins_define GPIO pin source
  86. * @{
  87. */
  88. #define GPIO_PIN_00 (0x0001U) /*!< Pin 00 selected */
  89. #define GPIO_PIN_01 (0x0002U) /*!< Pin 01 selected */
  90. #define GPIO_PIN_02 (0x0004U) /*!< Pin 02 selected */
  91. #define GPIO_PIN_03 (0x0008U) /*!< Pin 03 selected */
  92. #define GPIO_PIN_04 (0x0010U) /*!< Pin 04 selected */
  93. #define GPIO_PIN_05 (0x0020U) /*!< Pin 05 selected */
  94. #define GPIO_PIN_06 (0x0040U) /*!< Pin 06 selected */
  95. #define GPIO_PIN_07 (0x0080U) /*!< Pin 07 selected */
  96. #define GPIO_PIN_08 (0x0100U) /*!< Pin 08 selected */
  97. #define GPIO_PIN_09 (0x0200U) /*!< Pin 09 selected */
  98. #define GPIO_PIN_10 (0x0400U) /*!< Pin 10 selected */
  99. #define GPIO_PIN_11 (0x0800U) /*!< Pin 11 selected */
  100. #define GPIO_PIN_12 (0x1000U) /*!< Pin 12 selected */
  101. #define GPIO_PIN_13 (0x2000U) /*!< Pin 13 selected */
  102. #define GPIO_PIN_14 (0x4000U) /*!< Pin 14 selected */
  103. #define GPIO_PIN_15 (0x8000U) /*!< Pin 15 selected */
  104. #define GPIO_PIN_ALL (0xFFFFU) /*!< All pins selected */
  105. #define GPIO_PIN_MASK (0xFFFFU) /*!< PIN mask for assert test */
  106. /**
  107. * @}
  108. */
  109. /** @defgroup GPIO_Port_source GPIO port source
  110. * @{
  111. */
  112. #define GPIO_PORT_A (0x00U) /*!< Port A selected */
  113. #define GPIO_PORT_B (0x01U) /*!< Port B selected */
  114. #define GPIO_PORT_C (0x02U) /*!< Port C selected */
  115. #define GPIO_PORT_D (0x03U) /*!< Port D selected */
  116. #define GPIO_PORT_E (0x04U) /*!< Port E selected */
  117. #define GPIO_PORT_F (0x05U) /*!< Port F selected */
  118. #define GPIO_PORT_G (0x06U) /*!< Port G selected */
  119. #define GPIO_PORT_H (0x07U) /*!< Port H selected */
  120. #define GPIO_PORT_I (0x08U) /*!< Port I selected */
  121. /**
  122. * @}
  123. */
  124. /** @defgroup GPIO_Port_index GPIO port index
  125. * @{
  126. */
  127. #define GPIO_PORTA_IDX (0x0001U)
  128. #define GPIO_PORTB_IDX (0x0002U)
  129. #define GPIO_PORTC_IDX (0x0004U)
  130. #define GPIO_PORTD_IDX (0x0008U)
  131. #define GPIO_PORTE_IDX (0x0010U)
  132. #define GPIO_PORTF_IDX (0x0020U)
  133. #define GPIO_PORTG_IDX (0x0040U)
  134. #define GPIO_PORTH_IDX (0x0080U)
  135. #define GPIO_PORTI_IDX (0x0100U)
  136. #define GPIO_PORT_ALL (0x01FFU)
  137. #define GPIO_PORT_MASK (0x01FFU)
  138. /**
  139. * @}
  140. */
  141. /**
  142. * @}
  143. */
  144. /** @defgroup GPIO_function_selection_define GPIO function selection
  145. * @{
  146. */
  147. /** @defgroup GPIO_PinFunction0 GPIO Function 0 selection
  148. * @{
  149. */
  150. #define GPIO_FUNC_0 (0x00U)
  151. #define GPIO_FUNC_0_GPO (GPIO_FUNC_0) /* GPO function */
  152. /**
  153. * @}
  154. */
  155. /** @defgroup GPIO_PinFunction1 GPIO Function 1 selection
  156. * @{
  157. */
  158. #define GPIO_FUNC_1 (0x01U)
  159. #define GPIO_FUNC_1_FCMREF (GPIO_FUNC_1) /*!< Reference clock input for FCM */
  160. #define GPIO_FUNC_1_CTCREF (GPIO_FUNC_1) /*!< Reference clock input for internal CTC */
  161. #define GPIO_FUNC_1_RTCOUT (GPIO_FUNC_1) /*!< RTC 1Hz output */
  162. #define GPIO_FUNC_1_VCOUT (GPIO_FUNC_1) /*!< Voltage comparator output */
  163. #define GPIO_FUNC_1_ADTRG (GPIO_FUNC_1) /*!< ADC external trigger */
  164. #define GPIO_FUNC_1_MCO (GPIO_FUNC_1) /*!< Clock output */
  165. /**
  166. * @}
  167. */
  168. /** @defgroup GPIO_PinFunction2 GPIO Function 2 selection
  169. * @{
  170. */
  171. #define GPIO_FUNC_2 (0x02U)
  172. #define GPIO_FUNC_2_TIM41 (GPIO_FUNC_2) /*!< TMR4 unit */
  173. #define GPIO_FUNC_2_TIM41_PCT (GPIO_FUNC_2) /*!< TMR4 unit 1 basetimer count direction indicator */
  174. #define GPIO_FUNC_2_TIM41_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 1 special event */
  175. #define GPIO_FUNC_2_TIM41_CLK (GPIO_FUNC_2) /*!< TMR4 unit 1 clock input */
  176. #define GPIO_FUNC_2_TIM41_OUH (GPIO_FUNC_2) /*!< TMR4 unit 1 U-phase output high */
  177. #define GPIO_FUNC_2_TIM41_OUL (GPIO_FUNC_2) /*!< TMR4 unit 1 U-phase output low */
  178. #define GPIO_FUNC_2_TIM41_OVH (GPIO_FUNC_2) /*!< TMR4 unit 1 V-phase output high */
  179. #define GPIO_FUNC_2_TIM41_OVL (GPIO_FUNC_2) /*!< TMR4 unit 1 V-phase output low */
  180. #define GPIO_FUNC_2_TIM41_OWH (GPIO_FUNC_2) /*!< TMR4 unit 1 W-phase output high */
  181. #define GPIO_FUNC_2_TIM41_OWL (GPIO_FUNC_2) /*!< TMR4 unit 1 W-phase output low */
  182. #define GPIO_FUNC_2_TIM42 (GPIO_FUNC_2) /*!< TMR4 unit */
  183. #define GPIO_FUNC_2_TIM42_PCT (GPIO_FUNC_2) /*!< TMR4 unit 2 basetimer count direction indicator */
  184. #define GPIO_FUNC_2_TIM42_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 2 special event */
  185. #define GPIO_FUNC_2_TIM42_CLK (GPIO_FUNC_2) /*!< TMR4 unit 2 clock input */
  186. #define GPIO_FUNC_2_TIM42_OUH (GPIO_FUNC_2) /*!< TMR4 unit 2 U-phase output high */
  187. #define GPIO_FUNC_2_TIM42_OUL (GPIO_FUNC_2) /*!< TMR4 unit 2 U-phase output low */
  188. #define GPIO_FUNC_2_TIM42_OVH (GPIO_FUNC_2) /*!< TMR4 unit 2 V-phase output high */
  189. #define GPIO_FUNC_2_TIM42_OVL (GPIO_FUNC_2) /*!< TMR4 unit 2 V-phase output low */
  190. #define GPIO_FUNC_2_TIM42_OWH (GPIO_FUNC_2) /*!< TMR4 unit 2 W-phase output high */
  191. #define GPIO_FUNC_2_TIM42_OWL (GPIO_FUNC_2) /*!< TMR4 unit 2 W-phase output low */
  192. #define GPIO_FUNC_2_TIM43 (GPIO_FUNC_2) /*!< TMR4 unit */
  193. #define GPIO_FUNC_2_TIM43_PCT (GPIO_FUNC_2) /*!< TMR4 unit 3 basetimer count direction indicator */
  194. #define GPIO_FUNC_2_TIM43_ADSM (GPIO_FUNC_2) /*!< TMR4 unit 3 special event */
  195. #define GPIO_FUNC_2_TIM43_CLK (GPIO_FUNC_2) /*!< TMR4 unit 3 clock input */
  196. #define GPIO_FUNC_2_TIM43_OUH (GPIO_FUNC_2) /*!< TMR4 unit 3 U-phase output high */
  197. #define GPIO_FUNC_2_TIM43_OUL (GPIO_FUNC_2) /*!< TMR4 unit 3 U-phase output low */
  198. #define GPIO_FUNC_2_TIM43_OVH (GPIO_FUNC_2) /*!< TMR4 unit 3 V-phase output high */
  199. #define GPIO_FUNC_2_TIM43_OVL (GPIO_FUNC_2) /*!< TMR4 unit 3 V-phase output low */
  200. #define GPIO_FUNC_2_TIM43_OWH (GPIO_FUNC_2) /*!< TMR4 unit 3 W-phase output high */
  201. #define GPIO_FUNC_2_TIM43_OWL (GPIO_FUNC_2) /*!< TMR4 unit 3 W-phase output low */
  202. /**
  203. * @}
  204. */
  205. /** @defgroup GPIO_PinFunction3 GPIO Function 3 selection
  206. * @{
  207. */
  208. #define GPIO_FUNC_3 (0x03U)
  209. #define GPIO_FUNC_3_TIM6_TRIG (GPIO_FUNC_3) /*!< TMR6 trigger */
  210. #define GPIO_FUNC_3_TIM6_TRIGA (GPIO_FUNC_3) /*!< TMR6 trigger A */
  211. #define GPIO_FUNC_3_TIM6_TRIGB (GPIO_FUNC_3) /*!< TMR6 trigger B */
  212. #define GPIO_FUNC_3_TIM6_TRIGC (GPIO_FUNC_3) /*!< TMR6 trigger C */
  213. #define GPIO_FUNC_3_TIM6_TRIGD (GPIO_FUNC_3) /*!< TMR6 trigger D */
  214. #define GPIO_FUNC_3_TIM61 (GPIO_FUNC_3) /*!< TMR6 unit 1 */
  215. #define GPIO_FUNC_3_TIM61_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 1 channel A PWM output */
  216. #define GPIO_FUNC_3_TIM61_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 1 channel B PWM output */
  217. #define GPIO_FUNC_3_TIM62 (GPIO_FUNC_3) /*!< TMR6 unit 2 */
  218. #define GPIO_FUNC_3_TIM62_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 2 channel A PWM output */
  219. #define GPIO_FUNC_3_TIM62_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 2 channel B PWM output */
  220. #define GPIO_FUNC_3_TIM63 (GPIO_FUNC_3) /*!< TMR6 unit 3 */
  221. #define GPIO_FUNC_3_TIM63_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 3 channel A PWM output */
  222. #define GPIO_FUNC_3_TIM63_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 3 channel B PWM output */
  223. #define GPIO_FUNC_3_TIM64 (GPIO_FUNC_3) /*!< TMR6 unit 4 */
  224. #define GPIO_FUNC_3_TIM64_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 4 channel A PWM output */
  225. #define GPIO_FUNC_3_TIM64_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 4 channel B PWM output */
  226. #define GPIO_FUNC_3_TIM65 (GPIO_FUNC_3) /*!< TMR6 unit 5 */
  227. #define GPIO_FUNC_3_TIM65_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 5 channel A PWM output */
  228. #define GPIO_FUNC_3_TIM65_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 5 channel B PWM output */
  229. #define GPIO_FUNC_3_TIM66 (GPIO_FUNC_3) /*!< TMR6 unit 6 */
  230. #define GPIO_FUNC_3_TIM66_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 6 channel A PWM output */
  231. #define GPIO_FUNC_3_TIM66_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 6 channel B PWM output */
  232. #define GPIO_FUNC_3_TIM67 (GPIO_FUNC_3) /*!< TMR6 unit 7 */
  233. #define GPIO_FUNC_3_TIM67_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 7 channel A PWM output */
  234. #define GPIO_FUNC_3_TIM67_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 7 channel B PWM output */
  235. #define GPIO_FUNC_3_TIM68 (GPIO_FUNC_3) /*!< TMR6 unit 8 */
  236. #define GPIO_FUNC_3_TIM68_PWMA (GPIO_FUNC_3) /*!< TMR6 unit 8 channel A PWM output */
  237. #define GPIO_FUNC_3_TIM68_PWMB (GPIO_FUNC_3) /*!< TMR6 unit 8 channel B PWM output */
  238. /**
  239. * @}
  240. */
  241. /** @defgroup GPIO_PinFunction4 GPIO Function 4 selection
  242. * @{
  243. */
  244. #define GPIO_FUNC_4 (0x04U)
  245. #define GPIO_FUNC_4_TIMA1 (GPIO_FUNC_4) /*!< TMRA unit 1 */
  246. #define GPIO_FUNC_4_TIMA1_TRIG (GPIO_FUNC_4) /*!< TMRA unit 1 trigger */
  247. #define GPIO_FUNC_4_TIMA1_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 1 PWM output */
  248. #define GPIO_FUNC_4_TIMA1_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 2 PWM output */
  249. #define GPIO_FUNC_4_TIMA1_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 3 PWM output */
  250. #define GPIO_FUNC_4_TIMA1_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 1 channel 4 PWM output */
  251. #define GPIO_FUNC_4_TIMA2_PWM (GPIO_FUNC_4) /*!< TMRA unit 2 PWM */
  252. #define GPIO_FUNC_4_TIMA2_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 1 PWM output */
  253. #define GPIO_FUNC_4_TIMA2_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 2 PWM output */
  254. #define GPIO_FUNC_4_TIMA2_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 3 PWM output */
  255. #define GPIO_FUNC_4_TIMA2_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 2 channel 4 PWM output */
  256. #define GPIO_FUNC_4_TIMA3 (GPIO_FUNC_4) /*!< TMRA unit 3 */
  257. #define GPIO_FUNC_4_TIMA3_TRIG (GPIO_FUNC_4) /*!< TMRA unit 3 trigger */
  258. #define GPIO_FUNC_4_TIMA3_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 1 PWM output */
  259. #define GPIO_FUNC_4_TIMA3_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 2 PWM output */
  260. #define GPIO_FUNC_4_TIMA3_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 3 PWM output */
  261. #define GPIO_FUNC_4_TIMA3_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 3 channel 4 PWM output */
  262. #define GPIO_FUNC_4_TIMA4 (GPIO_FUNC_4) /*!< TMRA unit 4 */
  263. #define GPIO_FUNC_4_TIMA4_TRIG (GPIO_FUNC_4) /*!< TMRA unit 4 trigger */
  264. #define GPIO_FUNC_4_TIMA4_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 1 PWM output */
  265. #define GPIO_FUNC_4_TIMA4_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 2 PWM output */
  266. #define GPIO_FUNC_4_TIMA4_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 3 PWM output */
  267. #define GPIO_FUNC_4_TIMA4_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 4 channel 4 PWM output */
  268. #define GPIO_FUNC_4_TIMA6 (GPIO_FUNC_4) /*!< TMRA unit 6 */
  269. #define GPIO_FUNC_4_TIMA6_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 1 PWM output */
  270. #define GPIO_FUNC_4_TIMA6_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 2 PWM output */
  271. #define GPIO_FUNC_4_TIMA6_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 3 PWM output */
  272. #define GPIO_FUNC_4_TIMA6_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 6 channel 4 PWM output */
  273. #define GPIO_FUNC_4_TIMA7 (GPIO_FUNC_4) /*!< TMRA unit 7 */
  274. #define GPIO_FUNC_4_TIMA7_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 1 PWM output */
  275. #define GPIO_FUNC_4_TIMA7_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 2 PWM output */
  276. #define GPIO_FUNC_4_TIMA7_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 3 PWM output */
  277. #define GPIO_FUNC_4_TIMA7_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 7 channel 4 PWM output */
  278. #define GPIO_FUNC_4_TIMA8 (GPIO_FUNC_4) /*!< TMRA unit 8 */
  279. #define GPIO_FUNC_4_TIMA8_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 1 PWM output */
  280. #define GPIO_FUNC_4_TIMA8_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 2 PWM output */
  281. #define GPIO_FUNC_4_TIMA8_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 3 PWM output */
  282. #define GPIO_FUNC_4_TIMA8_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 8 channel 4 PWM output */
  283. #define GPIO_FUNC_4_TIMA9 (GPIO_FUNC_4) /*!< TMRA unit 9 */
  284. #define GPIO_FUNC_4_TIMA9_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 1 PWM output */
  285. #define GPIO_FUNC_4_TIMA9_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 2 PWM output */
  286. #define GPIO_FUNC_4_TIMA9_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 3 PWM output */
  287. #define GPIO_FUNC_4_TIMA9_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 9 channel 4 PWM output */
  288. #define GPIO_FUNC_4_TIMA10 (GPIO_FUNC_4) /*!< TMRA unit 10 */
  289. #define GPIO_FUNC_4_TIMA10_PWM1 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 1 PWM output */
  290. #define GPIO_FUNC_4_TIMA10_PWM2 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 2 PWM output */
  291. #define GPIO_FUNC_4_TIMA10_PWM3 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 3 PWM output */
  292. #define GPIO_FUNC_4_TIMA10_PWM4 (GPIO_FUNC_4) /*!< TMRA unit 10 channel 4 PWM output */
  293. /**
  294. * @}
  295. */
  296. /** @defgroup GPIO_PinFunction5 GPIO Function 5 selection
  297. * @{
  298. */
  299. #define GPIO_FUNC_5 (0x05U)
  300. #define GPIO_FUNC_5_TIMA2_TRIG (GPIO_FUNC_5) /*!< TMRA unit 2 trigger */
  301. #define GPIO_FUNC_5_TIMA3 (GPIO_FUNC_5) /*!< TMRA unit 3 */
  302. #define GPIO_FUNC_5_TIMA3_TRIG (GPIO_FUNC_5) /*!< TMRA unit 3 trigger */
  303. #define GPIO_FUNC_5_TIMA3_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 1 PWM output */
  304. #define GPIO_FUNC_5_TIMA3_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 2 PWM output */
  305. #define GPIO_FUNC_5_TIMA3_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 3 PWM output */
  306. #define GPIO_FUNC_5_TIMA3_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 3 channel 4 PWM output */
  307. #define GPIO_FUNC_5_TIMA4 (GPIO_FUNC_5) /*!< TMRA unit 4 */
  308. #define GPIO_FUNC_5_TIMA4_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 1 PWM output */
  309. #define GPIO_FUNC_5_TIMA4_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 2 PWM output */
  310. #define GPIO_FUNC_5_TIMA4_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 3 PWM output */
  311. #define GPIO_FUNC_5_TIMA4_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 4 channel 4 PWM output */
  312. #define GPIO_FUNC_5_TIMA5 (GPIO_FUNC_5) /*!< TMRA unit 5 */
  313. #define GPIO_FUNC_5_TIMA5_TRIG (GPIO_FUNC_5) /*!< TMRA unit 5 trigger */
  314. #define GPIO_FUNC_5_TIMA5_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 1 PWM output */
  315. #define GPIO_FUNC_5_TIMA5_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 2 PWM output */
  316. #define GPIO_FUNC_5_TIMA5_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 3 PWM output */
  317. #define GPIO_FUNC_5_TIMA5_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 5 channel 4 PWM output */
  318. #define GPIO_FUNC_5_TIMA6 (GPIO_FUNC_5) /*!< TMRA unit 6 */
  319. #define GPIO_FUNC_5_TIMA6_TRIG (GPIO_FUNC_5) /*!< TMRA unit 6 trigger */
  320. #define GPIO_FUNC_5_TIMA6_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 1 PWM output */
  321. #define GPIO_FUNC_5_TIMA6_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 2 PWM output */
  322. #define GPIO_FUNC_5_TIMA6_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 3 PWM output */
  323. #define GPIO_FUNC_5_TIMA6_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 6 channel 4 PWM output */
  324. #define GPIO_FUNC_5_TIMA9 (GPIO_FUNC_5) /*!< TMRA unit 9 */
  325. #define GPIO_FUNC_5_TIMA9_TRIG (GPIO_FUNC_5) /*!< TMRA unit 9 trigger */
  326. #define GPIO_FUNC_5_TIMA9_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 1 PWM output */
  327. #define GPIO_FUNC_5_TIMA9_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 2 PWM output */
  328. #define GPIO_FUNC_5_TIMA9_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 3 PWM output */
  329. #define GPIO_FUNC_5_TIMA9_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 9 channel 4 PWM output */
  330. #define GPIO_FUNC_5_TIMA11_PWM (GPIO_FUNC_5) /*!< TMRA unit 11 PWM */
  331. #define GPIO_FUNC_5_TIMA11_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 1 PWM output */
  332. #define GPIO_FUNC_5_TIMA11_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 2 PWM output */
  333. #define GPIO_FUNC_5_TIMA11_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 3 PWM output */
  334. #define GPIO_FUNC_5_TIMA11_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 11 channel 4 PWM output */
  335. #define GPIO_FUNC_5_TIMA12_PWM (GPIO_FUNC_5) /*!< TMRA unit 12 PWM */
  336. #define GPIO_FUNC_5_TIMA12_PWM1 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 1 PWM output */
  337. #define GPIO_FUNC_5_TIMA12_PWM2 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 2 PWM output */
  338. #define GPIO_FUNC_5_TIMA12_PWM3 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 3 PWM output */
  339. #define GPIO_FUNC_5_TIMA12_PWM4 (GPIO_FUNC_5) /*!< TMRA unit 12 channel 4 PWM output */
  340. /**
  341. * @}
  342. */
  343. /** @defgroup GPIO_PinFunction6 GPIO Function 6 selection
  344. * @{
  345. */
  346. #define GPIO_FUNC_6 (0x06U)
  347. #define GPIO_FUNC_6_TIMA1_TRIG (GPIO_FUNC_6) /*!< TMRA unit 1 trigger */
  348. #define GPIO_FUNC_6_TIMA2_TRIG (GPIO_FUNC_6) /*!< TMRA unit 2 trigger */
  349. #define GPIO_FUNC_6_TIMA3_TRIG (GPIO_FUNC_6) /*!< TMRA unit 3 trigger */
  350. #define GPIO_FUNC_6_TIMA4_TRIG (GPIO_FUNC_6) /*!< TMRA unit 4 trigger */
  351. #define GPIO_FUNC_6_TIMA6_TRIG (GPIO_FUNC_6) /*!< TMRA unit 6 trigger */
  352. #define GPIO_FUNC_6_TIMA7_TRIG (GPIO_FUNC_6) /*!< TMRA unit 7 trigger */
  353. #define GPIO_FUNC_6_TIMA8_TRIG (GPIO_FUNC_6) /*!< TMRA unit 8 trigger */
  354. #define GPIO_FUNC_6_TIMA11_TRIG (GPIO_FUNC_6) /*!< TMRA unit 11 trigger */
  355. #define GPIO_FUNC_6_TIMA12_TRIG (GPIO_FUNC_6) /*!< TMRA unit 12 trigger */
  356. #define GPIO_FUNC_6_TIMA5 (GPIO_FUNC_6) /*!< TMRA unit 5 */
  357. #define GPIO_FUNC_6_TIMA5_TRIG (GPIO_FUNC_6) /*!< TMRA unit 5 trigger */
  358. #define GPIO_FUNC_6_TIMA5_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 1 PWM output */
  359. #define GPIO_FUNC_6_TIMA5_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 2 PWM output */
  360. #define GPIO_FUNC_6_TIMA5_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 3 PWM output */
  361. #define GPIO_FUNC_6_TIMA5_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 5 channel 4 PWM output */
  362. #define GPIO_FUNC_6_TIMA9 (GPIO_FUNC_6) /*!< TMRA unit 9 */
  363. #define GPIO_FUNC_6_TIMA9_TRIG (GPIO_FUNC_6) /*!< TMRA unit 9 trigger */
  364. #define GPIO_FUNC_6_TIMA9_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 1 PWM output */
  365. #define GPIO_FUNC_6_TIMA9_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 2 PWM output */
  366. #define GPIO_FUNC_6_TIMA9_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 3 PWM output */
  367. #define GPIO_FUNC_6_TIMA9_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 9 channel 4 PWM output */
  368. #define GPIO_FUNC_6_TIMA10 (GPIO_FUNC_6) /*!< TMRA unit 10 */
  369. #define GPIO_FUNC_6_TIMA10_TRIG (GPIO_FUNC_6) /*!< TMRA unit 10 trigger */
  370. #define GPIO_FUNC_6_TIMA10_PWM1 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 1 PWM output */
  371. #define GPIO_FUNC_6_TIMA10_PWM2 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 2 PWM output */
  372. #define GPIO_FUNC_6_TIMA10_PWM3 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 3 PWM output */
  373. #define GPIO_FUNC_6_TIMA10_PWM4 (GPIO_FUNC_6) /*!< TMRA unit 10 channel 4 PWM output */
  374. #define GPIO_FUNC_6_TIM65_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 5 channel A PWM output */
  375. #define GPIO_FUNC_6_TIM66_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 6 channel A PWM output */
  376. #define GPIO_FUNC_6_TIM67_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 7 channel A PWM output */
  377. #define GPIO_FUNC_6_TIM68_PWMA (GPIO_FUNC_6) /*!< TMR6 unit 8 channel A PWM output */
  378. #define GPIO_FUNC_6_EMB_PORT (GPIO_FUNC_6) /*!< EMB port */
  379. #define GPIO_FUNC_6_EMB_PORT0 (GPIO_FUNC_6) /*!< EMB port 0 */
  380. #define GPIO_FUNC_6_EMB_PORT1 (GPIO_FUNC_6) /*!< EMB port 1 */
  381. #define GPIO_FUNC_6_EMB_PORT2 (GPIO_FUNC_6) /*!< EMB port 2 */
  382. #define GPIO_FUNC_6_EMB_PORT3 (GPIO_FUNC_6) /*!< EMB port 3 */
  383. /**
  384. * @}
  385. */
  386. /** @defgroup GPIO_PinFunction7 GPIO Function 7 selection
  387. * @{
  388. */
  389. #define GPIO_FUNC_7 (0x07U)
  390. #define GPIO_FUNC_7_USART1 (GPIO_FUNC_7) /*!< USART1 */
  391. #define GPIO_FUNC_7_USART1_CK (GPIO_FUNC_7) /*!< USART1 CK */
  392. #define GPIO_FUNC_7_USART1_CTS (GPIO_FUNC_7) /*!< USART1 CTS */
  393. #define GPIO_FUNC_7_USART1_RTS (GPIO_FUNC_7) /*!< USART1 RTS */
  394. #define GPIO_FUNC_7_USART2 (GPIO_FUNC_7) /*!< USART2 */
  395. #define GPIO_FUNC_7_USART2_CK (GPIO_FUNC_7) /*!< USART2 CK */
  396. #define GPIO_FUNC_7_USART2_CTS (GPIO_FUNC_7) /*!< USART2 CTS */
  397. #define GPIO_FUNC_7_USART2_RTS (GPIO_FUNC_7) /*!< USART2 RTS */
  398. #define GPIO_FUNC_7_USART3 (GPIO_FUNC_7) /*!< USART3 */
  399. #define GPIO_FUNC_7_USART3_CK (GPIO_FUNC_7) /*!< USART3 CK */
  400. #define GPIO_FUNC_7_USART3_CTS (GPIO_FUNC_7) /*!< USART3 CTS */
  401. #define GPIO_FUNC_7_USART3_RTS (GPIO_FUNC_7) /*!< USART3 RTS */
  402. #define GPIO_FUNC_7_USART4 (GPIO_FUNC_7) /*!< USART4 */
  403. #define GPIO_FUNC_7_USART4_CK (GPIO_FUNC_7) /*!< USART4 CK */
  404. #define GPIO_FUNC_7_USART4_CTS (GPIO_FUNC_7) /*!< USART4 CTS */
  405. #define GPIO_FUNC_7_USART4_RTS (GPIO_FUNC_7) /*!< USART4 RTS */
  406. #define GPIO_FUNC_7_USART5 (GPIO_FUNC_7) /*!< USART5 */
  407. #define GPIO_FUNC_7_USART5_CK (GPIO_FUNC_7) /*!< USART5 CK */
  408. #define GPIO_FUNC_7_USART5_CTS (GPIO_FUNC_7) /*!< USART5 CTS */
  409. #define GPIO_FUNC_7_USART5_RTS (GPIO_FUNC_7) /*!< USART5 RTS */
  410. #define GPIO_FUNC_7_USART6 (GPIO_FUNC_7) /*!< USART6 */
  411. #define GPIO_FUNC_7_USART6_CK (GPIO_FUNC_7) /*!< USART6 CK */
  412. #define GPIO_FUNC_7_USART6_CTS (GPIO_FUNC_7) /*!< USART6 CTS */
  413. #define GPIO_FUNC_7_USART6_RTS (GPIO_FUNC_7) /*!< USART6 RTS */
  414. #define GPIO_FUNC_7_USART7 (GPIO_FUNC_7) /*!< USART7 */
  415. #define GPIO_FUNC_7_USART7_CK (GPIO_FUNC_7) /*!< USART7 CK */
  416. #define GPIO_FUNC_7_USART7_CTS (GPIO_FUNC_7) /*!< USART7 CTS */
  417. #define GPIO_FUNC_7_USART7_RTS (GPIO_FUNC_7) /*!< USART7 RTS */
  418. #define GPIO_FUNC_7_USART8 (GPIO_FUNC_7) /*!< USART8 */
  419. #define GPIO_FUNC_7_USART8_CK (GPIO_FUNC_7) /*!< USART8 CK */
  420. #define GPIO_FUNC_7_USART8_CTS (GPIO_FUNC_7) /*!< USART8 CTS */
  421. #define GPIO_FUNC_7_USART8_RTS (GPIO_FUNC_7) /*!< USART8 RTS */
  422. #define GPIO_FUNC_7_USART9 (GPIO_FUNC_7) /*!< USART9 */
  423. #define GPIO_FUNC_7_USART9_CK (GPIO_FUNC_7) /*!< USART9 CK */
  424. #define GPIO_FUNC_7_USART9_CTS (GPIO_FUNC_7) /*!< USART9 CTS */
  425. #define GPIO_FUNC_7_USART9_RTS (GPIO_FUNC_7) /*!< USART9 RTS */
  426. #define GPIO_FUNC_7_USART10 (GPIO_FUNC_7) /*!< USART10 */
  427. #define GPIO_FUNC_7_USART10_CK (GPIO_FUNC_7) /*!< USART10 CK */
  428. #define GPIO_FUNC_7_USART10_CTS (GPIO_FUNC_7) /*!< USART10 CTS */
  429. #define GPIO_FUNC_7_USART10_RTS (GPIO_FUNC_7) /*!< USART10 RTS */
  430. /**
  431. * @}
  432. */
  433. /** @defgroup GPIO_PinFunction8 GPIO Function 8 selection
  434. * @{
  435. */
  436. #define GPIO_FUNC_8 (0x08U)
  437. #define GPIO_FUNC_8_KEYSCAN (GPIO_FUNC_8) /*!< KEYSCAN */
  438. /**
  439. * @}
  440. */
  441. /** @defgroup GPIO_PinFunction9 GPIO Function 9 selection
  442. * @{
  443. */
  444. #define GPIO_FUNC_9 (0x09U)
  445. #define GPIO_FUNC_9_SDIO (GPIO_FUNC_9) /*!< SDIO */
  446. #define GPIO_FUNC_9_SDIO1 (GPIO_FUNC_9) /*!< SDIO1 */
  447. #define GPIO_FUNC_9_SDIO1_WP (GPIO_FUNC_9) /*!< SDIO1 WP */
  448. #define GPIO_FUNC_9_SDIO1_CD (GPIO_FUNC_9) /*!< SDIO1 CD */
  449. #define GPIO_FUNC_9_SDIO1_CMD (GPIO_FUNC_9) /*!< SDIO1 CMD */
  450. #define GPIO_FUNC_9_SDIO1_CK (GPIO_FUNC_9) /*!< SDIO1 CK */
  451. #define GPIO_FUNC_9_SDIO1_DATA (GPIO_FUNC_9) /*!< SDIO1 data bus */
  452. #define GPIO_FUNC_9_SDIO2 (GPIO_FUNC_9) /*!< SDIO2 */
  453. #define GPIO_FUNC_9_SDIO2_WP (GPIO_FUNC_9) /*!< SDIO2 WP */
  454. #define GPIO_FUNC_9_SDIO2_CD (GPIO_FUNC_9) /*!< SDIO2 CD */
  455. #define GPIO_FUNC_9_SDIO2_CMD (GPIO_FUNC_9) /*!< SDIO2 CMD */
  456. #define GPIO_FUNC_9_SDIO2_CK (GPIO_FUNC_9) /*!< SDIO2 CK */
  457. #define GPIO_FUNC_9_SDIO2_DATA (GPIO_FUNC_9) /*!< SDIO2 data bus */
  458. /**
  459. * @}
  460. */
  461. /** @defgroup GPIO_PinFunction10 GPIO Function 10 selection
  462. * @{
  463. */
  464. #define GPIO_FUNC_10 (0x0AU)
  465. #define GPIO_FUNC_10_USBF (GPIO_FUNC_10) /*!< USB Full-speed */
  466. #define GPIO_FUNC_10_USBF_DRVVBUS (GPIO_FUNC_10) /*!< USB Full-speed host VBUS ctrl */
  467. #define GPIO_FUNC_10_USBF_SOF (GPIO_FUNC_10) /*!< USB Full-speed SOF */
  468. #define GPIO_FUNC_10_USBF_VBUS (GPIO_FUNC_10) /*!< USB Full-speed slave VBUS */
  469. #define GPIO_FUNC_10_USBF_ID (GPIO_FUNC_10) /*!< USB Full-speed */
  470. #define GPIO_FUNC_10_USBH (GPIO_FUNC_10) /*!< USB High-speed */
  471. #define GPIO_FUNC_10_USBH_ULPI_DIR (GPIO_FUNC_10) /*!< USB High-speed ULPI DIR */
  472. #define GPIO_FUNC_10_USBH_ULPI_STP (GPIO_FUNC_10) /*!< USB High-speed ULPI STP */
  473. #define GPIO_FUNC_10_USBH_ULPI_NXT (GPIO_FUNC_10) /*!< USB High-speed ULPI NXT */
  474. #define GPIO_FUNC_10_USBH_ULPI_CK (GPIO_FUNC_10) /*!< USB High-speed ULPI CK */
  475. #define GPIO_FUNC_10_USBH_ULPI_DRVVBUS (GPIO_FUNC_10) /*!< USB High-speed host VBUS ctrl */
  476. #define GPIO_FUNC_10_USBH_ULPI_DATA (GPIO_FUNC_10) /*!< USB High-speed ULPI data bus */
  477. #define GPIO_FUNC_10_TIM22_PWM (GPIO_FUNC_10) /*!< TMR2 unit 2 PWM */
  478. #define GPIO_FUNC_10_TIM22_PWMA (GPIO_FUNC_10) /*!< TMR2 unit 2 channel A PWM */
  479. #define GPIO_FUNC_10_TIM22_PWMB (GPIO_FUNC_10) /*!< TMR2 unit 2 channel B PWM */
  480. #define GPIO_FUNC_10_TIM24_PWM (GPIO_FUNC_10) /*!< TMR2 unit 4 PWM */
  481. #define GPIO_FUNC_10_TIM24_PWMA (GPIO_FUNC_10) /*!< TMR2 unit 4 channel A PWM */
  482. #define GPIO_FUNC_10_TIM24_PWMB (GPIO_FUNC_10) /*!< TMR2 unit 4 channel B PWM */
  483. /**
  484. * @}
  485. */
  486. /** @defgroup GPIO_PinFunction11 GPIO Function 11 selection
  487. * @{
  488. */
  489. #define GPIO_FUNC_11 (0x0BU)
  490. #define GPIO_FUNC_11_ETH (GPIO_FUNC_11) /*!< Ethernet */
  491. #define GPIO_FUNC_11_ETH_TXD (GPIO_FUNC_11) /*!< ETH TXD */
  492. #define GPIO_FUNC_11_ETH_TXEN (GPIO_FUNC_11) /*!< ETH TX enable */
  493. #define GPIO_FUNC_11_ETH_TXCLK (GPIO_FUNC_11) /*!< ETH TX clock */
  494. #define GPIO_FUNC_11_ETH_RXD (GPIO_FUNC_11) /*!< ETH RXD */
  495. #define GPIO_FUNC_11_ETH_RXER (GPIO_FUNC_11) /*!< ETH RX error */
  496. #define GPIO_FUNC_11_ETH_RXCLK (GPIO_FUNC_11) /*!< ETH RX clock */
  497. #define GPIO_FUNC_11_ETH_RXDV (GPIO_FUNC_11) /*!< ETH RX data valid */
  498. #define GPIO_FUNC_11_ETH_SMI_MDIO (GPIO_FUNC_11) /*!< SMI data */
  499. #define GPIO_FUNC_11_ETH_SMI_MDC (GPIO_FUNC_11) /*!< SMI clock */
  500. #define GPIO_FUNC_11_ETH_CRS (GPIO_FUNC_11) /*!< ETH MII carrier sense */
  501. #define GPIO_FUNC_11_ETH_COL (GPIO_FUNC_11) /*!< ETH MII collisioin detected */
  502. #define GPIO_FUNC_11_ETH_PPS_OUT (GPIO_FUNC_11) /*!< ETH PPS out */
  503. /**
  504. * @}
  505. */
  506. /** @defgroup GPIO_PinFunction12 GPIO Function 12 selection
  507. * @{
  508. */
  509. #define GPIO_FUNC_12 (0x0CU)
  510. #define GPIO_FUNC_12_EXMC (GPIO_FUNC_12) /*!< Ext. Bus */
  511. #define GPIO_FUNC_12_EXMC_CLE (GPIO_FUNC_12) /*!< Ext. Bus NAND CMD latch */
  512. #define GPIO_FUNC_12_EXMC_ALE (GPIO_FUNC_12) /*!< Ext. Bus NAND ADDR latch */
  513. #define GPIO_FUNC_12_EXMC_RB (GPIO_FUNC_12) /*!< Ext. Bus NAND busy or SRAM wait(RB0) input */
  514. #define GPIO_FUNC_12_EXMC_CE (GPIO_FUNC_12) /*!< Ext. Bus chip enable */
  515. #define GPIO_FUNC_12_EXMC_WE (GPIO_FUNC_12) /*!< Ext. Bus write enable */
  516. #define GPIO_FUNC_12_EXMC_OE (GPIO_FUNC_12) /*!< Ext. Bus output enable */
  517. #define GPIO_FUNC_12_EXMC_BAA (GPIO_FUNC_12) /*!< Ext. Bus SRAM BAA */
  518. #define GPIO_FUNC_12_EXMC_ADV (GPIO_FUNC_12) /*!< Ext. Bus SRAM ADDR latch */
  519. #define GPIO_FUNC_12_EXMC_CLK (GPIO_FUNC_12) /*!< Ext. Bus clock output */
  520. #define GPIO_FUNC_12_EXMC_ADDR (GPIO_FUNC_12) /*!< Ext. Bus Addr. Bus */
  521. #define GPIO_FUNC_12_EXMC_DATA (GPIO_FUNC_12) /*!< Ext. Bus data Bus */
  522. #define GPIO_FUNC_12_USBH (GPIO_FUNC_12) /*!< USB High-speed */
  523. #define GPIO_FUNC_12_USBH_SOF (GPIO_FUNC_12) /*!< USB High-speed SOF */
  524. #define GPIO_FUNC_12_USBH_VBUS (GPIO_FUNC_12) /*!< USB High-speed slave VBUS */
  525. #define GPIO_FUNC_12_USBH_ID (GPIO_FUNC_12) /*!< USB High-speed ID */
  526. #define GPIO_FUNC_12_I2S2_EXCK (GPIO_FUNC_12) /*!< I2S2 EXCK */
  527. /**
  528. * @}
  529. */
  530. /** @defgroup GPIO_PinFunction13 GPIO Function 13 selection
  531. * @{
  532. */
  533. #define GPIO_FUNC_13 (0x0DU)
  534. #define GPIO_FUNC_13_DVP (GPIO_FUNC_13) /*!< DVP */
  535. #define GPIO_FUNC_13_DVP_DATA (GPIO_FUNC_13) /*!< DVP data bus */
  536. #define GPIO_FUNC_13_DVP_PIXCLK (GPIO_FUNC_13) /*!< DVP pix clock */
  537. #define GPIO_FUNC_13_DVP_HSYNC (GPIO_FUNC_13) /*!< DVP line sync */
  538. #define GPIO_FUNC_13_DVP_VSYNC (GPIO_FUNC_13) /*!< DVP frame sync */
  539. #define GPIO_FUNC_13_EXMC (GPIO_FUNC_13) /*!< Ext. Bus */
  540. #define GPIO_FUNC_13_EXMC_A16 (GPIO_FUNC_13) /*!< Ext. Bus address 16 */
  541. #define GPIO_FUNC_13_EXMC_A17 (GPIO_FUNC_13) /*!< Ext. Bus address 17 */
  542. /**
  543. * @}
  544. */
  545. /** @defgroup GPIO_PinFunction14 GPIO Function 14 selection
  546. * @{
  547. */
  548. #define GPIO_FUNC_14 (0x0EU)
  549. #define GPIO_FUNC_14_EP (GPIO_FUNC_14) /*!< Event Port */
  550. #define GPIO_FUNC_14_EP1 (GPIO_FUNC_14) /*!< Event Port Group 1 */
  551. #define GPIO_FUNC_14_EP2 (GPIO_FUNC_14) /*!< Event Port Group 2 */
  552. #define GPIO_FUNC_14_EP3 (GPIO_FUNC_14) /*!< Event Port Group 3 */
  553. #define GPIO_FUNC_14_EP4 (GPIO_FUNC_14) /*!< Event Port Group 4 */
  554. /**
  555. * @}
  556. */
  557. /** @defgroup GPIO_PinFunction15 GPIO Function 15 selection
  558. * @{
  559. */
  560. #define GPIO_FUNC_15 (0x0FU)
  561. #define GPIO_FUNC_15_EVENTOUT (GPIO_FUNC_15) /*!< Event Out */
  562. /**
  563. * @}
  564. */
  565. /** @defgroup GPIO_PinFunction16 GPIO Function 16 selection
  566. * @{
  567. */
  568. #define GPIO_FUNC_16 (0x10U)
  569. #define GPIO_FUNC_16_TIM21 (GPIO_FUNC_16) /*!< TMR2 unit 1 */
  570. #define GPIO_FUNC_16_TIM21_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 1 channel A CLK input */
  571. #define GPIO_FUNC_16_TIM21_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 1 channel B CLK input */
  572. #define GPIO_FUNC_16_TIM21_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 1 channel A PWM output */
  573. #define GPIO_FUNC_16_TIM21_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 1 channel B PWM output */
  574. #define GPIO_FUNC_16_TIM22 (GPIO_FUNC_16) /*!< TMR2 unit 2 */
  575. #define GPIO_FUNC_16_TIM22_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 2 channel A CLK input */
  576. #define GPIO_FUNC_16_TIM22_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 2 channel B CLK input */
  577. #define GPIO_FUNC_16_TIM22_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 2 channel A PWM output */
  578. #define GPIO_FUNC_16_TIM22_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 2 channel B PWM output */
  579. #define GPIO_FUNC_16_TIM23 (GPIO_FUNC_16) /*!< TMR2 unit 3 */
  580. #define GPIO_FUNC_16_TIM23_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 3 channel A CLK input */
  581. #define GPIO_FUNC_16_TIM23_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 3 channel B CLK input */
  582. #define GPIO_FUNC_16_TIM23_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 3 channel A PWM output */
  583. #define GPIO_FUNC_16_TIM23_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 3 channel B PWM output */
  584. #define GPIO_FUNC_16_TIM24 (GPIO_FUNC_16) /*!< TMR2 unit 4 */
  585. #define GPIO_FUNC_16_TIM24_CLKA (GPIO_FUNC_16) /*!< TMR2 unit 4 channel A CLK input */
  586. #define GPIO_FUNC_16_TIM24_CLKB (GPIO_FUNC_16) /*!< TMR2 unit 4 channel B CLK input */
  587. #define GPIO_FUNC_16_TIM24_PWMA (GPIO_FUNC_16) /*!< TMR2 unit 4 channel A PWM output */
  588. #define GPIO_FUNC_16_TIM24_PWMB (GPIO_FUNC_16) /*!< TMR2 unit 4 channel B PWM output */
  589. #define GPIO_FUNC_16_TIM41_CLK (GPIO_FUNC_16) /*!< TMR4 unit 1 CLK input */
  590. #define GPIO_FUNC_16_TIM42_CLK (GPIO_FUNC_16) /*!< TMR4 unit 2 CLK input */
  591. #define GPIO_FUNC_16_TIM42_OUL (GPIO_FUNC_16) /*!< TMR4 unit 2 U-phase low output */
  592. #define GPIO_FUNC_16_TIM42_OVL (GPIO_FUNC_16) /*!< TMR4 unit 2 V-phase low output */
  593. #define GPIO_FUNC_16_TIM42_OWL (GPIO_FUNC_16) /*!< TMR4 unit 2 W-phase low output */
  594. #define GPIO_FUNC_16_TIM43_ADSM (GPIO_FUNC_16) /*!< TMR4 unit 3 special event */
  595. /**
  596. * @}
  597. */
  598. /** @defgroup GPIO_PinFunction17 GPIO Function 17 selection
  599. * @{
  600. */
  601. #define GPIO_FUNC_17 (0x11U)
  602. #define GPIO_FUNC_17_I2S1 (GPIO_FUNC_17) /*!< I2S1 */
  603. #define GPIO_FUNC_17_I2S1_MCK (GPIO_FUNC_17) /*!< I2S1 MCK */
  604. #define GPIO_FUNC_17_I2S1_EXCK (GPIO_FUNC_17) /*!< I2S1 EXCK */
  605. #define GPIO_FUNC_17_I2S1_SDIN (GPIO_FUNC_17) /*!< I2S1 SDIN */
  606. #define GPIO_FUNC_17_I2S2 (GPIO_FUNC_17) /*!< I2S2 */
  607. #define GPIO_FUNC_17_I2S2_CK (GPIO_FUNC_17) /*!< I2S2 CK */
  608. #define GPIO_FUNC_17_I2S2_MCK (GPIO_FUNC_17) /*!< I2S2 MCK */
  609. #define GPIO_FUNC_17_I2S2_EXCK (GPIO_FUNC_17) /*!< I2S2 EXCK */
  610. #define GPIO_FUNC_17_I2S2_SD (GPIO_FUNC_17) /*!< I2S2 SD */
  611. #define GPIO_FUNC_17_I2S2_SDIN (GPIO_FUNC_17) /*!< I2S2 SDIN */
  612. #define GPIO_FUNC_17_I2S3 (GPIO_FUNC_17) /*!< I2S3 */
  613. #define GPIO_FUNC_17_I2S3_MCK (GPIO_FUNC_17) /*!< I2S3 MCK */
  614. #define GPIO_FUNC_17_I2S3_EXCK (GPIO_FUNC_17) /*!< I2S3 EXCK */
  615. #define GPIO_FUNC_17_I2S3_SDIN (GPIO_FUNC_17) /*!< I2S3 SDIN */
  616. #define GPIO_FUNC_17_I2S4 (GPIO_FUNC_17) /*!< I2S4 */
  617. #define GPIO_FUNC_17_I2S4_MCK (GPIO_FUNC_17) /*!< I2S4 MCK */
  618. #define GPIO_FUNC_17_I2S4_EXCK (GPIO_FUNC_17) /*!< I2S4 EXCK */
  619. #define GPIO_FUNC_17_I2S4_SDIN (GPIO_FUNC_17) /*!< I2S4 SDIN */
  620. #define GPIO_FUNC_17_I2S4_SD (GPIO_FUNC_17) /*!< I2S4 SD */
  621. /**
  622. * @}
  623. */
  624. /** @defgroup GPIO_PinFunction18 GPIO Function 18 selection
  625. * @{
  626. */
  627. #define GPIO_FUNC_18 (0x12U)
  628. #define GPIO_FUNC_18_SPI1 (GPIO_FUNC_18) /*!< SPI1 */
  629. #define GPIO_FUNC_18_SPI1_NSS1 (GPIO_FUNC_18) /*!< SPI1 NSS1 */
  630. #define GPIO_FUNC_18_SPI1_NSS2 (GPIO_FUNC_18) /*!< SPI1 NSS2 */
  631. #define GPIO_FUNC_18_SPI1_NSS3 (GPIO_FUNC_18) /*!< SPI1 NSS3 */
  632. #define GPIO_FUNC_18_SPI2 (GPIO_FUNC_18) /*!< SPI2 */
  633. #define GPIO_FUNC_18_SPI2_NSS0 (GPIO_FUNC_18) /*!< SPI2 NSS0 */
  634. #define GPIO_FUNC_18_SPI2_NSS1 (GPIO_FUNC_18) /*!< SPI2 NSS1 */
  635. #define GPIO_FUNC_18_SPI2_NSS2 (GPIO_FUNC_18) /*!< SPI2 NSS2 */
  636. #define GPIO_FUNC_18_SPI2_NSS3 (GPIO_FUNC_18) /*!< SPI2 NSS3 */
  637. #define GPIO_FUNC_18_SPI3 (GPIO_FUNC_18) /*!< SPI3 */
  638. #define GPIO_FUNC_18_SPI3_NSS1 (GPIO_FUNC_18) /*!< SPI3 NSS1 */
  639. #define GPIO_FUNC_18_SPI3_NSS2 (GPIO_FUNC_18) /*!< SPI3 NSS2 */
  640. #define GPIO_FUNC_18_SPI3_NSS3 (GPIO_FUNC_18) /*!< SPI3 NSS3 */
  641. #define GPIO_FUNC_18_SPI4 (GPIO_FUNC_18) /*!< SPI4 */
  642. #define GPIO_FUNC_18_SPI4_NSS1 (GPIO_FUNC_18) /*!< SPI4 NSS1 */
  643. #define GPIO_FUNC_18_SPI4_NSS2 (GPIO_FUNC_18) /*!< SPI4 NSS2 */
  644. #define GPIO_FUNC_18_SPI4_NSS3 (GPIO_FUNC_18) /*!< SPI4 NSS3 */
  645. #define GPIO_FUNC_18_SPI5 (GPIO_FUNC_18) /*!< SPI5 */
  646. #define GPIO_FUNC_18_SPI5_NSS0 (GPIO_FUNC_18) /*!< SPI5 NSS0 */
  647. #define GPIO_FUNC_18_SPI5_NSS1 (GPIO_FUNC_18) /*!< SPI5 NSS1 */
  648. #define GPIO_FUNC_18_SPI5_NSS2 (GPIO_FUNC_18) /*!< SPI5 NSS2 */
  649. #define GPIO_FUNC_18_SPI5_NSS3 (GPIO_FUNC_18) /*!< SPI5 NSS3 */
  650. #define GPIO_FUNC_18_SPI6 (GPIO_FUNC_18) /*!< SPI6 */
  651. #define GPIO_FUNC_18_SPI6_NSS1 (GPIO_FUNC_18) /*!< SPI6 NSS1 */
  652. #define GPIO_FUNC_18_SPI6_NSS2 (GPIO_FUNC_18) /*!< SPI6 NSS2 */
  653. #define GPIO_FUNC_18_SPI6_NSS3 (GPIO_FUNC_18) /*!< SPI6 NSS3 */
  654. #define GPIO_FUNC_18_QSPI (GPIO_FUNC_18) /*!< QSPI */
  655. #define GPIO_FUNC_18_QSPI_NSS (GPIO_FUNC_18) /*!< QSPI NSS */
  656. #define GPIO_FUNC_18_QSPI_SCK (GPIO_FUNC_18) /*!< QSPI SCK */
  657. #define GPIO_FUNC_18_QSPI_IO0 (GPIO_FUNC_18) /*!< QSPI IO0 */
  658. #define GPIO_FUNC_18_QSPI_IO1 (GPIO_FUNC_18) /*!< QSPI IO1 */
  659. #define GPIO_FUNC_18_QSPI_IO2 (GPIO_FUNC_18) /*!< QSPI IO2 */
  660. #define GPIO_FUNC_18_QSPI_IO3 (GPIO_FUNC_18) /*!< QSPI IO3 */
  661. /**
  662. * @}
  663. */
  664. /** @defgroup GPIO_PinFunction19 GPIO Function 19 selection
  665. * @{
  666. */
  667. #define GPIO_FUNC_19 (0x13U)
  668. #define GPIO_FUNC_19_SPI1 (GPIO_FUNC_19) /*!< SPI1 */
  669. #define GPIO_FUNC_19_SPI1_NSS0 (GPIO_FUNC_19) /*!< SPI1 NSS0 */
  670. #define GPIO_FUNC_19_SPI2 (GPIO_FUNC_19) /*!< SPI2 */
  671. #define GPIO_FUNC_19_SPI2_NSS0 (GPIO_FUNC_19) /*!< SPI2 NSS0 */
  672. #define GPIO_FUNC_19_SPI2_MOSI (GPIO_FUNC_19) /*!< SPI2 MOSI */
  673. #define GPIO_FUNC_19_SPI2_MISO (GPIO_FUNC_19) /*!< SPI2 MISO */
  674. #define GPIO_FUNC_19_SPI2_SCK (GPIO_FUNC_19) /*!< SPI2 SCK */
  675. #define GPIO_FUNC_19_SPI3 (GPIO_FUNC_19) /*!< SPI3 */
  676. #define GPIO_FUNC_19_SPI3_NSS0 (GPIO_FUNC_19) /*!< SPI3 NSS0 */
  677. #define GPIO_FUNC_19_SPI3_MOSI (GPIO_FUNC_19) /*!< SPI3 MOSI */
  678. #define GPIO_FUNC_19_SPI3_MISO (GPIO_FUNC_19) /*!< SPI3 MISO */
  679. #define GPIO_FUNC_19_SPI3_SCK (GPIO_FUNC_19) /*!< SPI3 SCK */
  680. #define GPIO_FUNC_19_SPI (GPIO_FUNC_19) /*!< SPI4 */
  681. #define GPIO_FUNC_19_SPI4_NSS0 (GPIO_FUNC_19) /*!< SPI4 NSS0 */
  682. #define GPIO_FUNC_19_SPI5 (GPIO_FUNC_19) /*!< SPI5 */
  683. #define GPIO_FUNC_19_SPI5_NSS0 (GPIO_FUNC_19) /*!< SPI5 NSS0 */
  684. #define GPIO_FUNC_19_SPI5_MOSI (GPIO_FUNC_19) /*!< SPI5 MOSI */
  685. #define GPIO_FUNC_19_SPI5_MISO (GPIO_FUNC_19) /*!< SPI5 MISO */
  686. #define GPIO_FUNC_19_SPI5_SCK (GPIO_FUNC_19) /*!< SPI5 SCK */
  687. #define GPIO_FUNC_19_SPI6 (GPIO_FUNC_19) /*!< SPI6 */
  688. #define GPIO_FUNC_19_SPI6_NSS0 (GPIO_FUNC_19) /*!< SPI6 NSS0 */
  689. /**
  690. * @}
  691. */
  692. /** @defgroup GPIO_PinFunction20 GPIO Function 20 selection
  693. * @{
  694. */
  695. #define GPIO_FUNC_20 (0x14U)
  696. #define GPIO_FUNC_20_USART1 (GPIO_FUNC_20) /*!< USART1 */
  697. #define GPIO_FUNC_20_USART1_TX (GPIO_FUNC_20) /*!< USART1 TX */
  698. #define GPIO_FUNC_20_USART1_RX (GPIO_FUNC_20) /*!< USART1 RX */
  699. #define GPIO_FUNC_20_USART1_CTS (GPIO_FUNC_20) /*!< USART1 CTS */
  700. #define GPIO_FUNC_20_USART1_RTS (GPIO_FUNC_20) /*!< USART1 RTS */
  701. #define GPIO_FUNC_20_USART1_CK (GPIO_FUNC_20) /*!< USART1 CK */
  702. #define GPIO_FUNC_20_USART2 (GPIO_FUNC_20) /*!< USART2 */
  703. #define GPIO_FUNC_20_USART2_TX (GPIO_FUNC_20) /*!< USART2 TX */
  704. #define GPIO_FUNC_20_USART2_RX (GPIO_FUNC_20) /*!< USART2 RX */
  705. #define GPIO_FUNC_20_USART2_CTS (GPIO_FUNC_20) /*!< USART2 CTS */
  706. #define GPIO_FUNC_20_USART2_RTS (GPIO_FUNC_20) /*!< USART2 RTS */
  707. #define GPIO_FUNC_20_USART2_CK (GPIO_FUNC_20) /*!< USART2 CK */
  708. #define GPIO_FUNC_20_USART4 (GPIO_FUNC_20) /*!< USART4 */
  709. #define GPIO_FUNC_20_USART4_TX (GPIO_FUNC_20) /*!< USART4 TX */
  710. #define GPIO_FUNC_20_USART4_RX (GPIO_FUNC_20) /*!< USART4 RX */
  711. #define GPIO_FUNC_20_USART5 (GPIO_FUNC_20) /*!< USART5 */
  712. #define GPIO_FUNC_20_USART5_TX (GPIO_FUNC_20) /*!< USART5 TX */
  713. #define GPIO_FUNC_20_USART5_RX (GPIO_FUNC_20) /*!< USART5 RX */
  714. #define GPIO_FUNC_20_USART6 (GPIO_FUNC_20) /*!< USART6 */
  715. #define GPIO_FUNC_20_USART6_TX (GPIO_FUNC_20) /*!< USART6 TX */
  716. #define GPIO_FUNC_20_USART6_RX (GPIO_FUNC_20) /*!< USART6 RX */
  717. #define GPIO_FUNC_20_USART6_CTS (GPIO_FUNC_20) /*!< USART6 CTS */
  718. #define GPIO_FUNC_20_USART6_RTS (GPIO_FUNC_20) /*!< USART6 RTS */
  719. #define GPIO_FUNC_20_USART6_CK (GPIO_FUNC_20) /*!< USART6 CK */
  720. #define GPIO_FUNC_20_USART7 (GPIO_FUNC_20) /*!< USART7 */
  721. #define GPIO_FUNC_20_USART7_TX (GPIO_FUNC_20) /*!< USART7 TX */
  722. #define GPIO_FUNC_20_USART7_RX (GPIO_FUNC_20) /*!< USART7 RX */
  723. #define GPIO_FUNC_20_USART8 (GPIO_FUNC_20) /*!< USART8 */
  724. #define GPIO_FUNC_20_USART8_TX (GPIO_FUNC_20) /*!< USART8 TX */
  725. #define GPIO_FUNC_20_USART8_RX (GPIO_FUNC_20) /*!< USART8 RX */
  726. /**
  727. * @}
  728. */
  729. /** @defgroup GPIO_PinFunction32 GPIO Function 32 selection
  730. * @{
  731. */
  732. #define GPIO_FUNC_32 (0x20U)
  733. #define GPIO_FUNC_32_USART1_TX (GPIO_FUNC_32) /*!< USART1 TX in Function Group 1 */
  734. #define GPIO_FUNC_32_USART4_TX (GPIO_FUNC_32) /*!< USART4 TX in Function Group 2 */
  735. #define GPIO_FUNC_32_USART3_TX (GPIO_FUNC_32) /*!< USART3 TX in Function Group 3 */
  736. /**
  737. * @}
  738. */
  739. /** @defgroup GPIO_PinFunction33 GPIO Function 33 selection
  740. * @{
  741. */
  742. #define GPIO_FUNC_33 (0x21U)
  743. #define GPIO_FUNC_33_USART1_RX (GPIO_FUNC_33) /*!< USART1 RX in Function Group 1 */
  744. #define GPIO_FUNC_33_USART4_RX (GPIO_FUNC_33) /*!< USART4 RX in Function Group 2 */
  745. #define GPIO_FUNC_33_USART3_RX (GPIO_FUNC_33) /*!< USART3 RX in Function Group 3 */
  746. /**
  747. * @}
  748. */
  749. /** @defgroup GPIO_PinFunction34 GPIO Function 34 selection
  750. * @{
  751. */
  752. #define GPIO_FUNC_34 (0x22U)
  753. #define GPIO_FUNC_34_USART2_TX (GPIO_FUNC_34) /*!< USART2 TX in Function Group 1 */
  754. #define GPIO_FUNC_34_USART5_TX (GPIO_FUNC_34) /*!< USART5 TX in Function Group 2 */
  755. #define GPIO_FUNC_34_USART8_TX (GPIO_FUNC_34) /*!< USART8 TX in Function Group 3 */
  756. /**
  757. * @}
  758. */
  759. /** @defgroup GPIO_PinFunction35 GPIO Function 35 selection
  760. * @{
  761. */
  762. #define GPIO_FUNC_35 (0x23U)
  763. #define GPIO_FUNC_35_USART2_RX (GPIO_FUNC_35) /*!< USART2 RX in Function Group 1 */
  764. #define GPIO_FUNC_35_USART5_RX (GPIO_FUNC_35) /*!< USART5 RX in Function Group 2 */
  765. #define GPIO_FUNC_35_USART8_RX (GPIO_FUNC_35) /*!< USART8 RX in Function Group 3 */
  766. /**
  767. * @}
  768. */
  769. /** @defgroup GPIO_PinFunction36 GPIO Function 36 selection
  770. * @{
  771. */
  772. #define GPIO_FUNC_36 (0x24U)
  773. #define GPIO_FUNC_36_USART3_TX (GPIO_FUNC_36) /*!< USART3 TX in Function Group 1 */
  774. #define GPIO_FUNC_36_USART6_TX (GPIO_FUNC_36) /*!< USART6 TX in Function Group 2 */
  775. #define GPIO_FUNC_36_USART9_TX (GPIO_FUNC_36) /*!< USART9 TX in Function Group 3 */
  776. /**
  777. * @}
  778. */
  779. /** @defgroup GPIO_PinFunction37 GPIO Function 37 selection
  780. * @{
  781. */
  782. #define GPIO_FUNC_37 (0x25U)
  783. #define GPIO_FUNC_37_USART3_RX (GPIO_FUNC_37) /*!< USART3 RX in Function Group 1 */
  784. #define GPIO_FUNC_37_USART6_RX (GPIO_FUNC_37) /*!< USART6 RX in Function Group 2 */
  785. #define GPIO_FUNC_37_USART9_RX (GPIO_FUNC_37) /*!< USART9 RX in Function Group 3 */
  786. /**
  787. * @}
  788. */
  789. /** @defgroup GPIO_PinFunction38 GPIO Function 38 selection
  790. * @{
  791. */
  792. #define GPIO_FUNC_38 (0x26U)
  793. #define GPIO_FUNC_38_USART4_TX (GPIO_FUNC_38) /*!< USART4 TX in Function Group 1 */
  794. #define GPIO_FUNC_38_USART7_TX (GPIO_FUNC_38) /*!< USART7 TX in Function Group 2 */
  795. #define GPIO_FUNC_38_USART10_TX (GPIO_FUNC_38) /*!< USART10 TX in Function Group 3 */
  796. /**
  797. * @}
  798. */
  799. /** @defgroup GPIO_PinFunction39 GPIO Function 39 selection
  800. * @{
  801. */
  802. #define GPIO_FUNC_39 (0x27U)
  803. #define GPIO_FUNC_39_USART4_RX (GPIO_FUNC_39) /*!< USART4 RX in Function Group 1 */
  804. #define GPIO_FUNC_39_USART7_RX (GPIO_FUNC_39) /*!< USART7 RX in Function Group 2 */
  805. #define GPIO_FUNC_39_USART10_RX (GPIO_FUNC_39) /*!< USART10 RX in Function Group 3 */
  806. /**
  807. * @}
  808. */
  809. /** @defgroup GPIO_PinFunction40 GPIO Function 40 selection
  810. * @{
  811. */
  812. #define GPIO_FUNC_40 (0x28U)
  813. #define GPIO_FUNC_40_SPI1_SCK (GPIO_FUNC_40) /*!< SPI1 SCK in Function Group 1 & 3 */
  814. #define GPIO_FUNC_40_SPI4_SCK (GPIO_FUNC_40) /*!< SPI4 SCK in Function Group 2 */
  815. /**
  816. * @}
  817. */
  818. /** @defgroup GPIO_PinFunction41 GPIO Function 41 selection
  819. * @{
  820. */
  821. #define GPIO_FUNC_41 (0x29U)
  822. #define GPIO_FUNC_41_SPI1_MOSI (GPIO_FUNC_41) /*!< SPI1 MOSI in Function Group 1 & 3 */
  823. #define GPIO_FUNC_41_SPI4_MOSI (GPIO_FUNC_41) /*!< SPI4 MOSI in Function Group 2 */
  824. /**
  825. * @}
  826. */
  827. /** @defgroup GPIO_PinFunction42 GPIO Function 42 selection
  828. * @{
  829. */
  830. #define GPIO_FUNC_42 (0x2AU)
  831. #define GPIO_FUNC_42_SPI1_MISO (GPIO_FUNC_42) /*!< SPI1 MISO in Function Group 1 & 3 */
  832. #define GPIO_FUNC_42_SPI4_MISO (GPIO_FUNC_42) /*!< SPI4 MISO in Function Group 2 */
  833. /**
  834. * @}
  835. */
  836. /** @defgroup GPIO_PinFunction43 GPIO Function 43 selection
  837. * @{
  838. */
  839. #define GPIO_FUNC_43 (0x2BU)
  840. #define GPIO_FUNC_43_SPI2_SCK (GPIO_FUNC_43) /*!< SPI2 SCK in Function Group 1 */
  841. #define GPIO_FUNC_43_SPI5_SCK (GPIO_FUNC_43) /*!< SPI5 SCK in Function Group 2 */
  842. #define GPIO_FUNC_43_SPI4_SCK (GPIO_FUNC_43) /*!< SPI4 SCK in Function Group 3 */
  843. /**
  844. * @}
  845. */
  846. /** @defgroup GPIO_PinFunction44 GPIO Function 44 selection
  847. * @{
  848. */
  849. #define GPIO_FUNC_44 (0x2CU)
  850. #define GPIO_FUNC_44_SPI2_MOSI (GPIO_FUNC_44) /*!< SPI2 MOSI in Function Group 1 */
  851. #define GPIO_FUNC_44_SPI5_MOSI (GPIO_FUNC_44) /*!< SPI5 MOSI in Function Group 2 */
  852. #define GPIO_FUNC_44_SPI4_MOSI (GPIO_FUNC_44) /*!< SPI4 MOSI in Function Group 3 */
  853. /**
  854. * @}
  855. */
  856. /** @defgroup GPIO_PinFunction45 GPIO Function 45 selection
  857. * @{
  858. */
  859. #define GPIO_FUNC_45 (0x2DU)
  860. #define GPIO_FUNC_45_SPI2_MISO (GPIO_FUNC_45) /*!< SPI2 MISO in Function Group 1 */
  861. #define GPIO_FUNC_45_SPI5_MISO (GPIO_FUNC_45) /*!< SPI5 MISO in Function Group 2 */
  862. #define GPIO_FUNC_45_SPI4_MISO (GPIO_FUNC_45) /*!< SPI4 MISO in Function Group 3 */
  863. /**
  864. * @}
  865. */
  866. /** @defgroup GPIO_PinFunction46 GPIO Function 46 selection
  867. * @{
  868. */
  869. #define GPIO_FUNC_46 (0x2EU)
  870. #define GPIO_FUNC_46_SPI3_SCK (GPIO_FUNC_46) /*!< SPI3 SCK in Function Group 1 */
  871. #define GPIO_FUNC_46_SPI6_SCK (GPIO_FUNC_46) /*!< SPI6 SCK in Function Group 2 */
  872. #define GPIO_FUNC_46_SPI4_NSS0 (GPIO_FUNC_46) /*!< SPI4 NSS0 in Function Group 3 */
  873. /**
  874. * @}
  875. */
  876. /** @defgroup GPIO_PinFunction47 GPIO Function 47 selection
  877. * @{
  878. */
  879. #define GPIO_FUNC_47 (0x2FU)
  880. #define GPIO_FUNC_47_SPI3_MOSI (GPIO_FUNC_47) /*!< SPI3 MOSI in Function Group 1 */
  881. #define GPIO_FUNC_47_SPI6_MOSI (GPIO_FUNC_47) /*!< SPI6 MOSI in Function Group 2 */
  882. #define GPIO_FUNC_47_SPI1_NSS0 (GPIO_FUNC_47) /*!< SPI4 NSS0 in Function Group 3 */
  883. /**
  884. * @}
  885. */
  886. /** @defgroup GPIO_PinFunction48 GPIO Function 48 selection
  887. * @{
  888. */
  889. #define GPIO_FUNC_48 (0x30U)
  890. #define GPIO_FUNC_48_SPI3_MISO (GPIO_FUNC_48) /*!< SPI3 MISO in Function Group 1 */
  891. #define GPIO_FUNC_48_SPI6_MISO (GPIO_FUNC_48) /*!< SPI6 MISO in Function Group 2 */
  892. #define GPIO_FUNC_48_I2C1_SDA (GPIO_FUNC_48) /*!< I2C1 SDA in Function Group 3 */
  893. /**
  894. * @}
  895. */
  896. /** @defgroup GPIO_PinFunction49 GPIO Function 49 selection
  897. * @{
  898. */
  899. #define GPIO_FUNC_49 (0x31U)
  900. #define GPIO_FUNC_49_SPI3_NSS0 (GPIO_FUNC_49) /*!< SPI3 NSS0 in Function Group 1 */
  901. #define GPIO_FUNC_49_SPI6_NSS0 (GPIO_FUNC_49) /*!< SPI6 NSS0 in Function Group 2 */
  902. #define GPIO_FUNC_49_I2C1_SCL (GPIO_FUNC_49) /*!< I2C1 SCL in Function Group 3 */
  903. /**
  904. * @}
  905. */
  906. /** @defgroup GPIO_PinFunction50 GPIO Function 50 selection
  907. * @{
  908. */
  909. #define GPIO_FUNC_50 (0x32U)
  910. #define GPIO_FUNC_50_I2C1_SDA (GPIO_FUNC_50) /*!< I2C1 SDA in Function Group 1 */
  911. #define GPIO_FUNC_50_I2C2_SDA (GPIO_FUNC_50) /*!< I2C2 SDA in Function Group 2 & 3 */
  912. /**
  913. * @}
  914. */
  915. /** @defgroup GPIO_PinFunction51 GPIO Function 51 selection
  916. * @{
  917. */
  918. #define GPIO_FUNC_51 (0x33U)
  919. #define GPIO_FUNC_51_I2C1_SCL (GPIO_FUNC_51) /*!< I2C1 SCL in Function Group 1 */
  920. #define GPIO_FUNC_51_I2C2_SCL (GPIO_FUNC_51) /*!< I2C2 SCL in Function Group 2 & 3 */
  921. /**
  922. * @}
  923. */
  924. /** @defgroup GPIO_PinFunction52 GPIO Function 52 selection
  925. * @{
  926. */
  927. #define GPIO_FUNC_52 (0x34U)
  928. #define GPIO_FUNC_52_I2C3_SDA (GPIO_FUNC_52) /*!< I2C3 SDA in Function Group 1 */
  929. #define GPIO_FUNC_52_I2C4_SDA (GPIO_FUNC_52) /*!< I2C4 SDA in Function Group 2 */
  930. #define GPIO_FUNC_52_I2C6_SDA (GPIO_FUNC_52) /*!< I2C6 SDA in Function Group 3 */
  931. /**
  932. * @}
  933. */
  934. /** @defgroup GPIO_PinFunction53 GPIO Function 53 selection
  935. * @{
  936. */
  937. #define GPIO_FUNC_53 (0x35U)
  938. #define GPIO_FUNC_53_I2C3_SCL (GPIO_FUNC_53) /*!< I2C3 SCL in Function Group 1 */
  939. #define GPIO_FUNC_53_I2C4_SCL (GPIO_FUNC_53) /*!< I2C4 SCL in Function Group 2 */
  940. #define GPIO_FUNC_53_I2C6_SCL (GPIO_FUNC_53) /*!< I2C6 SCL in Function Group 3 */
  941. /**
  942. * @}
  943. */
  944. /** @defgroup GPIO_PinFunction54 GPIO Function 54 selection
  945. * @{
  946. */
  947. #define GPIO_FUNC_54 (0x36U)
  948. #define GPIO_FUNC_54_I2S1_CK (GPIO_FUNC_54) /*!< I2S1 CK in Function Group 1&3 */
  949. #define GPIO_FUNC_54_I2C5_SDA (GPIO_FUNC_54) /*!< I2C5 SDA in Function Group 2 */
  950. /**
  951. * @}
  952. */
  953. /** @defgroup GPIO_PinFunction55 GPIO Function 55 selection
  954. * @{
  955. */
  956. #define GPIO_FUNC_55 (0x37U)
  957. #define GPIO_FUNC_55_I2S1_WS (GPIO_FUNC_55) /*!< I2S1_WS in Function Group 1&3 */
  958. #define GPIO_FUNC_55_I2C5_SCL (GPIO_FUNC_55) /*!< I2C5_SCL in Function Group 2 */
  959. /**
  960. * @}
  961. */
  962. /** @defgroup GPIO_PinFunction56 GPIO Function 56 selection
  963. * @{
  964. */
  965. #define GPIO_FUNC_56 (0x38U)
  966. #define GPIO_FUNC_56_I2S1_SD (GPIO_FUNC_56) /*!< I2S1 SD in Function Group 1&3 */
  967. /**
  968. * @}
  969. */
  970. /** @defgroup GPIO_PinFunction57 GPIO Function 57 selection
  971. * @{
  972. */
  973. #define GPIO_FUNC_57 (0x39U)
  974. #define GPIO_FUNC_57_I2S2_CK (GPIO_FUNC_57) /*!< I2S2 CK in Function Group 1 */
  975. #define GPIO_FUNC_57_I2S3_CK (GPIO_FUNC_57) /*!< I2S3 CK in Function Group 2 */
  976. #define GPIO_FUNC_57_I2S4_CK (GPIO_FUNC_57) /*!< I2S4 CK in Function Group 3 */
  977. /**
  978. * @}
  979. */
  980. /** @defgroup GPIO_PinFunction58 GPIO Function 58 selection
  981. * @{
  982. */
  983. #define GPIO_FUNC_58 (0x3AU)
  984. #define GPIO_FUNC_58_I2S2_WS (GPIO_FUNC_58) /*!< I2S2 WS in Function Group 1 */
  985. #define GPIO_FUNC_58_I2S3_WS (GPIO_FUNC_58) /*!< I2S3 WS in Function Group 2 */
  986. #define GPIO_FUNC_58_I2S4_WS (GPIO_FUNC_58) /*!< I2S4 WS in Function Group 3 */
  987. /**
  988. * @}
  989. */
  990. /** @defgroup GPIO_PinFunction59 GPIO Function 59 selection
  991. * @{
  992. */
  993. #define GPIO_FUNC_59 (0x3BU)
  994. #define GPIO_FUNC_59_I2S2_SD (GPIO_FUNC_59) /*!< I2S2 SD in Function Group 1 */
  995. #define GPIO_FUNC_59_I2S3_SD (GPIO_FUNC_59) /*!< I2S3 SD in Function Group 2 */
  996. #define GPIO_FUNC_59_I2S4_SD (GPIO_FUNC_59) /*!< I2S4 SD in Function Group 3 */
  997. /**
  998. * @}
  999. */
  1000. /** @defgroup GPIO_PinFunction60 GPIO Function 60 selection
  1001. * @{
  1002. */
  1003. #define GPIO_FUNC_60 (0x3CU)
  1004. #define GPIO_FUNC_60_CAN1_TX (GPIO_FUNC_60) /*!< CAN1 TX in Function Group 1~3 */
  1005. /**
  1006. * @}
  1007. */
  1008. /** @defgroup GPIO_PinFunction61 GPIO Function 61 selection
  1009. * @{
  1010. */
  1011. #define GPIO_FUNC_61 (0x3DU)
  1012. #define GPIO_FUNC_61_CAN1_RX (GPIO_FUNC_61) /*!< CAN1 RX in Function Group 1~3 */
  1013. /**
  1014. * @}
  1015. */
  1016. /** @defgroup GPIO_PinFunction62 GPIO Function 62 selection
  1017. * @{
  1018. */
  1019. #define GPIO_FUNC_62 (0x3EU)
  1020. #define GPIO_FUNC_62_CAN2_TX (GPIO_FUNC_62) /*!< CAN2 TX in Function Group 1~3 */
  1021. /**
  1022. * @}
  1023. */
  1024. /** @defgroup GPIO_PinFunction63 GPIO Function 63 selection
  1025. * @{
  1026. */
  1027. #define GPIO_FUNC_63 (0x3FU)
  1028. #define GPIO_FUNC_63_CAN2_RX (GPIO_FUNC_63) /*!< CAN2 RX in Function Group 1~3 */
  1029. /**
  1030. * @}
  1031. */
  1032. /** @defgroup GPIO_DebugPin_Sel GPIO Debug pin selection
  1033. * @{
  1034. */
  1035. #define GPIO_PIN_SWCLK (0x01U)
  1036. #define GPIO_PIN_SWDIO (0x02U)
  1037. #define GPIO_PIN_SWO (0x04U)
  1038. #define GPIO_PIN_DEBUG_SWD (0x07U)
  1039. #define GPIO_PIN_TCK (0x01U)
  1040. #define GPIO_PIN_TMS (0x02U)
  1041. #define GPIO_PIN_TDO (0x04U)
  1042. #define GPIO_PIN_TDI (0x08U)
  1043. #define GPIO_PIN_TRST (0x10U)
  1044. #define GPIO_PIN_DEBUG_JTAG (0x1FU)
  1045. /**
  1046. * @}
  1047. */
  1048. /** @defgroup GPIO_ReadCycle_Sel GPIO pin read wait cycle selection
  1049. * @{
  1050. */
  1051. #define GPIO_READ_WAIT_0 ((uint16_t)(0x00UL << GPIO_PCCR_RDWT_POS))
  1052. #define GPIO_READ_WAIT_1 ((uint16_t)(0x01UL << GPIO_PCCR_RDWT_POS))
  1053. #define GPIO_READ_WAIT_2 ((uint16_t)(0x02UL << GPIO_PCCR_RDWT_POS))
  1054. #define GPIO_READ_WAIT_3 ((uint16_t)(0x03UL << GPIO_PCCR_RDWT_POS))
  1055. #define GPIO_READ_WAIT_4 ((uint16_t)(0x04UL << GPIO_PCCR_RDWT_POS))
  1056. #define GPIO_READ_WAIT_5 ((uint16_t)(0x05UL << GPIO_PCCR_RDWT_POS))
  1057. #define GPIO_READ_WAIT_6 ((uint16_t)(0x06UL << GPIO_PCCR_RDWT_POS))
  1058. #define GPIO_READ_WAIT_7 ((uint16_t)(0x07UL << GPIO_PCCR_RDWT_POS))
  1059. /**
  1060. * @}
  1061. */
  1062. /**
  1063. * @defgroup GPIO_PinState_Sel GPIO pin output state selection
  1064. * @{
  1065. */
  1066. #define PIN_STATE_RESET (0U)
  1067. #define PIN_STATE_SET (GPIO_PCR_POUT)
  1068. /**
  1069. * @}
  1070. */
  1071. /**
  1072. * @defgroup GPIO_PinDirection_Sel GPIO pin input/output direction selection
  1073. * @{
  1074. */
  1075. #define PIN_DIR_IN (0U)
  1076. #define PIN_DIR_OUT (GPIO_PCR_POUTE)
  1077. /**
  1078. * @}
  1079. */
  1080. /**
  1081. * @defgroup GPIO_PinOutType_Sel GPIO pin output type selection
  1082. * @{
  1083. */
  1084. #define PIN_OTYPE_CMOS (0U)
  1085. #define PIN_OTYPE_NMOS (GPIO_PCR_NOD)
  1086. /**
  1087. * @}
  1088. */
  1089. /**
  1090. * @defgroup GPIO_PinDrv_Sel GPIO Pin drive capacity selection
  1091. * @{
  1092. */
  1093. #define PIN_DRV_LOW (0U)
  1094. #define PIN_DRV_MID (GPIO_PCR_DRV_0)
  1095. #define PIN_DRV_HIGH (GPIO_PCR_DRV_1)
  1096. /**
  1097. * @}
  1098. */
  1099. /**
  1100. * @defgroup GPIO_PinLatch_Sel GPIO Pin output latch selection
  1101. * @{
  1102. */
  1103. #define PIN_LATCH_OFF (0U)
  1104. #define PIN_LATCH_ON (GPIO_PCR_LTE)
  1105. /**
  1106. * @}
  1107. */
  1108. /**
  1109. * @defgroup GPIO_PinPU_Sel GPIO Pin internal pull-up resistor selection
  1110. * @{
  1111. */
  1112. #define PIN_PU_OFF (0U)
  1113. #define PIN_PU_ON (GPIO_PCR_PUU)
  1114. /**
  1115. * @}
  1116. */
  1117. /**
  1118. * @defgroup GPIO_PinInvert_Sel GPIO Pin I/O invert selection
  1119. * @{
  1120. */
  1121. #define PIN_INVERT_OFF (0U)
  1122. #define PIN_INVERT_ON (GPIO_PCR_INVE)
  1123. /**
  1124. * @}
  1125. */
  1126. /**
  1127. * @defgroup GPIO_PinInType_Sel GPIO Pin input type selection
  1128. * @{
  1129. */
  1130. #define PIN_ITYPE_SMT (0U)
  1131. #define PIN_ITYPE_CMOS (GPIO_PCR_CINSEL)
  1132. /**
  1133. * @}
  1134. */
  1135. /**
  1136. * @defgroup GPIO_PinExInt_Sel GPIO Pin external interrupt selection
  1137. * @{
  1138. */
  1139. #define PIN_EXINT_OFF (0U)
  1140. #define PIN_EXINT_ON (GPIO_PCR_INTE)
  1141. /**
  1142. * @}
  1143. */
  1144. /**
  1145. * @defgroup GPIO_PinMode_Sel GPIO Pin mode selection
  1146. * @{
  1147. */
  1148. #define PIN_ATTR_DIGITAL (0U)
  1149. #define PIN_ATTR_ANALOG (GPIO_PCR_DDIS)
  1150. /**
  1151. * @}
  1152. */
  1153. /**
  1154. * @defgroup GPIO_PinSubFuncSet_Sel GPIO Pin sub-function enable or disable
  1155. * @{
  1156. */
  1157. #define PIN_SUBFUNC_DISABLE (0U)
  1158. #define PIN_SUBFUNC_ENABLE (GPIO_PFSR_BFE)
  1159. /**
  1160. * @}
  1161. */
  1162. /**
  1163. * @defgroup GPIO_Register_Protect GPIO Registers Protect Code
  1164. * @{
  1165. */
  1166. #define GPIO_REG_UNPROTECT (0xA501U)
  1167. #define GPIO_REG_PROTECT (0xA500U)
  1168. /**
  1169. * @}
  1170. */
  1171. /**
  1172. * @}
  1173. */
  1174. /*******************************************************************************
  1175. * Global variable definitions ('extern')
  1176. ******************************************************************************/
  1177. /*******************************************************************************
  1178. Global function prototypes (definition in C source)
  1179. ******************************************************************************/
  1180. /**
  1181. * @addtogroup GPIO_Global_Functions
  1182. * @{
  1183. */
  1184. /**
  1185. * @brief GPIO lock. PSPCR, PCCR, PINAER, PCRxy, PFSRxy write disable
  1186. * @param None
  1187. * @retval None
  1188. */
  1189. __STATIC_INLINE void GPIO_Lock(void)
  1190. {
  1191. WRITE_REG16(M4_GPIO->PWPR, GPIO_REG_PROTECT);
  1192. }
  1193. /**
  1194. * @brief GPIO unlock. PSPCR, PCCR, PINAER, PCRxy, PFSRxy write enable
  1195. * @param None
  1196. * @retval None
  1197. */
  1198. __STATIC_INLINE void GPIO_Unlock(void)
  1199. {
  1200. WRITE_REG16(M4_GPIO->PWPR, GPIO_REG_UNPROTECT);
  1201. }
  1202. en_result_t GPIO_Init(uint8_t u8Port, uint16_t u16Pin, const stc_gpio_init_t *pstcGpioInit);
  1203. void GPIO_DeInit(void);
  1204. void GPIO_Unlock(void);
  1205. void GPIO_Lock(void);
  1206. en_result_t GPIO_StructInit(stc_gpio_init_t *pstcGpioInit);
  1207. void GPIO_SetDebugPort(uint8_t u8DebugPort, en_functional_state_t enNewState);
  1208. void GPIO_SetFunc(uint8_t u8Port, uint16_t u16Pin, uint8_t u8Func, uint16_t u16BFE);
  1209. void GPIO_SetSubFunc(uint8_t u8Func);
  1210. void GPIO_SetReadWaitCycle(uint16_t u16ReadWait);
  1211. void GPIO_InMOSCmd(uint16_t u16PortIdx, en_functional_state_t enNewState);
  1212. void GPIO_OE(uint8_t u8Port, uint16_t u16Pin, en_functional_state_t enNewState);
  1213. //port pin
  1214. en_pin_state_t GPIO_ReadInputPins(uint8_t u8Port, uint16_t u16Pin);
  1215. uint16_t GPIO_ReadInputPort(uint8_t u8Port);
  1216. en_pin_state_t GPIO_ReadOutputPins(uint8_t u8Port, uint16_t u16Pin);
  1217. uint16_t GPIO_ReadOutputPort(uint8_t u8Port);
  1218. void GPIO_SetPins(uint8_t u8Port, uint16_t u16Pin);
  1219. void GPIO_ResetPins(uint8_t u8Port, uint16_t u16Pin);
  1220. void GPIO_TogglePins(uint8_t u8Port, uint16_t u16Pin);
  1221. void GPIO_WritePort(uint8_t u8Port, uint16_t u16PortVal);
  1222. /**
  1223. * @}
  1224. */
  1225. #endif /* DDL_GPIO_ENABLE */
  1226. /**
  1227. * @}
  1228. */
  1229. /**
  1230. * @}
  1231. */
  1232. #ifdef __cplusplus
  1233. }
  1234. #endif
  1235. #endif /* __HC32F4A0_GPIO_H__ */
  1236. /*******************************************************************************
  1237. * EOF (not truncated)
  1238. ******************************************************************************/