at32f425_gpio.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /**
  2. **************************************************************************
  3. * @file at32f425_gpio.h
  4. * @brief at32f425 gpio header file
  5. **************************************************************************
  6. * Copyright notice & Disclaimer
  7. *
  8. * The software Board Support Package (BSP) that is made available to
  9. * download from Artery official website is the copyrighted work of Artery.
  10. * Artery authorizes customers to use, copy, and distribute the BSP
  11. * software and its related documentation for the purpose of design and
  12. * development in conjunction with Artery microcontrollers. Use of the
  13. * software is governed by this copyright notice and the following disclaimer.
  14. *
  15. * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  16. * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  17. * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  18. * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  19. * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  21. *
  22. **************************************************************************
  23. */
  24. /* define to prevent recursive inclusion -------------------------------------*/
  25. #ifndef __AT32F425_GPIO_H
  26. #define __AT32F425_GPIO_H
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /* includes ------------------------------------------------------------------*/
  31. #include "at32f425.h"
  32. /** @addtogroup AT32F425_periph_driver
  33. * @{
  34. */
  35. /** @addtogroup GPIO
  36. * @{
  37. */
  38. /** @defgroup GPIO_pins_number_definition
  39. * @{
  40. */
  41. #define GPIO_PINS_0 0x0001 /*!< gpio pins number 0 */
  42. #define GPIO_PINS_1 0x0002 /*!< gpio pins number 1 */
  43. #define GPIO_PINS_2 0x0004 /*!< gpio pins number 2 */
  44. #define GPIO_PINS_3 0x0008 /*!< gpio pins number 3 */
  45. #define GPIO_PINS_4 0x0010 /*!< gpio pins number 4 */
  46. #define GPIO_PINS_5 0x0020 /*!< gpio pins number 5 */
  47. #define GPIO_PINS_6 0x0040 /*!< gpio pins number 6 */
  48. #define GPIO_PINS_7 0x0080 /*!< gpio pins number 7 */
  49. #define GPIO_PINS_8 0x0100 /*!< gpio pins number 8 */
  50. #define GPIO_PINS_9 0x0200 /*!< gpio pins number 9 */
  51. #define GPIO_PINS_10 0x0400 /*!< gpio pins number 10 */
  52. #define GPIO_PINS_11 0x0800 /*!< gpio pins number 11 */
  53. #define GPIO_PINS_12 0x1000 /*!< gpio pins number 12 */
  54. #define GPIO_PINS_13 0x2000 /*!< gpio pins number 13 */
  55. #define GPIO_PINS_14 0x4000 /*!< gpio pins number 14 */
  56. #define GPIO_PINS_15 0x8000 /*!< gpio pins number 15 */
  57. #define GPIO_PINS_ALL 0xFFFF /*!< gpio all pins */
  58. /**
  59. * @}
  60. */
  61. /** @defgroup GPIO_exported_types
  62. * @{
  63. */
  64. /**
  65. * @brief gpio mode select
  66. */
  67. typedef enum
  68. {
  69. GPIO_MODE_INPUT = 0x00, /*!< gpio input mode */
  70. GPIO_MODE_OUTPUT = 0x01, /*!< gpio output mode */
  71. GPIO_MODE_MUX = 0x02, /*!< gpio mux function mode */
  72. GPIO_MODE_ANALOG = 0x03 /*!< gpio analog in/out mode */
  73. } gpio_mode_type;
  74. /**
  75. * @brief gpio output drive strength select
  76. */
  77. typedef enum
  78. {
  79. GPIO_DRIVE_STRENGTH_STRONGER = 0x01, /*!< stronger sourcing/sinking strength */
  80. GPIO_DRIVE_STRENGTH_MODERATE = 0x02 /*!< moderate sourcing/sinking strength */
  81. } gpio_drive_type;
  82. /**
  83. * @brief gpio output type
  84. */
  85. typedef enum
  86. {
  87. GPIO_OUTPUT_PUSH_PULL = 0x00, /*!< output push-pull */
  88. GPIO_OUTPUT_OPEN_DRAIN = 0x01 /*!< output open-drain */
  89. } gpio_output_type;
  90. /**
  91. * @brief gpio pull type
  92. */
  93. typedef enum
  94. {
  95. GPIO_PULL_NONE = 0x00, /*!< floating for input, no pull for output */
  96. GPIO_PULL_UP = 0x01, /*!< pull-up */
  97. GPIO_PULL_DOWN = 0x02 /*!< pull-down */
  98. } gpio_pull_type;
  99. /**
  100. * @brief gpio init type
  101. */
  102. typedef struct
  103. {
  104. uint32_t gpio_pins; /*!< pins number selection */
  105. gpio_output_type gpio_out_type; /*!< output type selection */
  106. gpio_pull_type gpio_pull; /*!< pull type selection */
  107. gpio_mode_type gpio_mode; /*!< mode selection */
  108. gpio_drive_type gpio_drive_strength; /*!< drive strength selection */
  109. } gpio_init_type;
  110. /**
  111. * @brief gpio pins source type
  112. */
  113. typedef enum
  114. {
  115. GPIO_PINS_SOURCE0 = 0x00, /*!< gpio pins source number 0 */
  116. GPIO_PINS_SOURCE1 = 0x01, /*!< gpio pins source number 1 */
  117. GPIO_PINS_SOURCE2 = 0x02, /*!< gpio pins source number 2 */
  118. GPIO_PINS_SOURCE3 = 0x03, /*!< gpio pins source number 3 */
  119. GPIO_PINS_SOURCE4 = 0x04, /*!< gpio pins source number 4 */
  120. GPIO_PINS_SOURCE5 = 0x05, /*!< gpio pins source number 5 */
  121. GPIO_PINS_SOURCE6 = 0x06, /*!< gpio pins source number 6 */
  122. GPIO_PINS_SOURCE7 = 0x07, /*!< gpio pins source number 7 */
  123. GPIO_PINS_SOURCE8 = 0x08, /*!< gpio pins source number 8 */
  124. GPIO_PINS_SOURCE9 = 0x09, /*!< gpio pins source number 9 */
  125. GPIO_PINS_SOURCE10 = 0x0A, /*!< gpio pins source number 10 */
  126. GPIO_PINS_SOURCE11 = 0x0B, /*!< gpio pins source number 11 */
  127. GPIO_PINS_SOURCE12 = 0x0C, /*!< gpio pins source number 12 */
  128. GPIO_PINS_SOURCE13 = 0x0D, /*!< gpio pins source number 13 */
  129. GPIO_PINS_SOURCE14 = 0x0E, /*!< gpio pins source number 14 */
  130. GPIO_PINS_SOURCE15 = 0x0F /*!< gpio pins source number 15 */
  131. } gpio_pins_source_type;
  132. /**
  133. * @brief gpio muxing function selection type
  134. */
  135. typedef enum
  136. {
  137. GPIO_MUX_0 = 0x00, /*!< gpio muxing function selection 0 */
  138. GPIO_MUX_1 = 0x01, /*!< gpio muxing function selection 1 */
  139. GPIO_MUX_2 = 0x02, /*!< gpio muxing function selection 2 */
  140. GPIO_MUX_3 = 0x03, /*!< gpio muxing function selection 3 */
  141. GPIO_MUX_4 = 0x04, /*!< gpio muxing function selection 4 */
  142. GPIO_MUX_5 = 0x05, /*!< gpio muxing function selection 5 */
  143. GPIO_MUX_6 = 0x06, /*!< gpio muxing function selection 6 */
  144. GPIO_MUX_7 = 0x07, /*!< gpio muxing function selection 7 */
  145. } gpio_mux_sel_type;
  146. /**
  147. * @brief type define gpio register all
  148. */
  149. typedef struct
  150. {
  151. /**
  152. * @brief gpio mode register, offset:0x00
  153. */
  154. union
  155. {
  156. __IO uint32_t cfgr;
  157. struct
  158. {
  159. __IO uint32_t iomc0 : 2; /* [1:0] */
  160. __IO uint32_t iomc1 : 2; /* [3:2] */
  161. __IO uint32_t iomc2 : 2; /* [5:4] */
  162. __IO uint32_t iomc3 : 2; /* [7:6] */
  163. __IO uint32_t iomc4 : 2; /* [9:8] */
  164. __IO uint32_t iomc5 : 2; /* [11:10] */
  165. __IO uint32_t iomc6 : 2; /* [13:12] */
  166. __IO uint32_t iomc7 : 2; /* [15:14] */
  167. __IO uint32_t iomc8 : 2; /* [17:16] */
  168. __IO uint32_t iomc9 : 2; /* [19:18] */
  169. __IO uint32_t iomc10 : 2; /* [21:20] */
  170. __IO uint32_t iomc11 : 2; /* [23:22] */
  171. __IO uint32_t iomc12 : 2; /* [25:24] */
  172. __IO uint32_t iomc13 : 2; /* [27:26] */
  173. __IO uint32_t iomc14 : 2; /* [29:28] */
  174. __IO uint32_t iomc15 : 2; /* [31:30] */
  175. } cfgr_bit;
  176. };
  177. /**
  178. * @brief gpio output type register, offset:0x04
  179. */
  180. union
  181. {
  182. __IO uint32_t omode;
  183. struct
  184. {
  185. __IO uint32_t om0 : 1; /* [0] */
  186. __IO uint32_t om1 : 1; /* [1] */
  187. __IO uint32_t om2 : 1; /* [2] */
  188. __IO uint32_t om3 : 1; /* [3] */
  189. __IO uint32_t om4 : 1; /* [4] */
  190. __IO uint32_t om5 : 1; /* [5] */
  191. __IO uint32_t om6 : 1; /* [6] */
  192. __IO uint32_t om7 : 1; /* [7] */
  193. __IO uint32_t om8 : 1; /* [8] */
  194. __IO uint32_t om9 : 1; /* [9] */
  195. __IO uint32_t om10 : 1; /* [10] */
  196. __IO uint32_t om11 : 1; /* [11] */
  197. __IO uint32_t om12 : 1; /* [12] */
  198. __IO uint32_t om13 : 1; /* [13] */
  199. __IO uint32_t om14 : 1; /* [14] */
  200. __IO uint32_t om15 : 1; /* [15] */
  201. __IO uint32_t reserved1 : 16;/* [31:16] */
  202. } omode_bit;
  203. };
  204. /**
  205. * @brief gpio output driver register, offset:0x08
  206. */
  207. union
  208. {
  209. __IO uint32_t odrvr;
  210. struct
  211. {
  212. __IO uint32_t odrv0 : 2; /* [1:0] */
  213. __IO uint32_t odrv1 : 2; /* [3:2] */
  214. __IO uint32_t odrv2 : 2; /* [5:4] */
  215. __IO uint32_t odrv3 : 2; /* [7:6] */
  216. __IO uint32_t odrv4 : 2; /* [9:8] */
  217. __IO uint32_t odrv5 : 2; /* [11:10] */
  218. __IO uint32_t odrv6 : 2; /* [13:12] */
  219. __IO uint32_t odrv7 : 2; /* [15:14] */
  220. __IO uint32_t odrv8 : 2; /* [17:16] */
  221. __IO uint32_t odrv9 : 2; /* [19:18] */
  222. __IO uint32_t odrv10 : 2; /* [21:20] */
  223. __IO uint32_t odrv11 : 2; /* [23:22] */
  224. __IO uint32_t odrv12 : 2; /* [25:24] */
  225. __IO uint32_t odrv13 : 2; /* [27:26] */
  226. __IO uint32_t odrv14 : 2; /* [29:28] */
  227. __IO uint32_t odrv15 : 2; /* [31:30] */
  228. } odrvr_bit;
  229. };
  230. /**
  231. * @brief gpio pull up/down register, offset:0x0C
  232. */
  233. union
  234. {
  235. __IO uint32_t pull;
  236. struct
  237. {
  238. __IO uint32_t pull0 : 2; /* [1:0] */
  239. __IO uint32_t pull1 : 2; /* [3:2] */
  240. __IO uint32_t pull2 : 2; /* [5:4] */
  241. __IO uint32_t pull3 : 2; /* [7:6] */
  242. __IO uint32_t pull4 : 2; /* [9:8] */
  243. __IO uint32_t pull5 : 2; /* [11:10] */
  244. __IO uint32_t pull6 : 2; /* [13:12] */
  245. __IO uint32_t pull7 : 2; /* [15:14] */
  246. __IO uint32_t pull8 : 2; /* [17:16] */
  247. __IO uint32_t pull9 : 2; /* [19:18] */
  248. __IO uint32_t pull10 : 2; /* [21:20] */
  249. __IO uint32_t pull11 : 2; /* [23:22] */
  250. __IO uint32_t pull12 : 2; /* [25:24] */
  251. __IO uint32_t pull13 : 2; /* [27:26] */
  252. __IO uint32_t pull14 : 2; /* [29:28] */
  253. __IO uint32_t pull15 : 2; /* [31:30] */
  254. } pull_bit;
  255. };
  256. /**
  257. * @brief gpio input data register, offset:0x10
  258. */
  259. union
  260. {
  261. __IO uint32_t idt;
  262. struct
  263. {
  264. __IO uint32_t idt0 : 1; /* [0] */
  265. __IO uint32_t idt1 : 1; /* [1] */
  266. __IO uint32_t idt2 : 1; /* [2] */
  267. __IO uint32_t idt3 : 1; /* [3] */
  268. __IO uint32_t idt4 : 1; /* [4] */
  269. __IO uint32_t idt5 : 1; /* [5] */
  270. __IO uint32_t idt6 : 1; /* [6] */
  271. __IO uint32_t idt7 : 1; /* [7] */
  272. __IO uint32_t idt8 : 1; /* [8] */
  273. __IO uint32_t idt9 : 1; /* [9] */
  274. __IO uint32_t idt10 : 1; /* [10] */
  275. __IO uint32_t idt11 : 1; /* [11] */
  276. __IO uint32_t idt12 : 1; /* [12] */
  277. __IO uint32_t idt13 : 1; /* [13] */
  278. __IO uint32_t idt14 : 1; /* [14] */
  279. __IO uint32_t idt15 : 1; /* [15] */
  280. __IO uint32_t reserved1 : 16;/* [31:16] */
  281. } idt_bit;
  282. };
  283. /**
  284. * @brief gpio output data register, offset:0x14
  285. */
  286. union
  287. {
  288. __IO uint32_t odt;
  289. struct
  290. {
  291. __IO uint32_t odt0 : 1; /* [0] */
  292. __IO uint32_t odt1 : 1; /* [1] */
  293. __IO uint32_t odt2 : 1; /* [2] */
  294. __IO uint32_t odt3 : 1; /* [3] */
  295. __IO uint32_t odt4 : 1; /* [4] */
  296. __IO uint32_t odt5 : 1; /* [5] */
  297. __IO uint32_t odt6 : 1; /* [6] */
  298. __IO uint32_t odt7 : 1; /* [7] */
  299. __IO uint32_t odt8 : 1; /* [8] */
  300. __IO uint32_t odt9 : 1; /* [9] */
  301. __IO uint32_t odt10 : 1; /* [10] */
  302. __IO uint32_t odt11 : 1; /* [11] */
  303. __IO uint32_t odt12 : 1; /* [12] */
  304. __IO uint32_t odt13 : 1; /* [13] */
  305. __IO uint32_t odt14 : 1; /* [14] */
  306. __IO uint32_t odt15 : 1; /* [15] */
  307. __IO uint32_t reserved1 : 16;/* [31:16] */
  308. } odt_bit;
  309. };
  310. /**
  311. * @brief gpio scr register, offset:0x18
  312. */
  313. union
  314. {
  315. __IO uint32_t scr;
  316. struct
  317. {
  318. __IO uint32_t iosb0 : 1; /* [0] */
  319. __IO uint32_t iosb1 : 1; /* [1] */
  320. __IO uint32_t iosb2 : 1; /* [2] */
  321. __IO uint32_t iosb3 : 1; /* [3] */
  322. __IO uint32_t iosb4 : 1; /* [4] */
  323. __IO uint32_t iosb5 : 1; /* [5] */
  324. __IO uint32_t iosb6 : 1; /* [6] */
  325. __IO uint32_t iosb7 : 1; /* [7] */
  326. __IO uint32_t iosb8 : 1; /* [8] */
  327. __IO uint32_t iosb9 : 1; /* [9] */
  328. __IO uint32_t iosb10 : 1; /* [10] */
  329. __IO uint32_t iosb11 : 1; /* [11] */
  330. __IO uint32_t iosb12 : 1; /* [12] */
  331. __IO uint32_t iosb13 : 1; /* [13] */
  332. __IO uint32_t iosb14 : 1; /* [14] */
  333. __IO uint32_t iosb15 : 1; /* [15] */
  334. __IO uint32_t iocb0 : 1; /* [16] */
  335. __IO uint32_t iocb1 : 1; /* [17] */
  336. __IO uint32_t iocb2 : 1; /* [18] */
  337. __IO uint32_t iocb3 : 1; /* [19] */
  338. __IO uint32_t iocb4 : 1; /* [20] */
  339. __IO uint32_t iocb5 : 1; /* [21] */
  340. __IO uint32_t iocb6 : 1; /* [22] */
  341. __IO uint32_t iocb7 : 1; /* [23] */
  342. __IO uint32_t iocb8 : 1; /* [24] */
  343. __IO uint32_t iocb9 : 1; /* [25] */
  344. __IO uint32_t iocb10 : 1; /* [26] */
  345. __IO uint32_t iocb11 : 1; /* [27] */
  346. __IO uint32_t iocb12 : 1; /* [28] */
  347. __IO uint32_t iocb13 : 1; /* [29] */
  348. __IO uint32_t iocb14 : 1; /* [30] */
  349. __IO uint32_t iocb15 : 1; /* [31] */
  350. } scr_bit;
  351. };
  352. /**
  353. * @brief gpio wpr register, offset:0x1C
  354. */
  355. union
  356. {
  357. __IO uint32_t wpr;
  358. struct
  359. {
  360. __IO uint32_t wpen0 : 1; /* [0] */
  361. __IO uint32_t wpen1 : 1; /* [1] */
  362. __IO uint32_t wpen2 : 1; /* [2] */
  363. __IO uint32_t wpen3 : 1; /* [3] */
  364. __IO uint32_t wpen4 : 1; /* [4] */
  365. __IO uint32_t wpen5 : 1; /* [5] */
  366. __IO uint32_t wpen6 : 1; /* [6] */
  367. __IO uint32_t wpen7 : 1; /* [7] */
  368. __IO uint32_t wpen8 : 1; /* [8] */
  369. __IO uint32_t wpen9 : 1; /* [9] */
  370. __IO uint32_t wpen10 : 1; /* [10] */
  371. __IO uint32_t wpen11 : 1; /* [11] */
  372. __IO uint32_t wpen12 : 1; /* [12] */
  373. __IO uint32_t wpen13 : 1; /* [13] */
  374. __IO uint32_t wpen14 : 1; /* [14] */
  375. __IO uint32_t wpen15 : 1; /* [15] */
  376. __IO uint32_t wpseq : 1; /* [16] */
  377. __IO uint32_t reserved1 : 15;/* [31:17] */
  378. } wpr_bit;
  379. };
  380. /**
  381. * @brief gpio muxl register, offset:0x20
  382. */
  383. union
  384. {
  385. __IO uint32_t muxl;
  386. struct
  387. {
  388. __IO uint32_t muxl0 : 4; /* [3:0] */
  389. __IO uint32_t muxl1 : 4; /* [7:4] */
  390. __IO uint32_t muxl2 : 4; /* [11:8] */
  391. __IO uint32_t muxl3 : 4; /* [15:12] */
  392. __IO uint32_t muxl4 : 4; /* [19:16] */
  393. __IO uint32_t muxl5 : 4; /* [23:20] */
  394. __IO uint32_t muxl6 : 4; /* [27:24] */
  395. __IO uint32_t muxl7 : 4; /* [31:28] */
  396. } muxl_bit;
  397. };
  398. /**
  399. * @brief gpio muxh register, offset:0x24
  400. */
  401. union
  402. {
  403. __IO uint32_t muxh;
  404. struct
  405. {
  406. __IO uint32_t muxh8 : 4; /* [3:0] */
  407. __IO uint32_t muxh9 : 4; /* [7:4] */
  408. __IO uint32_t muxh10 : 4; /* [11:8] */
  409. __IO uint32_t muxh11 : 4; /* [15:12] */
  410. __IO uint32_t muxh12 : 4; /* [19:16] */
  411. __IO uint32_t muxh13 : 4; /* [23:20] */
  412. __IO uint32_t muxh14 : 4; /* [27:24] */
  413. __IO uint32_t muxh15 : 4; /* [31:28] */
  414. } muxh_bit;
  415. };
  416. /**
  417. * @brief gpio clr register, offset:0x28
  418. */
  419. union
  420. {
  421. __IO uint32_t clr;
  422. struct
  423. {
  424. __IO uint32_t iocb0 : 1; /* [0] */
  425. __IO uint32_t iocb1 : 1; /* [1] */
  426. __IO uint32_t iocb2 : 1; /* [2] */
  427. __IO uint32_t iocb3 : 1; /* [3] */
  428. __IO uint32_t iocb4 : 1; /* [4] */
  429. __IO uint32_t iocb5 : 1; /* [5] */
  430. __IO uint32_t iocb6 : 1; /* [6] */
  431. __IO uint32_t iocb7 : 1; /* [7] */
  432. __IO uint32_t iocb8 : 1; /* [8] */
  433. __IO uint32_t iocb9 : 1; /* [9] */
  434. __IO uint32_t iocb10 : 1; /* [10] */
  435. __IO uint32_t iocb11 : 1; /* [11] */
  436. __IO uint32_t iocb12 : 1; /* [12] */
  437. __IO uint32_t iocb13 : 1; /* [13] */
  438. __IO uint32_t iocb14 : 1; /* [14] */
  439. __IO uint32_t iocb15 : 1; /* [15] */
  440. __IO uint32_t reserved1 : 16;/* [31:16] */
  441. } clr_bit;
  442. };
  443. /**
  444. * @brief gpio reserved1 register, offset:0x2C~0x38
  445. */
  446. __IO uint32_t reserved1[4];
  447. /**
  448. * @brief gpio hdrv register, offset:0x3C
  449. */
  450. union
  451. {
  452. __IO uint32_t hdrv;
  453. struct
  454. {
  455. __IO uint32_t hdrv0 : 1; /* [0] */
  456. __IO uint32_t hdrv1 : 1; /* [1] */
  457. __IO uint32_t hdrv2 : 1; /* [2] */
  458. __IO uint32_t hdrv3 : 1; /* [3] */
  459. __IO uint32_t hdrv4 : 1; /* [4] */
  460. __IO uint32_t hdrv5 : 1; /* [5] */
  461. __IO uint32_t hdrv6 : 1; /* [6] */
  462. __IO uint32_t hdrv7 : 1; /* [7] */
  463. __IO uint32_t hdrv8 : 1; /* [8] */
  464. __IO uint32_t hdrv9 : 1; /* [9] */
  465. __IO uint32_t hdrv10 : 1; /* [10] */
  466. __IO uint32_t hdrv11 : 1; /* [11] */
  467. __IO uint32_t hdrv12 : 1; /* [12] */
  468. __IO uint32_t hdrv13 : 1; /* [13] */
  469. __IO uint32_t hdrv14 : 1; /* [14] */
  470. __IO uint32_t hdrv15 : 1; /* [15] */
  471. __IO uint32_t reserved1 : 16;/* [31:16] */
  472. } hdrv_bit;
  473. };
  474. } gpio_type;
  475. /**
  476. * @}
  477. */
  478. #define GPIOA ((gpio_type *) GPIOA_BASE)
  479. #define GPIOB ((gpio_type *) GPIOB_BASE)
  480. #define GPIOC ((gpio_type *) GPIOC_BASE)
  481. #define GPIOD ((gpio_type *) GPIOD_BASE)
  482. #define GPIOF ((gpio_type *) GPIOF_BASE)
  483. /** @defgroup GPIO_exported_functions
  484. * @{
  485. */
  486. void gpio_reset(gpio_type *gpio_x);
  487. void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct);
  488. void gpio_default_para_init(gpio_init_type *gpio_init_struct);
  489. flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins);
  490. uint16_t gpio_input_data_read(gpio_type *gpio_x);
  491. flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins);
  492. uint16_t gpio_output_data_read(gpio_type *gpio_x);
  493. void gpio_bits_set(gpio_type *gpio_x, uint16_t pins);
  494. void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins);
  495. void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state);
  496. void gpio_port_write(gpio_type *gpio_x, uint16_t port_value);
  497. void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins);
  498. void gpio_pins_huge_driven_config(gpio_type *gpio_x, uint16_t pins, confirm_state new_state);
  499. void gpio_pin_mux_config(gpio_type *gpio_x, gpio_pins_source_type gpio_pin_source, gpio_mux_sel_type gpio_mux);
  500. /**
  501. * @}
  502. */
  503. /**
  504. * @}
  505. */
  506. /**
  507. * @}
  508. */
  509. #ifdef __cplusplus
  510. }
  511. #endif
  512. #endif