Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
4.2 KiB

4 years ago
  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Copyright (c) 1992 Digital Equipment Corporation
  4. Module Name:
  5. jxserp.h
  6. Abstract:
  7. This header file defines the Jensen serial port registers.
  8. Stolen from jazzserp.h, which is a slightly different chip-
  9. it has a 16 byte fifo - we are just double buffered.
  10. Author:
  11. David N. Cutler (davec) 28-Apr-1991
  12. Miche Baker-Harvey (miche) 01-June-1992
  13. Revision History:
  14. --*/
  15. #ifndef _JXSERP_
  16. #define _JXSERP_
  17. //
  18. // Define base port numbers for serial lines inside the combo chip
  19. //
  20. #define COMA_PORT_BASE 0x3f8
  21. #define COMB_PORT_BASE 0x2f8
  22. //
  23. // Define serial port read registers structure.
  24. //
  25. typedef struct _SP_READ_REGISTERS {
  26. UCHAR ReceiveBuffer;
  27. UCHAR InterruptEnable;
  28. UCHAR InterruptId;
  29. UCHAR LineControl;
  30. UCHAR ModemControl;
  31. UCHAR LineStatus;
  32. UCHAR ModemStatus;
  33. UCHAR ScratchPad;
  34. } SP_READ_REGISTERS, *PSP_READ_REGISTERS;
  35. //
  36. // Define define serial port write registers structure.
  37. //
  38. typedef struct _SP_WRITE_REGISTERS {
  39. UCHAR TransmitBuffer;
  40. UCHAR InterruptEnable;
  41. UCHAR FifoControl;
  42. UCHAR LineControl;
  43. UCHAR ModemControl;
  44. UCHAR Reserved1;
  45. UCHAR ModemStatus;
  46. UCHAR ScratchPad;
  47. } SP_WRITE_REGISTERS, *PSP_WRITE_REGISTERS;
  48. //
  49. // Define serial port interrupt enable register structure.
  50. //
  51. typedef struct _SP_INTERRUPT_ENABLE {
  52. UCHAR ReceiveEnable : 1;
  53. UCHAR TransmitEnable : 1;
  54. UCHAR LineStatusEnable : 1;
  55. UCHAR ModemStatusEnable : 1;
  56. UCHAR Reserved1 : 4;
  57. } SP_INTERRUPT_ENABLE, *PSP_INTERRUPT_ENABLE;
  58. //
  59. // Define serial port interrupt id register structure.
  60. //
  61. typedef struct _SP_INTERRUPT_ID {
  62. UCHAR InterruptPending : 1;
  63. UCHAR Identification : 3;
  64. UCHAR Reserved1 : 2;
  65. UCHAR FifoEnabled : 2; // always read as 0
  66. } SP_INTERRUPT_ID, *PSP_INTERRUPT_ID;
  67. //
  68. // Define serial port fifo control register structure.
  69. // This register is here for software compatibility, but there is
  70. // no FIFO on the 16C452
  71. //
  72. typedef struct _SP_FIFO_CONTROL {
  73. UCHAR FifoEnable : 1;
  74. UCHAR ReceiveFifoReset : 1;
  75. UCHAR TransmitFifoReset : 1;
  76. UCHAR DmaModeSelect : 1;
  77. UCHAR Reserved1 : 2;
  78. UCHAR ReceiveFifoLevel : 2;
  79. } SP_FIFO_CONTROL, *PSP_FIFO_CONTROL;
  80. //
  81. // Define serial port line control register structure.
  82. //
  83. typedef struct _SP_LINE_CONTROL {
  84. UCHAR CharacterSize : 2;
  85. UCHAR StopBits : 1;
  86. UCHAR ParityEnable : 1;
  87. UCHAR EvenParity : 1;
  88. UCHAR StickParity : 1;
  89. UCHAR SetBreak : 1;
  90. UCHAR DivisorLatch : 1;
  91. } SP_LINE_CONTROL, *PSP_LINE_CONTROL;
  92. //
  93. // Line status register character size definitions.
  94. //
  95. #define FIVE_BITS 0x0 // five bits per character
  96. #define SIX_BITS 0x1 // six bits per character
  97. #define SEVEN_BITS 0x2 // seven bits per character
  98. #define EIGHT_BITS 0x3 // eight bits per character
  99. //
  100. // Line speed divisor definition. We get our baud rate clock
  101. // from the 82C106.
  102. //
  103. #define BAUD_RATE_9600 12 // divisor for 9600 baud
  104. #define BAUD_RATE_19200 6 // divisor for 19200 baud
  105. //
  106. // Define serial port modem control register structure.
  107. //
  108. typedef struct _SP_MODEM_CONTROL {
  109. UCHAR DataTerminalReady : 1;
  110. UCHAR RequestToSend : 1;
  111. UCHAR Reserved1 : 1;
  112. UCHAR Interrupt : 1;
  113. UCHAR loopBack : 1;
  114. UCHAR Reserved2 : 3;
  115. } SP_MODEM_CONTROL, *PSP_MODEM_CONTROL;
  116. //
  117. // Define serial port line status register structure.
  118. //
  119. typedef struct _SP_LINE_STATUS {
  120. UCHAR DataReady : 1;
  121. UCHAR OverrunError : 1;
  122. UCHAR ParityError : 1;
  123. UCHAR FramingError : 1;
  124. UCHAR BreakIndicator : 1;
  125. UCHAR TransmitHoldingEmpty : 1;
  126. UCHAR TransmitEmpty : 1;
  127. UCHAR ReceiveFifoError : 1;
  128. } SP_LINE_STATUS, *PSP_LINE_STATUS;
  129. //
  130. // Define serial port modem status register structure.
  131. //
  132. typedef struct _SP_MODEM_STATUS {
  133. UCHAR DeltaClearToSend : 1;
  134. UCHAR DeltaDataSetReady : 1;
  135. UCHAR TrailingRingIndicator : 1;
  136. UCHAR DeltaReceiveDetect : 1;
  137. UCHAR ClearToSend : 1;
  138. UCHAR DataSetReady : 1;
  139. UCHAR RingIndicator : 1;
  140. UCHAR ReceiveDetect : 1;
  141. } SP_MODEM_STATUS, *PSP_MODEM_STATUS;
  142. #endif // _JAZZSERP_