DSP2803x_Sci.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. //###########################################################################
  2. //
  3. // FILE: DSP2803x_Sci.h
  4. //
  5. // TITLE: DSP2803x Device SCI Register Definitions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  9. // $Release Date: May 8, 2015 $
  10. // $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  11. // http://www.ti.com/ ALL RIGHTS RESERVED $
  12. //###########################################################################
  13. #ifndef DSP2803x_SCI_H
  14. #define DSP2803x_SCI_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //---------------------------------------------------------------------------
  19. // SCI Individual Register Bit Definitions
  20. //----------------------------------------------------------
  21. // SCICCR communication control register bit definitions:
  22. //
  23. struct SCICCR_BITS { // bit description
  24. Uint16 SCICHAR:3; // 2:0 Character length control
  25. Uint16 ADDRIDLE_MODE:1; // 3 ADDR/IDLE Mode control
  26. Uint16 LOOPBKENA:1; // 4 Loop Back enable
  27. Uint16 PARITYENA:1; // 5 Parity enable
  28. Uint16 PARITY:1; // 6 Even or Odd Parity
  29. Uint16 STOPBITS:1; // 7 Number of Stop Bits
  30. Uint16 rsvd1:8; // 15:8 reserved
  31. };
  32. union SCICCR_REG {
  33. Uint16 all;
  34. struct SCICCR_BITS bit;
  35. };
  36. //-------------------------------------------
  37. // SCICTL1 control register 1 bit definitions:
  38. //
  39. struct SCICTL1_BITS { // bit description
  40. Uint16 RXENA:1; // 0 SCI receiver enable
  41. Uint16 TXENA:1; // 1 SCI transmitter enable
  42. Uint16 SLEEP:1; // 2 SCI sleep
  43. Uint16 TXWAKE:1; // 3 Transmitter wakeup method
  44. Uint16 rsvd:1; // 4 reserved
  45. Uint16 SWRESET:1; // 5 Software reset
  46. Uint16 RXERRINTENA:1; // 6 Recieve interrupt enable
  47. Uint16 rsvd1:9; // 15:7 reserved
  48. };
  49. union SCICTL1_REG {
  50. Uint16 all;
  51. struct SCICTL1_BITS bit;
  52. };
  53. //---------------------------------------------
  54. // SCICTL2 control register 2 bit definitions:
  55. //
  56. struct SCICTL2_BITS { // bit description
  57. Uint16 TXINTENA:1; // 0 Transmit interrupt enable
  58. Uint16 RXBKINTENA:1; // 1 Receiver-buffer break enable
  59. Uint16 rsvd:4; // 5:2 reserved
  60. Uint16 TXEMPTY:1; // 6 Transmitter empty flag
  61. Uint16 TXRDY:1; // 7 Transmitter ready flag
  62. Uint16 rsvd1:8; // 15:8 reserved
  63. };
  64. union SCICTL2_REG {
  65. Uint16 all;
  66. struct SCICTL2_BITS bit;
  67. };
  68. //---------------------------------------------------
  69. // SCIRXST Receiver status register bit definitions:
  70. //
  71. struct SCIRXST_BITS { // bit description
  72. Uint16 rsvd:1; // 0 reserved
  73. Uint16 RXWAKE:1; // 1 Receiver wakeup detect flag
  74. Uint16 PE:1; // 2 Parity error flag
  75. Uint16 OE:1; // 3 Overrun error flag
  76. Uint16 FE:1; // 4 Framing error flag
  77. Uint16 BRKDT:1; // 5 Break-detect flag
  78. Uint16 RXRDY:1; // 6 Receiver ready flag
  79. Uint16 RXERROR:1; // 7 Receiver error flag
  80. Uint16 rsvd1:8; // 15-8 reserved
  81. };
  82. union SCIRXST_REG {
  83. Uint16 all;
  84. struct SCIRXST_BITS bit;
  85. };
  86. //----------------------------------------------------
  87. // SCIRXBUF Receiver Data Buffer with FIFO bit definitions:
  88. //
  89. struct SCIRXBUF_BITS { // bits description
  90. Uint16 RXDT:8; // 7:0 Receive word
  91. Uint16 rsvd:6; // 13:8 reserved
  92. Uint16 SCIFFPE:1; // 14 SCI PE error in FIFO mode
  93. Uint16 SCIFFFE:1; // 15 SCI FE error in FIFO mode
  94. };
  95. union SCIRXBUF_REG {
  96. Uint16 all;
  97. struct SCIRXBUF_BITS bit;
  98. };
  99. //--------------------------------------------------
  100. // SCIPRI Priority control register bit definitions:
  101. //
  102. //
  103. struct SCIPRI_BITS { // bit description
  104. Uint16 rsvd:3; // 2:0 reserved
  105. Uint16 FREE:1; // 3 Free emulation suspend mode
  106. Uint16 SOFT:1; // 4 Soft emulation suspend mode
  107. Uint16 rsvd1:11; // 15:5 reserved
  108. };
  109. union SCIPRI_REG {
  110. Uint16 all;
  111. struct SCIPRI_BITS bit;
  112. };
  113. //-------------------------------------------------
  114. // SCI FIFO Transmit register bit definitions:
  115. //
  116. //
  117. struct SCIFFTX_BITS { // bit description
  118. Uint16 TXFFIL:5; // 4:0 Interrupt level
  119. Uint16 TXFFIENA:1; // 5 Interrupt enable
  120. Uint16 TXFFINTCLR:1; // 6 Clear INT flag
  121. Uint16 TXFFINT:1; // 7 INT flag
  122. Uint16 TXFFST:5; // 12:8 FIFO status
  123. Uint16 TXFIFOXRESET:1; // 13 FIFO reset
  124. Uint16 SCIFFENA:1; // 14 Enhancement enable
  125. Uint16 SCIRST:1; // 15 SCI reset rx/tx channels
  126. };
  127. union SCIFFTX_REG {
  128. Uint16 all;
  129. struct SCIFFTX_BITS bit;
  130. };
  131. //------------------------------------------------
  132. // SCI FIFO recieve register bit definitions:
  133. //
  134. //
  135. struct SCIFFRX_BITS { // bits description
  136. Uint16 RXFFIL:5; // 4:0 Interrupt level
  137. Uint16 RXFFIENA:1; // 5 Interrupt enable
  138. Uint16 RXFFINTCLR:1; // 6 Clear INT flag
  139. Uint16 RXFFINT:1; // 7 INT flag
  140. Uint16 RXFFST:5; // 12:8 FIFO status
  141. Uint16 RXFIFORESET:1; // 13 FIFO reset
  142. Uint16 RXFFOVRCLR:1; // 14 Clear overflow
  143. Uint16 RXFFOVF:1; // 15 FIFO overflow
  144. };
  145. union SCIFFRX_REG {
  146. Uint16 all;
  147. struct SCIFFRX_BITS bit;
  148. };
  149. // SCI FIFO control register bit definitions:
  150. struct SCIFFCT_BITS { // bits description
  151. Uint16 FFTXDLY:8; // 7:0 FIFO transmit delay
  152. Uint16 rsvd:5; // 12:8 reserved
  153. Uint16 CDC:1; // 13 Auto baud mode enable
  154. Uint16 ABDCLR:1; // 14 Auto baud clear
  155. Uint16 ABD:1; // 15 Auto baud detect
  156. };
  157. union SCIFFCT_REG {
  158. Uint16 all;
  159. struct SCIFFCT_BITS bit;
  160. };
  161. //---------------------------------------------------------------------------
  162. // SCI Register File:
  163. //
  164. struct SCI_REGS {
  165. union SCICCR_REG SCICCR; // Communications control register
  166. union SCICTL1_REG SCICTL1; // Control register 1
  167. Uint16 SCIHBAUD; // Baud rate (high) register
  168. Uint16 SCILBAUD; // Baud rate (low) register
  169. union SCICTL2_REG SCICTL2; // Control register 2
  170. union SCIRXST_REG SCIRXST; // Recieve status register
  171. Uint16 SCIRXEMU; // Recieve emulation buffer register
  172. union SCIRXBUF_REG SCIRXBUF; // Recieve data buffer
  173. Uint16 rsvd1; // reserved
  174. Uint16 SCITXBUF; // Transmit data buffer
  175. union SCIFFTX_REG SCIFFTX; // FIFO transmit register
  176. union SCIFFRX_REG SCIFFRX; // FIFO recieve register
  177. union SCIFFCT_REG SCIFFCT; // FIFO control register
  178. Uint16 rsvd2; // reserved
  179. Uint16 rsvd3; // reserved
  180. union SCIPRI_REG SCIPRI; // FIFO Priority control
  181. };
  182. //---------------------------------------------------------------------------
  183. // SCI External References & Function Declarations:
  184. //
  185. extern volatile struct SCI_REGS SciaRegs;
  186. #ifdef __cplusplus
  187. }
  188. #endif /* extern "C" */
  189. #endif // end of DSP2803x_SCI_H definition
  190. //===========================================================================
  191. // End of file.
  192. //===========================================================================