stm32f4xx_qspi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_qspi.h
  4. * @author MCD Application Team
  5. * @version V1.8.1
  6. * @date 27-January-2022
  7. * @brief This file contains all the functions prototypes for the QSPI
  8. * firmware library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * Copyright (c) 2016 STMicroelectronics.
  13. * All rights reserved.
  14. *
  15. * This software is licensed under terms that can be found in the LICENSE file
  16. * in the root directory of this software component.
  17. * If no LICENSE file comes with this software, it is provided AS-IS.
  18. *
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F4XX_QUADSPI_H
  23. #define __STM32F4XX_QUADSPI_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f4xx.h"
  29. /** @addtogroup STM32F4xx_StdPeriph_Driver
  30. * @{
  31. */
  32. /** @addtogroup QSPI
  33. * @{
  34. */
  35. #if defined(STM32F412xG) || defined(STM32F413_423xx) || defined(STM32F446xx) || defined(STM32F469_479xx)
  36. /* Exported types ------------------------------------------------------------*/
  37. /**
  38. * @brief QSPI Communication Configuration Init structure definition
  39. */
  40. typedef struct
  41. {
  42. uint32_t QSPI_ComConfig_FMode; /* Specifies the Functional Mode
  43. This parameter can be a value of @ref QSPI_ComConfig_Functional_Mode*/
  44. uint32_t QSPI_ComConfig_DDRMode; /* Specifies the Double Data Rate Mode
  45. This parameter can be a value of @ref QSPI_ComConfig_DoubleDataRateMode*/
  46. uint32_t QSPI_ComConfig_DHHC; /* Specifies the Delay Half Hclk Cycle
  47. This parameter can be a value of @ref QSPI_ComConfig_DelayHalfHclkCycle*/
  48. uint32_t QSPI_ComConfig_SIOOMode; /* Specifies the Send Instruction Only Once Mode
  49. This parameter can be a value of @ref QSPI_ComConfig_SendInstructionOnlyOnceMode*/
  50. uint32_t QSPI_ComConfig_DMode; /* Specifies the Data Mode
  51. This parameter can be a value of @ref QSPI_ComConfig_DataMode*/
  52. uint32_t QSPI_ComConfig_DummyCycles; /* Specifies the Number of Dummy Cycles.
  53. This parameter can be a number between 0x00 and 0x1F */
  54. uint32_t QSPI_ComConfig_ABSize; /* Specifies the Alternate Bytes Size
  55. This parameter can be a value of @ref QSPI_ComConfig_AlternateBytesSize*/
  56. uint32_t QSPI_ComConfig_ABMode; /* Specifies the Alternate Bytes Mode
  57. This parameter can be a value of @ref QSPI_ComConfig_AlternateBytesMode*/
  58. uint32_t QSPI_ComConfig_ADSize; /* Specifies the Address Size
  59. This parameter can be a value of @ref QSPI_ComConfig_AddressSize*/
  60. uint32_t QSPI_ComConfig_ADMode; /* Specifies the Address Mode
  61. This parameter can be a value of @ref QSPI_ComConfig_AddressMode*/
  62. uint32_t QSPI_ComConfig_IMode; /* Specifies the Instruction Mode
  63. This parameter can be a value of @ref QSPI_ComConfig_InstructionMode*/
  64. uint32_t QSPI_ComConfig_Ins; /* Specifies the Instruction Mode
  65. This parameter can be a value of @ref QSPI_ComConfig_Instruction*/
  66. }QSPI_ComConfig_InitTypeDef;
  67. /**
  68. * @brief QSPI Init structure definition
  69. */
  70. typedef struct
  71. {
  72. uint32_t QSPI_SShift; /* Specifies the Sample Shift
  73. This parameter can be a value of @ref QSPI_Sample_Shift*/
  74. uint32_t QSPI_Prescaler; /* Specifies the prescaler value used to divide the QSPI clock.
  75. This parameter can be a number between 0x00 and 0xFF */
  76. uint32_t QSPI_CKMode; /* Specifies the Clock Mode
  77. This parameter can be a value of @ref QSPI_Clock_Mode*/
  78. uint32_t QSPI_CSHTime; /* Specifies the Chip Select High Time
  79. This parameter can be a value of @ref QSPI_ChipSelectHighTime*/
  80. uint32_t QSPI_FSize; /* Specifies the Flash Size.
  81. QSPI_FSize+1 is effectively the number of address bits required to address the flash memory.
  82. The flash capacity can be up to 4GB (addressed using 32 bits) in indirect mode, but the
  83. addressable space in memory-mapped mode is limited to 512MB
  84. This parameter can be a number between 0x00 and 0x1F */
  85. uint32_t QSPI_FSelect; /* Specifies the Flash which will be used,
  86. This parameter can be a value of @ref QSPI_Fash_Select*/
  87. uint32_t QSPI_DFlash; /* Specifies the Dual Flash Mode State
  88. This parameter can be a value of @ref QSPI_Dual_Flash*/
  89. }QSPI_InitTypeDef;
  90. /* Exported constants --------------------------------------------------------*/
  91. /** @defgroup QSPI_Exported_Constants
  92. * @{
  93. */
  94. /** @defgroup QSPI_Sample_Shift
  95. * @{
  96. */
  97. #define QSPI_SShift_NoShift ((uint32_t)0x00000000)
  98. #define QSPI_SShift_HalfCycleShift ((uint32_t)QUADSPI_CR_SSHIFT)
  99. #define IS_QSPI_SSHIFT(SSHIFT) (((SSHIFT) == QSPI_SShift_NoShift) || ((SSHIFT) == QSPI_SShift_HalfCycleShift))
  100. /* Legacy Defines */
  101. #define QUADSPI_CR_SSHIFT_0 QUADSPI_CR_SSHIFT
  102. /**
  103. * @}
  104. */
  105. /** @defgroup QSPI_Prescaler
  106. * @{
  107. */
  108. #define IS_QSPI_PRESCALER(PRESCALER) (((PRESCALER) <= 0xFF))
  109. /**
  110. * @}
  111. */
  112. /** @defgroup QSPI_Clock_Mode
  113. * @{
  114. */
  115. #define QSPI_CKMode_Mode0 ((uint32_t)0x00000000)
  116. #define QSPI_CKMode_Mode3 ((uint32_t)QUADSPI_DCR_CKMODE)
  117. #define IS_QSPI_CKMODE(CKMode) (((CKMode) == QSPI_CKMode_Mode0) || ((CKMode) == QSPI_CKMode_Mode3))
  118. /**
  119. * @}
  120. */
  121. /** @defgroup QSPI_ChipSelectHighTime
  122. * @{
  123. */
  124. #define QSPI_CSHTime_1Cycle ((uint32_t)0x00000000)
  125. #define QSPI_CSHTime_2Cycle ((uint32_t)QUADSPI_DCR_CSHT_0)
  126. #define QSPI_CSHTime_3Cycle ((uint32_t)QUADSPI_DCR_CSHT_1)
  127. #define QSPI_CSHTime_4Cycle ((uint32_t)QUADSPI_DCR_CSHT_0 | QUADSPI_DCR_CSHT_1)
  128. #define QSPI_CSHTime_5Cycle ((uint32_t)QUADSPI_DCR_CSHT_2)
  129. #define QSPI_CSHTime_6Cycle ((uint32_t)QUADSPI_DCR_CSHT_2 | QUADSPI_DCR_CSHT_0)
  130. #define QSPI_CSHTime_7Cycle ((uint32_t)QUADSPI_DCR_CSHT_2 | QUADSPI_DCR_CSHT_1)
  131. #define QSPI_CSHTime_8Cycle ((uint32_t)QUADSPI_DCR_CSHT)
  132. #define IS_QSPI_CSHTIME(CSHTIME) (((CSHTIME) == QSPI_CSHTime_1Cycle) || \
  133. ((CSHTIME) == QSPI_CSHTime_2Cycle) || \
  134. ((CSHTIME) == QSPI_CSHTime_3Cycle) || \
  135. ((CSHTIME) == QSPI_CSHTime_4Cycle) || \
  136. ((CSHTIME) == QSPI_CSHTime_5Cycle) || \
  137. ((CSHTIME) == QSPI_CSHTime_6Cycle) || \
  138. ((CSHTIME) == QSPI_CSHTime_7Cycle) || \
  139. ((CSHTIME) == QSPI_CSHTime_8Cycle))
  140. /**
  141. * @}
  142. */
  143. /** @defgroup QSPI_Flash_Size
  144. * @{
  145. */
  146. #define IS_QSPI_FSIZE(FSIZE) (((FSIZE) <= 0x1F))
  147. /**
  148. * @}
  149. */
  150. /** @defgroup QSPI_Fash_Select
  151. * @{
  152. */
  153. #define QSPI_FSelect_1 ((uint32_t)0x00000000)
  154. #define QSPI_FSelect_2 ((uint32_t)QUADSPI_CR_FSEL)
  155. #define IS_QSPI_FSEL(FLA) (((FLA) == QSPI_FSelect_1) || ((FLA) == QSPI_FSelect_2))
  156. /**
  157. * @}
  158. */
  159. /** @defgroup QSPI_Dual_Flash
  160. * @{
  161. */
  162. #define QSPI_DFlash_Disable ((uint32_t)0x00000000)
  163. #define QSPI_DFlash_Enable ((uint32_t)QUADSPI_CR_DFM)
  164. #define IS_QSPI_DFM(FLA) (((FLA) == QSPI_DFlash_Enable) || ((FLA) == QSPI_DFlash_Disable))
  165. /**
  166. * @}
  167. */
  168. /** @defgroup QSPI_ComConfig_Functional_Mode
  169. * @{
  170. */
  171. #define QSPI_ComConfig_FMode_Indirect_Write ((uint32_t)0x00000000)
  172. #define QSPI_ComConfig_FMode_Indirect_Read ((uint32_t)QUADSPI_CCR_FMODE_0)
  173. #define QSPI_ComConfig_FMode_Auto_Polling ((uint32_t)QUADSPI_CCR_FMODE_1)
  174. #define QSPI_ComConfig_FMode_Memory_Mapped ((uint32_t)QUADSPI_CCR_FMODE)
  175. #define IS_QSPI_FMODE(FMODE) (((FMODE) == QSPI_ComConfig_FMode_Indirect_Write) || \
  176. ((FMODE) == QSPI_ComConfig_FMode_Indirect_Read) || \
  177. ((FMODE) == QSPI_ComConfig_FMode_Auto_Polling) || \
  178. ((FMODE) == QSPI_ComConfig_FMode_Memory_Mapped))
  179. /**
  180. * @}
  181. */
  182. /** @defgroup QSPI_ComConfig_DoubleDataRateMode
  183. * @{
  184. */
  185. #define QSPI_ComConfig_DDRMode_Disable ((uint32_t)0x00000000)
  186. #define QSPI_ComConfig_DDRMode_Enable ((uint32_t)QUADSPI_CCR_DDRM)
  187. #define IS_QSPI_DDRMODE(DDRMODE) (((DDRMODE) == QSPI_ComConfig_DDRMode_Disable) || \
  188. ((DDRMODE) == QSPI_ComConfig_DDRMode_Enable))
  189. /**
  190. * @}
  191. */
  192. /** @defgroup QSPI_ComConfig_DelayHalfHclkCycle
  193. * @{
  194. */
  195. #define QSPI_ComConfig_DHHC_Disable ((uint32_t)0x00000000)
  196. #define QSPI_ComConfig_DHHC_Enable ((uint32_t)QUADSPI_CCR_DHHC)
  197. #define IS_QSPI_DHHC(DHHC) (((DHHC) == QSPI_ComConfig_DHHC_Disable) || \
  198. ((DHHC) == QSPI_ComConfig_DHHC_Enable))
  199. /**
  200. * @}
  201. */
  202. /** @defgroup QSPI_ComConfig_SendInstructionOnlyOnceMode
  203. * @{
  204. */
  205. #define QSPI_ComConfig_SIOOMode_Disable ((uint32_t)0x00000000)
  206. #define QSPI_ComConfig_SIOOMode_Enable ((uint32_t)QUADSPI_CCR_SIOO)
  207. #define IS_QSPI_SIOOMODE(SIOOMODE) (((SIOOMODE) == QSPI_ComConfig_SIOOMode_Disable) || \
  208. ((SIOOMODE) == QSPI_ComConfig_SIOOMode_Enable))
  209. /**
  210. * @}
  211. */
  212. /** @defgroup QSPI_ComConfig_DataMode
  213. * @{
  214. */
  215. #define QSPI_ComConfig_DMode_NoData ((uint32_t)0x00000000)
  216. #define QSPI_ComConfig_DMode_1Line ((uint32_t)QUADSPI_CCR_DMODE_0)
  217. #define QSPI_ComConfig_DMode_2Line ((uint32_t)QUADSPI_CCR_DMODE_1)
  218. #define QSPI_ComConfig_DMode_4Line ((uint32_t)QUADSPI_CCR_DMODE)
  219. #define IS_QSPI_DMODE(DMODE) (((DMODE) == QSPI_ComConfig_DMode_NoData) || \
  220. ((DMODE) == QSPI_ComConfig_DMode_1Line) || \
  221. ((DMODE) == QSPI_ComConfig_DMode_2Line) || \
  222. ((DMODE) == QSPI_ComConfig_DMode_4Line))
  223. /**
  224. * @}
  225. */
  226. /** @defgroup QSPI_ComConfig_AlternateBytesSize
  227. * @{
  228. */
  229. #define QSPI_ComConfig_ABSize_8bit ((uint32_t)0x00000000)
  230. #define QSPI_ComConfig_ABSize_16bit ((uint32_t)QUADSPI_CCR_ABSIZE_0)
  231. #define QSPI_ComConfig_ABSize_24bit ((uint32_t)QUADSPI_CCR_ABSIZE_1)
  232. #define QSPI_ComConfig_ABSize_32bit ((uint32_t)QUADSPI_CCR_ABSIZE)
  233. #define IS_QSPI_ABSIZE(ABSIZE) (((ABSIZE) == QSPI_ComConfig_ABSize_8bit) || \
  234. ((ABSIZE) == QSPI_ComConfig_ABSize_16bit) || \
  235. ((ABSIZE) == QSPI_ComConfig_ABSize_24bit) || \
  236. ((ABSIZE) == QSPI_ComConfig_ABSize_32bit))
  237. /**
  238. * @}
  239. */
  240. /** @defgroup QSPI_ComConfig_AlternateBytesMode
  241. * @{
  242. */
  243. #define QSPI_ComConfig_ABMode_NoAlternateByte ((uint32_t)0x00000000)
  244. #define QSPI_ComConfig_ABMode_1Line ((uint32_t)QUADSPI_CCR_ABMODE_0)
  245. #define QSPI_ComConfig_ABMode_2Line ((uint32_t)QUADSPI_CCR_ABMODE_1)
  246. #define QSPI_ComConfig_ABMode_4Line ((uint32_t)QUADSPI_CCR_ABMODE)
  247. #define IS_QSPI_ABMODE(ABMODE) (((ABMODE) == QSPI_ComConfig_ABMode_NoAlternateByte) || \
  248. ((ABMODE) == QSPI_ComConfig_ABMode_1Line) || \
  249. ((ABMODE) == QSPI_ComConfig_ABMode_2Line) || \
  250. ((ABMODE) == QSPI_ComConfig_ABMode_4Line))
  251. /**
  252. * @}
  253. */
  254. /** @defgroup QSPI_ComConfig_AddressSize
  255. * @{
  256. */
  257. #define QSPI_ComConfig_ADSize_8bit ((uint32_t)0x00000000)
  258. #define QSPI_ComConfig_ADSize_16bit ((uint32_t)QUADSPI_CCR_ADSIZE_0)
  259. #define QSPI_ComConfig_ADSize_24bit ((uint32_t)QUADSPI_CCR_ADSIZE_1)
  260. #define QSPI_ComConfig_ADSize_32bit ((uint32_t)QUADSPI_CCR_ADSIZE)
  261. #define IS_QSPI_ADSIZE(ADSIZE) (((ADSIZE) == QSPI_ComConfig_ADSize_8bit) || \
  262. ((ADSIZE) == QSPI_ComConfig_ADSize_16bit) || \
  263. ((ADSIZE) == QSPI_ComConfig_ADSize_24bit) || \
  264. ((ADSIZE) == QSPI_ComConfig_ADSize_32bit))
  265. /**
  266. * @}
  267. */
  268. /** @defgroup QSPI_ComConfig_AddressMode
  269. * @{
  270. */
  271. #define QSPI_ComConfig_ADMode_NoAddress ((uint32_t)0x00000000)
  272. #define QSPI_ComConfig_ADMode_1Line ((uint32_t)QUADSPI_CCR_ADMODE_0)
  273. #define QSPI_ComConfig_ADMode_2Line ((uint32_t)QUADSPI_CCR_ADMODE_1)
  274. #define QSPI_ComConfig_ADMode_4Line ((uint32_t)QUADSPI_CCR_ADMODE)
  275. #define IS_QSPI_ADMODE(ADMODE) (((ADMODE) == QSPI_ComConfig_ADMode_NoAddress) || \
  276. ((ADMODE) == QSPI_ComConfig_ADMode_1Line) || \
  277. ((ADMODE) == QSPI_ComConfig_ADMode_2Line) || \
  278. ((ADMODE) == QSPI_ComConfig_ADMode_4Line))
  279. /**
  280. * @}
  281. */
  282. /** @defgroup QSPI_ComConfig_InstructionMode
  283. * @{
  284. */
  285. #define QSPI_ComConfig_IMode_NoInstruction ((uint32_t)0x00000000)
  286. #define QSPI_ComConfig_IMode_1Line ((uint32_t)QUADSPI_CCR_IMODE_0)
  287. #define QSPI_ComConfig_IMode_2Line ((uint32_t)QUADSPI_CCR_IMODE_1)
  288. #define QSPI_ComConfig_IMode_4Line ((uint32_t)QUADSPI_CCR_IMODE)
  289. #define IS_QSPI_IMODE(IMODE) (((IMODE) == QSPI_ComConfig_IMode_NoInstruction) || \
  290. ((IMODE) == QSPI_ComConfig_IMode_1Line) || \
  291. ((IMODE) == QSPI_ComConfig_IMode_2Line) || \
  292. ((IMODE) == QSPI_ComConfig_IMode_4Line))
  293. /**
  294. * @}
  295. */
  296. /** @defgroup QSPI_ComConfig_Instruction
  297. * @{
  298. */
  299. #define IS_QSPI_INSTRUCTION(INSTRUCTION) ((INSTRUCTION) <= 0xFF)
  300. /**
  301. * @}
  302. */
  303. /** @defgroup QSPI_InterruptsDefinition
  304. * @{
  305. */
  306. #define QSPI_IT_TO (uint32_t)(QUADSPI_CR_TOIE | QUADSPI_SR_TOF)
  307. #define QSPI_IT_SM (uint32_t)(QUADSPI_CR_SMIE | QUADSPI_SR_SMF)
  308. #define QSPI_IT_FT (uint32_t)(QUADSPI_CR_FTIE | QUADSPI_SR_FTF)
  309. #define QSPI_IT_TC (uint32_t)(QUADSPI_CR_TCIE | QUADSPI_SR_TCF)
  310. #define QSPI_IT_TE (uint32_t)(QUADSPI_CR_TEIE | QUADSPI_SR_TEF)
  311. #define IS_QSPI_IT(IT) ((((IT) & 0xFFE0FFE0) == 0) && ((IT) != 0))
  312. #define IS_QSPI_CLEAR_IT(IT) ((((IT) & 0xFFE4FFE4) == 0) && ((IT) != 0))
  313. /**
  314. * @}
  315. */
  316. /** @defgroup QSPI_FlagsDefinition
  317. * @{
  318. */
  319. #define QSPI_FLAG_TO QUADSPI_SR_TOF
  320. #define QSPI_FLAG_SM QUADSPI_SR_SMF
  321. #define QSPI_FLAG_FT QUADSPI_SR_FTF
  322. #define QSPI_FLAG_TC QUADSPI_SR_TCF
  323. #define QSPI_FLAG_TE QUADSPI_SR_TEF
  324. #define QSPI_FLAG_BUSY QUADSPI_SR_BUSY
  325. #define IS_QSPI_GET_FLAG(FLAG) (((FLAG) == QSPI_FLAG_TO) || ((FLAG) == QSPI_FLAG_SM) || \
  326. ((FLAG) == QSPI_FLAG_FT) || ((FLAG) == QSPI_FLAG_TC) || \
  327. ((FLAG) == QSPI_FLAG_TE) || ((FLAG) == QSPI_FLAG_BUSY))
  328. #define IS_QSPI_CLEAR_FLAG(FLAG) (((FLAG) == QSPI_FLAG_TO) || ((FLAG) == QSPI_FLAG_SM) || \
  329. ((FLAG) == QSPI_FLAG_TC) || ((FLAG) == QSPI_FLAG_TE))
  330. /**
  331. * @}
  332. */
  333. /** @defgroup QSPI_Polling_Match_Mode
  334. * @{
  335. */
  336. #define QSPI_PMM_AND ((uint32_t)0x00000000)
  337. #define QSPI_PMM_OR ((uint32_t)QUADSPI_CR_PMM)
  338. #define IS_QSPI_PMM(PMM) (((PMM) == QSPI_PMM_AND) || ((PMM) == QSPI_PMM_OR))
  339. /**
  340. * @}
  341. */
  342. /** @defgroup QSPI_Polling_Interval
  343. * @{
  344. */
  345. #define IS_QSPI_PIR(PIR) ((PIR) <= QUADSPI_PIR_INTERVAL)
  346. /**
  347. * @}
  348. */
  349. /** @defgroup QSPI_Timeout
  350. * @{
  351. */
  352. #define IS_QSPI_TIMEOUT(TIMEOUT) ((TIMEOUT) <= QUADSPI_LPTR_TIMEOUT)
  353. /**
  354. * @}
  355. */
  356. /** @defgroup QSPI_DummyCycle
  357. * @{
  358. */
  359. #define IS_QSPI_DCY(DCY) ((DCY) <= 0x1F)
  360. /**
  361. * @}
  362. */
  363. /** @defgroup QSPI_FIFOThreshold
  364. * @{
  365. */
  366. #define IS_QSPI_FIFOTHRESHOLD(FIFOTHRESHOLD) ((FIFOTHRESHOLD) <= 0x0F)
  367. /**
  368. * @}
  369. */
  370. /**
  371. * @}
  372. */
  373. /* Exported macro ------------------------------------------------------------*/
  374. /* Exported functions ------------------------------------------------------- */
  375. /* Initialization and Configuration functions *********************************/
  376. void QSPI_DeInit(void);
  377. void QSPI_Init(QSPI_InitTypeDef* QSPI_InitStruct);
  378. void QSPI_StructInit(QSPI_InitTypeDef* QSPI_InitStruct);
  379. void QSPI_ComConfig_Init(QSPI_ComConfig_InitTypeDef* QSPI_ComConfig_InitStruct);
  380. void QSPI_ComConfig_StructInit(QSPI_ComConfig_InitTypeDef* QSPI_ComConfig_InitStruct);
  381. void QSPI_Cmd(FunctionalState NewState);
  382. void QSPI_AutoPollingMode_Config(uint32_t QSPI_Match, uint32_t QSPI_Mask , uint32_t QSPI_Match_Mode);
  383. void QSPI_AutoPollingMode_SetInterval(uint32_t QSPI_Interval);
  384. void QSPI_MemoryMappedMode_SetTimeout(uint32_t QSPI_Timeout);
  385. void QSPI_SetAddress(uint32_t QSPI_Address);
  386. void QSPI_SetAlternateByte(uint32_t QSPI_AlternateByte);
  387. void QSPI_SetFIFOThreshold(uint32_t QSPI_FIFOThreshold);
  388. void QSPI_SetDataLength(uint32_t QSPI_DataLength);
  389. void QSPI_TimeoutCounterCmd(FunctionalState NewState);
  390. void QSPI_AutoPollingModeStopCmd(FunctionalState NewState);
  391. void QSPI_AbortRequest(void);
  392. void QSPI_DualFlashMode_Cmd(FunctionalState NewState);
  393. /* Data transfers functions ***************************************************/
  394. void QSPI_SendData8(uint8_t Data);
  395. void QSPI_SendData16(uint16_t Data);
  396. void QSPI_SendData32(uint32_t Data);
  397. uint8_t QSPI_ReceiveData8(void);
  398. uint16_t QSPI_ReceiveData16(void);
  399. uint32_t QSPI_ReceiveData32(void);
  400. /* DMA transfers management functions *****************************************/
  401. void QSPI_DMACmd(FunctionalState NewState);
  402. /* Interrupts and flags management functions **********************************/
  403. void QSPI_ITConfig(uint32_t QSPI_IT, FunctionalState NewState);
  404. uint32_t QSPI_GetFIFOLevel(void);
  405. FlagStatus QSPI_GetFlagStatus(uint32_t QSPI_FLAG);
  406. void QSPI_ClearFlag(uint32_t QSPI_FLAG);
  407. ITStatus QSPI_GetITStatus(uint32_t QSPI_IT);
  408. void QSPI_ClearITPendingBit(uint32_t QSPI_IT);
  409. uint32_t QSPI_GetFMode(void);
  410. #endif /* STM32F412xG || STM32F413_423xx || STM32F446xx || STM32F469_479xx */
  411. /**
  412. * @}
  413. */
  414. /**
  415. * @}
  416. */
  417. #ifdef __cplusplus
  418. }
  419. #endif
  420. #endif /*__STM32F4XX_QUADSPI_H */