gd32f30x_fmc.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /*!
  2. \file gd32f30x_fmc.h
  3. \brief definitions for the FMC
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-02-10, V1.0.1, firmware for GD32F30x
  8. */
  9. #ifndef GD32F30X_FMC_H
  10. #define GD32F30X_FMC_H
  11. #include "gd32f30x.h"
  12. /* FMC and option byte definition */
  13. #define FMC FMC_BASE /*!< FMC register base address */
  14. #define OB OB_BASE /*!< option bytes base address */
  15. /* registers definitions */
  16. #define FMC_WS REG32((FMC) + 0x00U) /*!< FMC wait state register */
  17. #define FMC_KEY0 REG32((FMC) + 0x04U) /*!< FMC unlock key register 0 */
  18. #define FMC_OBKEY REG32((FMC) + 0x08U) /*!< FMC option bytes unlock key register */
  19. #define FMC_STAT0 REG32((FMC) + 0x0CU) /*!< FMC status register 0 */
  20. #define FMC_CTL0 REG32((FMC) + 0x10U) /*!< FMC control register 0 */
  21. #define FMC_ADDR0 REG32((FMC) + 0x14U) /*!< FMC address register 0 */
  22. #define FMC_OBSTAT REG32((FMC) + 0x1CU) /*!< FMC option bytes status register */
  23. #define FMC_WP REG32((FMC) + 0x20U) /*!< FMC erase/program protection register */
  24. #define FMC_KEY1 REG32((FMC) + 0x44U) /*!< FMC unlock key register 1 */
  25. #define FMC_STAT1 REG32((FMC) + 0x4CU) /*!< FMC status register 1 */
  26. #define FMC_CTL1 REG32((FMC) + 0x50U) /*!< FMC control register 1 */
  27. #define FMC_ADDR1 REG32((FMC) + 0x54U) /*!< FMC address register 1 */
  28. #define FMC_WSEN REG32((FMC) + 0xFCU) /*!< FMC wait state enable register */
  29. #define FMC_PID REG32((FMC) + 0x100U) /*!< FMC product ID register */
  30. #define OB_SPC REG16((OB) + 0x00U) /*!< option byte security protection value */
  31. #define OB_USER REG16((OB) + 0x02U) /*!< option byte user value*/
  32. #define OB_WP0 REG16((OB) + 0x08U) /*!< option byte write protection 0 */
  33. #define OB_WP1 REG16((OB) + 0x0AU) /*!< option byte write protection 1 */
  34. #define OB_WP2 REG16((OB) + 0x0CU) /*!< option byte write protection 2 */
  35. #define OB_WP3 REG16((OB) + 0x0EU) /*!< option byte write protection 3 */
  36. /* bits definitions */
  37. /* FMC_WS */
  38. #define FMC_WS_WSCNT BITS(0,2) /*!< wait state counter */
  39. /* FMC_KEY0 */
  40. #define FMC_KEY0_KEY BITS(0,31) /*!< FMC_CTL0 unlock key bits */
  41. /* FMC_OBKEY */
  42. #define FMC_OBKEY_OBKEY BITS(0,31) /*!< option bytes unlock key bits */
  43. /* FMC_STAT0 */
  44. #define FMC_STAT0_BUSY BIT(0) /*!< flash busy flag bit */
  45. #define FMC_STAT0_PGERR BIT(2) /*!< flash program error flag bit */
  46. #define FMC_STAT0_WPERR BIT(4) /*!< erase/program protection error flag bit */
  47. #define FMC_STAT0_ENDF BIT(5) /*!< end of operation flag bit */
  48. /* FMC_CTL0 */
  49. #define FMC_CTL0_PG BIT(0) /*!< main flash program for bank0 command bit */
  50. #define FMC_CTL0_PER BIT(1) /*!< main flash page erase for bank0 command bit */
  51. #define FMC_CTL0_MER BIT(2) /*!< main flash mass erase for bank0 command bit */
  52. #define FMC_CTL0_OBPG BIT(4) /*!< option bytes program command bit */
  53. #define FMC_CTL0_OBER BIT(5) /*!< option bytes erase command bit */
  54. #define FMC_CTL0_START BIT(6) /*!< send erase command to FMC bit */
  55. #define FMC_CTL0_LK BIT(7) /*!< FMC_CTL0 lock bit */
  56. #define FMC_CTL0_OBWEN BIT(9) /*!< option bytes erase/program enable bit */
  57. #define FMC_CTL0_ERRIE BIT(10) /*!< error interrupt enable bit */
  58. #define FMC_CTL0_ENDIE BIT(12) /*!< end of operation interrupt enable bit */
  59. /* FMC_ADDR0 */
  60. #define FMC_ADDR0_ADDR BITS(0,31) /*!< Flash erase/program command address bits */
  61. /* FMC_OBSTAT */
  62. #define FMC_OBSTAT_OBERR BIT(0) /*!< option bytes read error bit. */
  63. #define FMC_OBSTAT_SPC BIT(1) /*!< option bytes security protection code */
  64. #define FMC_OBSTAT_USER BITS(2,9) /*!< store USER of option bytes block after system reset */
  65. #define FMC_OBSTAT_DATA BITS(10,25) /*!< store DATA of option bytes block after system reset. */
  66. /* FMC_WP */
  67. #define FMC_WP_WP BITS(0,31) /*!< store WP of option bytes block after system reset */
  68. /* FMC_KEY1 */
  69. #define FMC_KEY1_KEY BITS(0,31) /*!< FMC_CTL1 unlock key bits */
  70. /* FMC_STAT1 */
  71. #define FMC_STAT1_BUSY BIT(0) /*!< flash busy flag bit */
  72. #define FMC_STAT1_PGERR BIT(2) /*!< flash program error flag bit */
  73. #define FMC_STAT1_WPERR BIT(4) /*!< erase/program protection error flag bit */
  74. #define FMC_STAT1_ENDF BIT(5) /*!< end of operation flag bit */
  75. /* FMC_CTL1 */
  76. #define FMC_CTL1_PG BIT(0) /*!< main flash program for bank1 command bit */
  77. #define FMC_CTL1_PER BIT(1) /*!< main flash page erase for bank1 command bit */
  78. #define FMC_CTL1_MER BIT(2) /*!< main flash mass erase for bank1 command bit */
  79. #define FMC_CTL1_START BIT(6) /*!< send erase command to FMC bit */
  80. #define FMC_CTL1_LK BIT(7) /*!< FMC_CTL1 lock bit */
  81. #define FMC_CTL1_ERRIE BIT(10) /*!< error interrupt enable bit */
  82. #define FMC_CTL1_ENDIE BIT(12) /*!< end of operation interrupt enable bit */
  83. /* FMC_ADDR1 */
  84. #define FMC_ADDR1_ADDR BITS(0,31) /*!< Flash erase/program command address bits */
  85. /* FMC_WSEN */
  86. #define FMC_WSEN_WSEN BIT(0) /*!< FMC wait state enable bit */
  87. /* FMC_PID */
  88. #define FMC_PID_PID BITS(0,31) /*!< product ID bits */
  89. /* constants definitions */
  90. /* define the FMC bit position and its register index offset */
  91. #define FMC_REGIDX_BIT(regidx, bitpos) (((uint32_t)(regidx) << 6) | (uint32_t)(bitpos))
  92. #define FMC_REG_VAL(offset) (REG32(FMC + ((uint32_t)(offset) >> 6)))
  93. #define FMC_BIT_POS(val) ((uint32_t)(val) & 0x1FU)
  94. #define FMC_REGIDX_BITS(regidx, bitpos0, bitpos1) (((uint32_t)(regidx) << 12) | ((uint32_t)(bitpos0) << 6) | (uint32_t)(bitpos1))
  95. #define FMC_REG_VALS(offset) (REG32(FMC + ((uint32_t)(offset) >> 12)))
  96. #define FMC_BIT_POS0(val) (((uint32_t)(val) >> 6) & 0x1FU)
  97. #define FMC_BIT_POS1(val) ((uint32_t)(val) & 0x1FU)
  98. #define FMC_REG_OFFSET_GET(flag) ((uint32_t)(flag) >> 12)
  99. /* configuration register */
  100. #define FMC_STAT0_REG_OFFSET 0x0CU /*!< status register 0 offset */
  101. #define FMC_CTL0_REG_OFFSET 0x10U /*!< control register 0 offset */
  102. #define FMC_STAT1_REG_OFFSET 0x4CU /*!< status register 1 offset */
  103. #define FMC_CTL1_REG_OFFSET 0x50U /*!< control register 1 offset */
  104. #define FMC_OBSTAT_REG_OFFSET 0x1CU /*!< option byte status register offset */
  105. /* fmc state */
  106. typedef enum
  107. {
  108. FMC_READY, /*!< the operation has been completed */
  109. FMC_BUSY, /*!< the operation is in progress */
  110. FMC_PGERR, /*!< program error */
  111. FMC_WPERR, /*!< erase/program protection error */
  112. FMC_TOERR, /*!< timeout error */
  113. }fmc_state_enum;
  114. /* FMC interrupt enable */
  115. typedef enum
  116. {
  117. FMC_INT_BANK0_END = FMC_REGIDX_BIT(FMC_CTL0_REG_OFFSET, 12U), /*!< enable FMC end of program interrupt */
  118. FMC_INT_BANK0_ERR = FMC_REGIDX_BIT(FMC_CTL0_REG_OFFSET, 10U), /*!< enable FMC error interrupt */
  119. FMC_INT_BANK1_END = FMC_REGIDX_BIT(FMC_CTL1_REG_OFFSET, 12U), /*!< enable FMC bank1 end of program interrupt */
  120. FMC_INT_BANK1_ERR = FMC_REGIDX_BIT(FMC_CTL1_REG_OFFSET, 10U), /*!< enable FMC bank1 error interrupt */
  121. }fmc_int_enum;
  122. /* FMC flags */
  123. typedef enum
  124. {
  125. FMC_FLAG_BANK0_BUSY = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 0U), /*!< FMC bank0 busy flag */
  126. FMC_FLAG_BANK0_PGERR = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 2U), /*!< FMC bank0 operation error flag bit */
  127. FMC_FLAG_BANK0_WPERR = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 4U), /*!< FMC bank0 erase/program protection error flag bit */
  128. FMC_FLAG_BANK0_END = FMC_REGIDX_BIT(FMC_STAT0_REG_OFFSET, 5U), /*!< FMC bank0 end of operation flag bit */
  129. FMC_FLAG_OBERR = FMC_REGIDX_BIT(FMC_OBSTAT_REG_OFFSET, 0U), /*!< FMC option bytes read error flag */
  130. FMC_FLAG_BANK1_BUSY = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 0U), /*!< FMC bank1 busy flag */
  131. FMC_FLAG_BANK1_PGERR = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 2U), /*!< FMC bank1 operation error flag bit */
  132. FMC_FLAG_BANK1_WPERR = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 4U), /*!< FMC bank1 erase/program protection error flag bit */
  133. FMC_FLAG_BANK1_END = FMC_REGIDX_BIT(FMC_STAT1_REG_OFFSET, 5U), /*!< FMC bank1 end of operation flag bit */
  134. }fmc_flag_enum;
  135. /* FMC interrupt flags */
  136. typedef enum
  137. {
  138. FMC_INT_FLAG_BANK0_PGERR = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 2U, 10U), /*!< FMC bank0 operation error interrupt flag bit */
  139. FMC_INT_FLAG_BANK0_WPERR = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 4U, 10U), /*!< FMC bank0 erase/program protection error interrupt flag bit */
  140. FMC_INT_FLAG_BANK0_END = FMC_REGIDX_BITS(FMC_STAT0_REG_OFFSET, 5U, 12U), /*!< FMC bank0 end of operation interrupt flag bit */
  141. FMC_INT_FLAG_BANK1_PGERR = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 2U, 10U), /*!< FMC bank1 operation error interrupt flag bit */
  142. FMC_INT_FLAG_BANK1_WPERR = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 4U, 10U), /*!< FMC bank1 erase/program protection error interrupt flag bit */
  143. FMC_INT_FLAG_BANK1_END = FMC_REGIDX_BITS(FMC_STAT1_REG_OFFSET, 5U, 12U), /*!< FMC bank1 end of operation interrupt flag bit */
  144. }fmc_interrupt_flag_enum;
  145. /* unlock key */
  146. #define UNLOCK_KEY0 ((uint32_t)0x45670123U) /*!< unlock key 0 */
  147. #define UNLOCK_KEY1 ((uint32_t)0xCDEF89ABU) /*!< unlock key 1 */
  148. /* FMC wait state counter */
  149. #define WS_WSCNT(regval) (BITS(0,2) & ((uint32_t)(regval)))
  150. #define WS_WSCNT_0 WS_WSCNT(0) /*!< FMC 0 wait */
  151. #define WS_WSCNT_1 WS_WSCNT(1) /*!< FMC 1 wait */
  152. #define WS_WSCNT_2 WS_WSCNT(2) /*!< FMC 2 wait */
  153. /* option bytes software/hardware free watch dog timer */
  154. #define OB_FWDGT_SW ((uint8_t)0x01U) /*!< software free watchdog */
  155. #define OB_FWDGT_HW ((uint8_t)0x00U) /*!< hardware free watchdog */
  156. /* option bytes reset or not entering deep sleep mode */
  157. #define OB_DEEPSLEEP_NRST ((uint8_t)0x02U) /*!< no reset when entering deepsleep mode */
  158. #define OB_DEEPSLEEP_RST ((uint8_t)0x00U) /*!< generate a reset instead of entering deepsleep mode */
  159. /* option bytes reset or not entering standby mode */
  160. #define OB_STDBY_NRST ((uint8_t)0x04U) /*!< no reset when entering deepsleep mode */
  161. #define OB_STDBY_RST ((uint8_t)0x00U) /*!< generate a reset instead of entering standby mode */
  162. /* option bytes boot bank value */
  163. #define OB_BOOT_B0 ((uint8_t)0x08U) /*!< boot from bank0 */
  164. #define OB_BOOT_B1 ((uint8_t)0x00U) /*!< boot from bank1 */
  165. #define OB_USER_MASK ((uint8_t)0xF0U) /*!< MASK value */
  166. /* read protect configure */
  167. #define FMC_NSPC ((uint8_t)0xA5U) /*!< no security protection */
  168. #define FMC_USPC ((uint8_t)0xBBU) /*!< under security protection */
  169. /* OB_SPC */
  170. #define OB_SPC_SPC ((uint32_t)0x000000FFU) /*!< option byte security protection value */
  171. #define OB_SPC_SPC_N ((uint32_t)0x0000FF00U) /*!< option byte security protection complement value */
  172. /* OB_USER */
  173. #define OB_USER_USER ((uint32_t)0x00FF0000U) /*!< user option value */
  174. #define OB_USER_USER_N ((uint32_t)0xFF000000U) /*!< user option complement value */
  175. /* OB_WP0 */
  176. #define OB_WP0_WP0 ((uint32_t)0x000000FFU) /*!< FMC write protection option value */
  177. /* OB_WP1 */
  178. #define OB_WP1_WP1 ((uint32_t)0x0000FF00U) /*!< FMC write protection option complement value */
  179. /* OB_WP2 */
  180. #define OB_WP2_WP2 ((uint32_t)0x00FF0000U) /*!< FMC write protection option value */
  181. /* OB_WP3 */
  182. #define OB_WP3_WP3 ((uint32_t)0xFF000000U) /*!< FMC write protection option complement value */
  183. /* option bytes write protection */
  184. #define OB_WP_0 ((uint32_t)0x00000001U) /*!< erase/program protection of sector 0 */
  185. #define OB_WP_1 ((uint32_t)0x00000002U) /*!< erase/program protection of sector 1 */
  186. #define OB_WP_2 ((uint32_t)0x00000004U) /*!< erase/program protection of sector 2 */
  187. #define OB_WP_3 ((uint32_t)0x00000008U) /*!< erase/program protection of sector 3 */
  188. #define OB_WP_4 ((uint32_t)0x00000010U) /*!< erase/program protection of sector 4 */
  189. #define OB_WP_5 ((uint32_t)0x00000020U) /*!< erase/program protection of sector 5 */
  190. #define OB_WP_6 ((uint32_t)0x00000040U) /*!< erase/program protection of sector 6 */
  191. #define OB_WP_7 ((uint32_t)0x00000080U) /*!< erase/program protection of sector 7 */
  192. #define OB_WP_8 ((uint32_t)0x00000100U) /*!< erase/program protection of sector 8 */
  193. #define OB_WP_9 ((uint32_t)0x00000200U) /*!< erase/program protection of sector 9 */
  194. #define OB_WP_10 ((uint32_t)0x00000400U) /*!< erase/program protection of sector 10 */
  195. #define OB_WP_11 ((uint32_t)0x00000800U) /*!< erase/program protection of sector 11 */
  196. #define OB_WP_12 ((uint32_t)0x00001000U) /*!< erase/program protection of sector 12 */
  197. #define OB_WP_13 ((uint32_t)0x00002000U) /*!< erase/program protection of sector 13 */
  198. #define OB_WP_14 ((uint32_t)0x00004000U) /*!< erase/program protection of sector 14 */
  199. #define OB_WP_15 ((uint32_t)0x00008000U) /*!< erase/program protection of sector 15 */
  200. #define OB_WP_16 ((uint32_t)0x00010000U) /*!< erase/program protection of sector 16 */
  201. #define OB_WP_17 ((uint32_t)0x00020000U) /*!< erase/program protection of sector 17 */
  202. #define OB_WP_18 ((uint32_t)0x00040000U) /*!< erase/program protection of sector 18 */
  203. #define OB_WP_19 ((uint32_t)0x00080000U) /*!< erase/program protection of sector 19 */
  204. #define OB_WP_20 ((uint32_t)0x00100000U) /*!< erase/program protection of sector 20 */
  205. #define OB_WP_21 ((uint32_t)0x00200000U) /*!< erase/program protection of sector 21 */
  206. #define OB_WP_22 ((uint32_t)0x00400000U) /*!< erase/program protection of sector 22 */
  207. #define OB_WP_23 ((uint32_t)0x00800000U) /*!< erase/program protection of sector 23 */
  208. #define OB_WP_24 ((uint32_t)0x01000000U) /*!< erase/program protection of sector 24 */
  209. #define OB_WP_25 ((uint32_t)0x02000000U) /*!< erase/program protection of sector 25 */
  210. #define OB_WP_26 ((uint32_t)0x04000000U) /*!< erase/program protection of sector 26 */
  211. #define OB_WP_27 ((uint32_t)0x08000000U) /*!< erase/program protection of sector 27 */
  212. #define OB_WP_28 ((uint32_t)0x10000000U) /*!< erase/program protection of sector 28 */
  213. #define OB_WP_29 ((uint32_t)0x20000000U) /*!< erase/program protection of sector 29 */
  214. #define OB_WP_30 ((uint32_t)0x40000000U) /*!< erase/program protection of sector 30 */
  215. #define OB_WP_31 ((uint32_t)0x80000000U) /*!< erase/program protection of sector 31 */
  216. #define OB_WP_ALL ((uint32_t)0xFFFFFFFFU) /*!< erase/program protection of all sectors */
  217. /* FMC timeout */
  218. #define FMC_TIMEOUT_COUNT ((uint32_t)0x000F0000U) /*!< FMC timeout count value */
  219. /* FMC BANK address */
  220. #define FMC_BANK0_END_ADDRESS ((uint32_t)0x0807FFFFU) /*!< FMC bank0 end address */
  221. #define FMC_BANK0_SIZE ((uint32_t)0x00000200U) /*!< FMC bank0 size */
  222. #define FMC_SIZE (*(uint16_t *)0x1FFFF7E0U) /*!< FMC size */
  223. /* function declarations */
  224. /* FMC main memory programming functions */
  225. /* set the FMC wait state counter */
  226. void fmc_wscnt_set(uint32_t wscnt);
  227. /* unlock the main FMC operation */
  228. void fmc_unlock(void);
  229. /* unlock the FMC bank0 operation */
  230. void fmc_bank0_unlock(void);
  231. /* unlock the FMC bank1 operation */
  232. void fmc_bank1_unlock(void);
  233. /* lock the main FMC operation */
  234. void fmc_lock(void);
  235. /* lock the bank0 FMC operation */
  236. void fmc_bank0_lock(void);
  237. /* lock the bank1 FMC operation */
  238. void fmc_bank1_lock(void);
  239. /* FMC erase page */
  240. fmc_state_enum fmc_page_erase(uint32_t page_address);
  241. /* FMC erase whole chip */
  242. fmc_state_enum fmc_mass_erase(void);
  243. /* FMC erase whole bank0 */
  244. fmc_state_enum fmc_bank0_erase(void);
  245. /* FMC erase whole bank1 */
  246. fmc_state_enum fmc_bank1_erase(void);
  247. /* FMC program a word at the corresponding address */
  248. fmc_state_enum fmc_word_program(uint32_t address, uint32_t data);
  249. /* FMC program a half word at the corresponding address */
  250. fmc_state_enum fmc_halfword_program(uint32_t address, uint16_t data);
  251. /* FMC option bytes programming functions */
  252. /* unlock the option byte operation */
  253. void ob_unlock(void);
  254. /* lock the option byte operation */
  255. void ob_lock(void);
  256. /* erase the option byte */
  257. fmc_state_enum ob_erase(void);
  258. /* enable write protect */
  259. fmc_state_enum ob_write_protection_enable(uint32_t ob_wp);
  260. /* configure the option byte security protection */
  261. fmc_state_enum ob_security_protection_config(uint8_t ob_spc);
  262. /* write the FMC option byte */
  263. fmc_state_enum ob_user_write(uint8_t ob_fwdgt, uint8_t ob_deepsleep, uint8_t ob_stdby, uint8_t ob_boot);
  264. /* program option bytes data */
  265. fmc_state_enum ob_data_program(uint32_t address, uint8_t data);
  266. /* get the FMC option byte user */
  267. uint8_t ob_user_get(void);
  268. /* get OB_DATA in register FMC_OBSTAT */
  269. uint16_t ob_data_get(void);
  270. /* get the FMC option byte write protection */
  271. uint32_t ob_write_protection_get(void);
  272. /* get option byte security protection code value */
  273. FlagStatus ob_spc_get(void);
  274. /* FMC interrupts and flags management functions */
  275. /* enable FMC interrupt */
  276. void fmc_interrupt_enable(uint32_t interrupt);
  277. /* disable FMC interrupt */
  278. void fmc_interrupt_disable(uint32_t interrupt);
  279. /* check flag is set or not */
  280. FlagStatus fmc_flag_get(uint32_t flag);
  281. /* clear the FMC flag */
  282. void fmc_flag_clear(uint32_t flag);
  283. /* get FMC interrupt flag state */
  284. FlagStatus fmc_interrupt_flag_get(fmc_interrupt_flag_enum flag);
  285. /* clear FMC interrupt flag state */
  286. void fmc_interrupt_flag_clear(fmc_interrupt_flag_enum flag);
  287. /* return the FMC bank0 state */
  288. fmc_state_enum fmc_bank0_state_get(void);
  289. /* return the FMC bank1 state */
  290. fmc_state_enum fmc_bank1_state_get(void);
  291. /* check FMC bank0 ready or not */
  292. fmc_state_enum fmc_bank0_ready_wait(uint32_t timeout);
  293. /* check FMC bank1 ready or not */
  294. fmc_state_enum fmc_bank1_ready_wait(uint32_t timeout);
  295. #endif /* GD32F30X_FMC_H */