nu_usci_spi.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. /****************************************************************************//**
  2. * @file nu_usci_spi.h
  3. * @version V3.00
  4. * @brief M480 series USCI_SPI driver header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __NU_USCI_SPI_H__
  10. #define __NU_USCI_SPI_H__
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15. /** @addtogroup Standard_Driver Standard Driver
  16. @{
  17. */
  18. /** @addtogroup USCI_SPI_Driver USCI_SPI Driver
  19. @{
  20. */
  21. /** @addtogroup USCI_SPI_EXPORTED_CONSTANTS USCI_SPI Exported Constants
  22. @{
  23. */
  24. #define USPI_MODE_0 (0x0 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with falling edge and receive with rising edge \hideinitializer */
  25. #define USPI_MODE_1 (0x1 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle low; data transmit with rising edge and receive with falling edge \hideinitializer */
  26. #define USPI_MODE_2 (0x2 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with rising edge and receive with falling edge \hideinitializer */
  27. #define USPI_MODE_3 (0x3 << USPI_PROTCTL_SCLKMODE_Pos) /*!< SCLK idle high; data transmit with falling edge and receive with rising edge \hideinitializer */
  28. #define USPI_SLAVE (USPI_PROTCTL_SLAVE_Msk) /*!< Set as slave \hideinitializer */
  29. #define USPI_MASTER (0x0ul) /*!< Set as master \hideinitializer */
  30. #define USPI_SS (USPI_PROTCTL_SS_Msk) /*!< Set SS \hideinitializer */
  31. #define USPI_SS_ACTIVE_HIGH (0x0ul) /*!< SS active high \hideinitializer */
  32. #define USPI_SS_ACTIVE_LOW (USPI_LINECTL_CTLOINV_Msk) /*!< SS active low \hideinitializer */
  33. /* USCI_SPI Interrupt Mask */
  34. #define USPI_SSINACT_INT_MASK (0x001ul) /*!< Slave Slave Inactive interrupt mask \hideinitializer */
  35. #define USPI_SSACT_INT_MASK (0x002ul) /*!< Slave Slave Active interrupt mask \hideinitializer */
  36. #define USPI_SLVTO_INT_MASK (0x004ul) /*!< Slave Mode Time-out interrupt mask \hideinitializer */
  37. #define USPI_SLVBE_INT_MASK (0x008ul) /*!< Slave Mode Bit Count Error interrupt mask \hideinitializer */
  38. #define USPI_TXUDR_INT_MASK (0x010ul) /*!< Slave Transmit Under Run interrupt mask \hideinitializer */
  39. #define USPI_RXOV_INT_MASK (0x020ul) /*!< Receive Buffer Overrun interrupt mask \hideinitializer */
  40. #define USPI_TXST_INT_MASK (0x040ul) /*!< Transmit Start interrupt mask \hideinitializer */
  41. #define USPI_TXEND_INT_MASK (0x080ul) /*!< Transmit End interrupt mask \hideinitializer */
  42. #define USPI_RXST_INT_MASK (0x100ul) /*!< Receive Start interrupt mask \hideinitializer */
  43. #define USPI_RXEND_INT_MASK (0x200ul) /*!< Receive End interrupt mask \hideinitializer */
  44. /* USCI_SPI Status Mask */
  45. #define USPI_BUSY_MASK (0x01ul) /*!< Busy status mask \hideinitializer */
  46. #define USPI_RX_EMPTY_MASK (0x02ul) /*!< RX empty status mask \hideinitializer */
  47. #define USPI_RX_FULL_MASK (0x04ul) /*!< RX full status mask \hideinitializer */
  48. #define USPI_TX_EMPTY_MASK (0x08ul) /*!< TX empty status mask \hideinitializer */
  49. #define USPI_TX_FULL_MASK (0x10ul) /*!< TX full status mask \hideinitializer */
  50. #define USPI_SSLINE_STS_MASK (0x20ul) /*!< USCI_SPI_SS line status mask \hideinitializer */
  51. /*@}*/ /* end of group USCI_SPI_EXPORTED_CONSTANTS */
  52. /** @addtogroup USCI_SPI_EXPORTED_FUNCTIONS USCI_SPI Exported Functions
  53. @{
  54. */
  55. /**
  56. * @brief Disable slave 3-wire mode.
  57. * @param[in] uspi The pointer of the specified USCI_SPI module.
  58. * @return None
  59. * \hideinitializer
  60. */
  61. #define USPI_DISABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL &= ~USPI_PROTCTL_SLV3WIRE_Msk )
  62. /**
  63. * @brief Enable slave 3-wire mode.
  64. * @param[in] uspi The pointer of the specified USCI_SPI module.
  65. * @return None
  66. * \hideinitializer
  67. */
  68. #define USPI_ENABLE_3WIRE_MODE(uspi) ( (uspi)->PROTCTL |= USPI_PROTCTL_SLV3WIRE_Msk )
  69. /**
  70. * @brief Get the Rx buffer empty flag.
  71. * @param[in] uspi The pointer of the specified USCI_SPI module.
  72. * @return Rx buffer flag
  73. * @retval 0: Rx buffer is not empty
  74. * @retval 1: Rx buffer is empty
  75. * \hideinitializer
  76. */
  77. #define USPI_GET_RX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_RXEMPTY_Msk) == USPI_BUFSTS_RXEMPTY_Msk ? 1:0 )
  78. /**
  79. * @brief Get the Tx buffer empty flag.
  80. * @param[in] uspi The pointer of the specified USCI_SPI module.
  81. * @return Tx buffer flag
  82. * @retval 0: Tx buffer is not empty
  83. * @retval 1: Tx buffer is empty
  84. * \hideinitializer
  85. */
  86. #define USPI_GET_TX_EMPTY_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXEMPTY_Msk) == USPI_BUFSTS_TXEMPTY_Msk ? 1:0 )
  87. /**
  88. * @brief Get the Tx buffer full flag.
  89. * @param[in] uspi The pointer of the specified USCI_SPI module.
  90. * @return Tx buffer flag
  91. * @retval 0: Tx buffer is not full
  92. * @retval 1: Tx buffer is full
  93. * \hideinitializer
  94. */
  95. #define USPI_GET_TX_FULL_FLAG(uspi) ( ((uspi)->BUFSTS & USPI_BUFSTS_TXFULL_Msk) == USPI_BUFSTS_TXFULL_Msk ? 1:0 )
  96. /**
  97. * @brief Get the datum read from RX register.
  98. * @param[in] uspi The pointer of the specified USCI_SPI module.
  99. * @return data in Rx register
  100. * \hideinitializer
  101. */
  102. #define USPI_READ_RX(uspi) ((uspi)->RXDAT)
  103. /**
  104. * @brief Write datum to TX register.
  105. * @param[in] uspi The pointer of the specified USCI_SPI module.
  106. * @param[in] u32TxData The datum which user attempt to transfer through USCI_SPI bus.
  107. * @return None
  108. * \hideinitializer
  109. */
  110. #define USPI_WRITE_TX(uspi, u32TxData) ( (uspi)->TXDAT = (u32TxData) )
  111. /**
  112. * @brief Set USCI_SPI_SS pin to high state.
  113. * @param[in] uspi The pointer of the specified USCI_SPI module.
  114. * @return None.
  115. * @details Disable automatic slave selection function and set USCI_SPI_SS pin to high state. Only available in Master mode.
  116. * \hideinitializer
  117. */
  118. #define USPI_SET_SS_HIGH(uspi) \
  119. do{ \
  120. (uspi)->LINECTL &= ~(USPI_LINECTL_CTLOINV_Msk); \
  121. (uspi)->PROTCTL = ((uspi)->PROTCTL & ~(USPI_PROTCTL_AUTOSS_Msk | USPI_PROTCTL_SS_Msk)); \
  122. }while(0)
  123. /**
  124. * @brief Set USCI_SPI_SS pin to low state.
  125. * @param[in] uspi The pointer of the specified USCI_SPI module.
  126. * @return None.
  127. * @details Disable automatic slave selection function and set USCI_SPI_SS pin to low state. Only available in Master mode.
  128. * \hideinitializer
  129. */
  130. #define USPI_SET_SS_LOW(uspi) \
  131. do{ \
  132. (uspi)->LINECTL |= (USPI_LINECTL_CTLOINV_Msk); \
  133. (uspi)->PROTCTL = (((uspi)->PROTCTL & ~USPI_PROTCTL_AUTOSS_Msk) | USPI_PROTCTL_SS_Msk); \
  134. }while(0)
  135. /**
  136. * @brief Set the length of suspend interval.
  137. * @param[in] uspi The pointer of the specified USCI_SPI module.
  138. * @param[in] u32SuspCycle Decide the length of suspend interval.
  139. * @return None
  140. * \hideinitializer
  141. */
  142. #define USPI_SET_SUSPEND_CYCLE(uspi, u32SuspCycle) ( (uspi)->PROTCTL = ((uspi)->PROTCTL & ~USPI_PROTCTL_SUSPITV_Msk) | ((u32SuspCycle) << USPI_PROTCTL_SUSPITV_Pos) )
  143. /**
  144. * @brief Set the USCI_SPI transfer sequence with LSB first.
  145. * @param[in] uspi The pointer of the specified USCI_SPI module.
  146. * @return None
  147. * \hideinitializer
  148. */
  149. #define USPI_SET_LSB_FIRST(uspi) ( (uspi)->LINECTL |= USPI_LINECTL_LSB_Msk )
  150. /**
  151. * @brief Set the USCI_SPI transfer sequence with MSB first.
  152. * @param[in] uspi The pointer of the specified USCI_SPI module.
  153. * @return None
  154. * \hideinitializer
  155. */
  156. #define USPI_SET_MSB_FIRST(uspi) ( (uspi)->LINECTL &= ~USPI_LINECTL_LSB_Msk )
  157. /**
  158. * @brief Set the data width of a USCI_SPI transaction.
  159. * @param[in] uspi The pointer of the specified USCI_SPI module.
  160. * @param[in] u32Width The data width
  161. * @return None
  162. * \hideinitializer
  163. */
  164. #define USPI_SET_DATA_WIDTH(uspi,u32Width) \
  165. do{ \
  166. if((u32Width) == 16ul){ \
  167. (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | (0 << USPI_LINECTL_DWIDTH_Pos); \
  168. }else { \
  169. (uspi)->LINECTL = ((uspi)->LINECTL & ~USPI_LINECTL_DWIDTH_Msk) | ((u32Width) << USPI_LINECTL_DWIDTH_Pos); \
  170. } \
  171. }while(0)
  172. /**
  173. * @brief Get the USCI_SPI busy state.
  174. * @param[in] uspi The pointer of the specified USCI_SPI module.
  175. * @return USCI_SPI busy status
  176. * @retval 0: USCI_SPI module is not busy
  177. * @retval 1: USCI_SPI module is busy
  178. * \hideinitializer
  179. */
  180. #define USPI_IS_BUSY(uspi) ( ((uspi)->PROTSTS & USPI_PROTSTS_BUSY_Msk) == USPI_PROTSTS_BUSY_Msk ? 1:0 )
  181. /**
  182. * @brief Get the USCI_SPI wakeup flag.
  183. * @param[in] uspi The pointer of the specified USCI_SPI module.
  184. * @return Wakeup status.
  185. * @retval 0 Flag is not set.
  186. * @retval 1 Flag is set.
  187. * \hideinitializer
  188. */
  189. #define USPI_GET_WAKEUP_FLAG(uspi) ( ((uspi)->WKSTS & USPI_WKSTS_WKF_Msk) == USPI_WKSTS_WKF_Msk ? 1:0)
  190. /**
  191. * @brief Clear the USCI_SPI wakeup flag.
  192. * @param[in] uspi The pointer of the specified USCI_SPI module.
  193. * @return None
  194. * \hideinitializer
  195. */
  196. #define USPI_CLR_WAKEUP_FLAG(uspi) ( (uspi)->WKSTS |= USPI_WKSTS_WKF_Msk)
  197. /**
  198. * @brief Get protocol interrupt flag/status.
  199. * @param[in] uspi The pointer of the specified USCI_SPI module.
  200. * @return The interrupt flag/status of protocol status register.
  201. * \hideinitializer
  202. */
  203. #define USPI_GET_PROT_STATUS(uspi) ( (uspi)->PROTSTS)
  204. /**
  205. * @brief Clear specified protocol interrupt flag.
  206. * @param[in] uspi The pointer of the specified USCI_SPI module.
  207. * @param[in] u32IntTypeFlag Interrupt Type Flag, should be
  208. * - \ref USPI_PROTSTS_SSACTIF_Msk
  209. * - \ref USPI_PROTSTS_SSINAIF_Msk
  210. * - \ref USPI_PROTSTS_SLVBEIF_Msk
  211. * - \ref USPI_PROTSTS_SLVTOIF_Msk
  212. * - \ref USPI_PROTSTS_RXENDIF_Msk
  213. * - \ref USPI_PROTSTS_RXSTIF_Msk
  214. * - \ref USPI_PROTSTS_TXENDIF_Msk
  215. * - \ref USPI_PROTSTS_TXSTIF_Msk
  216. * @return None
  217. * \hideinitializer
  218. */
  219. #define USPI_CLR_PROT_INT_FLAG(uspi,u32IntTypeFlag) ( (uspi)->PROTSTS = (u32IntTypeFlag))
  220. /**
  221. * @brief Get buffer interrupt flag/status.
  222. * @param[in] uspi The pointer of the specified USCI_SPI module.
  223. * @return The interrupt flag/status of buffer status register.
  224. * \hideinitializer
  225. */
  226. #define USPI_GET_BUF_STATUS(uspi) ( (uspi)->BUFSTS)
  227. /**
  228. * @brief Clear specified buffer interrupt flag.
  229. * @param[in] uspi The pointer of the specified USCI_SPI module.
  230. * @param[in] u32IntTypeFlag Interrupt Type Flag, should be
  231. * - \ref USPI_BUFSTS_TXUDRIF_Msk
  232. * - \ref USPI_BUFSTS_RXOVIF_Msk
  233. * @return None
  234. * \hideinitializer
  235. */
  236. #define USPI_CLR_BUF_INT_FLAG(uspi,u32IntTypeFlag) ( (uspi)->BUFSTS = (u32IntTypeFlag))
  237. /**
  238. * @brief Enable specified protocol interrupt.
  239. * @param[in] uspi The pointer of the specified USCI_SPI module.
  240. * @param[in] u32IntSel Interrupt Type, should be
  241. * - \ref USPI_PROTIEN_SLVBEIEN_Msk
  242. * - \ref USPI_PROTIEN_SLVTOIEN_Msk
  243. * - \ref USPI_PROTIEN_SSACTIEN_Msk
  244. * - \ref USPI_PROTIEN_SSINAIEN_Msk
  245. * @return None
  246. * \hideinitializer
  247. */
  248. #define USPI_ENABLE_PROT_INT(uspi, u32IntSel) ((uspi)->PROTIEN |= (u32IntSel))
  249. /**
  250. * @brief Disable specified protocol interrupt.
  251. * @param[in] uspi The pointer of the specified USCI_SPI module.
  252. * @param[in] u32IntSel Interrupt Type, should be
  253. * - \ref USPI_PROTIEN_SLVBEIEN_Msk
  254. * - \ref USPI_PROTIEN_SLVTOIEN_Msk
  255. * - \ref USPI_PROTIEN_SSACTIEN_Msk
  256. * - \ref USPI_PROTIEN_SSINAIEN_Msk
  257. * @return None
  258. * \hideinitializer
  259. */
  260. #define USPI_DISABLE_PROT_INT(uspi, u32IntSel) ((uspi)->PROTIEN &= ~ (u32IntSel))
  261. /**
  262. * @brief Enable specified buffer interrupt.
  263. * @param[in] uspi The pointer of the specified USCI_SPI module.
  264. * @param[in] u32IntSel Interrupt Type, should be
  265. * - \ref USPI_BUFCTL_RXOVIEN_Msk
  266. * - \ref USPI_BUFCTL_TXUDRIEN_Msk
  267. * @return None
  268. * \hideinitializer
  269. */
  270. #define USPI_ENABLE_BUF_INT(uspi, u32IntSel) ((uspi)->BUFCTL |= (u32IntSel))
  271. /**
  272. * @brief Disable specified buffer interrupt.
  273. * @param[in] uspi The pointer of the specified USCI_SPI module.
  274. * @param[in] u32IntSel Interrupt Type, should be
  275. * - \ref USPI_BUFCTL_RXOVIEN_Msk
  276. * - \ref USPI_BUFCTL_TXUDRIEN_Msk
  277. * @return None
  278. * \hideinitializer
  279. */
  280. #define USPI_DISABLE_BUF_INT(uspi, u32IntSel) ((uspi)->BUFCTL &= ~ (u32IntSel))
  281. /**
  282. * @brief Enable specified transfer interrupt.
  283. * @param[in] uspi The pointer of the specified USCI_SPI module.
  284. * @param[in] u32IntSel Interrupt Type, should be
  285. * - \ref USPI_INTEN_RXENDIEN_Msk
  286. * - \ref USPI_INTEN_RXSTIEN_Msk
  287. * - \ref USPI_INTEN_TXENDIEN_Msk
  288. * - \ref USPI_INTEN_TXSTIEN_Msk
  289. * @return None
  290. * \hideinitializer
  291. */
  292. #define USPI_ENABLE_TRANS_INT(uspi, u32IntSel) ((uspi)->INTEN |= (u32IntSel))
  293. /**
  294. * @brief Disable specified transfer interrupt.
  295. * @param[in] uspi The pointer of the specified USCI_SPI module.
  296. * @param[in] u32IntSel Interrupt Type, should be
  297. * - \ref USPI_INTEN_RXENDIEN_Msk
  298. * - \ref USPI_INTEN_RXSTIEN_Msk
  299. * - \ref USPI_INTEN_TXENDIEN_Msk
  300. * - \ref USPI_INTEN_TXSTIEN_Msk
  301. * @return None
  302. * \hideinitializer
  303. */
  304. #define USPI_DISABLE_TRANS_INT(uspi, u32IntSel) ((uspi)->INTEN &= ~ (u32IntSel))
  305. /**
  306. * @brief Trigger RX PDMA function.
  307. * @param[in] uspi The pointer of the specified USCI_SPI module.
  308. * @return None.
  309. * @details Set RXPDMAEN bit of USPI_PDMACTL register to enable RX PDMA transfer function.
  310. * \hideinitializer
  311. */
  312. #define USPI_TRIGGER_RX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_RXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk)
  313. /**
  314. * @brief Trigger TX PDMA function.
  315. * @param[in] uspi The pointer of the specified USCI_SPI module.
  316. * @return None.
  317. * @details Set TXPDMAEN bit of USPI_PDMACTL register to enable TX PDMA transfer function.
  318. * \hideinitializer
  319. */
  320. #define USPI_TRIGGER_TX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk)
  321. /**
  322. * @brief Trigger TX and RX PDMA function.
  323. * @param[in] uspi The pointer of the specified USCI_SPI module.
  324. * @return None.
  325. * @details Set TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to enable TX and RX PDMA transfer function.
  326. * \hideinitializer
  327. */
  328. #define USPI_TRIGGER_TX_RX_PDMA(uspi) ((uspi)->PDMACTL |= USPI_PDMACTL_TXPDMAEN_Msk|USPI_PDMACTL_RXPDMAEN_Msk|USPI_PDMACTL_PDMAEN_Msk)
  329. /**
  330. * @brief Disable RX PDMA transfer.
  331. * @param[in] uspi The pointer of the specified USCI_SPI module.
  332. * @return None.
  333. * @details Clear RXPDMAEN bit of USPI_PDMACTL register to disable RX PDMA transfer function.
  334. * \hideinitializer
  335. */
  336. #define USPI_DISABLE_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_RXPDMAEN_Msk )
  337. /**
  338. * @brief Disable TX PDMA transfer.
  339. * @param[in] uspi The pointer of the specified USCI_SPI module.
  340. * @return None.
  341. * @details Clear TXPDMAEN bit of USPI_PDMACTL register to disable TX PDMA transfer function.
  342. * \hideinitializer
  343. */
  344. #define USPI_DISABLE_TX_PDMA(uspi) ( (uspi)->PDMACTL &= ~USPI_PDMACTL_TXPDMAEN_Msk )
  345. /**
  346. * @brief Disable TX and RX PDMA transfer.
  347. * @param[in] uspi The pointer of the specified USCI_SPI module.
  348. * @return None.
  349. * @details Clear TXPDMAEN bit and RXPDMAEN bit of USPI_PDMACTL register to disable TX and RX PDMA transfer function.
  350. * \hideinitializer
  351. */
  352. #define USPI_DISABLE_TX_RX_PDMA(uspi) ( (uspi)->PDMACTL &= ~(USPI_PDMACTL_TXPDMAEN_Msk | USPI_PDMACTL_RXPDMAEN_Msk))
  353. uint32_t USPI_Open(USPI_T *uspi, uint32_t u32MasterSlave, uint32_t u32SPIMode, uint32_t u32DataWidth, uint32_t u32BusClock);
  354. void USPI_Close(USPI_T *uspi);
  355. void USPI_ClearRxBuf(USPI_T *uspi);
  356. void USPI_ClearTxBuf(USPI_T *uspi);
  357. void USPI_DisableAutoSS(USPI_T *uspi);
  358. void USPI_EnableAutoSS(USPI_T *uspi, uint32_t u32SSPinMask, uint32_t u32ActiveLevel);
  359. uint32_t USPI_SetBusClock(USPI_T *uspi, uint32_t u32BusClock);
  360. uint32_t USPI_GetBusClock(USPI_T *uspi);
  361. void USPI_EnableInt(USPI_T *uspi, uint32_t u32Mask);
  362. void USPI_DisableInt(USPI_T *uspi, uint32_t u32Mask);
  363. uint32_t USPI_GetIntFlag(USPI_T *uspi, uint32_t u32Mask);
  364. void USPI_ClearIntFlag(USPI_T *uspi, uint32_t u32Mask);
  365. uint32_t USPI_GetStatus(USPI_T *uspi, uint32_t u32Mask);
  366. void USPI_EnableWakeup(USPI_T *uspi);
  367. void USPI_DisableWakeup(USPI_T *uspi);
  368. /*@}*/ /* end of group USCI_SPI_EXPORTED_FUNCTIONS */
  369. /*@}*/ /* end of group USCI_SPI_Driver */
  370. /*@}*/ /* end of group Standard_Driver */
  371. #ifdef __cplusplus
  372. }
  373. #endif
  374. #endif /* __NU_USCI_SPI_H__ */
  375. /*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/