i2s_reg.h 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /**************************************************************************//**
  2. * @file i2s_reg.h
  3. * @version V1.00
  4. * @brief I2S register definition header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __I2S_REG_H__
  10. #define __I2S_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup I2S I2S Interface Controller(I2S)
  20. Memory Mapped Structure for I2S Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var I2S_T::CTL0
  26. * Offset: 0x00 I2S Control Register 0
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[0] |I2SEN |I2S Controller Enable Control
  31. * | | |0 = I2S controller Disabled.
  32. * | | |1 = I2S controller Enabled.
  33. * |[1] |TXEN |Transmit Enable Control
  34. * | | |0 = Data transmission Disabled.
  35. * | | |1 = Data transmission Enabled.
  36. * |[2] |RXEN |Receive Enable Control
  37. * | | |0 = Data receiving Disabled.
  38. * | | |1 = Data receiving Enabled.
  39. * |[3] |MUTE |Transmit Mute Enable Control
  40. * | | |0 = Transmit data is shifted from buffer.
  41. * | | |1 = Send zero on transmit channel.
  42. * |[5:4] |DATWIDTH |Data Width
  43. * | | |This bit field is used to define the bit-width of data word in each audio channel
  44. * | | |00 = The bit-width of data word is 8-bit.
  45. * | | |01 = The bit-width of data word is 16-bit.
  46. * | | |10 = The bit-width of data word is 24-bit.
  47. * | | |11 = The bit-width of data word is 32-bit.
  48. * |[6] |MONO |Monaural Data Control
  49. * | | |0 = Data is stereo format.
  50. * | | |1 = Data is monaural format.
  51. * | | |Note: when chip records data, RXLCH (I2S_CTL0[23]) indicates which channel data will be saved if monaural format is selected.
  52. * |[7] |ORDER |Stereo Data Order in FIFO
  53. * | | |In 8-bit/16-bit data width, this bit is used to select whether the even or odd channel data is stored in higher byte
  54. * | | |In 24-bit data width, this is used to select the left/right alignment method of audio data which is stored in data memory consisted of 32-bit FIFO entries.
  55. * | | |0 = Even channel data at high byte in 8-bit/16-bit data width.
  56. * | | |LSB of 24-bit audio data in each channel is aligned to right side in 32-bit FIFO entries.
  57. * | | |1 = Even channel data at low byte.
  58. * | | | MSB of 24-bit audio data in each channel is aligned to left side in 32-bit FIFO entries.
  59. * |[8] |SLAVE |Slave Mode Enable Control
  60. * | | |0 = Master mode.
  61. * | | |1 = Slave mode.
  62. * | | |Note: I2S can operate as master or slave
  63. * | | |For Master mode, I2S_BCLK and I2S_LRCLK pins are output mode and send out bit clock to Audio CODEC chip
  64. * | | |In Slave mode, I2S_BCLK and I2S_LRCLK pins are input mode and I2S_BCLK and I2S_LRCLK signals are received from outer Audio CODEC chip.
  65. * |[15] |MCLKEN |Master Clock Enable Control
  66. * | | |If MCLKEN is set to 1, I2S controller will generate master clock on I2S_MCLK pin for external audio devices.
  67. * | | |0 = Master clock Disabled.
  68. * | | |1 = Master clock Enabled.
  69. * |[18] |TXFBCLR |Transmit FIFO Buffer Clear
  70. * | | |0 = No Effect.
  71. * | | |1 = Clear TX FIFO.
  72. * | | |Note1: Write 1 to clear transmit FIFO, internal pointer is reset to FIFO start point, and TXCNT (I2S_STATUS1[12:8]) returns 0 and transmit FIFO becomes empty but data in transmit FIFO is not changed.
  73. * | | |Note2: This bit is clear by hardware automatically, read it return zero.
  74. * |[19] |RXFBCLR |Receive FIFO Buffer Clear
  75. * | | |0 = No Effect.
  76. * | | |1 = Clear RX FIFO.
  77. * | | |Note1: Write 1 to clear receive FIFO, internal pointer is reset to FIFO start point, and RXCNT (I2S_STATUS1[20:16]) returns 0 and receive FIFO becomes empty.
  78. * | | |Note2: This bit is cleared by hardware automatically, read it return zero.
  79. * |[20] |TXPDMAEN |Transmit PDMA Enable Control
  80. * | | |0 = Transmit PDMA function Disabled.
  81. * | | |1 = Transmit PDMA function Enabled.
  82. * |[21] |RXPDMAEN |Receive PDMA Enable Control
  83. * | | |0 = Receiver PDMA function Disabled.
  84. * | | |1 = Receiver PDMA function Enabled.
  85. * |[23] |RXLCH |Receive Left Channel Enable Control
  86. * | | |When monaural format is selected (MONO = 1), I2S will receive channel1 data if RXLCH is set to 0, and receive channel0 data if RXLCH is set to 1.
  87. * | | |0 = Receives channel1 data in MONO mode.
  88. * | | |1 = Receives channel0 data in MONO mode.
  89. * |[26:24] |FORMAT |Data Format Selection
  90. * | | |000 = I2S standard data format.
  91. * | | |001 = I2S with MSB justified.
  92. * | | |010 = I2S with LSB justified.
  93. * | | |011 = Reserved.
  94. * | | |100 = PCM standard data format.
  95. * | | |101 = PCM with MSB justified.
  96. * | | |110 = PCM with LSB justified.
  97. * | | |111 = Reserved.
  98. * |[27] |PCMSYNC |PCM Synchronization Pulse Length Selection
  99. * | | |This bit field is used to select the high pulse length of frame synchronization signal in PCM protocol
  100. * | | |0 = One BCLK period.
  101. * | | |1 = One channel period.
  102. * | | |Note: This bit is only available in master mode
  103. * |[29:28] |CHWIDTH |Channel Width
  104. * | | |This bit fields are used to define the length of audio channel
  105. * | | |If CHWIDTH < DATWIDTH, the hardware will set the real channel length as the bit-width of audio data which is defined by DATWIDTH.
  106. * | | |00 = The bit-width of each audio channel is 8-bit.
  107. * | | |01 = The bit-width of each audio channel is 16-bit.
  108. * | | |10 = The bit-width of each audio channel is 24-bit.
  109. * | | |11 = The bit-width of each audio channel is 32-bit.
  110. * |[31:30] |TDMCHNUM |TDM Channel Number
  111. * | | |This bit fields are used to define the TDM channel number in one audio frame while PCM mode (FORMAT[2] = 1).
  112. * | | |00 = 2 channels in audio frame.
  113. * | | |01 = 4 channels in audio frame.
  114. * | | |10 = 6 channels in audio frame.
  115. * | | |11 = 8 channels in audio frame.
  116. * @var I2S_T::CLKDIV
  117. * Offset: 0x04 I2S Clock Divider Register
  118. * ---------------------------------------------------------------------------------------------------
  119. * |Bits |Field |Descriptions
  120. * | :----: | :----: | :---- |
  121. * |[5:0] |MCLKDIV |Master Clock Divider
  122. * | | |If chip external crystal frequency is (2xMCLKDIV)*256fs then software can program these bits to generate 256fs clock frequency to audio codec chip
  123. * | | |If MCLKDIV is set to 0, MCLK is the same as external clock input.
  124. * | | |For example, sampling rate is 24 kHz and chip external crystal clock is 12.288 MHz, set MCLKDIV = 1.
  125. * | | |F_MCLK = F_I2SCLK/(2x(MCLKDIV)) (When MCLKDIV is >= 1 ).
  126. * | | |F_MCLK = F_I2SCLK (When MCLKDIV is set to 0 ).
  127. * | | |Note: F_MCLK is the frequency of MCLK, and F_I2SCLK is the frequency of the I2S_CLK
  128. * |[16:8] |BCLKDIV |Bit Clock Divider
  129. * | | |The I2S controller will generate bit clock in Master mode
  130. * | | |Software can program these bit fields to generate sampling rate clock frequency.
  131. * | | |F_BCLK= F_I2SCLK / (2*(BCLKDIV + 1)).
  132. * | | |Note: F_BCLK is the frequency of BCLK and F_I2SCLK is the frequency of I2S_CLK
  133. * @var I2S_T::IEN
  134. * Offset: 0x08 I2S Interrupt Enable Register
  135. * ---------------------------------------------------------------------------------------------------
  136. * |Bits |Field |Descriptions
  137. * | :----: | :----: | :---- |
  138. * |[0] |RXUDFIEN |Receive FIFO Underflow Interrupt Enable Control
  139. * | | |0 = Interrupt Disabled.
  140. * | | |1 = Interrupt Enabled.
  141. * | | |Note: If software reads receive FIFO when it is empty then RXUDIF (I2S_STATUS0[8]) flag is set to 1.
  142. * |[1] |RXOVFIEN |Receive FIFO Overflow Interrupt Enable Control
  143. * | | |0 = Interrupt Disabled.
  144. * | | |1 = Interrupt Enabled.
  145. * | | |Note: Interrupt occurs if this bit is set to 1 and RXOVIF (I2S_STATUS0[9]) flag is set to 1
  146. * |[2] |RXTHIEN |Receive FIFO Threshold Level Interrupt Enable Control
  147. * | | |0 = Interrupt Disabled.
  148. * | | |1 = Interrupt Enabled.
  149. * | | |Note: When data word in receive FIFO is equal or higher than RXTH (I2S_CTL1[19:16]) and the RXTHIF (I2S_STATUS0[10]) bit is set to 1
  150. * | | |If RXTHIEN bit is enabled, interrupt occur.
  151. * |[8] |TXUDFIEN |Transmit FIFO Underflow Interrupt Enable Control
  152. * | | |0 = Interrupt Disabled.
  153. * | | |1 = Interrupt Enabled.
  154. * | | |Note: Interrupt occur if this bit is set to 1 and TXUDIF (I2S_STATUS0[16]) flag is set to 1.
  155. * |[9] |TXOVFIEN |Transmit FIFO Overflow Interrupt Enable Control
  156. * | | |0 = Interrupt Disabled.
  157. * | | |1 = Interrupt Enabled.
  158. * | | |Note: Interrupt occurs if this bit is set to 1 and TXOVIF (I2S_STATUS0[17]) flag is set to 1
  159. * |[10] |TXTHIEN |Transmit FIFO Threshold Level Interrupt Enable Control
  160. * | | |0 = Interrupt Disabled.
  161. * | | |1 = Interrupt Enabled.
  162. * | | |Note: Interrupt occurs if this bit is set to 1 and data words in transmit FIFO is less than TXTH (I2S_CTL1[11:8]).
  163. * |[16] |CH0ZCIEN |Channel0 Zero-cross Interrupt Enable Control
  164. * | | |0 = Interrupt Disabled.
  165. * | | |1 = Interrupt Enabled.
  166. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel0 zero-cross
  167. * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  168. * |[17] |CH1ZCIEN |Channel1 Zero-cross Interrupt Enable Control
  169. * | | |0 = Interrupt Disabled.
  170. * | | |1 = Interrupt Enabled.
  171. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel1 zero-cross
  172. * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  173. * |[18] |CH2ZCIEN |Channel2 Zero-cross Interrupt Enable Control
  174. * | | |0 = Interrupt Disabled.
  175. * | | |1 = Interrupt Enabled.
  176. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel2 zero-cross
  177. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  178. * |[19] |CH3ZCIEN |Channel3 Zero-cross Interrupt Enable Control
  179. * | | |0 = Interrupt Disabled.
  180. * | | |1 = Interrupt Enabled.
  181. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel3 zero-cross
  182. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  183. * |[20] |CH4ZCIEN |Channel4 Zero-cross Interrupt Enable Control
  184. * | | |0 = Interrupt Disabled.
  185. * | | |1 = Interrupt Enabled.
  186. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel4 zero-cross
  187. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  188. * |[21] |CH5ZCIEN |Channel5 Zero-cross Interrupt Enable Control
  189. * | | |0 = Interrupt Disabled.
  190. * | | |1 = Interrupt Enabled.
  191. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel5 zero-cross
  192. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  193. * |[22] |CH6ZCIEN |Channel6 Zero-cross Interrupt Enable Control
  194. * | | |0 = Interrupt Disabled.
  195. * | | |1 = Interrupt Enabled.
  196. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel6 zero-cross
  197. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  198. * |[23] |CH7ZCIEN |Channel7 Zero-cross Interrupt Enable Control
  199. * | | |0 = Interrupt Disabled.
  200. * | | |1 = Interrupt Enabled.
  201. * | | |Note1: Interrupt occurs if this bit is set to 1 and channel7 zero-cross
  202. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  203. * @var I2S_T::STATUS0
  204. * Offset: 0x0C I2S Status Register 0
  205. * ---------------------------------------------------------------------------------------------------
  206. * |Bits |Field |Descriptions
  207. * | :----: | :----: | :---- |
  208. * |[0] |I2SINT |I2S Interrupt Flag (Read Only)
  209. * | | |0 = No I2S interrupt.
  210. * | | |1 = I2S interrupt.
  211. * | | |Note: It is wire-OR of I2STXINT and I2SRXINT bits.
  212. * |[1] |I2SRXINT |I2S Receive Interrupt (Read Only)
  213. * | | |0 = No receive interrupt.
  214. * | | |1 = Receive interrupt.
  215. * |[2] |I2STXINT |I2S Transmit Interrupt (Read Only)
  216. * | | |0 = No transmit interrupt.
  217. * | | |1 = Transmit interrupt.
  218. * |[5:3] |DATACH |Transmission Data Channel (Read Only)
  219. * | | |This bit fields are used to indicate which audio channel is current transmit data belong.
  220. * | | |000 = channel0 (means left channel while 2-channel I2S/PCM mode).
  221. * | | |001 = channel1 (means right channel while 2-channel I2S/PCM mode).
  222. * | | |010 = channel2 (available while 4-channel TDM PCM mode).
  223. * | | |011 = channel3 (available while 4-channel TDM PCM mode).
  224. * | | |100 = channel4 (available while 6-channel TDM PCM mode).
  225. * | | |101 = channel5 (available while 6-channel TDM PCM mode).
  226. * | | |110 = channel6 (available while 8-channel TDM PCM mode).
  227. * | | |111 = channel7 (available while 8-channel TDM PCM mode).
  228. * |[8] |RXUDIF |Receive FIFO Underflow Interrupt Flag
  229. * | | |0 = No underflow occur.
  230. * | | |1 = Underflow occur.
  231. * | | |Note1: When receive FIFO is empty, and software reads the receive FIFO again
  232. * | | |This bit will be set to 1, and it indicates underflow situation occurs.
  233. * | | |Note2: Write 1 to clear this bit to zero
  234. * |[9] |RXOVIF |Receive FIFO Overflow Interrupt Flag
  235. * | | |0 = No overflow occur.
  236. * | | |1 = Overflow occur.
  237. * | | |Note1: When receive FIFO is full and receive hardware attempt to write data into receive FIFO then this bit is set to 1, data in 1st buffer is overwrote.
  238. * | | |Note2: Write 1 to clear this bit to 0.
  239. * |[10] |RXTHIF |Receive FIFO Threshold Interrupt Flag (Read Only)
  240. * | | |0 = Data word(s) in FIFO is not higher than threshold level.
  241. * | | |1 = Data word(s) in FIFO is higher than threshold level.
  242. * | | |Note: When data word(s) in receive FIFO is higher than threshold value set in RXTH (I2S_CTL1[19:16]) the RXTHIF bit becomes to 1
  243. * | | |It keeps at 1 till RXCNT (I2S_STATUS1[20:16]) is not higher than RXTH (I2S_CTL1[19:16]) after software read RXFIFO register.
  244. * |[11] |RXFULL |Receive FIFO Full (Read Only)
  245. * | | |0 = Not full.
  246. * | | |1 = Full.
  247. * | | |Note: This bit reflects data words number in receive FIFO is 16.
  248. * |[12] |RXEMPTY |Receive FIFO Empty (Read Only)
  249. * | | |0 = Not empty.
  250. * | | |1 = Empty.
  251. * | | |Note: This bit reflects data words number in receive FIFO is zero
  252. * |[16] |TXUDIF |Transmit FIFO Underflow Interrupt Flag
  253. * | | |0 = No underflow.
  254. * | | |1 = Underflow.
  255. * | | |Note1: This bit will be set to 1 when shift logic hardware read data from transmitting FIFO and the filling data level in transmitting FIFO is not enough for one audio frame.
  256. * | | |Note2: Write 1 to clear this bit to 0.
  257. * |[17] |TXOVIF |Transmit FIFO Overflow Interrupt Flag
  258. * | | |0 = No overflow.
  259. * | | |1 = Overflow.
  260. * | | |Note1: Write data to transmit FIFO when it is full and this bit set to 1
  261. * | | |Note2: Write 1 to clear this bit to 0.
  262. * |[18] |TXTHIF |Transmit FIFO Threshold Interrupt Flag (Read Only)
  263. * | | |0 = Data word(s) in FIFO is higher than threshold level.
  264. * | | |1 = Data word(s) in FIFO is equal or lower than threshold level.
  265. * | | |Note: When data word(s) in transmit FIFO is equal or lower than threshold value set in TXTH (I2S_CTL1[11:8]) the TXTHIF bit becomes to 1
  266. * | | |It keeps at 1 till TXCNT (I2S_STATUS1[12:8]) is higher than TXTH (I2S_CTL1[11:8]) after software write TXFIFO register.
  267. * |[19] |TXFULL |Transmit FIFO Full (Read Only)
  268. * | | |This bit reflect data word number in transmit FIFO is 16
  269. * | | |0 = Not full.
  270. * | | |1 = Full.
  271. * |[20] |TXEMPTY |Transmit FIFO Empty (Read Only)
  272. * | | |This bit reflect data word number in transmit FIFO is zero
  273. * | | |0 = Not empty.
  274. * | | |1 = Empty.
  275. * |[21] |TXBUSY |Transmit Busy (Read Only)
  276. * | | |0 = Transmit shift buffer is empty.
  277. * | | |1 = Transmit shift buffer is busy.
  278. * | | |Note: This bit is cleared to 0 when all data in transmit FIFO and shift buffer is shifted out
  279. * | | |And set to 1 when 1st data is load to shift buffer
  280. * @var I2S_T::TXFIFO
  281. * Offset: 0x10 I2S Transmit FIFO Register
  282. * ---------------------------------------------------------------------------------------------------
  283. * |Bits |Field |Descriptions
  284. * | :----: | :----: | :---- |
  285. * |[31:0] |TXFIFO |Transmit FIFO Bits
  286. * | | |I2S contains 16 words (16x32 bit) data buffer for data transmit
  287. * | | |Write data to this register to prepare data for transmit
  288. * | | |The remaining word number is indicated by TXCNT (I2S_STATUS1[12:8]).
  289. * @var I2S_T::RXFIFO
  290. * Offset: 0x14 I2S Receive FIFO Register
  291. * ---------------------------------------------------------------------------------------------------
  292. * |Bits |Field |Descriptions
  293. * | :----: | :----: | :---- |
  294. * |[31:0] |RXFIFO |Receive FIFO Bits
  295. * | | |I2S contains 16 words (16x32 bit) data buffer for data receive
  296. * | | |Read this register to get data in FIFO
  297. * | | |The remaining data word number is indicated by RXCNT (I2S_STATUS1[20:16]).
  298. * @var I2S_T::CTL1
  299. * Offset: 0x20 I2S Control Register 1
  300. * ---------------------------------------------------------------------------------------------------
  301. * |Bits |Field |Descriptions
  302. * | :----: | :----: | :---- |
  303. * |[0] |CH0ZCEN |Channel0 Zero-cross Detection Enable Control
  304. * | | |0 = channel0 zero-cross detect Disabled.
  305. * | | |1 = channel0 zero-cross detect Enabled.
  306. * | | |Note1: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  307. * | | |Note2: If this bit is set to 1, when channel0 data sign bit change or next shift data bits are all zero then CH0ZCIF(I2S_STATUS1[0]) flag is set to 1.
  308. * | | |Note3: If CH0ZCIF Flag is set to 1, the channel0 will be mute.
  309. * |[1] |CH1ZCEN |Channel1 Zero-cross Detect Enable Control
  310. * | | |0 = channel1 zero-cross detect Disabled.
  311. * | | |1 = channel1 zero-cross detect Enabled.
  312. * | | |Note1: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  313. * | | |Note2: If this bit is set to 1, when channel1 data sign bit change or next shift data bits are all zero then CH1ZCIF(I2S_STATUS1[1]) flag is set to 1.
  314. * | | |Note3: If CH1ZCIF Flag is set to 1, the channel1 will be mute.
  315. * |[2] |CH2ZCEN |Channel2 Zero-cross Detect Enable Control
  316. * | | |0 = channel2 zero-cross detect Disabled.
  317. * | | |1 = channel2 zero-cross detect Enabled.
  318. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  319. * | | |Note2: If this bit is set to 1, when channel2 data sign bit change or next shift data bits are all zero then CH2ZCIF(I2S_STATUS1[2]) flag is set to 1.
  320. * | | |Note3: If CH2ZCIF Flag is set to 1, the channel2 will be mute.
  321. * |[3] |CH3ZCEN |Channel3 Zero-cross Detect Enable Control
  322. * | | |0 = channel3 zero-cross detect Disabled.
  323. * | | |1 = channel3 zero-cross detect Enabled.
  324. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  325. * | | |Note2: If this bit is set to 1, when channel3 data sign bit change or next shift data bits are all zero then CH3ZCIF(I2S_STATUS1[3]) flag is set to 1.
  326. * | | |Note3: If CH3ZCIF Flag is set to 1, the channel3 will be mute.
  327. * |[4] |CH4ZCEN |Channel4 Zero-cross Detect Enable Control
  328. * | | |0 = channel4 zero-cross detect Disabled.
  329. * | | |1 = channel4 zero-cross detect Enabled.
  330. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  331. * | | |Note2: If this bit is set to 1, when channel4 data sign bit change or next shift data bits are all zero then CH4ZCIF(I2S_STATUS1[4]) flag is set to 1.
  332. * | | |Note3: If CH4ZCIF Flag is set to 1, the channel4 will be mute.
  333. * |[5] |CH5ZCEN |Channel5 Zero-cross Detect Enable Control
  334. * | | |0 = channel5 zero-cross detect Disabled.
  335. * | | |1 = channel5 zero-cross detect Enabled.
  336. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  337. * | | |Note2: If this bit is set to 1, when channel5 data sign bit change or next shift data bits are all zero then CH5ZCIF(I2S_STATUS1[5]) flag is set to 1.
  338. * | | |Note3: If CH5ZCIF Flag is set to 1, the channel5 will be mute.
  339. * |[6] |CH6ZCEN |Channel6 Zero-cross Detect Enable Control
  340. * | | |0 = channel6 zero-cross detect Disabled.
  341. * | | |1 = channel6 zero-cross detect Enabled.
  342. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  343. * | | |Note2: If this bit is set to 1, when channel6 data sign bit change or next shift data bits are all zero then CH6ZCIF(I2S_STATUS1[6]) flag is set to 1.
  344. * | | |Note3: If CH6ZCIF Flag is set to 1, the channel6 will be mute.
  345. * |[7] |CH7ZCEN |Channel7 Zero-cross Detect Enable Control
  346. * | | |0 = channel7 zero-cross detect Disabled.
  347. * | | |1 = channel7 zero-cross detect Enabled.
  348. * | | |Note1: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  349. * | | |Note2: If this bit is set to 1, when channel7 data sign bit change or next shift data bits are all zero then CH7ZCIF (I2S_STATUS1[7]) flag is set to 1.
  350. * | | |Note3: If CH7ZCIF Flag is set to 1, the channel7 will be mute.
  351. * |[11:8] |TXTH |Transmit FIFO Threshold Level
  352. * | | |0000 = 0 data word in transmit FIFO.
  353. * | | |0001 = 1 data word in transmit FIFO.
  354. * | | |0010 = 2 data words in transmit FIFO.
  355. * | | |...
  356. * | | |1110 = 14 data words in transmit FIFO.
  357. * | | |1111 = 15 data words in transmit FIFO.
  358. * | | |Note: If remain data word number in transmit FIFO is the same or less than threshold level then TXTHIF (I2S_STATUS0[18]) flag is set.
  359. * |[19:16] |RXTH |Receive FIFO Threshold Level
  360. * | | |0000 = 1 data word in receive FIFO.
  361. * | | |0001 = 2 data words in receive FIFO.
  362. * | | |0010 = 3 data words in receive FIFO.
  363. * | | |...
  364. * | | |1110 = 15 data words in receive FIFO.
  365. * | | |1111 = 16 data words in receive FIFO.
  366. * | | |Note: When received data word number in receive buffer is greater than threshold level then RXTHIF (I2S_STATUS0[10]) flag is set.
  367. * |[24] |PBWIDTH |Peripheral Bus Data Width Selection
  368. * | | |This bit is used to choice the available data width of APB bus
  369. * | | |It must be set to 1 while PDMA function is enable and it is set to 16-bit transmission mode
  370. * | | |0 = 32 bits data width.
  371. * | | |1 = 16 bits data width.
  372. * | | |Note1: If PBWIDTH=1, the low 16 bits of 32-bit data bus are available.
  373. * | | |Note2: If PBWIDTH=1, the transmitting FIFO level will be increased after two FIFO write operations.
  374. * | | |Note3: If PBWIDTH=1, the receiving FIFO level will be decreased after two FIFO read operations.
  375. * |[25] |PB16ORD |FIFO Read/Write Order in 16-bit Width of Peripheral Bus
  376. * | | |When PBWIDTH = 1, the data FIFO will be increased or decreased by two peripheral bus access
  377. * | | |This bit is used to select the order of FIFO access operations to meet the 32-bit transmitting/receiving FIFO entries.
  378. * | | |0 = Low 16-bit read/write access first.
  379. * | | |1 = High 16-bit read/write access first.
  380. * | | |Note: This bit is available while PBWIDTH = 1.
  381. * @var I2S_T::STATUS1
  382. * Offset: 0x24 I2S Status Register 1
  383. * ---------------------------------------------------------------------------------------------------
  384. * |Bits |Field |Descriptions
  385. * | :----: | :----: | :---- |
  386. * |[0] |CH0ZCIF |Channel0 Zero-cross Interrupt Flag
  387. * | | |It indicates channel0 next sample data sign bit is changed or all data bits are zero.
  388. * | | |0 = No zero-cross in channel0.
  389. * | | |1 = Channel0 zero-cross is detected.
  390. * | | |Note1: Write 1 to clear this bit to 0.
  391. * | | |Note2: Channel0 also means left audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  392. * |[1] |CH1ZCIF |Channel1 Zero-cross Interrupt Flag
  393. * | | |It indicates channel1 next sample data sign bit is changed or all data bits are zero.
  394. * | | |0 = No zero-cross in channel1.
  395. * | | |1 = Channel1 zero-cross is detected.
  396. * | | |Note1: Write 1 to clear this bit to 0.
  397. * | | |Note2: Channel1 also means right audio channel while I2S (FORMAT[2]=0) or 2-channel PCM mode.
  398. * |[2] |CH2ZCIF |Channel2 Zero-cross Interrupt Flag
  399. * | | |It indicates channel2 next sample data sign bit is changed or all data bits are zero.
  400. * | | |0 = No zero-cross in channel2.
  401. * | | |1 = Channel2 zero-cross is detected.
  402. * | | |Note1: Write 1 to clear this bit to 0.
  403. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  404. * |[3] |CH3ZCIF |Channel3 Zero-cross Interrupt Flag
  405. * | | |It indicates channel3 next sample data sign bit is changed or all data bits are zero.
  406. * | | |0 = No zero-cross in channel3.
  407. * | | |1 = Channel3 zero-cross is detected.
  408. * | | |Note1: Write 1 to clear this bit to 0.
  409. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  410. * |[4] |CH4ZCIF |Channel4 Zero-cross Interrupt Flag
  411. * | | |It indicates channel4 next sample data sign bit is changed or all data bits are zero.
  412. * | | |0 = No zero-cross in channel4.
  413. * | | |1 = Channel4 zero-cross is detected.
  414. * | | |Note1: Write 1 to clear this bit to 0.
  415. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  416. * |[5] |CH5ZCIF |Channel5 Zero-cross Interrupt Flag
  417. * | | |It indicates channel5 next sample data sign bit is changed or all data bits are zero.
  418. * | | |0 = No zero-cross in channel5.
  419. * | | |1 = Channel5 zero-cross is detected.
  420. * | | |Note1: Write 1 to clear this bit to 0.
  421. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  422. * |[6] |CH6ZCIF |Channel6 Zero-cross Interrupt Flag
  423. * | | |It indicates channel6 next sample data sign bit is changed or all data bits are zero.
  424. * | | |0 = No zero-cross in channel6.
  425. * | | |1 = Channel6 zero-cross is detected.
  426. * | | |Note1: Write 1 to clear this bit to 0.
  427. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  428. * |[7] |CH7ZCIF |Channel7 Zero-cross Interrupt Flag
  429. * | | |It indicates channel7 next sample data sign bit is changed or all data bits are zero.
  430. * | | |0 = No zero-cross in channel7.
  431. * | | |1 = Channel7 zero-cross is detected.
  432. * | | |Note1: Write 1 to clear this bit to 0.
  433. * | | |Note2: This bit is available while multi-channel PCM mode and TDMCHNUM (I2S_CTL0[31:30]) = 0x1, 0x2, 0x3.
  434. * |[12:8] |TXCNT |Transmit FIFO Level (Read Only)
  435. * | | |These bits indicate the number of available entries in transmit FIFO
  436. * | | |00000 = No data.
  437. * | | |00001 = 1 word in transmit FIFO.
  438. * | | |00010 = 2 words in transmit FIFO.
  439. * | | |...
  440. * | | |01110 = 14 words in transmit FIFO.
  441. * | | |01111 = 15 words in transmit FIFO.
  442. * | | |10000 = 16 words in transmit FIFO.
  443. * | | |Others are reserved.
  444. * |[20:16] |RXCNT |Receive FIFO Level (Read Only)
  445. * | | |These bits indicate the number of available entries in receive FIFO
  446. * | | |00000 = No data.
  447. * | | |00001 = 1 word in receive FIFO.
  448. * | | |00010 = 2 words in receive FIFO.
  449. * | | |...
  450. * | | |01110 = 14 words in receive FIFO.
  451. * | | |01111 = 15 words in receive FIFO.
  452. * | | |10000 = 16 words in receive FIFO.
  453. * | | |Others are reserved.
  454. */
  455. __IO uint32_t CTL0; /*!< [0x0000] I2S Control Register 0 */
  456. __IO uint32_t CLKDIV; /*!< [0x0004] I2S Clock Divider Register */
  457. __IO uint32_t IEN; /*!< [0x0008] I2S Interrupt Enable Register */
  458. __IO uint32_t STATUS0; /*!< [0x000c] I2S Status Register 0 */
  459. __O uint32_t TXFIFO; /*!< [0x0010] I2S Transmit FIFO Register */
  460. __I uint32_t RXFIFO; /*!< [0x0014] I2S Receive FIFO Register */
  461. /// @cond HIDDEN_SYMBOLS
  462. __I uint32_t RESERVE0[2];
  463. /// @endcond //HIDDEN_SYMBOLS
  464. __IO uint32_t CTL1; /*!< [0x0020] I2S Control Register 1 */
  465. __IO uint32_t STATUS1; /*!< [0x0024] I2S Status Register 1 */
  466. } I2S_T;
  467. /**
  468. @addtogroup I2S_CONST I2S Bit Field Definition
  469. Constant Definitions for I2S Controller
  470. @{ */
  471. #define I2S_CTL0_I2SEN_Pos (0) /*!< I2S_T::CTL0: I2SEN Position */
  472. #define I2S_CTL0_I2SEN_Msk (0x1ul << I2S_CTL0_I2SEN_Pos) /*!< I2S_T::CTL0: I2SEN Mask */
  473. #define I2S_CTL0_TXEN_Pos (1) /*!< I2S_T::CTL0: TXEN Position */
  474. #define I2S_CTL0_TXEN_Msk (0x1ul << I2S_CTL0_TXEN_Pos) /*!< I2S_T::CTL0: TXEN Mask */
  475. #define I2S_CTL0_RXEN_Pos (2) /*!< I2S_T::CTL0: RXEN Position */
  476. #define I2S_CTL0_RXEN_Msk (0x1ul << I2S_CTL0_RXEN_Pos) /*!< I2S_T::CTL0: RXEN Mask */
  477. #define I2S_CTL0_MUTE_Pos (3) /*!< I2S_T::CTL0: MUTE Position */
  478. #define I2S_CTL0_MUTE_Msk (0x1ul << I2S_CTL0_MUTE_Pos) /*!< I2S_T::CTL0: MUTE Mask */
  479. #define I2S_CTL0_DATWIDTH_Pos (4) /*!< I2S_T::CTL0: DATWIDTH Position */
  480. #define I2S_CTL0_DATWIDTH_Msk (0x3ul << I2S_CTL0_DATWIDTH_Pos) /*!< I2S_T::CTL0: DATWIDTH Mask */
  481. #define I2S_CTL0_MONO_Pos (6) /*!< I2S_T::CTL0: MONO Position */
  482. #define I2S_CTL0_MONO_Msk (0x1ul << I2S_CTL0_MONO_Pos) /*!< I2S_T::CTL0: MONO Mask */
  483. #define I2S_CTL0_ORDER_Pos (7) /*!< I2S_T::CTL0: ORDER Position */
  484. #define I2S_CTL0_ORDER_Msk (0x1ul << I2S_CTL0_ORDER_Pos) /*!< I2S_T::CTL0: ORDER Mask */
  485. #define I2S_CTL0_SLAVE_Pos (8) /*!< I2S_T::CTL0: SLAVE Position */
  486. #define I2S_CTL0_SLAVE_Msk (0x1ul << I2S_CTL0_SLAVE_Pos) /*!< I2S_T::CTL0: SLAVE Mask */
  487. #define I2S_CTL0_MCLKEN_Pos (15) /*!< I2S_T::CTL0: MCLKEN Position */
  488. #define I2S_CTL0_MCLKEN_Msk (0x1ul << I2S_CTL0_MCLKEN_Pos) /*!< I2S_T::CTL0: MCLKEN Mask */
  489. #define I2S_CTL0_TXFBCLR_Pos (18) /*!< I2S_T::CTL0: TXFBCLR Position */
  490. #define I2S_CTL0_TXFBCLR_Msk (0x1ul << I2S_CTL0_TXFBCLR_Pos) /*!< I2S_T::CTL0: TXFBCLR Mask */
  491. #define I2S_CTL0_RXFBCLR_Pos (19) /*!< I2S_T::CTL0: RXFBCLR Position */
  492. #define I2S_CTL0_RXFBCLR_Msk (0x1ul << I2S_CTL0_RXFBCLR_Pos) /*!< I2S_T::CTL0: RXFBCLR Mask */
  493. #define I2S_CTL0_TXPDMAEN_Pos (20) /*!< I2S_T::CTL0: TXPDMAEN Position */
  494. #define I2S_CTL0_TXPDMAEN_Msk (0x1ul << I2S_CTL0_TXPDMAEN_Pos) /*!< I2S_T::CTL0: TXPDMAEN Mask */
  495. #define I2S_CTL0_RXPDMAEN_Pos (21) /*!< I2S_T::CTL0: RXPDMAEN Position */
  496. #define I2S_CTL0_RXPDMAEN_Msk (0x1ul << I2S_CTL0_RXPDMAEN_Pos) /*!< I2S_T::CTL0: RXPDMAEN Mask */
  497. #define I2S_CTL0_RXLCH_Pos (23) /*!< I2S_T::CTL0: RXLCH Position */
  498. #define I2S_CTL0_RXLCH_Msk (0x1ul << I2S_CTL0_RXLCH_Pos) /*!< I2S_T::CTL0: RXLCH Mask */
  499. #define I2S_CTL0_FORMAT_Pos (24) /*!< I2S_T::CTL0: FORMAT Position */
  500. #define I2S_CTL0_FORMAT_Msk (0x7ul << I2S_CTL0_FORMAT_Pos) /*!< I2S_T::CTL0: FORMAT Mask */
  501. #define I2S_CTL0_PCMSYNC_Pos (27) /*!< I2S_T::CTL0: PCMSYNC Position */
  502. #define I2S_CTL0_PCMSYNC_Msk (0x1ul << I2S_CTL0_PCMSYNC_Pos) /*!< I2S_T::CTL0: PCMSYNC Mask */
  503. #define I2S_CTL0_CHWIDTH_Pos (28) /*!< I2S_T::CTL0: CHWIDTH Position */
  504. #define I2S_CTL0_CHWIDTH_Msk (0x3ul << I2S_CTL0_CHWIDTH_Pos) /*!< I2S_T::CTL0: CHWIDTH Mask */
  505. #define I2S_CTL0_TDMCHNUM_Pos (30) /*!< I2S_T::CTL0: TDMCHNUM Position */
  506. #define I2S_CTL0_TDMCHNUM_Msk (0x3ul << I2S_CTL0_TDMCHNUM_Pos) /*!< I2S_T::CTL0: TDMCHNUM Mask */
  507. #define I2S_CLKDIV_MCLKDIV_Pos (0) /*!< I2S_T::CLKDIV: MCLKDIV Position */
  508. #define I2S_CLKDIV_MCLKDIV_Msk (0x3ful << I2S_CLKDIV_MCLKDIV_Pos) /*!< I2S_T::CLKDIV: MCLKDIV Mask */
  509. #define I2S_CLKDIV_BCLKDIV_Pos (8) /*!< I2S_T::CLKDIV: BCLKDIV Position */
  510. #define I2S_CLKDIV_BCLKDIV_Msk (0x1fful << I2S_CLKDIV_BCLKDIV_Pos) /*!< I2S_T::CLKDIV: BCLKDIV Mask */
  511. #define I2S_IEN_RXUDFIEN_Pos (0) /*!< I2S_T::IEN: RXUDFIEN Position */
  512. #define I2S_IEN_RXUDFIEN_Msk (0x1ul << I2S_IEN_RXUDFIEN_Pos) /*!< I2S_T::IEN: RXUDFIEN Mask */
  513. #define I2S_IEN_RXOVFIEN_Pos (1) /*!< I2S_T::IEN: RXOVFIEN Position */
  514. #define I2S_IEN_RXOVFIEN_Msk (0x1ul << I2S_IEN_RXOVFIEN_Pos) /*!< I2S_T::IEN: RXOVFIEN Mask */
  515. #define I2S_IEN_RXTHIEN_Pos (2) /*!< I2S_T::IEN: RXTHIEN Position */
  516. #define I2S_IEN_RXTHIEN_Msk (0x1ul << I2S_IEN_RXTHIEN_Pos) /*!< I2S_T::IEN: RXTHIEN Mask */
  517. #define I2S_IEN_TXUDFIEN_Pos (8) /*!< I2S_T::IEN: TXUDFIEN Position */
  518. #define I2S_IEN_TXUDFIEN_Msk (0x1ul << I2S_IEN_TXUDFIEN_Pos) /*!< I2S_T::IEN: TXUDFIEN Mask */
  519. #define I2S_IEN_TXOVFIEN_Pos (9) /*!< I2S_T::IEN: TXOVFIEN Position */
  520. #define I2S_IEN_TXOVFIEN_Msk (0x1ul << I2S_IEN_TXOVFIEN_Pos) /*!< I2S_T::IEN: TXOVFIEN Mask */
  521. #define I2S_IEN_TXTHIEN_Pos (10) /*!< I2S_T::IEN: TXTHIEN Position */
  522. #define I2S_IEN_TXTHIEN_Msk (0x1ul << I2S_IEN_TXTHIEN_Pos) /*!< I2S_T::IEN: TXTHIEN Mask */
  523. #define I2S_IEN_CH0ZCIEN_Pos (16) /*!< I2S_T::IEN: CH0ZCIEN Position */
  524. #define I2S_IEN_CH0ZCIEN_Msk (0x1ul << I2S_IEN_CH0ZCIEN_Pos) /*!< I2S_T::IEN: CH0ZCIEN Mask */
  525. #define I2S_IEN_CH1ZCIEN_Pos (17) /*!< I2S_T::IEN: CH1ZCIEN Position */
  526. #define I2S_IEN_CH1ZCIEN_Msk (0x1ul << I2S_IEN_CH1ZCIEN_Pos) /*!< I2S_T::IEN: CH1ZCIEN Mask */
  527. #define I2S_IEN_CH2ZCIEN_Pos (18) /*!< I2S_T::IEN: CH2ZCIEN Position */
  528. #define I2S_IEN_CH2ZCIEN_Msk (0x1ul << I2S_IEN_CH2ZCIEN_Pos) /*!< I2S_T::IEN: CH2ZCIEN Mask */
  529. #define I2S_IEN_CH3ZCIEN_Pos (19) /*!< I2S_T::IEN: CH3ZCIEN Position */
  530. #define I2S_IEN_CH3ZCIEN_Msk (0x1ul << I2S_IEN_CH3ZCIEN_Pos) /*!< I2S_T::IEN: CH3ZCIEN Mask */
  531. #define I2S_IEN_CH4ZCIEN_Pos (20) /*!< I2S_T::IEN: CH4ZCIEN Position */
  532. #define I2S_IEN_CH4ZCIEN_Msk (0x1ul << I2S_IEN_CH4ZCIEN_Pos) /*!< I2S_T::IEN: CH4ZCIEN Mask */
  533. #define I2S_IEN_CH5ZCIEN_Pos (21) /*!< I2S_T::IEN: CH5ZCIEN Position */
  534. #define I2S_IEN_CH5ZCIEN_Msk (0x1ul << I2S_IEN_CH5ZCIEN_Pos) /*!< I2S_T::IEN: CH5ZCIEN Mask */
  535. #define I2S_IEN_CH6ZCIEN_Pos (22) /*!< I2S_T::IEN: CH6ZCIEN Position */
  536. #define I2S_IEN_CH6ZCIEN_Msk (0x1ul << I2S_IEN_CH6ZCIEN_Pos) /*!< I2S_T::IEN: CH6ZCIEN Mask */
  537. #define I2S_IEN_CH7ZCIEN_Pos (23) /*!< I2S_T::IEN: CH7ZCIEN Position */
  538. #define I2S_IEN_CH7ZCIEN_Msk (0x1ul << I2S_IEN_CH7ZCIEN_Pos) /*!< I2S_T::IEN: CH7ZCIEN Mask */
  539. #define I2S_STATUS0_I2SINT_Pos (0) /*!< I2S_T::STATUS0: I2SINT Position */
  540. #define I2S_STATUS0_I2SINT_Msk (0x1ul << I2S_STATUS0_I2SINT_Pos) /*!< I2S_T::STATUS0: I2SINT Mask */
  541. #define I2S_STATUS0_I2SRXINT_Pos (1) /*!< I2S_T::STATUS0: I2SRXINT Position */
  542. #define I2S_STATUS0_I2SRXINT_Msk (0x1ul << I2S_STATUS0_I2SRXINT_Pos) /*!< I2S_T::STATUS0: I2SRXINT Mask */
  543. #define I2S_STATUS0_I2STXINT_Pos (2) /*!< I2S_T::STATUS0: I2STXINT Position */
  544. #define I2S_STATUS0_I2STXINT_Msk (0x1ul << I2S_STATUS0_I2STXINT_Pos) /*!< I2S_T::STATUS0: I2STXINT Mask */
  545. #define I2S_STATUS0_DATACH_Pos (3) /*!< I2S_T::STATUS0: DATACH Position */
  546. #define I2S_STATUS0_DATACH_Msk (0x7ul << I2S_STATUS0_DATACH_Pos) /*!< I2S_T::STATUS0: DATACH Mask */
  547. #define I2S_STATUS0_RXUDIF_Pos (8) /*!< I2S_T::STATUS0: RXUDIF Position */
  548. #define I2S_STATUS0_RXUDIF_Msk (0x1ul << I2S_STATUS0_RXUDIF_Pos) /*!< I2S_T::STATUS0: RXUDIF Mask */
  549. #define I2S_STATUS0_RXOVIF_Pos (9) /*!< I2S_T::STATUS0: RXOVIF Position */
  550. #define I2S_STATUS0_RXOVIF_Msk (0x1ul << I2S_STATUS0_RXOVIF_Pos) /*!< I2S_T::STATUS0: RXOVIF Mask */
  551. #define I2S_STATUS0_RXTHIF_Pos (10) /*!< I2S_T::STATUS0: RXTHIF Position */
  552. #define I2S_STATUS0_RXTHIF_Msk (0x1ul << I2S_STATUS0_RXTHIF_Pos) /*!< I2S_T::STATUS0: RXTHIF Mask */
  553. #define I2S_STATUS0_RXFULL_Pos (11) /*!< I2S_T::STATUS0: RXFULL Position */
  554. #define I2S_STATUS0_RXFULL_Msk (0x1ul << I2S_STATUS0_RXFULL_Pos) /*!< I2S_T::STATUS0: RXFULL Mask */
  555. #define I2S_STATUS0_RXEMPTY_Pos (12) /*!< I2S_T::STATUS0: RXEMPTY Position */
  556. #define I2S_STATUS0_RXEMPTY_Msk (0x1ul << I2S_STATUS0_RXEMPTY_Pos) /*!< I2S_T::STATUS0: RXEMPTY Mask */
  557. #define I2S_STATUS0_TXUDIF_Pos (16) /*!< I2S_T::STATUS0: TXUDIF Position */
  558. #define I2S_STATUS0_TXUDIF_Msk (0x1ul << I2S_STATUS0_TXUDIF_Pos) /*!< I2S_T::STATUS0: TXUDIF Mask */
  559. #define I2S_STATUS0_TXOVIF_Pos (17) /*!< I2S_T::STATUS0: TXOVIF Position */
  560. #define I2S_STATUS0_TXOVIF_Msk (0x1ul << I2S_STATUS0_TXOVIF_Pos) /*!< I2S_T::STATUS0: TXOVIF Mask */
  561. #define I2S_STATUS0_TXTHIF_Pos (18) /*!< I2S_T::STATUS0: TXTHIF Position */
  562. #define I2S_STATUS0_TXTHIF_Msk (0x1ul << I2S_STATUS0_TXTHIF_Pos) /*!< I2S_T::STATUS0: TXTHIF Mask */
  563. #define I2S_STATUS0_TXFULL_Pos (19) /*!< I2S_T::STATUS0: TXFULL Position */
  564. #define I2S_STATUS0_TXFULL_Msk (0x1ul << I2S_STATUS0_TXFULL_Pos) /*!< I2S_T::STATUS0: TXFULL Mask */
  565. #define I2S_STATUS0_TXEMPTY_Pos (20) /*!< I2S_T::STATUS0: TXEMPTY Position */
  566. #define I2S_STATUS0_TXEMPTY_Msk (0x1ul << I2S_STATUS0_TXEMPTY_Pos) /*!< I2S_T::STATUS0: TXEMPTY Mask */
  567. #define I2S_STATUS0_TXBUSY_Pos (21) /*!< I2S_T::STATUS0: TXBUSY Position */
  568. #define I2S_STATUS0_TXBUSY_Msk (0x1ul << I2S_STATUS0_TXBUSY_Pos) /*!< I2S_T::STATUS0: TXBUSY Mask */
  569. #define I2S_TXFIFO_TXFIFO_Pos (0) /*!< I2S_T::TXFIFO: TXFIFO Position */
  570. #define I2S_TXFIFO_TXFIFO_Msk (0xfffffffful << I2S_TXFIFO_TXFIFO_Pos) /*!< I2S_T::TXFIFO: TXFIFO Mask */
  571. #define I2S_RXFIFO_RXFIFO_Pos (0) /*!< I2S_T::RXFIFO: RXFIFO Position */
  572. #define I2S_RXFIFO_RXFIFO_Msk (0xfffffffful << I2S_RXFIFO_RXFIFO_Pos) /*!< I2S_T::RXFIFO: RXFIFO Mask */
  573. #define I2S_CTL1_CH0ZCEN_Pos (0) /*!< I2S_T::CTL1: CH0ZCEN Position */
  574. #define I2S_CTL1_CH0ZCEN_Msk (0x1ul << I2S_CTL1_CH0ZCEN_Pos) /*!< I2S_T::CTL1: CH0ZCEN Mask */
  575. #define I2S_CTL1_CH1ZCEN_Pos (1) /*!< I2S_T::CTL1: CH1ZCEN Position */
  576. #define I2S_CTL1_CH1ZCEN_Msk (0x1ul << I2S_CTL1_CH1ZCEN_Pos) /*!< I2S_T::CTL1: CH1ZCEN Mask */
  577. #define I2S_CTL1_CH2ZCEN_Pos (2) /*!< I2S_T::CTL1: CH2ZCEN Position */
  578. #define I2S_CTL1_CH2ZCEN_Msk (0x1ul << I2S_CTL1_CH2ZCEN_Pos) /*!< I2S_T::CTL1: CH2ZCEN Mask */
  579. #define I2S_CTL1_CH3ZCEN_Pos (3) /*!< I2S_T::CTL1: CH3ZCEN Position */
  580. #define I2S_CTL1_CH3ZCEN_Msk (0x1ul << I2S_CTL1_CH3ZCEN_Pos) /*!< I2S_T::CTL1: CH3ZCEN Mask */
  581. #define I2S_CTL1_CH4ZCEN_Pos (4) /*!< I2S_T::CTL1: CH4ZCEN Position */
  582. #define I2S_CTL1_CH4ZCEN_Msk (0x1ul << I2S_CTL1_CH4ZCEN_Pos) /*!< I2S_T::CTL1: CH4ZCEN Mask */
  583. #define I2S_CTL1_CH5ZCEN_Pos (5) /*!< I2S_T::CTL1: CH5ZCEN Position */
  584. #define I2S_CTL1_CH5ZCEN_Msk (0x1ul << I2S_CTL1_CH5ZCEN_Pos) /*!< I2S_T::CTL1: CH5ZCEN Mask */
  585. #define I2S_CTL1_CH6ZCEN_Pos (6) /*!< I2S_T::CTL1: CH6ZCEN Position */
  586. #define I2S_CTL1_CH6ZCEN_Msk (0x1ul << I2S_CTL1_CH6ZCEN_Pos) /*!< I2S_T::CTL1: CH6ZCEN Mask */
  587. #define I2S_CTL1_CH7ZCEN_Pos (7) /*!< I2S_T::CTL1: CH7ZCEN Position */
  588. #define I2S_CTL1_CH7ZCEN_Msk (0x1ul << I2S_CTL1_CH7ZCEN_Pos) /*!< I2S_T::CTL1: CH7ZCEN Mask */
  589. #define I2S_CTL1_TXTH_Pos (8) /*!< I2S_T::CTL1: TXTH Position */
  590. #define I2S_CTL1_TXTH_Msk (0xful << I2S_CTL1_TXTH_Pos) /*!< I2S_T::CTL1: TXTH Mask */
  591. #define I2S_CTL1_RXTH_Pos (16) /*!< I2S_T::CTL1: RXTH Position */
  592. #define I2S_CTL1_RXTH_Msk (0xful << I2S_CTL1_RXTH_Pos) /*!< I2S_T::CTL1: RXTH Mask */
  593. #define I2S_CTL1_PBWIDTH_Pos (24) /*!< I2S_T::CTL1: PBWIDTH Position */
  594. #define I2S_CTL1_PBWIDTH_Msk (0x1ul << I2S_CTL1_PBWIDTH_Pos) /*!< I2S_T::CTL1: PBWIDTH Mask */
  595. #define I2S_CTL1_PB16ORD_Pos (25) /*!< I2S_T::CTL1: PB16ORD Position */
  596. #define I2S_CTL1_PB16ORD_Msk (0x1ul << I2S_CTL1_PB16ORD_Pos) /*!< I2S_T::CTL1: PB16ORD Mask */
  597. #define I2S_STATUS1_CH0ZCIF_Pos (0) /*!< I2S_T::STATUS1: CH0ZCIF Position */
  598. #define I2S_STATUS1_CH0ZCIF_Msk (0x1ul << I2S_STATUS1_CH0ZCIF_Pos) /*!< I2S_T::STATUS1: CH0ZCIF Mask */
  599. #define I2S_STATUS1_CH1ZCIF_Pos (1) /*!< I2S_T::STATUS1: CH1ZCIF Position */
  600. #define I2S_STATUS1_CH1ZCIF_Msk (0x1ul << I2S_STATUS1_CH1ZCIF_Pos) /*!< I2S_T::STATUS1: CH1ZCIF Mask */
  601. #define I2S_STATUS1_CH2ZCIF_Pos (2) /*!< I2S_T::STATUS1: CH2ZCIF Position */
  602. #define I2S_STATUS1_CH2ZCIF_Msk (0x1ul << I2S_STATUS1_CH2ZCIF_Pos) /*!< I2S_T::STATUS1: CH2ZCIF Mask */
  603. #define I2S_STATUS1_CH3ZCIF_Pos (3) /*!< I2S_T::STATUS1: CH3ZCIF Position */
  604. #define I2S_STATUS1_CH3ZCIF_Msk (0x1ul << I2S_STATUS1_CH3ZCIF_Pos) /*!< I2S_T::STATUS1: CH3ZCIF Mask */
  605. #define I2S_STATUS1_CH4ZCIF_Pos (4) /*!< I2S_T::STATUS1: CH4ZCIF Position */
  606. #define I2S_STATUS1_CH4ZCIF_Msk (0x1ul << I2S_STATUS1_CH4ZCIF_Pos) /*!< I2S_T::STATUS1: CH4ZCIF Mask */
  607. #define I2S_STATUS1_CH5ZCIF_Pos (5) /*!< I2S_T::STATUS1: CH5ZCIF Position */
  608. #define I2S_STATUS1_CH5ZCIF_Msk (0x1ul << I2S_STATUS1_CH5ZCIF_Pos) /*!< I2S_T::STATUS1: CH5ZCIF Mask */
  609. #define I2S_STATUS1_CH6ZCIF_Pos (6) /*!< I2S_T::STATUS1: CH6ZCIF Position */
  610. #define I2S_STATUS1_CH6ZCIF_Msk (0x1ul << I2S_STATUS1_CH6ZCIF_Pos) /*!< I2S_T::STATUS1: CH6ZCIF Mask */
  611. #define I2S_STATUS1_CH7ZCIF_Pos (7) /*!< I2S_T::STATUS1: CH7ZCIF Position */
  612. #define I2S_STATUS1_CH7ZCIF_Msk (0x1ul << I2S_STATUS1_CH7ZCIF_Pos) /*!< I2S_T::STATUS1: CH7ZCIF Mask */
  613. #define I2S_STATUS1_TXCNT_Pos (8) /*!< I2S_T::STATUS1: TXCNT Position */
  614. #define I2S_STATUS1_TXCNT_Msk (0x1ful << I2S_STATUS1_TXCNT_Pos) /*!< I2S_T::STATUS1: TXCNT Mask */
  615. #define I2S_STATUS1_RXCNT_Pos (16) /*!< I2S_T::STATUS1: RXCNT Position */
  616. #define I2S_STATUS1_RXCNT_Msk (0x1ful << I2S_STATUS1_RXCNT_Pos) /*!< I2S_T::STATUS1: RXCNT Mask */
  617. /**@}*/ /* I2S_CONST */
  618. /**@}*/ /* end of I2S register group */
  619. /**@}*/ /* end of REGISTER group */
  620. #if defined ( __CC_ARM )
  621. #pragma no_anon_unions
  622. #endif
  623. #endif /* __I2S_REG_H__ */