F2837xD_sci.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_sci.h
  4. //
  5. // TITLE: SCI 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_SCI_H__
  43. #define __F2837xD_SCI_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // SCI Individual Register Bit Definitions:
  49. struct SCICCR_BITS { // bits description
  50. Uint16 SCICHAR:3; // 2:0 Character length control
  51. Uint16 ADDRIDLE_MODE:1; // 3 ADDR/IDLE Mode control
  52. Uint16 LOOPBKENA:1; // 4 Loop Back enable
  53. Uint16 PARITYENA:1; // 5 Parity enable
  54. Uint16 PARITY:1; // 6 Even or Odd Parity
  55. Uint16 STOPBITS:1; // 7 Number of Stop Bits
  56. Uint16 rsvd1:8; // 15:8 Reserved
  57. };
  58. union SCICCR_REG {
  59. Uint16 all;
  60. struct SCICCR_BITS bit;
  61. };
  62. struct SCICTL1_BITS { // bits description
  63. Uint16 RXENA:1; // 0 SCI receiver enable
  64. Uint16 TXENA:1; // 1 SCI transmitter enable
  65. Uint16 SLEEP:1; // 2 SCI sleep
  66. Uint16 TXWAKE:1; // 3 Transmitter wakeup method
  67. Uint16 rsvd1:1; // 4 Reserved
  68. Uint16 SWRESET:1; // 5 Software reset
  69. Uint16 RXERRINTENA:1; // 6 Recieve __interrupt enable
  70. Uint16 rsvd2:9; // 15:7 Reserved
  71. };
  72. union SCICTL1_REG {
  73. Uint16 all;
  74. struct SCICTL1_BITS bit;
  75. };
  76. struct SCIHBAUD_BITS { // bits description
  77. Uint16 BAUD:8; // 7:0 SCI 16-bit baud selection Registers SCIHBAUD
  78. Uint16 rsvd1:8; // 15:8 Reserved
  79. };
  80. union SCIHBAUD_REG {
  81. Uint16 all;
  82. struct SCIHBAUD_BITS bit;
  83. };
  84. struct SCILBAUD_BITS { // bits description
  85. Uint16 BAUD:8; // 7:0 SCI 16-bit baud selection Registers SCILBAUD
  86. Uint16 rsvd1:8; // 15:8 Reserved
  87. };
  88. union SCILBAUD_REG {
  89. Uint16 all;
  90. struct SCILBAUD_BITS bit;
  91. };
  92. struct SCICTL2_BITS { // bits description
  93. Uint16 TXINTENA:1; // 0 Transmit __interrupt enable
  94. Uint16 RXBKINTENA:1; // 1 Receiver-buffer break enable
  95. Uint16 rsvd1:4; // 5:2 Reserved
  96. Uint16 TXEMPTY:1; // 6 Transmitter empty flag
  97. Uint16 TXRDY:1; // 7 Transmitter ready flag
  98. Uint16 rsvd2:8; // 15:8 Reserved
  99. };
  100. union SCICTL2_REG {
  101. Uint16 all;
  102. struct SCICTL2_BITS bit;
  103. };
  104. struct SCIRXST_BITS { // bits description
  105. Uint16 rsvd1:1; // 0 Reserved
  106. Uint16 RXWAKE:1; // 1 Receiver wakeup detect flag
  107. Uint16 PE:1; // 2 Parity error flag
  108. Uint16 OE:1; // 3 Overrun error flag
  109. Uint16 FE:1; // 4 Framing error flag
  110. Uint16 BRKDT:1; // 5 Break-detect flag
  111. Uint16 RXRDY:1; // 6 Receiver ready flag
  112. Uint16 RXERROR:1; // 7 Receiver error flag
  113. Uint16 rsvd2:8; // 15:8 Reserved
  114. };
  115. union SCIRXST_REG {
  116. Uint16 all;
  117. struct SCIRXST_BITS bit;
  118. };
  119. struct SCIRXEMU_BITS { // bits description
  120. Uint16 ERXDT:8; // 7:0 Receive emulation buffer data
  121. Uint16 rsvd1:8; // 15:8 Reserved
  122. };
  123. union SCIRXEMU_REG {
  124. Uint16 all;
  125. struct SCIRXEMU_BITS bit;
  126. };
  127. struct SCIRXBUF_BITS { // bits description
  128. Uint16 SAR:8; // 7:0 Receive Character bits
  129. Uint16 rsvd1:6; // 13:8 Reserved
  130. Uint16 SCIFFPE:1; // 14 Receiver error flag
  131. Uint16 SCIFFFE:1; // 15 Receiver error flag
  132. };
  133. union SCIRXBUF_REG {
  134. Uint16 all;
  135. struct SCIRXBUF_BITS bit;
  136. };
  137. struct SCITXBUF_BITS { // bits description
  138. Uint16 TXDT:8; // 7:0 Transmit data buffer
  139. Uint16 rsvd1:8; // 15:8 Reserved
  140. };
  141. union SCITXBUF_REG {
  142. Uint16 all;
  143. struct SCITXBUF_BITS bit;
  144. };
  145. struct SCIFFTX_BITS { // bits description
  146. Uint16 TXFFIL:5; // 4:0 Interrupt level
  147. Uint16 TXFFIENA:1; // 5 Interrupt enable
  148. Uint16 TXFFINTCLR:1; // 6 Clear INT flag
  149. Uint16 TXFFINT:1; // 7 INT flag
  150. Uint16 TXFFST:5; // 12:8 FIFO status
  151. Uint16 TXFIFORESET:1; // 13 FIFO reset
  152. Uint16 SCIFFENA:1; // 14 Enhancement enable
  153. Uint16 SCIRST:1; // 15 SCI reset rx/tx channels
  154. };
  155. union SCIFFTX_REG {
  156. Uint16 all;
  157. struct SCIFFTX_BITS bit;
  158. };
  159. struct SCIFFRX_BITS { // bits description
  160. Uint16 RXFFIL:5; // 4:0 Interrupt level
  161. Uint16 RXFFIENA:1; // 5 Interrupt enable
  162. Uint16 RXFFINTCLR:1; // 6 Clear INT flag
  163. Uint16 RXFFINT:1; // 7 INT flag
  164. Uint16 RXFFST:5; // 12:8 FIFO status
  165. Uint16 RXFIFORESET:1; // 13 FIFO reset
  166. Uint16 RXFFOVRCLR:1; // 14 Clear overflow
  167. Uint16 RXFFOVF:1; // 15 FIFO overflow
  168. };
  169. union SCIFFRX_REG {
  170. Uint16 all;
  171. struct SCIFFRX_BITS bit;
  172. };
  173. struct SCIFFCT_BITS { // bits description
  174. Uint16 FFTXDLY:8; // 7:0 FIFO transmit delay
  175. Uint16 rsvd1:5; // 12:8 Reserved
  176. Uint16 CDC:1; // 13 Auto baud mode enable
  177. Uint16 ABDCLR:1; // 14 Auto baud clear
  178. Uint16 ABD:1; // 15 Auto baud detect
  179. };
  180. union SCIFFCT_REG {
  181. Uint16 all;
  182. struct SCIFFCT_BITS bit;
  183. };
  184. struct SCIPRI_BITS { // bits description
  185. Uint16 rsvd1:3; // 2:0 Reserved
  186. Uint16 FREESOFT:2; // 4:3 Emulation modes
  187. Uint16 rsvd2:3; // 7:5 Reserved
  188. Uint16 rsvd3:8; // 15:8 Reserved
  189. };
  190. union SCIPRI_REG {
  191. Uint16 all;
  192. struct SCIPRI_BITS bit;
  193. };
  194. struct SCI_REGS {
  195. union SCICCR_REG SCICCR; // Communications control register
  196. union SCICTL1_REG SCICTL1; // Control register 1
  197. union SCIHBAUD_REG SCIHBAUD; // Baud rate (high) register
  198. union SCILBAUD_REG SCILBAUD; // Baud rate (low) register
  199. union SCICTL2_REG SCICTL2; // Control register 2
  200. union SCIRXST_REG SCIRXST; // Recieve status register
  201. union SCIRXEMU_REG SCIRXEMU; // Recieve emulation buffer register
  202. union SCIRXBUF_REG SCIRXBUF; // Recieve data buffer
  203. Uint16 rsvd1; // Reserved
  204. union SCITXBUF_REG SCITXBUF; // Transmit data buffer
  205. union SCIFFTX_REG SCIFFTX; // FIFO transmit register
  206. union SCIFFRX_REG SCIFFRX; // FIFO recieve register
  207. union SCIFFCT_REG SCIFFCT; // FIFO control register
  208. Uint16 rsvd2[2]; // Reserved
  209. union SCIPRI_REG SCIPRI; // SCI Priority control
  210. };
  211. //---------------------------------------------------------------------------
  212. // SCI External References & Function Declarations:
  213. //
  214. #ifdef CPU1
  215. extern volatile struct SCI_REGS SciaRegs;
  216. extern volatile struct SCI_REGS ScibRegs;
  217. extern volatile struct SCI_REGS ScicRegs;
  218. extern volatile struct SCI_REGS ScidRegs;
  219. #endif
  220. #ifdef CPU2
  221. extern volatile struct SCI_REGS SciaRegs;
  222. extern volatile struct SCI_REGS ScibRegs;
  223. extern volatile struct SCI_REGS ScicRegs;
  224. extern volatile struct SCI_REGS ScidRegs;
  225. #endif
  226. #ifdef __cplusplus
  227. }
  228. #endif /* extern "C" */
  229. #endif
  230. //===========================================================================
  231. // End of file.
  232. //===========================================================================