hw_i2s.h 11 KB

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