home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / architecture / zs85C30.h < prev   
Text File  |  1992-07-21  |  9KB  |  222 lines

  1. /* Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved.
  2.  *
  3.  *    Zilog Z85C30 Serial Controller Chip definitions
  4.  *
  5.  * The 85C30 contains the following registers:
  6.  * Read Register:    Function:
  7.  *     RR0        Transmit/Receive buffer and external status
  8.  *     RR1        Special receive condition status
  9.  *     RR2        Interrupt vector.
  10.  *     RR3        Interrupt pending bits.
  11.  *     RR8        Receive buffer.
  12.  *     RR10        Miscellaneous status
  13.  *     RR12        Lower byte of baud rate generator time constant
  14.  *     RR13        Upper byte of baud rate generator time constant
  15.  *     RR15        External/Status interrupt information
  16.  *
  17.  * Write register:    Function:
  18.  *    WR0        Initialization commands.
  19.  *    WR1        Transmit/Receive interrupt and data transfer mode
  20.  *    WR2        Interrupt vector
  21.  *    WR3        Receive parameters and control
  22.  *    WR4        Transmit/Receive miscellaneous parameters and modes
  23.  *    WR5        Transmit parameters and controls
  24.  *    WR6        Sync characters or SDLC address field
  25.  *    WR7        Sync character or SDLC flag
  26.  *    WR8        Transmit buffer
  27.  *    WR9        Master interrupt control and reset
  28.  *    WR10        Miscellaneous transmitter/receiver control bits
  29.  *    WR11        Clock mode control
  30.  *    WR12        Lower byte of baud rate generator time constant
  31.  *    WR13        Upper byte of baud rate generator time constant
  32.  *    WR14        Miscellaneous control bits
  33.  *    WR15        External/Status interrupt control
  34.  */
  35.  
  36. /* Read register 0 */
  37. #define RR0_RXAVAIL    0x01        /* Rx Character Available */
  38. #define RR0_ZERO_COUNT    0x02        /* Zero count (timer) *&Caefine RR0_TXEMPTY    0x04        /* Tx Buffer Empty */
  39. #define RR0_DCD        0x08        /* DCD status */
  40. #define RR0_SYNC_HUNT    0x10        /* Sync hunt mode */
  41.  
  42. /*
  43.  * NOTE: the sense of CTS is dependent on the cpu board rev
  44.  */
  45. #define RR0_CTS        0x20        /* CTS status */
  46.  
  47. #define RR0_TXUNDER    0x40        /* Tx Underrun/EOM */
  48. #define RR0_BREAK    0x80        /* Break/Abort */
  49.  
  50. /* Read register 1 */
  51. #define RR1_ALLSENT    0x01        /* All Sent */
  52. #define RR1_RESCODE2    0x02        /* Residue Code 2 */
  53. #define RR1_RESCODE1    0x04        /* Residue Code 1 */
  54. #define RR1_RESCODE0    0x08        /* Residue Code 0 */
  55. #define RR1_PARITY    0x10        /* Parity Error */
  56. #define RR1_RXOVER    0x20        /* Rx Overrun Error */
  57. #define RR1_FRAME    0x40        /* CRC/Framing Error */
  58. #define RR1_EOF        0x80        /* End of Frame (SDLC) */
  59.  
  60. /*
  61.  * Read/Write Register 2: 8 bits of interrupt vector
  62.  * Channel A unmodified, channel B is modified by current UART status
  63.  */
  64.  
  65. /* Read register 3 -- ONLY CHANNEL A */
  66. #define RR3_B_STATIP    0x01        /* Chanel B Ext/Status intr pending */
  67. #define RR3_B_TXIP    0x02        /* Chanel B Tx interrupt pending */
  68. #define RR3_B_RXIP    0x04        /* Chanel B Rx interrupt pending */
  69. #define RR3_A_STATIP    0x08        /* Chanel A Ext/Status intr pending */
  70. #define RR3_A_TXIP    0x10        /* Chanel A Tx interrupt pending */
  71. #define RR3_A_RXIP    0x20        /* Chanel A Rx interrupt pending */
  72.  
  73. #define    RR3_A_IP    (RR3_A_STATIP|RR3_A_TXIP|RR3_A_RXIP)
  74. #define    RR3_B_IP    (RR3_B_STATIP|RR3_B_TXIP|RR3_B_RXIP)
  75.  
  76. /*
  77.  * Read Register 8: same as data port (receive buffer)
  78.  */
  79.  
  80. /* Read Register 10 */
  81. #define RR10_ONLOOP    0x02        /* On Loop */
  82. #define RR10_LOOPSEND    0x10        /* Loop Sending */
  83. #define RR10_MISS2    0x40        /* Two Clocks Missing */
  84. #define RR10_MISS1    0x80        /* One Clock Missing */
  85.  
  86. /*
  87.  * Read/Write Register 12/13 16 bits of time constant
  88.  */
  89.  
  90. /* Read/Write Register 15 */
  91. #define RW15_ZEROCNTIE    0x02        /* Enable interrupt on timer zero */
  92. #define RW15_DCDIE    0x08        /* Enable interrupt on DCD change */
  93. #define RW15_SYNCIE    0x10        /* Enable interrupt on Sync Hunt */
  94. #define RW15_CTSIE    0x20        /* Enable interrupt on CTS change */
  95. #define RW15_TXUNDERIE    0x40        /* Enable interrupt on Tx Underrun/EOM*/
  96. #define RW15_BREAKIE    0x80        /* Enable interrupt on Bread/Abort */
  97.  
  98. /* Write register 0 */
  99. #define WR0_REGMASK    0x0F        /* Mask for register select */
  100. #define WR0_RESET_STAT    0x10        /* Reset Ext/Status Interrupts */
  101. #define WR0_ABORT    0x18        /* Send abort */
  102. #define WR0_NEXTRXIE    0x&Cb/* Enable interrupt on next char Rx */
  103. #define WR0_RESETTXPEND    0x28        /* Reset Pending Tx Interrupt */
  104. #define WR0_RESET    0x30        /* Error Reset */
  105. #define WR0_RESETIUS    0x38        /* Reset Interrupt Under Service */
  106. #define WR0_RESETRXCRC    0x40        /* Reset Rx CRC Checker */
  107. #define WR0_RESETTXCRC    0x80        /* Reset Rx CRC Generator */
  108. #define WR0_RESETEOM    0xC0        /* Reset Underrun/EOM latch */
  109.  
  110. /* Write register 1 */
  111. #define WR1_EXTIE    0x01        /* External Interrupt Enable */
  112. #define WR1_TXIE    0x02        /* Transmit Interrupt Enable */
  113. #define WR1_PARSPEC    0x04        /* Parity is Special Condition */
  114. #define WR1_RXFIRSTIE    0x08        /* Interrupt Enable on First Rx */
  115. #define WR1_RXALLIE    0x10        /* Interrupt Enable on ALL Rx */
  116. #define WR1_SPECIE    0x18        /* Interrupt on Special only */
  117. #define WR1_REQRX    0x20        /* Request on Rx (else Tx) */
  118. #define WR1_REQFUNC    0x40        /* DMA Request (else cpu wait) */
  119. #define WR1_REQENABLE    0x80        /* Request/Wait enable */
  120.  
  121. /* Read/Write register 2, interrupt vector */
  122.  
  123. /* Write register 3 */
  124. #define WR3_RXENABLE    0x01        /* Rx Enable */
  125. #define WR3_SYNCINHIB    0x02        /* Sync Character Load Inhibit */
  126. #define WR3_ADDRSRCH    0x04        /* Address search mode (SDLC) */
  127. #define WR3_RXCRCENABLE    0x08        /* Rx CRC enable */
  128. #define WR3_ENTERHUNT    0x10        /* Enter Hunt Mode */
  129. #define WR3_AUTOENABLES    0x20        /* Auto Enables */
  130. #define WR3_RX5        0x00        /* Rx 5 bit characters */
  131. #define WR3_RX7        0x40        /* Rx 7 bit characters */
  132. #define WR3_RX6        0x80        /* Rx 6 bit characters */
  133. #define WR3_RX8        0xC0        /* Rx 8 bit characters */
  134.  
  135. /* Write register 4 */
  136. #define WR4_PARENABLE    0x01        /* Parity enable */
  137. #define WR4_PAREVEN    0x02        /* Even parity */
  138. #define WR4_STOP1    0x04        /* 1 stop bit */
  139. #define WR4_STOP15    0x08        /* 1.5 stop bits */
  140. #define WR4_STOP2    0x0C        /* 2 stop bits */
  141. #define WR4_SYNC8    0x00        /* 8 bit sync character */
  142. #define WR4_SYNC16    0x10        /* 16 bit sync character */
  143. #define WR4_SDLC    0x10        /* SDLC mode */
  144. #define WR4_EXTSYNC    0x30        /* External sync */
  145. #define WR4_X1CLOCK    0x00        /* x1 clock mode */
  146. #define WR4_X16CLOCK    0x40        /* x16 clock mode */
  147. #define WR4_X32CLOCK    0x80        /* x32 clock mode */
  148. #define WR4_X64CLOCK    0xC0        /* x64 clock mode */
  149.  
  150. /* Write register 5 */
  151. #define WR5_TXCRCENABLE    0x01        /* Enable CRC on Rx */
  152. #define WR5_RTS        0x02        /* RTS */
  153. #define WR5_CRC16    0x04        /* SDLC/CRC-16 */
  154. #define WR5_TXENABLE    0x08        /* Enable transmitter */
  155. #define WR5_BREAK    0&Cc    /* Send a break */
  156. #define WR5_TX5        0x00        /* Tx 5 bit characters */
  157. #define WR5_TX7        0x20        /* Tx 7 bit characters */
  158. #define WR5_TX6        0x40        /* Tx 6 bit characters */
  159. #define WR5_TX8        0x60        /* Tx 8 bit characters */
  160. #define WR5_DTR        0x80        /* DTR */
  161.  
  162. /* Write register 6 (Sync characters or SDLC address) */
  163.  
  164. /* Write register 7 more sync/SDLC */
  165.  
  166. /* Write register 8, same as data port, (Tx buffer) */
  167.  
  168. /* Write register 9 -- ONLY 1, SHARED BETWEEN CHANNELS, ACCESSABLE FROM BOTH */
  169. #define WR9_VIS        0x01        /* Vector Includes Status */
  170. #define WR9_NV        0x02        /* No Vector (don't respond to IACK) */
  171. #define WR9_DLC        0x04        /* Disable Lower Chain */
  172. #define WR9_MIE        0x08        /* Master Interrupt Enable */
  173. #define WR9_STATHIGH    0x10        /* Status high */
  174. #define WR9_RESETB    0x40        /* Reset channel B */
  175. #define WR9_RESETA    0x80        /* Reset channel A */
  176. #define WR9_RESETHARD    0xC0        /* Hardware reset */
  177.  
  178. /* Write register 10 */
  179. #define WR10_SYNC6    0x01        /* 6 bit sync */
  180. #define WR10_LOOP    0x02        /* Loop mode */
  181. #define WR10_ABORTUNDER    0x04        /* Abort on Underrun */
  182. #define WR10_MARKIDLE    0x08        /* Mark Idle */
  183. #define WR10_POLLACT    0x10        /* Go active on poll */
  184. #define WR10_NRZ    0x00        /* NRZ */
  185. #define WR10_NRZI    0x20        /* NRZI */
  186. #define WR10_FM1    0x40        /* FM (Transition = 1) */
  187. #define WR10_FM0    0x60        /* FM (Transition = 0) */
  188. #define WR10_PRESET1    0x80        /* CRC Preset 1 */
  189.  
  190. /* Write register 11 */
  191. #define WR11_XTAL    0x00        /* TRxC Out = XTAL Output */
  192. #define WR11_TXCLOCK    0x01        /* TRxC Out = Transmit clock */
  193. #define WR11_BRGEN    0x02        /* TRxC Out = BR Generator Output */
  194. #define WR11_DPLL    0x03        /* TRxC Out = DPLL Output */
  195. #define WR11_TRXCOUTEN    0x04        /* Enable TRxC as output */
  196. #define WR11_TXCLKRTXC    0x00        /* Tx clock = RTxC pin */
  197. #define WR11_TXCLKTRXC    0x08        /* Tx clock = TRxC pin */
  198. #define WR11_TXCLKBRGEN    0x10        /* Tx clock = BR Generator Output */
  199. #define WR11_TXCLKDPLL    0x18        /* Tx clock = DPLL Output */
  200. #define WR11_RXCLKRTXC    0x00        /* Rx clock = RTxC pin */
  201. #define WR11_RXCLKTRXC    0x20        /* Rx clock = TRxC pin */
  202. #define WR11_RXCLKBRGEN    0x40        /* Rx clock = BR Generator Output */
  203. #define WR11_RXCLKDPLL    0x60        /* Rx clock = DPLL Output */
  204. #define WR11_RTXCXTAL    0x80        /* Crystal RTxC in (else TTL) */
  205.  
  206. /* Read/Write register 12/13 Time constant */
  207.  
  208. /* Write register 14 */
  209. #define WR14_BRENABLE    0x01        /* BR Generator Enable */
  210. #define WR14_BRPCLK    0x02        /&Cd Generator CLK from PCLK */
  211. #define WR14_DTSREQ    0x04        /* DTR low is DMA request */
  212. #define WR14_AUTOECHO    0x08        /* Auto echo */
  213. #define WR14_LOOPBACK    0x10        /* Local loopback */
  214. #define WR14_SEARCH    0x20        /* Enter Search mode */
  215. #define WR14_RESET    0x40        /* Reset Missing Clock */
  216. #define WR14_DPLLDISABLE 0x60        /* Disable DPLL */
  217. #define WR14_SRCBR    0x80        /* Set DPLL CLK Src = BR Generator */
  218. #define WR14_SRCRTXC    0xA0        /* Set DPLL CLK Src = RTxC */
  219. #define WR14_FM        0xC0        /* Set FM mode */
  220. #define WR14_NRZI    0xE0        /* Set NRZI mode */
  221.  
  222.