F2837xD_mcbsp.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_mcbsp.h
  4. //
  5. // TITLE: MCBSP Register Definitions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef __F2837xD_MCBSP_H__
  43. #define __F2837xD_MCBSP_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // MCBSP Individual Register Bit Definitions:
  49. struct DRR2_BITS { // bits description
  50. Uint16 HWLB:8; // 7:0 High word low byte
  51. Uint16 HWHB:8; // 15:8 High word high byte
  52. };
  53. union DRR2_REG {
  54. Uint16 all;
  55. struct DRR2_BITS bit;
  56. };
  57. struct DRR1_BITS { // bits description
  58. Uint16 LWLB:8; // 7:0 Low word low byte
  59. Uint16 LWHB:8; // 15:8 Low word high byte
  60. };
  61. union DRR1_REG {
  62. Uint16 all;
  63. struct DRR1_BITS bit;
  64. };
  65. struct DXR2_BITS { // bits description
  66. Uint16 HWLB:8; // 7:0 High word low byte
  67. Uint16 HWHB:8; // 15:8 High word high byte
  68. };
  69. union DXR2_REG {
  70. Uint16 all;
  71. struct DXR2_BITS bit;
  72. };
  73. struct DXR1_BITS { // bits description
  74. Uint16 LWLB:8; // 7:0 Low word low byte
  75. Uint16 LWHB:8; // 15:8 Low word high byte
  76. };
  77. union DXR1_REG {
  78. Uint16 all;
  79. struct DXR1_BITS bit;
  80. };
  81. struct SPCR2_BITS { // bits description
  82. Uint16 XRST:1; // 0 Transmitter reset
  83. Uint16 XRDY:1; // 1 Transmitter ready
  84. Uint16 XEMPTY:1; // 2 Transmitter empty
  85. Uint16 XSYNCERR:1; // 3 Transmit sync error INT flag
  86. Uint16 XINTM:2; // 5:4 Transmit Interupt mode bits
  87. Uint16 GRST:1; // 6 Sample rate generator reset
  88. Uint16 FRST:1; // 7 Frame sync logic reset
  89. Uint16 SOFT:1; // 8 SOFT bit
  90. Uint16 FREE:1; // 9 FREE bit
  91. Uint16 rsvd1:6; // 15:10 Reserved
  92. };
  93. union SPCR2_REG {
  94. Uint16 all;
  95. struct SPCR2_BITS bit;
  96. };
  97. struct SPCR1_BITS { // bits description
  98. Uint16 RRST:1; // 0 Receiver reset
  99. Uint16 RRDY:1; // 1 Receiver ready
  100. Uint16 RFULL:1; // 2 Receiver full
  101. Uint16 RSYNCERR:1; // 3 Receive sync error INT flag
  102. Uint16 RINTM:2; // 5:4 Receive Interupt mode bits
  103. Uint16 rsvd1:1; // 6 Reserved
  104. Uint16 DXENA:1; // 7 DX delay enable
  105. Uint16 rsvd2:3; // 10:8 Reserved
  106. Uint16 CLKSTP:2; // 12:11 Clock stop mode
  107. Uint16 RJUST:2; // 14:13 Rx sign extension and justification mode
  108. Uint16 DLB:1; // 15 Digital loopback
  109. };
  110. union SPCR1_REG {
  111. Uint16 all;
  112. struct SPCR1_BITS bit;
  113. };
  114. struct RCR2_BITS { // bits description
  115. Uint16 RDATDLY:2; // 1:0 Receive data delay
  116. Uint16 RFIG:1; // 2 Receive frame sync ignore
  117. Uint16 RCOMPAND:2; // 4:3 Receive Companding Mode selects
  118. Uint16 RWDLEN2:3; // 7:5 Receive word length 2
  119. Uint16 RFRLEN2:7; // 14:8 Receive Frame length 2
  120. Uint16 RPHASE:1; // 15 Receive Phase
  121. };
  122. union RCR2_REG {
  123. Uint16 all;
  124. struct RCR2_BITS bit;
  125. };
  126. struct RCR1_BITS { // bits description
  127. Uint16 rsvd1:5; // 4:0 Reserved
  128. Uint16 RWDLEN1:3; // 7:5 Receive word length 1
  129. Uint16 RFRLEN1:7; // 14:8 Receive Frame length 1
  130. Uint16 rsvd2:1; // 15 Reserved
  131. };
  132. union RCR1_REG {
  133. Uint16 all;
  134. struct RCR1_BITS bit;
  135. };
  136. struct XCR2_BITS { // bits description
  137. Uint16 XDATDLY:2; // 1:0 Transmit data delay
  138. Uint16 XFIG:1; // 2 Transmit frame sync ignore
  139. Uint16 XCOMPAND:2; // 4:3 Transmit Companding Mode selects
  140. Uint16 XWDLEN2:3; // 7:5 Transmit word length 2
  141. Uint16 XFRLEN2:7; // 14:8 Transmit Frame length 2
  142. Uint16 XPHASE:1; // 15 Transmit Phase
  143. };
  144. union XCR2_REG {
  145. Uint16 all;
  146. struct XCR2_BITS bit;
  147. };
  148. struct XCR1_BITS { // bits description
  149. Uint16 rsvd1:5; // 4:0 Reserved
  150. Uint16 XWDLEN1:3; // 7:5 Transmit word length 1
  151. Uint16 XFRLEN1:7; // 14:8 Transmit Frame length 1
  152. Uint16 rsvd2:1; // 15 Reserved
  153. };
  154. union XCR1_REG {
  155. Uint16 all;
  156. struct XCR1_BITS bit;
  157. };
  158. struct SRGR2_BITS { // bits description
  159. Uint16 FPER:12; // 11:0 Frame-sync period
  160. Uint16 FSGM:1; // 12 Frame sync generator mode
  161. Uint16 CLKSM:1; // 13 Sample rate generator mode
  162. Uint16 rsvd1:1; // 14 Reserved
  163. Uint16 GSYNC:1; // 15 CLKG sync
  164. };
  165. union SRGR2_REG {
  166. Uint16 all;
  167. struct SRGR2_BITS bit;
  168. };
  169. struct SRGR1_BITS { // bits description
  170. Uint16 CLKGDV:8; // 7:0 CLKG divider
  171. Uint16 FWID:8; // 15:8 Frame width
  172. };
  173. union SRGR1_REG {
  174. Uint16 all;
  175. struct SRGR1_BITS bit;
  176. };
  177. struct MCR2_BITS { // bits description
  178. Uint16 XMCM:2; // 1:0 Transmit data delay
  179. Uint16 XCBLK:3; // 4:2 Transmit frame sync ignore
  180. Uint16 XPABLK:2; // 6:5 Transmit Companding Mode selects
  181. Uint16 XPBBLK:2; // 8:7 Transmit word length 2
  182. Uint16 XMCME:1; // 9 Transmit Frame length 2
  183. Uint16 rsvd1:6; // 15:10 Reserved
  184. };
  185. union MCR2_REG {
  186. Uint16 all;
  187. struct MCR2_BITS bit;
  188. };
  189. struct MCR1_BITS { // bits description
  190. Uint16 RMCM:1; // 0 Receive multichannel mode
  191. Uint16 rsvd1:1; // 1 Reserved
  192. Uint16 RCBLK:3; // 4:2 eceive current block
  193. Uint16 RPABLK:2; // 6:5 Receive partition A Block
  194. Uint16 RPBBLK:2; // 8:7 Receive partition B Block
  195. Uint16 RMCME:1; // 9 Receive multi-channel enhance mode
  196. Uint16 rsvd2:6; // 15:10 Reserved
  197. };
  198. union MCR1_REG {
  199. Uint16 all;
  200. struct MCR1_BITS bit;
  201. };
  202. struct PCR_BITS { // bits description
  203. Uint16 CLKRP:1; // 0 Receive Clock polarity
  204. Uint16 CLKXP:1; // 1 Transmit clock polarity
  205. Uint16 FSRP:1; // 2 Receive Frame synchronization polarity
  206. Uint16 FSXP:1; // 3 Transmit Frame synchronization polarity
  207. Uint16 rsvd1:1; // 4 Reserved
  208. Uint16 rsvd2:1; // 5 Reserved
  209. Uint16 rsvd3:1; // 6 Reserved
  210. Uint16 SCLKME:1; // 7 Sample clock mode selection
  211. Uint16 CLKRM:1; // 8 Receiver Clock Mode
  212. Uint16 CLKXM:1; // 9 Transmit Clock Mode.
  213. Uint16 FSRM:1; // 10 Receive Frame Synchronization Mode
  214. Uint16 FSXM:1; // 11 Transmit Frame Synchronization Mode
  215. Uint16 rsvd4:4; // 15:12 Reserved
  216. };
  217. union PCR_REG {
  218. Uint16 all;
  219. struct PCR_BITS bit;
  220. };
  221. struct MFFINT_BITS { // bits description
  222. Uint16 XINT:1; // 0 Enable for Receive Interrupt
  223. Uint16 rsvd1:1; // 1 Reserved
  224. Uint16 RINT:1; // 2 Enable for transmit Interrupt
  225. Uint16 rsvd2:13; // 15:3 Reserved
  226. };
  227. union MFFINT_REG {
  228. Uint16 all;
  229. struct MFFINT_BITS bit;
  230. };
  231. struct McBSP_REGS {
  232. union DRR2_REG DRR2; // Data receive register bits 31-16
  233. union DRR1_REG DRR1; // Data receive register bits 15-0
  234. union DXR2_REG DXR2; // Data transmit register bits 31-16
  235. union DXR1_REG DXR1; // Data transmit register bits 15-0
  236. union SPCR2_REG SPCR2; // Control register 2
  237. union SPCR1_REG SPCR1; // Control register 1
  238. union RCR2_REG RCR2; // Receive Control register 2
  239. union RCR1_REG RCR1; // Receive Control register 1
  240. union XCR2_REG XCR2; // Transmit Control register 2
  241. union XCR1_REG XCR1; // Transmit Control register 1
  242. union SRGR2_REG SRGR2; // Sample rate generator register 2
  243. union SRGR1_REG SRGR1; // Sample rate generator register 1
  244. union MCR2_REG MCR2; // Multi-channel register 2
  245. union MCR1_REG MCR1; // Multi-channel register 1
  246. Uint16 RCERA; // Receive channel enable partition A
  247. Uint16 RCERB; // Receive channel enable partition B
  248. Uint16 XCERA; // Transmit channel enable partition A
  249. Uint16 XCERB; // Transmit channel enable partition B
  250. union PCR_REG PCR; // Pin Control register
  251. Uint16 RCERC; // Receive channel enable partition C
  252. Uint16 RCERD; // Receive channel enable partition D
  253. Uint16 XCERC; // Transmit channel enable partition C
  254. Uint16 XCERD; // Transmit channel enable partition D
  255. Uint16 RCERE; // Receive channel enable partition E
  256. Uint16 RCERF; // Receive channel enable partition F
  257. Uint16 XCERE; // Transmit channel enable partition E
  258. Uint16 XCERF; // Transmit channel enable partition F
  259. Uint16 RCERG; // Receive channel enable partition G
  260. Uint16 RCERH; // Receive channel enable partition H
  261. Uint16 XCERG; // Transmit channel enable partition G
  262. Uint16 XCERH; // Transmit channel enable partition H
  263. Uint16 rsvd1[4]; // Reserved
  264. union MFFINT_REG MFFINT; // Interrupt enable
  265. };
  266. //---------------------------------------------------------------------------
  267. // MCBSP External References & Function Declarations:
  268. //
  269. #ifdef CPU1
  270. extern volatile struct McBSP_REGS McbspaRegs;
  271. extern volatile struct McBSP_REGS McbspbRegs;
  272. #endif
  273. #ifdef CPU2
  274. extern volatile struct McBSP_REGS McbspaRegs;
  275. extern volatile struct McBSP_REGS McbspbRegs;
  276. #endif
  277. #ifdef __cplusplus
  278. }
  279. #endif /* extern "C" */
  280. #endif
  281. //===========================================================================
  282. // End of file.
  283. //===========================================================================