fsl_flexspi.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef __FSL_FLEXSPI_H_
  35. #define __FSL_FLEXSPI_H_
  36. #include <stddef.h>
  37. #include "fsl_device_registers.h"
  38. #include "fsl_common.h"
  39. /*!
  40. * @addtogroup flexspi
  41. * @{
  42. */
  43. /*******************************************************************************
  44. * Definitions
  45. ******************************************************************************/
  46. /*! @name Driver version */
  47. /*@{*/
  48. /*! @brief FLEXSPI driver version 2.0.2. */
  49. #define FSL_FLEXSPI_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
  50. /*@}*/
  51. #define FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNTn(0)
  52. /*! @breif Formula to form FLEXSPI instructions in LUT table. */
  53. #define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
  54. (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
  55. FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
  56. /*! @brief Status structure of FLEXSPI.*/
  57. enum _flexspi_status
  58. {
  59. kStatus_FLEXSPI_Busy = MAKE_STATUS(kStatusGroup_FLEXSPI, 0), /*!< FLEXSPI is busy */
  60. kStatus_FLEXSPI_SequenceExecutionTimeout = MAKE_STATUS(kStatusGroup_FLEXSPI, 1), /*!< Sequence execution timeout
  61. error occurred during FLEXSPI transfer. */
  62. kStatus_FLEXSPI_IpCommandSequenceError = MAKE_STATUS(kStatusGroup_FLEXSPI, 2), /*!< IP command Sequence execution
  63. timeout error occurred during FLEXSPI transfer. */
  64. kStatus_FLEXSPI_IpCommandGrantTimeout = MAKE_STATUS(kStatusGroup_FLEXSPI, 3), /*!< IP command grant timeout error
  65. occurred during FLEXSPI transfer. */
  66. };
  67. /*! @brief CMD definition of FLEXSPI, use to form LUT instruction. */
  68. enum _flexspi_command
  69. {
  70. kFLEXSPI_Command_STOP = 0x00U, /*!< Stop execution, deassert CS. */
  71. kFLEXSPI_Command_SDR = 0x01U, /*!< Transmit Command code to Flash, using SDR mode. */
  72. kFLEXSPI_Command_RADDR_SDR = 0x02U, /*!< Transmit Row Address to Flash, using SDR mode. */
  73. kFLEXSPI_Command_CADDR_SDR = 0x03U, /*!< Transmit Column Address to Flash, using SDR mode. */
  74. kFLEXSPI_Command_MODE1_SDR = 0x04U, /*!< Transmit 1-bit Mode bits to Flash, using SDR mode. */
  75. kFLEXSPI_Command_MODE2_SDR = 0x05U, /*!< Transmit 2-bit Mode bits to Flash, using SDR mode. */
  76. kFLEXSPI_Command_MODE4_SDR = 0x06U, /*!< Transmit 4-bit Mode bits to Flash, using SDR mode. */
  77. kFLEXSPI_Command_MODE8_SDR = 0x07U, /*!< Transmit 8-bit Mode bits to Flash, using SDR mode. */
  78. kFLEXSPI_Command_WRITE_SDR = 0x08U, /*!< Transmit Programming Data to Flash, using SDR mode. */
  79. kFLEXSPI_Command_READ_SDR = 0x09U, /*!< Receive Read Data from Flash, using SDR mode. */
  80. kFLEXSPI_Command_LEARN_SDR = 0x0AU, /*!< Receive Read Data or Preamble bit from Flash, SDR mode. */
  81. kFLEXSPI_Command_DATSZ_SDR = 0x0BU, /*!< Transmit Read/Program Data size (byte) to Flash, SDR mode. */
  82. kFLEXSPI_Command_DUMMY_SDR = 0x0CU, /*!< Leave data lines undriven by FlexSPI controller.*/
  83. kFLEXSPI_Command_DUMMY_RWDS_SDR = 0x0DU, /*!< Leave data lines undriven by FlexSPI controller,
  84. dummy cycles decided by RWDS. */
  85. kFLEXSPI_Command_DDR = 0x21U, /*!< Transmit Command code to Flash, using DDR mode. */
  86. kFLEXSPI_Command_RADDR_DDR = 0x22U, /*!< Transmit Row Address to Flash, using DDR mode. */
  87. kFLEXSPI_Command_CADDR_DDR = 0x23U, /*!< Transmit Column Address to Flash, using DDR mode. */
  88. kFLEXSPI_Command_MODE1_DDR = 0x24U, /*!< Transmit 1-bit Mode bits to Flash, using DDR mode. */
  89. kFLEXSPI_Command_MODE2_DDR = 0x25U, /*!< Transmit 2-bit Mode bits to Flash, using DDR mode. */
  90. kFLEXSPI_Command_MODE4_DDR = 0x26U, /*!< Transmit 4-bit Mode bits to Flash, using DDR mode. */
  91. kFLEXSPI_Command_MODE8_DDR = 0x27U, /*!< Transmit 8-bit Mode bits to Flash, using DDR mode. */
  92. kFLEXSPI_Command_WRITE_DDR = 0x28U, /*!< Transmit Programming Data to Flash, using DDR mode. */
  93. kFLEXSPI_Command_READ_DDR = 0x29U, /*!< Receive Read Data from Flash, using DDR mode. */
  94. kFLEXSPI_Command_LEARN_DDR = 0x2AU, /*!< Receive Read Data or Preamble bit from Flash, DDR mode. */
  95. kFLEXSPI_Command_DATSZ_DDR = 0x2BU, /*!< Transmit Read/Program Data size (byte) to Flash, DDR mode. */
  96. kFLEXSPI_Command_DUMMY_DDR = 0x2CU, /*!< Leave data lines undriven by FlexSPI controller.*/
  97. kFLEXSPI_Command_DUMMY_RWDS_DDR = 0x2DU, /*!< Leave data lines undriven by FlexSPI controller,
  98. dummy cycles decided by RWDS. */
  99. kFLEXSPI_Command_JUMP_ON_CS = 0x1FU, /*!< Stop execution, deassert CS and save operand[7:0] as the
  100. instruction start pointer for next sequence */
  101. };
  102. /*! @brief pad definition of FLEXSPI, use to form LUT instruction. */
  103. enum _flexspi_pad
  104. {
  105. kFLEXSPI_1PAD = 0x00U, /*!< Transmit command/address and transmit/receive data only through DATA0/DATA1. */
  106. kFLEXSPI_2PAD = 0x01U, /*!< Transmit command/address and transmit/receive data only through DATA[1:0]. */
  107. kFLEXSPI_4PAD = 0x02U, /*!< Transmit command/address and transmit/receive data only through DATA[3:0]. */
  108. kFLEXSPI_8PAD = 0x03U, /*!< Transmit command/address and transmit/receive data only through DATA[7:0]. */
  109. };
  110. /*! @brief FLEXSPI interrupt status flags.*/
  111. typedef enum _flexspi_flags
  112. {
  113. kFLEXSPI_SequenceExecutionTimeoutFlag = FLEXSPI_INTEN_SEQTIMEOUTEN_MASK, /*!< Sequence execution timeout. */
  114. kFLEXSPI_AhbBusTimeoutFlag = FLEXSPI_INTEN_AHBBUSTIMEOUTEN_MASK, /*!< AHB Bus timeout. */
  115. kFLEXSPI_SckStoppedBecauseTxEmptyFlag =
  116. FLEXSPI_INTEN_SCKSTOPBYWREN_MASK, /*!< SCK is stopped during command
  117. sequence because Async TX FIFO empty. */
  118. kFLEXSPI_SckStoppedBecauseRxFullFlag =
  119. FLEXSPI_INTEN_SCKSTOPBYRDEN_MASK, /*!< SCK is stopped during command
  120. sequence because Async RX FIFO full. */
  121. #if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) && (FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN))
  122. kFLEXSPI_DataLearningFailedFlag = FLEXSPI_INTEN_DATALEARNFAILEN_MASK, /*!< Data learning failed. */
  123. #endif
  124. kFLEXSPI_IpTxFifoWatermarkEmpltyFlag = FLEXSPI_INTEN_IPTXWEEN_MASK, /*!< IP TX FIFO WaterMark empty. */
  125. kFLEXSPI_IpRxFifoWatermarkAvailableFlag = FLEXSPI_INTEN_IPRXWAEN_MASK, /*!< IP RX FIFO WaterMark available. */
  126. kFLEXSPI_AhbCommandSequenceErrorFlag =
  127. FLEXSPI_INTEN_AHBCMDERREN_MASK, /*!< AHB triggered Command Sequences Error. */
  128. kFLEXSPI_IpCommandSequenceErrorFlag = FLEXSPI_INTEN_IPCMDERREN_MASK, /*!< IP triggered Command Sequences Error. */
  129. kFLEXSPI_AhbCommandGrantTimeoutFlag =
  130. FLEXSPI_INTEN_AHBCMDGEEN_MASK, /*!< AHB triggered Command Sequences Grant Timeout. */
  131. kFLEXSPI_IpCommandGrantTimeoutFlag =
  132. FLEXSPI_INTEN_IPCMDGEEN_MASK, /*!< IP triggered Command Sequences Grant Timeout. */
  133. kFLEXSPI_IpCommandExcutionDoneFlag =
  134. FLEXSPI_INTEN_IPCMDDONEEN_MASK, /*!< IP triggered Command Sequences Execution finished. */
  135. kFLEXSPI_AllInterruptFlags = 0xFFFU, /*!< All flags. */
  136. } flexspi_flags_t;
  137. /*! @brief FLEXSPI sample clock source selection for Flash Reading.*/
  138. typedef enum _flexspi_read_sample_clock
  139. {
  140. kFLEXSPI_ReadSampleClkLoopbackInternally = 0x0U, /*!< Dummy Read strobe generated by FlexSPI Controller
  141. and loopback internally. */
  142. kFLEXSPI_ReadSampleClkLoopbackFromDqsPad = 0x1U, /*!< Dummy Read strobe generated by FlexSPI Controller
  143. and loopback from DQS pad. */
  144. kFLEXSPI_ReadSampleClkLoopbackFromSckPad = 0x2U, /*!< SCK output clock and loopback from SCK pad. */
  145. kFLEXSPI_ReadSampleClkExternalInputFromDqsPad = 0x3U, /*!< Flash provided Read strobe and input from DQS pad. */
  146. } flexspi_read_sample_clock_t;
  147. /*! @brief FLEXSPI interval unit for flash device select.*/
  148. typedef enum _flexspi_cs_interval_cycle_unit
  149. {
  150. kFLEXSPI_CsIntervalUnit1SckCycle = 0x0U, /*!< Chip selection interval: CSINTERVAL * 1 serial clock cycle. */
  151. kFLEXSPI_CsIntervalUnit256SckCycle = 0x1U, /*!< Chip selection interval: CSINTERVAL * 256 serial clock cycle. */
  152. } flexspi_cs_interval_cycle_unit_t;
  153. /*! @brief FLEXSPI AHB wait interval unit for writting.*/
  154. typedef enum _flexspi_ahb_write_wait_unit
  155. {
  156. kFLEXSPI_AhbWriteWaitUnit2AhbCycle = 0x0U, /*!< AWRWAIT unit is 2 ahb clock cycle. */
  157. kFLEXSPI_AhbWriteWaitUnit8AhbCycle = 0x1U, /*!< AWRWAIT unit is 8 ahb clock cycle. */
  158. kFLEXSPI_AhbWriteWaitUnit32AhbCycle = 0x2U, /*!< AWRWAIT unit is 32 ahb clock cycle. */
  159. kFLEXSPI_AhbWriteWaitUnit128AhbCycle = 0x3U, /*!< AWRWAIT unit is 128 ahb clock cycle. */
  160. kFLEXSPI_AhbWriteWaitUnit512AhbCycle = 0x4U, /*!< AWRWAIT unit is 512 ahb clock cycle. */
  161. kFLEXSPI_AhbWriteWaitUnit2048AhbCycle = 0x5U, /*!< AWRWAIT unit is 2048 ahb clock cycle. */
  162. kFLEXSPI_AhbWriteWaitUnit8192AhbCycle = 0x6U, /*!< AWRWAIT unit is 8192 ahb clock cycle. */
  163. kFLEXSPI_AhbWriteWaitUnit32768AhbCycle = 0x7U, /*!< AWRWAIT unit is 32768 ahb clock cycle. */
  164. } flexspi_ahb_write_wait_unit_t;
  165. /*! @brief Error Code when IP command Error detected.*/
  166. typedef enum _flexspi_ip_error_code
  167. {
  168. kFLEXSPI_IpCmdErrorNoError = 0x0U, /*!< No error. */
  169. kFLEXSPI_IpCmdErrorJumpOnCsInIpCmd = 0x2U, /*!< IP command with JMP_ON_CS instruction used. */
  170. kFLEXSPI_IpCmdErrorUnknownOpCode = 0x3U, /*!< Unknown instruction opcode in the sequence. */
  171. kFLEXSPI_IpCmdErrorSdrDummyInDdrSequence = 0x4U, /*!< Instruction DUMMY_SDR/DUMMY_RWDS_SDR
  172. used in DDR sequence. */
  173. kFLEXSPI_IpCmdErrorDdrDummyInSdrSequence = 0x5U, /*!< Instruction DUMMY_DDR/DUMMY_RWDS_DDR
  174. used in SDR sequence. */
  175. kFLEXSPI_IpCmdErrorInvalidAddress = 0x6U, /*!< Flash access start address exceed the whole
  176. flash address range (A1/A2/B1/B2). */
  177. kFLEXSPI_IpCmdErrorSequenceExecutionTimeout = 0xEU, /*!< Sequence execution timeout. */
  178. kFLEXSPI_IpCmdErrorFlashBoundaryAcrosss = 0xFU, /*!< Flash boundary crossed. */
  179. } flexspi_ip_error_code_t;
  180. /*! @brief Error Code when AHB command Error detected.*/
  181. typedef enum _flexspi_ahb_error_code
  182. {
  183. kFLEXSPI_AhbCmdErrorNoError = 0x0U, /*!< No error. */
  184. kFLEXSPI_AhbCmdErrorJumpOnCsInWriteCmd = 0x2U, /*!< AHB Write command with JMP_ON_CS instruction
  185. used in the sequence. */
  186. kFLEXSPI_AhbCmdErrorUnknownOpCode = 0x3U, /*!< Unknown instruction opcode in the sequence. */
  187. kFLEXSPI_AhbCmdErrorSdrDummyInDdrSequence = 0x4U, /*!< Instruction DUMMY_SDR/DUMMY_RWDS_SDR used
  188. in DDR sequence. */
  189. kFLEXSPI_AhbCmdErrorDdrDummyInSdrSequence = 0x5U, /*!< Instruction DUMMY_DDR/DUMMY_RWDS_DDR
  190. used in SDR sequence. */
  191. kFLEXSPI_AhbCmdSequenceExecutionTimeout = 0x6U, /*!< Sequence execution timeout. */
  192. } flexspi_ahb_error_code_t;
  193. /*! @brief FLEXSPI operation port select.*/
  194. typedef enum _flexspi_port
  195. {
  196. kFLEXSPI_PortA1 = 0x0U, /*!< Access flash on A1 port. */
  197. kFLEXSPI_PortA2 = 0x1U, /*!< Access flash on A2 port. */
  198. kFLEXSPI_PortB1 = 0x2U, /*!< Access flash on B1 port. */
  199. kFLEXSPI_PortB2 = 0x3U, /*!< Access flash on B2 port. */
  200. } flexspi_port_t;
  201. /*! @brief Trigger source of current command sequence granted by arbitrator.*/
  202. typedef enum _flexspi_arb_command_source
  203. {
  204. kFLEXSPI_AhbReadCommand = 0x0U,
  205. kFLEXSPI_AhbWriteCommand = 0x1U,
  206. kFLEXSPI_IpCommand = 0x2U,
  207. kFLEXSPI_SuspendedCommand = 0x3U,
  208. } flexspi_arb_command_source_t;
  209. typedef enum _flexspi_command_type
  210. {
  211. kFLEXSPI_Command, /*!< FlexSPI operation: Only command, both TX and Rx buffer are ignored. */
  212. kFLEXSPI_Config, /*!< FlexSPI operation: Configure device mode, the TX fifo size is fixed in LUT. */
  213. kFLEXSPI_Read, /* /!< FlexSPI operation: Read, only Rx Buffer is effective. */
  214. kFLEXSPI_Write, /* /!< FlexSPI operation: Read, only Tx Buffer is effective. */
  215. } flexspi_command_type_t;
  216. typedef struct _flexspi_ahbBuffer_config
  217. {
  218. uint8_t priority; /*!< This priority for AHB Master Read which this AHB RX Buffer is assigned. */
  219. uint8_t masterIndex; /*!< AHB Master ID the AHB RX Buffer is assigned. */
  220. uint16_t bufferSize; /*!< AHB buffer size in byte. */
  221. bool enablePrefetch; /*!< AHB Read Prefetch Enable for current AHB RX Buffer corresponding Master, allows
  222. prefetch disable/enable seperately for each master. */
  223. } flexspi_ahbBuffer_config_t;
  224. /*! @brief FLEXSPI configuration structure. */
  225. typedef struct _flexspi_config
  226. {
  227. flexspi_read_sample_clock_t rxSampleClock; /*!< Sample Clock source selection for Flash Reading. */
  228. bool enableSckFreeRunning; /*!< Enable/disable SCK output free-running. */
  229. bool enableCombination; /*!< Enable/disable combining PORT A and B Data Pins
  230. (SIOA[3:0] and SIOB[3:0]) to support Flash Octal mode. */
  231. bool enableDoze; /*!< Enable/disable doze mode support. */
  232. bool enableHalfSpeedAccess; /*!< Enable/disable divide by 2 of the clock for half
  233. speed commands. */
  234. bool enableSckBDiffOpt; /*!< Enable/disable SCKB pad use as SCKA differential clock
  235. output, when enable, Port B flash access is not available. */
  236. bool enableSameConfigForAll; /*!< Enable/disable same configuration for all connected devices
  237. when enabled, same configuration in FLASHA1CRx is applied to all. */
  238. uint16_t seqTimeoutCycle; /*!< Timeout wait cycle for command sequence execution,
  239. timeout after ahbGrantTimeoutCyle*1024 serial root clock cycles. */
  240. uint8_t ipGrantTimeoutCycle; /*!< Timeout wait cycle for IP command grant, timeout after
  241. ipGrantTimeoutCycle*1024 AHB clock cycles. */
  242. uint8_t txWatermark; /*!< FLEXSPI IP transmit watermark value. */
  243. uint8_t rxWatermark; /*!< FLEXSPI receive watermark value. */
  244. struct
  245. {
  246. bool enableAHBWriteIpTxFifo; /*!< Enable AHB bus write access to IP TX FIFO. */
  247. bool enableAHBWriteIpRxFifo; /*!< Enable AHB bus write access to IP RX FIFO. */
  248. uint8_t ahbGrantTimeoutCycle; /*!< Timeout wait cycle for AHB command grant,
  249. timeout after ahbGrantTimeoutCyle*1024 AHB clock cycles. */
  250. uint16_t ahbBusTimeoutCycle; /*!< Timeout wait cycle for AHB read/write access,
  251. timeout after ahbBusTimeoutCycle*1024 AHB clock cycles. */
  252. uint8_t resumeWaitCycle; /*!< Wait cycle for idle state before suspended command sequence
  253. resume, timeout after ahbBusTimeoutCycle AHB clock cycles. */
  254. flexspi_ahbBuffer_config_t buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT]; /*!< AHB buffer size. */
  255. bool enableClearAHBBufferOpt; /*!< Enable/disable automatically clean AHB RX Buffer and TX Buffer
  256. when FLEXSPI returns STOP mode ACK. */
  257. bool enableReadAddressOpt; /*!< Enable/disable remove AHB read burst start address alignment limitation.
  258. when eanble, there is no AHB read burst start address alignment limitation. */
  259. bool enableAHBPrefetch; /*!< Enable/disable AHB read prefetch feature, when enabled, FLEXSPI
  260. will fetch more data than current AHB burst. */
  261. bool enableAHBBufferable; /*!< Enable/disable AHB bufferable write access support, when enabled,
  262. FLEXSPI return before waiting for command excution finished. */
  263. bool enableAHBCachable; /*!< Enable AHB bus cachable read access support. */
  264. } ahbConfig;
  265. } flexspi_config_t;
  266. /*! @brief External device configuration items. */
  267. typedef struct _flexspi_device_config
  268. {
  269. uint32_t flexspiRootClk; /*!< FLEXSPI serial root clock. */
  270. bool isSck2Enabled; /*!< FLEXSPI use SCK2. */
  271. uint32_t flashSize; /*!< Flash size in KByte. */
  272. flexspi_cs_interval_cycle_unit_t CSIntervalUnit; /*!< CS interval unit, 1 or 256 cycle. */
  273. uint16_t CSInterval; /*!< CS line assert interval, mutiply CS interval unit to
  274. get the CS line assert interval cycles. */
  275. uint8_t CSHoldTime; /*!< CS line hold time. */
  276. uint8_t CSSetupTime; /*!< CS line setup time. */
  277. uint8_t dataValidTime; /*!< Data valid time for external device. */
  278. uint8_t columnspace; /*!< Column space size. */
  279. bool enableWordAddress; /*!< If enable word address.*/
  280. uint8_t AWRSeqIndex; /*!< Sequence ID for AHB write command. */
  281. uint8_t AWRSeqNumber; /*!< Sequence number for AHB write command. */
  282. uint8_t ARDSeqIndex; /*!< Sequence ID for AHB read command. */
  283. uint8_t ARDSeqNumber; /*!< Sequence number for AHB read command. */
  284. flexspi_ahb_write_wait_unit_t AHBWriteWaitUnit; /*!< AHB write wait unit. */
  285. uint16_t AHBWriteWaitInterval; /*!< AHB write wait interval, mutiply AHB write interval
  286. unit to get the AHB write wait cycles. */
  287. bool enableWriteMask; /*!< Enable/Disable FLEXSPI drive DQS pin as write mask
  288. when writing to external device. */
  289. } flexspi_device_config_t;
  290. /*! @brief Transfer structure for FLEXSPI. */
  291. typedef struct _flexspi_transfer
  292. {
  293. uint32_t deviceAddress; /*!< Operation device address. */
  294. flexspi_port_t port; /*!< Operation port. */
  295. flexspi_command_type_t cmdType; /*!< Execution command type. */
  296. uint8_t seqIndex; /*!< Sequence ID for command. */
  297. uint8_t SeqNumber; /*!< Sequence number for command. */
  298. uint32_t *data; /*!< Data buffer. */
  299. size_t dataSize; /*!< Data size in bytes. */
  300. } flexspi_transfer_t;
  301. /* Forward declaration of the handle typedef. */
  302. typedef struct _flexspi_handle flexspi_handle_t;
  303. /*! @brief FLEXSPI transfer callback function. */
  304. typedef void (*flexspi_transfer_callback_t)(FLEXSPI_Type *base,
  305. flexspi_handle_t *handle,
  306. status_t status,
  307. void *userData);
  308. /*! @brief Transfer handle structure for FLEXSPI. */
  309. struct _flexspi_handle
  310. {
  311. uint32_t state; /*!< Internal state for FLEXSPI transfer */
  312. uint32_t *data; /*!< Data buffer. */
  313. size_t dataSize; /*!< Remaining Data size in bytes. */
  314. size_t transferTotalSize; /*!< Total Data size in bytes. */
  315. flexspi_transfer_callback_t completionCallback; /*!< Callback for users while transfer finish or error occurred */
  316. void *userData; /*!< FLEXSPI callback function parameter.*/
  317. };
  318. /*******************************************************************************
  319. * API
  320. ******************************************************************************/
  321. #if defined(__cplusplus)
  322. extern "C" {
  323. #endif /*_cplusplus. */
  324. /*!
  325. * @name Initialization and deinitialization
  326. * @{
  327. */
  328. /*!
  329. * @brief Initializes the FLEXSPI module and internal state.
  330. *
  331. * This function enables the clock for FLEXSPI and also configures the FLEXSPI with the
  332. * input configure parameters. Users should call this function before any FLEXSPI operations.
  333. *
  334. * @param base FLEXSPI peripheral base address.
  335. * @param config FLEXSPI configure structure.
  336. */
  337. void FLEXSPI_Init(FLEXSPI_Type *base, const flexspi_config_t *config);
  338. /*!
  339. * @brief Gets default settings for FLEXSPI.
  340. *
  341. * @param config FLEXSPI configuration structure.
  342. */
  343. void FLEXSPI_GetDefaultConfig(flexspi_config_t *config);
  344. /*!
  345. * @brief Deinitializes the FLEXSPI module.
  346. *
  347. * Clears the FLEXSPI state and FLEXSPI module registers.
  348. * @param base FLEXSPI peripheral base address.
  349. */
  350. void FLEXSPI_Deinit(FLEXSPI_Type *base);
  351. /*!
  352. * @brief Configures the connected device parameter.
  353. *
  354. * This function configures the connected device relevant parameters, such as the size, command, and so on.
  355. * The flash configuration value cannot have a default value. The user needs to configure it according to the
  356. * connected device.
  357. *
  358. * @param base FLEXSPI peripheral base address.
  359. * @param config Flash configuration parameters.
  360. * @param port FLEXSPI Operation port.
  361. */
  362. void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port);
  363. /*!
  364. * @brief Software reset for the FLEXSPI logic.
  365. *
  366. * This function sets the software reset flags for both AHB and buffer domain and
  367. * resets both AHB buffer and also IP FIFOs.
  368. *
  369. * @param base FLEXSPI peripheral base address.
  370. */
  371. static inline void FLEXSPI_SoftwareReset(FLEXSPI_Type *base)
  372. {
  373. base->MCR0 |= FLEXSPI_MCR0_SWRESET_MASK;
  374. while (base->MCR0 & FLEXSPI_MCR0_SWRESET_MASK)
  375. {
  376. }
  377. }
  378. /*!
  379. * @brief Enables or disables the FLEXSPI module.
  380. *
  381. * @param base FLEXSPI peripheral base address.
  382. * @param enable True means enable FLEXSPI, false means disable.
  383. */
  384. static inline void FLEXSPI_Enable(FLEXSPI_Type *base, bool enable)
  385. {
  386. if (enable)
  387. {
  388. base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK;
  389. }
  390. else
  391. {
  392. base->MCR0 |= FLEXSPI_MCR0_MDIS_MASK;
  393. }
  394. }
  395. /* @} */
  396. /*!
  397. * @name Interrupts
  398. * @{
  399. */
  400. /*!
  401. * @brief Enables the FLEXSPI interrupts.
  402. *
  403. * @param base FLEXSPI peripheral base address.
  404. * @param mask FLEXSPI interrupt source.
  405. */
  406. static inline void FLEXSPI_EnableInterrupts(FLEXSPI_Type *base, uint32_t mask)
  407. {
  408. base->INTEN |= mask;
  409. }
  410. /*!
  411. * @brief Disable the FLEXSPI interrupts.
  412. *
  413. * @param base FLEXSPI peripheral base address.
  414. * @param mask FLEXSPI interrupt source.
  415. */
  416. static inline void FLEXSPI_DisableInterrupts(FLEXSPI_Type *base, uint32_t mask)
  417. {
  418. base->INTEN &= ~mask;
  419. }
  420. /* @} */
  421. /*! @name DMA control */
  422. /*@{*/
  423. /*!
  424. * @brief Enables or disables FLEXSPI IP Tx FIFO DMA requests.
  425. *
  426. * @param base FLEXSPI peripheral base address.
  427. * @param enable Enable flag for transmit DMA request. Pass true for enable, false for disable.
  428. */
  429. static inline void FLEXSPI_EnableTxDMA(FLEXSPI_Type *base, bool enable)
  430. {
  431. if (enable)
  432. {
  433. base->IPTXFCR |= FLEXSPI_IPTXFCR_TXDMAEN_MASK;
  434. }
  435. else
  436. {
  437. base->IPTXFCR &= ~FLEXSPI_IPTXFCR_TXDMAEN_MASK;
  438. }
  439. }
  440. /*!
  441. * @brief Enables or disables FLEXSPI IP Rx FIFO DMA requests.
  442. *
  443. * @param base FLEXSPI peripheral base address.
  444. * @param enable Enable flag for receive DMA request. Pass true for enable, false for disable.
  445. */
  446. static inline void FLEXSPI_EnableRxDMA(FLEXSPI_Type *base, bool enable)
  447. {
  448. if (enable)
  449. {
  450. base->IPRXFCR |= FLEXSPI_IPRXFCR_RXDMAEN_MASK;
  451. }
  452. else
  453. {
  454. base->IPRXFCR &= ~FLEXSPI_IPRXFCR_RXDMAEN_MASK;
  455. }
  456. }
  457. /*!
  458. * @brief Gets FLEXSPI IP tx fifo address for DMA transfer.
  459. *
  460. * @param base FLEXSPI peripheral base address.
  461. * @retval The tx fifo address.
  462. */
  463. static inline uint32_t FLEXSPI_GetTxFifoAddress(FLEXSPI_Type *base)
  464. {
  465. return (uint32_t)&base->TFDR[0];
  466. }
  467. /*!
  468. * @brief Gets FLEXSPI IP rx fifo address for DMA transfer.
  469. *
  470. * @param base FLEXSPI peripheral base address.
  471. * @retval The rx fifo address.
  472. */
  473. static inline uint32_t FLEXSPI_GetRxFifoAddress(FLEXSPI_Type *base)
  474. {
  475. return (uint32_t)&base->RFDR[0];
  476. }
  477. /*@}*/
  478. /*! @name FIFO control */
  479. /*@{*/
  480. /*! @brief Clears the FLEXSPI IP FIFO logic.
  481. *
  482. * @param base FLEXSPI peripheral base address.
  483. * @param txFifo Pass true to reset TX FIFO.
  484. * @param rxFifo Pass true to reset RX FIFO.
  485. */
  486. static inline void FLEXSPI_ResetFifos(FLEXSPI_Type *base, bool txFifo, bool rxFifo)
  487. {
  488. if (txFifo)
  489. {
  490. base->IPTXFCR |= FLEXSPI_IPTXFCR_CLRIPTXF_MASK;
  491. }
  492. if (rxFifo)
  493. {
  494. base->IPRXFCR |= FLEXSPI_IPRXFCR_CLRIPRXF_MASK;
  495. }
  496. }
  497. /*!
  498. * @brief Gets the valid data entries in the FLEXSPI FIFOs.
  499. *
  500. * @param base FLEXSPI peripheral base address.
  501. * @param[out] txCount Pointer through which the current number of bytes in the transmit FIFO is returned.
  502. * Pass NULL if this value is not required.
  503. * @param[out] rxCount Pointer through which the current number of bytes in the receive FIFO is returned.
  504. * Pass NULL if this value is not required.
  505. */
  506. static inline void FLEXSPI_GetFifoCounts(FLEXSPI_Type *base, size_t *txCount, size_t *rxCount)
  507. {
  508. if (txCount)
  509. {
  510. *txCount = (((base->IPTXFSTS) & FLEXSPI_IPTXFSTS_FILL_MASK) >> FLEXSPI_IPTXFSTS_FILL_SHIFT) * 8U;
  511. }
  512. if (rxCount)
  513. {
  514. *rxCount = (((base->IPRXFSTS) & FLEXSPI_IPRXFSTS_FILL_MASK) >> FLEXSPI_IPRXFSTS_FILL_SHIFT) * 8U;
  515. }
  516. }
  517. /*@}*/
  518. /*!
  519. * @name Status
  520. * @{
  521. */
  522. /*!
  523. * @brief Get the FLEXSPI interrupt status flags.
  524. *
  525. * @param base FLEXSPI peripheral base address.
  526. * @retval interrupt status flag, use status flag to AND #flexspi_flags_t could get the related status.
  527. */
  528. static inline uint32_t FLEXSPI_GetInterruptStatusFlags(FLEXSPI_Type *base)
  529. {
  530. return base->INTR;
  531. }
  532. /*!
  533. * @brief Get the FLEXSPI interrupt status flags.
  534. *
  535. * @param base FLEXSPI peripheral base address.
  536. * @param interrupt status flag.
  537. */
  538. static inline void FLEXSPI_ClearInterruptStatusFlags(FLEXSPI_Type *base, uint32_t mask)
  539. {
  540. base->INTR |= mask;
  541. }
  542. #if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN)) && (FSL_FEATURE_FLEXSPI_HAS_NO_DATA_LEARN))
  543. /*! @brief Gets the sampling clock phase selection after Data Learning.
  544. *
  545. * @param base FLEXSPI peripheral base address.
  546. * @param portAPhase Pointer to a uint8_t type variable to receive the selected clock phase on PORTA.
  547. * @param portBPhase Pointer to a uint8_t type variable to receive the selected clock phase on PORTB.
  548. */
  549. static inline void FLEXSPI_GetDataLearningPhase(FLEXSPI_Type *base, uint8_t *portAPhase, uint8_t *portBPhase)
  550. {
  551. if (portAPhase)
  552. {
  553. *portAPhase = (base->STS0 & FLEXSPI_STS0_DATALEARNPHASEA_MASK) >> FLEXSPI_STS0_DATALEARNPHASEA_SHIFT;
  554. }
  555. if (portBPhase)
  556. {
  557. *portBPhase = (base->STS0 & FLEXSPI_STS0_DATALEARNPHASEB_MASK) >> FLEXSPI_STS0_DATALEARNPHASEB_SHIFT;
  558. }
  559. }
  560. #endif
  561. /*! @brief Gets the trigger source of current command sequence granted by arbitrator.
  562. *
  563. * @param base FLEXSPI peripheral base address.
  564. * @retval trigger source of current command sequence.
  565. */
  566. static inline flexspi_arb_command_source_t FLEXSPI_GetArbitratorCommandSource(FLEXSPI_Type *base)
  567. {
  568. return (flexspi_arb_command_source_t)((base->STS0 & FLEXSPI_STS0_ARBCMDSRC_MASK) >> FLEXSPI_STS0_ARBCMDSRC_SHIFT);
  569. }
  570. /*! @brief Gets the error code when IP command error detected.
  571. *
  572. * @param base FLEXSPI peripheral base address.
  573. * @param index Pointer to a uint8_t type variable to receive the sequence index when error detected.
  574. * @retval error code when IP command error detected.
  575. */
  576. static inline flexspi_ip_error_code_t FLEXSPI_GetIPCommandErrorCode(FLEXSPI_Type *base, uint8_t *index)
  577. {
  578. *index = (base->STS1 & FLEXSPI_STS1_IPCMDERRID_MASK) >> FLEXSPI_STS1_IPCMDERRID_SHIFT;
  579. return (flexspi_ip_error_code_t)((base->STS1 & FLEXSPI_STS1_IPCMDERRCODE_MASK) >> FLEXSPI_STS1_IPCMDERRCODE_SHIFT);
  580. }
  581. /*! @brief Gets the error code when AHB command error detected.
  582. *
  583. * @param base FLEXSPI peripheral base address.
  584. * @param index Pointer to a uint8_t type variable to receive the sequence index when error detected.
  585. * @retval error code when AHB command error detected.
  586. */
  587. static inline flexspi_ahb_error_code_t FLEXSPI_GetAHBCommandErrorCode(FLEXSPI_Type *base, uint8_t *index)
  588. {
  589. *index = (base->STS1 & FLEXSPI_STS1_AHBCMDERRID_MASK) >> FLEXSPI_STS1_AHBCMDERRID_SHIFT;
  590. return (flexspi_ahb_error_code_t)((base->STS1 & FLEXSPI_STS1_AHBCMDERRCODE_MASK) >>
  591. FLEXSPI_STS1_AHBCMDERRCODE_SHIFT);
  592. }
  593. /*! @brief Returns whether the bus is idle.
  594. *
  595. * @param base FLEXSPI peripheral base address.
  596. * @retval true Bus is idle.
  597. * @retval false Bus is busy.
  598. */
  599. static inline bool FLEXSPI_GetBusIdleStatus(FLEXSPI_Type *base)
  600. {
  601. return (base->STS0 & FLEXSPI_STS0_ARBIDLE_MASK) && (base->STS0 & FLEXSPI_STS0_SEQIDLE_MASK);
  602. }
  603. /*@}*/
  604. /*!
  605. * @name Bus Operations
  606. * @{
  607. */
  608. /*! @brief Enables/disables the FLEXSPI IP command parallel mode.
  609. *
  610. * @param base FLEXSPI peripheral base address.
  611. * @param enable True means enable parallel mode, false means disable parallel mode.
  612. */
  613. static inline void FLEXSPI_EnableIPParallelMode(FLEXSPI_Type *base, bool enable)
  614. {
  615. if (enable)
  616. {
  617. base->IPCR1 |= FLEXSPI_IPCR1_IPAREN_MASK;
  618. }
  619. else
  620. {
  621. base->IPCR1 &= ~FLEXSPI_IPCR1_IPAREN_MASK;
  622. }
  623. }
  624. /*! @brief Enables/disables the FLEXSPI AHB command parallel mode.
  625. *
  626. * @param base FLEXSPI peripheral base address.
  627. * @param enable True means enable parallel mode, false means disable parallel mode.
  628. */
  629. static inline void FLEXSPI_EnableAHBParallelMode(FLEXSPI_Type *base, bool enable)
  630. {
  631. if (enable)
  632. {
  633. base->AHBCR |= FLEXSPI_AHBCR_APAREN_MASK;
  634. }
  635. else
  636. {
  637. base->AHBCR &= ~FLEXSPI_AHBCR_APAREN_MASK;
  638. }
  639. }
  640. /*! @brief Updates the LUT table.
  641. *
  642. * @param base FLEXSPI peripheral base address.
  643. * @param index From which index start to update. It could be any index of the LUT table, which
  644. * also allows user to update command content inside a command. Each command consists of up to
  645. * 8 instructions and occupy 4*32-bit memory.
  646. * @param cmd Command sequence array.
  647. * @param count Number of sequences.
  648. */
  649. void FLEXSPI_UpdateLUT(FLEXSPI_Type *base, uint32_t index, const uint32_t *cmd, uint32_t count);
  650. /*!
  651. * @brief Writes data into FIFO.
  652. *
  653. * @param base FLEXSPI peripheral base address
  654. * @param data The data bytes to send
  655. * @param fifoIndex Destination fifo index.
  656. */
  657. static inline void FLEXSPI_WriteData(FLEXSPI_Type *base, uint32_t data, uint8_t fifoIndex)
  658. {
  659. base->TFDR[fifoIndex] = data;
  660. }
  661. /*!
  662. * @brief Receives data from data FIFO.
  663. *
  664. * @param base FLEXSPI peripheral base address
  665. * @param fifoIndex Source fifo index.
  666. * @return The data in the FIFO.
  667. */
  668. static inline uint32_t FLEXSPI_ReadData(FLEXSPI_Type *base, uint8_t fifoIndex)
  669. {
  670. return base->RFDR[fifoIndex];
  671. }
  672. /*!
  673. * @brief Sends a buffer of data bytes using blocking method.
  674. * @note This function blocks via polling until all bytes have been sent.
  675. * @param base FLEXSPI peripheral base address
  676. * @param buffer The data bytes to send
  677. * @param size The number of data bytes to send
  678. * @retval kStatus_Success write success without error
  679. * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout
  680. * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequencen error detected
  681. * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
  682. */
  683. status_t FLEXSPI_WriteBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size);
  684. /*!
  685. * @brief Receives a buffer of data bytes using a blocking method.
  686. * @note This function blocks via polling until all bytes have been sent.
  687. * @param base FLEXSPI peripheral base address
  688. * @param buffer The data bytes to send
  689. * @param size The number of data bytes to receive
  690. * @retval kStatus_Success read success without error
  691. * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout
  692. * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequencen error detected
  693. * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
  694. */
  695. status_t FLEXSPI_ReadBlocking(FLEXSPI_Type *base, uint32_t *buffer, size_t size);
  696. /*!
  697. * @brief Execute command to transfer a buffer data bytes using a blocking method.
  698. * @param base FLEXSPI peripheral base address
  699. * @param xfer pointer to the transfer structure.
  700. * @retval kStatus_Success command transfer success without error
  701. * @retval kStatus_FLEXSPI_SequenceExecutionTimeout sequence execution timeout
  702. * @retval kStatus_FLEXSPI_IpCommandSequenceError IP command sequencen error detected
  703. * @retval kStatus_FLEXSPI_IpCommandGrantTimeout IP command grant timeout detected
  704. */
  705. status_t FLEXSPI_TransferBlocking(FLEXSPI_Type *base, flexspi_transfer_t *xfer);
  706. /*! @} */
  707. /*!
  708. * @name Transactional
  709. * @{
  710. */
  711. /*!
  712. * @brief Initializes the FLEXSPI handle which is used in transactional functions.
  713. *
  714. * @param base FLEXSPI peripheral base address.
  715. * @param handle pointer to flexspi_handle_t structure to store the transfer state.
  716. * @param callback pointer to user callback function.
  717. * @param userData user parameter passed to the callback function.
  718. */
  719. void FLEXSPI_TransferCreateHandle(FLEXSPI_Type *base,
  720. flexspi_handle_t *handle,
  721. flexspi_transfer_callback_t callback,
  722. void *userData);
  723. /*!
  724. * @brief Performs a interrupt non-blocking transfer on the FLEXSPI bus.
  725. *
  726. * @note Calling the API returns immediately after transfer initiates. The user needs
  727. * to call FLEXSPI_GetTransferCount to poll the transfer status to check whether
  728. * the transfer is finished. If the return status is not kStatus_FLEXSPI_Busy, the transfer
  729. * is finished. For FLEXSPI_Read, the dataSize should be multiple of rx watermark levle, or
  730. * FLEXSPI could not read data properly.
  731. *
  732. * @param base FLEXSPI peripheral base address.
  733. * @param handle pointer to flexspi_handle_t structure which stores the transfer state.
  734. * @param xfer pointer to flexspi_transfer_t structure.
  735. * @retval kStatus_Success Successfully start the data transmission.
  736. * @retval kStatus_FLEXSPI_Busy Previous transmission still not finished.
  737. */
  738. status_t FLEXSPI_TransferNonBlocking(FLEXSPI_Type *base, flexspi_handle_t *handle, flexspi_transfer_t *xfer);
  739. /*!
  740. * @brief Gets the master transfer status during a interrupt non-blocking transfer.
  741. *
  742. * @param base FLEXSPI peripheral base address.
  743. * @param handle pointer to flexspi_handle_t structure which stores the transfer state.
  744. * @param count Number of bytes transferred so far by the non-blocking transaction.
  745. * @retval kStatus_InvalidArgument count is Invalid.
  746. * @retval kStatus_Success Successfully return the count.
  747. */
  748. status_t FLEXSPI_TransferGetCount(FLEXSPI_Type *base, flexspi_handle_t *handle, size_t *count);
  749. /*!
  750. * @brief Aborts an interrupt non-blocking transfer early.
  751. *
  752. * @note This API can be called at any time when an interrupt non-blocking transfer initiates
  753. * to abort the transfer early.
  754. *
  755. * @param base FLEXSPI peripheral base address.
  756. * @param handle pointer to flexspi_handle_t structure which stores the transfer state
  757. */
  758. void FLEXSPI_TransferAbort(FLEXSPI_Type *base, flexspi_handle_t *handle);
  759. /*!
  760. * @brief Master interrupt handler.
  761. *
  762. * @param base FLEXSPI peripheral base address.
  763. * @param handle pointer to flexspi_handle_t structure.
  764. */
  765. void FLEXSPI_TransferHandleIRQ(FLEXSPI_Type *base, flexspi_handle_t *handle);
  766. /*! @} */
  767. #if defined(__cplusplus)
  768. }
  769. #endif /*_cplusplus. */
  770. /*@}*/
  771. #endif /* __FSL_FLEXSPI_H_ */