hw_i2s.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. //*****************************************************************************
  2. //
  3. // hw_i2s.h - Macros for use in accessing the I2S registers.
  4. //
  5. // Copyright (c) 2008-2009 Luminary Micro, Inc. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
  9. // exclusively on LMI's microcontroller products.
  10. //
  11. // The software is owned by LMI and/or its suppliers, and is protected under
  12. // applicable copyright laws. All rights are reserved. You may not combine
  13. // this software with "viral" open-source software in order to form a larger
  14. // program. Any use in violation of the foregoing restrictions may subject
  15. // the user to criminal sanctions under applicable laws, as well as to civil
  16. // liability for the breach of the terms and conditions of this license.
  17. //
  18. // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  19. // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  20. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  21. // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  22. // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  23. //
  24. // This is part of revision 4694 of the Stellaris Firmware Development Package.
  25. //
  26. //*****************************************************************************
  27. #ifndef __HW_I2S_H__
  28. #define __HW_I2S_H__
  29. //*****************************************************************************
  30. //
  31. // The following are defines for the Inter-Integrated Circuit Sound (I2S)
  32. // Interface
  33. //
  34. //*****************************************************************************
  35. #define I2S_O_TXFIFO 0x00000000 // I2S Transmit FIFO Data
  36. #define I2S_O_TXFIFOCFG 0x00000004 // I2S Transmit FIFO Configuration
  37. #define I2S_O_TXCFG 0x00000008 // I2S Transmit Module
  38. // Configuration
  39. #define I2S_O_TXLIMIT 0x0000000C // I2S Transmit FIFO Limit
  40. #define I2S_O_TXISM 0x00000010 // I2S Transmit Interrupt Status
  41. // and Mask
  42. #define I2S_O_TXLEV 0x00000018 // I2S Transmit FIFO Level
  43. #define I2S_O_RXFIFO 0x00000800 // I2S Receive FIFO Data
  44. #define I2S_O_RXFIFOCFG 0x00000804 // I2S Receive FIFO Configuration
  45. #define I2S_O_RXCFG 0x00000808 // I2S Receive Module Configuration
  46. #define I2S_O_RXLIMIT 0x0000080C // I2S Receive FIFO Limit
  47. #define I2S_O_RXISM 0x00000810 // I2S Receive Interrupt Status and
  48. // Mask
  49. #define I2S_O_RXLEV 0x00000818 // I2S Receive FIFO Level
  50. #define I2S_O_CFG 0x00000C00 // I2S Module Configuration
  51. #define I2S_O_IM 0x00000C10 // I2S Interrupt Mask
  52. #define I2S_O_RIS 0x00000C14 // I2S Raw Interrupt Status
  53. #define I2S_O_MIS 0x00000C18 // I2S Masked Interrupt Status
  54. #define I2S_O_IC 0x00000C1C // I2S Interrupt Clear
  55. //*****************************************************************************
  56. //
  57. // The following are defines for the bit fields in the I2S_O_TXFIFO register.
  58. //
  59. //*****************************************************************************
  60. #define I2S_TXFIFO_M 0xFFFFFFFF // TX Data.
  61. #define I2S_TXFIFO_S 0
  62. //*****************************************************************************
  63. //
  64. // The following are defines for the bit fields in the I2S_O_TXFIFOCFG
  65. // register.
  66. //
  67. //*****************************************************************************
  68. #define I2S_TXFIFOCFG_CSS 0x00000002 // Compact Stereo Sample Size.
  69. #define I2S_TXFIFOCFG_LRS 0x00000001 // Left-Right Sample Indicator.
  70. //*****************************************************************************
  71. //
  72. // The following are defines for the bit fields in the I2S_O_TXCFG register.
  73. //
  74. //*****************************************************************************
  75. #define I2S_TXCFG_JST 0x20000000 // Justification of Output Data.
  76. #define I2S_TXCFG_DLY 0x10000000 // Data Delay.
  77. #define I2S_TXCFG_SCP 0x08000000 // SCLK Polarity.
  78. #define I2S_TXCFG_LRP 0x04000000 // Left/Right Clock Polarity.
  79. #define I2S_TXCFG_WM_M 0x03000000 // Write Mode.
  80. #define I2S_TXCFG_WM_DUAL 0x00000000 // Stereo mode
  81. #define I2S_TXCFG_WM_COMPACT 0x01000000 // Compact Stereo mode
  82. #define I2S_TXCFG_WM_MONO 0x02000000 // Mono mode
  83. #define I2S_TXCFG_FMT 0x00800000 // FIFO Empty.
  84. #define I2S_TXCFG_MSL 0x00400000 // SCLK Master/Slave.
  85. #define I2S_TXCFG_SSZ_M 0x0000FC00 // Sample Size.
  86. #define I2S_TXCFG_SDSZ_M 0x000003F0 // System Data Size.
  87. #define I2S_TXCFG_SSZ_S 10
  88. #define I2S_TXCFG_SDSZ_S 4
  89. //*****************************************************************************
  90. //
  91. // The following are defines for the bit fields in the I2S_O_TXLIMIT register.
  92. //
  93. //*****************************************************************************
  94. #define I2S_TXLIMIT_LIMIT_M 0x0000001F // FIFO Limit.
  95. #define I2S_TXLIMIT_LIMIT_S 0
  96. //*****************************************************************************
  97. //
  98. // The following are defines for the bit fields in the I2S_O_TXISM register.
  99. //
  100. //*****************************************************************************
  101. #define I2S_TXISM_FFI 0x00010000 // Transmit FIFO Service Request
  102. // Interrupt.
  103. #define I2S_TXISM_FFM 0x00000001 // FIFO Interrupt Mask.
  104. //*****************************************************************************
  105. //
  106. // The following are defines for the bit fields in the I2S_O_TXLEV register.
  107. //
  108. //*****************************************************************************
  109. #define I2S_TXLEV_LEVEL_M 0x0000001F // Number of Audio Samples.
  110. #define I2S_TXLEV_LEVEL_S 0
  111. //*****************************************************************************
  112. //
  113. // The following are defines for the bit fields in the I2S_O_RXFIFO register.
  114. //
  115. //*****************************************************************************
  116. #define I2S_RXFIFO_M 0xFFFFFFFF // RX Data.
  117. #define I2S_RXFIFO_S 0
  118. //*****************************************************************************
  119. //
  120. // The following are defines for the bit fields in the I2S_O_RXFIFOCFG
  121. // register.
  122. //
  123. //*****************************************************************************
  124. #define I2S_RXFIFOCFG_FMM 0x00000004 // FIFO Mono Mode.
  125. #define I2S_RXFIFOCFG_CSS 0x00000002 // Compact Stereo Sample Size.
  126. #define I2S_RXFIFOCFG_LRS 0x00000001 // Left-Right Sample Indicator.
  127. //*****************************************************************************
  128. //
  129. // The following are defines for the bit fields in the I2S_O_RXCFG register.
  130. //
  131. //*****************************************************************************
  132. #define I2S_RXCFG_JST 0x20000000 // Justification of Input Data.
  133. #define I2S_RXCFG_DLY 0x10000000 // Data Delay.
  134. #define I2S_RXCFG_SCP 0x08000000 // SCLK Polarity.
  135. #define I2S_RXCFG_LRP 0x04000000 // Left/Right Clock Polarity.
  136. #define I2S_RXCFG_RM 0x01000000 // Read Mode.
  137. #define I2S_RXCFG_MSL 0x00400000 // SCLK Master/Slave.
  138. #define I2S_RXCFG_SSZ_M 0x0000FC00 // Sample Size.
  139. #define I2S_RXCFG_SDSZ_M 0x000003F0 // System Data Size.
  140. #define I2S_RXCFG_SSZ_S 10
  141. #define I2S_RXCFG_SDSZ_S 4
  142. //*****************************************************************************
  143. //
  144. // The following are defines for the bit fields in the I2S_O_RXLIMIT register.
  145. //
  146. //*****************************************************************************
  147. #define I2S_RXLIMIT_LIMIT_M 0x0000001F // FIFO Limit.
  148. #define I2S_RXLIMIT_LIMIT_S 0
  149. //*****************************************************************************
  150. //
  151. // The following are defines for the bit fields in the I2S_O_RXISM register.
  152. //
  153. //*****************************************************************************
  154. #define I2S_RXISM_FFI 0x00010000 // Receive FIFO Service Request
  155. // Interrupt.
  156. #define I2S_RXISM_FFM 0x00000001 // FIFO Interrupt Mask.
  157. //*****************************************************************************
  158. //
  159. // The following are defines for the bit fields in the I2S_O_RXLEV register.
  160. //
  161. //*****************************************************************************
  162. #define I2S_RXLEV_LEVEL_M 0x0000001F // Number of Audio Samples.
  163. #define I2S_RXLEV_LEVEL_S 0
  164. //*****************************************************************************
  165. //
  166. // The following are defines for the bit fields in the I2S_O_CFG register.
  167. //
  168. //*****************************************************************************
  169. #define I2S_CFG_RXSLV 0x00000020 // When clear, this bit configures
  170. // the receiver to use the
  171. // externally driven I2S0RXMCLK
  172. // signal.
  173. #define I2S_CFG_TXSLV 0x00000010 // When clear, this bit configures
  174. // the transmitter to use the
  175. // externally driven I2S0TXMCLK
  176. // signal.
  177. #define I2S_CFG_RXEN 0x00000002 // Serial Receive Engine Enable.
  178. #define I2S_CFG_TXEN 0x00000001 // Serial Transmit Engine Enable.
  179. //*****************************************************************************
  180. //
  181. // The following are defines for the bit fields in the I2S_O_IM register.
  182. //
  183. //*****************************************************************************
  184. #define I2S_IM_RXRE 0x00000020 // Receive FIFO Read Error.
  185. #define I2S_IM_RXFSR 0x00000010 // Receive FIFO Service Request.
  186. #define I2S_IM_TXWE 0x00000002 // Transmit FIFO Write Error.
  187. #define I2S_IM_TXFSR 0x00000001 // Transmit FIFO Service Request.
  188. //*****************************************************************************
  189. //
  190. // The following are defines for the bit fields in the I2S_O_RIS register.
  191. //
  192. //*****************************************************************************
  193. #define I2S_RIS_RXRE 0x00000020 // Receive FIFO Read Error.
  194. #define I2S_RIS_RXFSR 0x00000010 // Receive FIFO Service Request.
  195. #define I2S_RIS_TXWE 0x00000002 // Transmit FIFO Write Error.
  196. #define I2S_RIS_TXFSR 0x00000001 // Transmit FIFO Service Request.
  197. //*****************************************************************************
  198. //
  199. // The following are defines for the bit fields in the I2S_O_MIS register.
  200. //
  201. //*****************************************************************************
  202. #define I2S_MIS_RXRE 0x00000020 // Receive FIFO Read Error.
  203. #define I2S_MIS_RXFSR 0x00000010 // Receive FIFO Service Request.
  204. #define I2S_MIS_TXWE 0x00000002 // Transmit FIFO Write Error.
  205. #define I2S_MIS_TXFSR 0x00000001 // Transmit FIFO Service Request.
  206. //*****************************************************************************
  207. //
  208. // The following are defines for the bit fields in the I2S_O_IC register.
  209. //
  210. //*****************************************************************************
  211. #define I2S_IC_RXRE 0x00000020 // Receive FIFO Read Error.
  212. #define I2S_IC_TXWE 0x00000002 // Transmit FIFO Write Error.
  213. #endif // __HW_I2S_H__