m68562.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:29k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* m68562.h - Motorola M68562 Serial I/O Chip header */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01k,22sep92,rrr  added support for c++
  7. 01j,02jul92,caf  added TY_CO_DEV and function declarations for 5.1 upgrade.
  8.  for 5.0.x compatibility, define INCLUDE_TY_CO_DRV_50 when
  9.  including this header.
  10. 01i,26may92,rrr  the tree shuffle
  11. 01h,04oct91,rrr  passed through the ansification filter
  12.   -changed ASMLANGUAGE to _ASMLANGUAGE
  13.   -changed copyright notice
  14. 01g,05oct90,shl  added copyright notice.
  15.                  made #endif ANSI style.
  16. 01f,11jun90,gae  added _ASMLANGUAGE version.
  17.  simplified DUSCC macros, but kept 4.0.2 version temporarily.
  18.  fixed def'n of DUSCC_OMR_GPO1_1 to be O (oh) not 0 (zero).
  19. 01e,01mar89,jcc  incorporated DUSCC_REG_ADDR_INTERVAL into definitions.
  20. 01d,28nov88,jcf  change M562 to DUSCC because thats easier to remember.
  21. 01c,10aug88,gae  got rid of ^L which are unloved by some assemblers.
  22. 01b,21jun88,mcl  changed to be generic, not just mz7122; adds documentation.
  23. 01a,26jan88,sah  written.
  24. */
  25. #ifndef __INCm68562h
  26. #define __INCm68562h
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /*
  31.  * The macro's DUSCC_BASE_ADRS and DUSCC_REG_INTERVAL must be defined
  32.  * when including this header.
  33.  *
  34.  * define INCLUDE_TY_CO_DRV_50 when using this header if you are using
  35.  * a VxWorks 5.0-style serial driver (tyCoDrv.c).
  36.  */
  37. #ifdef _ASMLANGUAGE
  38. #define CAST
  39. #else /* _ASMLANGUAGE */
  40. #define CAST (char *)
  41. #include "tyLib.h"
  42. #ifndef  INCLUDE_TY_CO_DRV_50
  43. typedef struct          /* TY_CO_DEV */
  44.     {
  45.     TY_DEV     tyDev;
  46.     BOOL     created;     /* true if this device has been created */
  47.     char     numChannels;    /* number of channels to support */
  48.     volatile char * rx_data;        /* receiver data port */
  49.     volatile char * tx_data;        /* transmitter data port */
  50.     volatile char * ttr;            /* transmitter timer register */
  51.     volatile char * rtr;            /* receiver timer register */
  52.     volatile char * ier;            /* interrupt enable register */
  53.     volatile char * gsr;            /* general status register */
  54.     volatile char * rsr;            /* receiver status register */
  55.     volatile char * cmr1;
  56.     volatile char * cmr2;
  57.     volatile char * tpr;
  58.     volatile char * rpr;
  59.     volatile char * omr;
  60.     volatile char * ccr;
  61.     char     rx_rdy;         /* receiver ready bit */
  62.     char     tx_rdy;         /* transmitter ready bit */
  63.     } TY_CO_DEV;
  64. #endif /* INCLUDE_TY_CO_DRV_50 */
  65. #endif /* _ASMLANGUAGE */
  66. #define DUSCC_ADRS(reg)   (CAST (DUSCC_BASE_ADRS+(reg*DUSCC_REG_INTERVAL)))
  67. /* port registers */
  68. #define DUSCC_CMR1A DUSCC_ADRS(0x00) /* channel mode reg. 1    */
  69. #define DUSCC_CMR2A DUSCC_ADRS(0x01) /* channel mode reg. 2    */
  70. #define DUSCC_S1RA DUSCC_ADRS(0x02) /* secondary adrs reg1    */
  71. #define DUSCC_S2RA DUSCC_ADRS(0x03) /* secondary adrs reg2    */
  72. #define DUSCC_TPRA DUSCC_ADRS(0x04) /* tx parameter reg.      */
  73. #define DUSCC_TTRA DUSCC_ADRS(0x05) /* tx timing reg.         */
  74. #define DUSCC_RPRA DUSCC_ADRS(0x06) /* rx parameter reg.      */
  75. #define DUSCC_RTRA DUSCC_ADRS(0x07) /* rx timing reg.         */
  76. #define DUSCC_CTPRHA DUSCC_ADRS(0x08) /* counter preset high    */
  77. #define DUSCC_CTPRLA DUSCC_ADRS(0x09) /* counter preset low     */
  78. #define DUSCC_CTCRA DUSCC_ADRS(0x0a) /* counter control reg.   */
  79. #define DUSCC_OMRA DUSCC_ADRS(0x0b) /* output/misc. reg.      */
  80. #define DUSCC_CTHA DUSCC_ADRS(0x0c) /* counter/timer high     */
  81. #define DUSCC_CTLA DUSCC_ADRS(0x0d) /* counter/timer low      */
  82. #define DUSCC_PCRA DUSCC_ADRS(0x0e) /* pin configuration      */
  83. #define DUSCC_CCRA DUSCC_ADRS(0x0f) /* channel command reg.   */
  84. #define DUSCC_TXFIFOA DUSCC_ADRS(0x10) /* tx FIFO                */
  85. #define DUSCC_RXFIFOA DUSCC_ADRS(0x14) /* rx FIFO                */
  86. #define DUSCC_RSRA DUSCC_ADRS(0x18) /* rx status reg.         */
  87. #define DUSCC_TRSRA DUSCC_ADRS(0x19) /* tx/rx status reg.      */
  88. #define DUSCC_ICTSRA DUSCC_ADRS(0x1a) /* counter status reg.    */
  89. #define DUSCC_GSR DUSCC_ADRS(0x1b) /* general status         */
  90. #define DUSCC_IERA DUSCC_ADRS(0x1c) /* interrupt enable       */
  91. #define DUSCC_IVR DUSCC_ADRS(0x1e) /* interrupt vector       */
  92. #define DUSCC_ICR DUSCC_ADRS(0x1f) /* interrupt control      */
  93. #define DUSCC_CMR1B DUSCC_ADRS(0x20) /* channel mode reg. 1    */
  94. #define DUSCC_CMR2B DUSCC_ADRS(0x21) /* channel mode reg. 2    */
  95. #define DUSCC_S1RB DUSCC_ADRS(0x22) /* secondary adrs reg 1   */
  96. #define DUSCC_S2RB DUSCC_ADRS(0x23) /* secondary adrs reg 2   */
  97. #define DUSCC_TPRB DUSCC_ADRS(0x24) /* tx parameter reg.      */
  98. #define DUSCC_TTRB DUSCC_ADRS(0x25) /* tx timing reg.         */
  99. #define DUSCC_RPRB DUSCC_ADRS(0x26) /* rx parameter reg.      */
  100. #define DUSCC_RTRB DUSCC_ADRS(0x27) /* rx timing reg.         */
  101. #define DUSCC_CTPRHB DUSCC_ADRS(0x28) /* counter preset high    */
  102. #define DUSCC_CTPRLB DUSCC_ADRS(0x29) /* counter preset low     */
  103. #define DUSCC_CTCRB DUSCC_ADRS(0x2a) /* counter control reg.   */
  104. #define DUSCC_OMRB DUSCC_ADRS(0x2b) /* output/misc. reg.      */
  105. #define DUSCC_CTHB DUSCC_ADRS(0x2c) /* counter/timer high     */
  106. #define DUSCC_CTLB DUSCC_ADRS(0x2d) /* counter/timer low      */
  107. #define DUSCC_PCRB DUSCC_ADRS(0x2e) /* pin configuration      */
  108. #define DUSCC_CCRB DUSCC_ADRS(0x2f) /* channel command reg.   */
  109. #define DUSCC_TXFIFOB DUSCC_ADRS(0x30) /* tx FIFO                */
  110. #define DUSCC_RXFIFOB DUSCC_ADRS(0x34) /* rx FIFO                */
  111. #define DUSCC_RSRB DUSCC_ADRS(0x38) /* rx status reg.         */
  112. #define DUSCC_TRSRB DUSCC_ADRS(0x39) /* tx/rx status reg.      */
  113. #define DUSCC_ICTSRB DUSCC_ADRS(0x3a) /* count/timer status     */
  114. #define DUSCC_IERB DUSCC_ADRS(0x3c) /* interrupt enable       */
  115. #define DUSCC_IVRM DUSCC_ADRS(0x3e) /* int. vec. modified     */
  116. /* vector number offsets */
  117. #define DUSCC_INT_A_RXRDY 0x00 /* RxRDY interrupt */
  118. #define DUSCC_INT_A_TXRDY 0x01 /* TxRDY interrupt */
  119. #define DUSCC_INT_A_RX_TX_ERROR 0x02 /* rx/tx error interrupt */
  120. #define DUSCC_INT_A_EXT 0x03 /* ext. & cnt/timer interrupt */
  121. #define DUSCC_INT_B_RXRDY 0x04 /* RxRDY interrupt */
  122. #define DUSCC_INT_B_TXRDY 0x05 /* TxRDY interrupt */
  123. #define DUSCC_INT_B_RX_TX_ERROR 0x06 /* rx/tx error interrupt */
  124. #define DUSCC_INT_B_EXT 0x07 /* ext. & cnt/timer interrupt */
  125. #define N_CHANNELS 2 /* number of channels per chip */
  126. /* channel mode register one (CMR1A, CMR1B) */
  127. #define DUSCC_CMR1_BOP_PRIMARY 0x00 /* channel protocol mode */
  128. #define DUSCC_CMR1_BOP_SECONDARY 0x01 /* channel protocol mode */
  129. #define DUSCC_CMR1_BOP_LOOP 0x02 /* channel protocol mode */
  130. #define DUSCC_CMR1_BOP_LOOP_NO_ADR_CMP 0x03 /* channel protocol mode */
  131. #define DUSCC_CMR1_BOP_8BIT_ADRS 0x00 /* single octet address */
  132. #define DUSCC_CMR1_BOP_EXT_ADRS 0x08 /* extended address */
  133. #define DUSCC_CMR1_BOP_16BIT_ADRS 0x10 /* dual octet address */
  134. #define DUSCC_CMR1_BOP_16BIT_GRP_ADRS 0x18 /* dual octet adrs with group */
  135. #define DUSCC_CMR1_BOP_1_OCTET_CNT 0x00 /* 1 ctrl field follows adrs */
  136. #define DUSCC_CMR1_BOP_2_OCTET_CNT 0x20 /* 2 ctrl fields follow adrs */
  137. #define DUSCC_CMR1_COP_DUAL_SYN 0x04 /* channel protocol mode */
  138. #define DUSCC_CMR1_COP_BISYNC 0x05 /* channel protocol mode */
  139. #define DUSCC_CMR1_COP_SINGLE_SYN 0x06 /* channel protocol mode */
  140. #define DUSCC_CMR1_COP_NO_PARITY 0x00 /* channel parity none */
  141. #define DUSCC_CMR1_COP_WITH_PARITY 0x10 /* channel parity odd/even */
  142. #define DUSCC_CMR1_COP_FORCE_PARITY 0x18 /* channel parity hi/lo */
  143. #define DUSCC_CMR1_COP_EVEN_PARITY 0x00 /* channel parity even */
  144. #define DUSCC_CMR1_COP_ODD_PARITY 0x20 /* channel parity odd */
  145. #define DUSCC_CMR1_COP_BISYNC_EBCDIC 0x00 /* comparisons in EBCDIC */
  146. #define DUSCC_CMR1_COP_BISYNC_ASCII 0x20 /* comparisons in ASCII */
  147. #define DUSCC_CMR1_ASYNC 0x07 /* chnl protocol mode: async. */
  148. #define DUSCC_CMR1_NRZ 0x00 /* non-return-to-zero */
  149. #define DUSCC_CMR1_NRZI 0x40 /* non-return-to-zero, inv */
  150. #define DUSCC_CMR1_FM0 0x80 /* bi-phase space */
  151. #define DUSCC_CMR1_FM1 0xc0 /* bi-phase mark */
  152. /* equates for channel mode register two (CMR2A, CMR2B) */
  153. #define DUSCC_CMR2_FCS_SEL_NONE 0x00 /* frame check seq. select */
  154. #define DUSCC_CMR2_FCS_SEL_LRC_8_PRS0 0x02 /* frame check seq. select */
  155. #define DUSCC_CMR2_FCS_SEL_LRC_8_PRS1 0x03 /* frame check seq. select */
  156. #define DUSCC_CMR2_FCS_SEL_CRC_16_PRS0 0x04 /* frame check seq. select */
  157. #define DUSCC_CMR2_FCS_SEL_CRC_16_PRS1 0x05 /* frame check seq. select */
  158. #define DUSCC_CMR2_FCS_SEL_CRC_CC_PRS0 0x06 /* frame check seq. select */
  159. #define DUSCC_CMR2_FCS_SEL_CRC_CC_PRS1 0x07 /* frame check seq. select */
  160. #define DUSCC_CMR2_DTI_HLFDUP_SADRDMA 0x00 /* data transfer interface */
  161. #define DUSCC_CMR2_DTI_HLFDUP_DADRDMA 0x08 /* data transfer interface */
  162. #define DUSCC_CMR2_DTI_FULDUP_SADRDMA 0x10 /* data transfer interface */
  163. #define DUSCC_CMR2_DTI_FULDUP_DADRDMA 0x18 /* data transfer interface */
  164. #define DUSCC_CMR2_DTI_WAIT_RX 0x20 /* data transfer interface */
  165. #define DUSCC_CMR2_DTI_WAIT_TX 0x28 /* data transfer interface */
  166. #define DUSCC_CMR2_DTI_WAIT_RX_TX 0x30 /* data transfer interface */
  167. #define DUSCC_CMR2_DTI_POLL_OR_INT 0x38 /* data transfer interface */
  168. #define DUSCC_CMR2_CHN_CON_NORNAL 0x00 /* channel connection */
  169. #define DUSCC_CMR2_CHN_CON_AUTO_ECHO 0x40 /* channel connection */
  170. #define DUSCC_CMR2_CHN_CON_LOCAL_LOOP 0x80 /* channel connection */
  171. /* equates for transmit parameter register (TPRA, TPRB) */
  172. #define DUSCC_TPR_5BITS 0x00 /* tx 5 bits per character */
  173. #define DUSCC_TPR_6BITS 0x01 /* tx 6 bits per character */
  174. #define DUSCC_TPR_7BITS 0x02 /* tx 7 bits per character */
  175. #define DUSCC_TPR_8BITS 0x03 /* tx 8 bits per character */
  176. #define DUSCC_TPR_CTS_EN_TX_ENABLE 0x04 /* CTS_N affects tx */
  177. #define DUSCC_TPR_TX_RTS_CONT_YES 0x08 /* RTS_N affected by tx */
  178. #define DUSCC_TPR_ASYNC_9_16 0x00 /* async: 9/16 stop bits */
  179. #define DUSCC_TPR_ASYNC_10_16 0x10 /* async: 10/16 stop bits */
  180. #define DUSCC_TPR_ASYNC_11_16 0x20 /* async: 11/16 stop bits */
  181. #define DUSCC_TPR_ASYNC_12_16 0x30 /* async: 12/16 stop bits */
  182. #define DUSCC_TPR_ASYNC_13_16 0x40 /* async: 13/16 stop bits */
  183. #define DUSCC_TPR_ASYNC_14_16 0x50 /* async: 14/16 stop bits */
  184. #define DUSCC_TPR_ASYNC_15_16 0x60 /* async: 15/16 stop bits */
  185. #define DUSCC_TPR_ASYNC_1 0x70 /* async: 16/16 stop bits */
  186. #define DUSCC_TPR_ASYNC_1_9_16 0x80 /* async: 1 stop bit */
  187. #define DUSCC_TPR_ASYNC_1_10_16 0x90 /* async: 10/16 stop bits */
  188. #define DUSCC_TPR_ASYNC_1_11_16 0xa0 /* async: 11/16 stop bits */
  189. #define DUSCC_TPR_ASYNC_1_12_16 0xb0 /* async: 12/16 stop bits */
  190. #define DUSCC_TPR_ASYNC_1_13_16 0xc0 /* async: 13/16 stop bits */
  191. #define DUSCC_TPR_ASYNC_1_14_16 0xd0 /* async: 14/16 stop bits */
  192. #define DUSCC_TPR_ASYNC_1_15_16 0xe0 /* async: 15/16 stop bits */
  193. #define DUSCC_TPR_ASYNC_2 0xf0 /* async: 2 stop bits */
  194. #define DUSCC_TPR_COP_TEOM_NO 0x00 /* no EOM on zero or done */
  195. #define DUSCC_TPR_COP_TEOM_YES 0x10 /* tx EOM on zero or done */
  196. #define DUSCC_TPR_COP_IDLE_MARK 0x00 /* idle in marking condition */
  197. #define DUSCC_TPR_COP_IDLE_SYN 0x20 /* idle sending SYNs */
  198. #define DUSCC_TPR_COP_UNDR_FCS 0x00 /* EOM termination */
  199. #define DUSCC_TPR_COP_UNDR_MARK 0x80 /* TxD in marking condition */
  200. #define DUSCC_TPR_COP_UNDR_SYN 0xc0 /* send SYNs */
  201. #define DUSCC_TPR_BOP_TEOM_NO 0x00 /* no EOM on zero or done */
  202. #define DUSCC_TPR_BOP_TEOM_YES 0x10 /* tx EOM on zero or done */
  203. #define DUSCC_TPR_BOP_IDLE_MARK 0x00 /* idle in marking condition */
  204. #define DUSCC_TPR_BOP_IDLE_SYN 0x20 /* idle sending FLAGs */
  205. #define DUSCC_TPR_BOP_UNDR_FCS 0x00 /* EOM termination */
  206. #define DUSCC_TPR_BOP_UNDR_ABORT_MARK 0x80 /* TxD in marking condition */
  207. #define DUSCC_TPR_BOP_UNDR_ABORT_FLAG 0xc0 /* send ABORTs */
  208. /* equates for transmitter timing register (TTRA, TTRB) */
  209. #define DUSCC_TTR_BAUD_50 0x00 /* transmit speed */
  210. #define DUSCC_TTR_BAUD_75 0x01 /* transmit speed */
  211. #define DUSCC_TTR_BAUD_110 0x02 /* transmit speed */
  212. #define DUSCC_TTR_BAUD_134_5 0x03 /* transmit speed */
  213. #define DUSCC_TTR_BAUD_150 0x04 /* transmit speed */
  214. #define DUSCC_TTR_BAUD_200 0x05 /* transmit speed */
  215. #define DUSCC_TTR_BAUD_300 0x06 /* transmit speed */
  216. #define DUSCC_TTR_BAUD_600 0x07 /* transmit speed */
  217. #define DUSCC_TTR_BAUD_1050 0x08 /* transmit speed */
  218. #define DUSCC_TTR_BAUD_1200 0x09 /* transmit speed */
  219. #define DUSCC_TTR_BAUD_2000 0x0a /* transmit speed */
  220. #define DUSCC_TTR_BAUD_2400 0x0b /* transmit speed */
  221. #define DUSCC_TTR_BAUD_4800 0x0c /* transmit speed */
  222. #define DUSCC_TTR_BAUD_9600 0x0d /* transmit speed */
  223. #define DUSCC_TTR_BAUD_19200 0x0e /* transmit speed */
  224. #define DUSCC_TTR_BAUD_38400 0x0f /* transmit speed */
  225. #define DUSCC_TTR_CLK_1x_EXT 0x00 /* ext. clock, 1x baud rate */
  226. #define DUSCC_TTR_CLK_16x_EXT 0x10 /* ext. clock, 16x, async */
  227. #define DUSCC_TTR_CLK_DPLL 0x20 /* int., DPLL, half duplex */
  228. #define DUSCC_TTR_CLK_BRG 0x30 /* int., BRG, 32x, baud rate */
  229. #define DUSCC_TTR_CLK_2x_OTHER_CHAN 0x40 /* int., C/T, 2x baud rate */
  230. #define DUSCC_TTR_CLK_32x_OTHER_CHAN 0x50 /* int., C/T, 32x baud rate */
  231. #define DUSCC_TTR_CLK_2x_OWN_CHAN 0x60 /* int., C/T, 2x baud rate */
  232. #define DUSCC_TTR_CLK_32x_OWN_CHAN 0x70 /* int., C/T, 32x baud rate */
  233. #define DUSCC_TTR_EXT_SOURCE_RTXC 0x00 /* ext. input from RTxC */
  234. #define DUSCC_TTR_EXT_SOURCE_TRXC 0x80 /* ext. input from TRxC */
  235. /* equates for receiver parameter register (RPRA, RPRB) */
  236. #define DUSCC_RPR_5BITS 0x00 /* rx 5 bits per character */
  237. #define DUSCC_RPR_6BITS 0x01 /* rx 6 bits per character */
  238. #define DUSCC_RPR_7BITS 0x02 /* rx 7 bits per character */
  239. #define DUSCC_RPR_8BITS 0x03 /* rx 8 bits per character */
  240. #define DUSCC_RPR_DCD_EN_RX_DISABLE 0x00 /* not used to enable rx */
  241. #define DUSCC_RPR_DCD_EN_RX_ENABLE 0x04 /* used to enable receiver */
  242. #define DUSCC_RPR_ASYNC_STRIP_PARITY_NO 0x00 /* do not strip RX parity */
  243. #define DUSCC_RPR_ASYNC_STRIP_PARITY_YES 0x08 /* strip RX parity */
  244. #define DUSCC_RPR_ASYNC_RX_RTS_CONT_NO 0x00 /* rx can't negate RTS_N */
  245. #define DUSCC_RPR_ASYNC_RX_RTS_CONT_YES 0x10 /* async: rx can negate RTS_N */
  246. #define DUSCC_RPR_COP_STRIP_PARITY_NO 0x00 /* don't strip RX parity */
  247. #define DUSCC_RPR_COP_STRIP_PARITY_YES 0x08 /* strip RX parity */
  248. #define DUSCC_RPR_COP_EXT_SYNC_NO 0x00 /* external SYNC disable */
  249. #define DUSCC_RPR_COP_EXT_SYNC_YES 0x10 /* external SYNC enable */
  250. #define DUSCC_RPR_COP_AUTO_HUNT_NO 0x00 /* disable auto-hunt/PAD check*/
  251. #define DUSCC_RPR_COP_AUTO_HUNT_YES 0x20 /* enable auto-hunt/PAD check */
  252. #define DUSCC_RPR_COP_FCS_FIFO_NO 0x00 /* don't trans to RxFIFO */
  253. #define DUSCC_RPR_COP_FCS_FIFO_YES 0x40 /* trans. FCS to RxFIFO */
  254. #define DUSCC_RPR_COP_SYN_STRIP_LEADING 0x00 /* strip leading SYNs */
  255. #define DUSCC_RPR_COP_SYN_STRIP_ALL 0x80 /* strip all SYNs */
  256. #define DUSCC_RPR_BOP_ALL_PARITY_ADR_NO 0x00 /* BOP: don't recognize all */
  257. #define DUSCC_RPR_BOP_ALL_PARITY_ADR_YES 0x08 /* BOP: recognize all parties */
  258. #define DUSCC_RPR_BOP_OVRUN_HUNT 0x00 /* BOP: hunt for FLAG on over */
  259. #define DUSCC_RPR_BOP_OVRUN_CONT 0x20 /* BOP: continue on overrun */
  260. #define DUSCC_RPR_BOP_FCS_FIFO_NO 0x00 /* BOP: don't trans. FCS */
  261. #define DUSCC_RPR_BOP_FCS_FIFO_YES 0x40 /* BOP: trans. FCS to RxFIFO */
  262. /* equates for receiver timing register (RTRA, RTRB) */
  263. #define DUSCC_RTR_BAUD_50 0x00 /* receiver speed */
  264. #define DUSCC_RTR_BAUD_75 0x01 /* receiver speed */
  265. #define DUSCC_RTR_BAUD_110 0x02 /* receiver speed */
  266. #define DUSCC_RTR_BAUD_134_5 0x03 /* receiver speed */
  267. #define DUSCC_RTR_BAUD_150 0x04 /* receiver speed */
  268. #define DUSCC_RTR_BAUD_200 0x05 /* receiver speed */
  269. #define DUSCC_RTR_BAUD_300 0x06 /* receiver speed */
  270. #define DUSCC_RTR_BAUD_600 0x07 /* receiver speed */
  271. #define DUSCC_RTR_BAUD_1050 0x08 /* receiver speed */
  272. #define DUSCC_RTR_BAUD_1200 0x09 /* receiver speed */
  273. #define DUSCC_RTR_BAUD_2000 0x0a /* receiver speed */
  274. #define DUSCC_RTR_BAUD_2400 0x0b /* receiver speed */
  275. #define DUSCC_RTR_BAUD_4800 0x0c /* receiver speed */
  276. #define DUSCC_RTR_BAUD_9600 0x0d /* receiver speed */
  277. #define DUSCC_RTR_BAUD_19200 0x0e /* receiver speed */
  278. #define DUSCC_RTR_BAUD_38400 0x0f /* receiver speed */
  279. #define DUSCC_RTR_CLK_1x_EXT 0x00 /* ext. clock, 1x */
  280. #define DUSCC_RTR_CLK_16x_EXT 0x10 /* ext. clock, 16x, async */
  281. #define DUSCC_RTR_CLK_BRG 0x20 /* int. BRG clock, 32x, async */
  282. #define DUSCC_RTR_CLK_CT 0x30 /* int. C/T clock, 32x, async */
  283. #define DUSCC_RTR_CLK_DPLL_64x 0x40 /* int. clock, 64x */
  284. #define DUSCC_RTR_CK_DPLL_32x_EXT 0x50 /* ext. clock, 32x baud */
  285. #define DUSCC_RTR_CK_DPLL_32x_BRG 0x60 /* int. BRG clock, 32x baud */
  286. #define DUSCC_RTR_CK_DPLL_32x_CT 0x70 /* int. C/T clock, 32x baud */
  287. #define DUSCC_RTR_EXT_SOURCE_RTXC 0x00 /* external input from RTxC */
  288. #define DUSCC_RTR_EXT_SOURCE_TRXC 0x80 /* external input from TRxC */
  289. /* equates for counter/timer control register (CTCRA, CTCRB) */
  290. #define DUSCC_CTCR_CLK_RTXC 0x00 /* clock source is RTxC pin */
  291. #define DUSCC_CTCR_CLK_TRXC 0x01 /* clock source is TRxC pin */
  292. #define DUSCC_CTCR_CLK_X1_CLK 0x02 /* clock source is clock/4 */
  293. #define DUSCC_CTCR_CLK_X1_CLK_RXD 0x03 /* clk is clk/4 gated by RxD */
  294. #define DUSCC_CTCR_CLK_RX_BRG 0x04 /* clock source is BRG */
  295. #define DUSCC_CTCR_CLK_TX_BRG 0x05 /* clock source is BRG */
  296. #define DUSCC_CTCR_CLK_RX_CHAR 0x06 /* clock source is rxload */
  297. #define DUSCC_CTCR_CLK_TX_CHAR 0x07 /* clock source is txload */
  298. #define DUSCC_CTCR_PRESCALER_DIV_1 0x00 /* prescale by 1 */
  299. #define DUSCC_CTCR_PRESCALER_DIV_16 0x08 /* prescale by 16 */
  300. #define DUSCC_CTCR_PRESCALER_DIV_32 0x10 /* prescale by 32 */
  301. #define DUSCC_CTCR_PRESCALER_DIV_64 0x18 /* prescale by 64 */
  302. #define DUSCC_CTCR_OUTPUT_CONT_SQUARE 0x00 /* count roll toggles output */
  303. #define DUSCC_CTCR_OUTPUT_CONT_PULSE 0x20 /* counter roll pulses output */
  304. #define DUSCC_CTCR_ZERO_DET_CONT_PRESET 0x00 /* counter is preset to value */
  305. #define DUSCC_CTCR_ZERO_DET_CONT_CONT 0x40 /* counter is preset to -1 */
  306. #define DUSCC_CTCR_ZERO_DET_INTR_DISABLE 0x00 /* disable zero detect int. */
  307. #define DUSCC_CTCR_ZERO_DET_INTR_ENABLE 0x80 /* enable zero detect int. */
  308. /* equates for output and miscellaneous register (OMRA, OMRB) */
  309. #define DUSCC_OMR_RTS_0 0x00 /* request-to-send lo */
  310. #define DUSCC_OMR_RTS_1 0x01 /* request-to-send hi */
  311. #define DUSCC_OMR_GPO1_0 0x00 /* gen. purpose output 1 lo */
  312. #define DUSCC_OMR_GPO1_1 0x02 /* gen. purpose output 1 hi */
  313. #define DUSCC_OMR_GPO2_0 0x00 /* gen. purpose output 2 lo */
  314. #define DUSCC_OMR_GPO2_1 0x04 /* gen. purpose output 2 hi */
  315. #define DUSCC_OMR_RXRDY_FIFO_NOT_EMPTY 0x00 /* set TxRDY until FIFO empty */
  316. #define DUSCC_OMR_RXRDY_FIFO_FULL 0x08 /* set TxRDY if FIFO full */
  317. #define DUSCC_OMR_TXRDY_FIFO_NOT_FULL 0x00 /* set TxRDY until FIFO full */
  318. #define DUSCC_OMR_TXRDY_FIFO_EMPTY 0x10 /* set TxRDY if FIFO empty */
  319. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_1 0x00 /* BOP: last char is 1 bits */
  320. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_2 0x20 /* BOP: last char is 2 bits */
  321. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_3 0x40 /* BOP: last char is 3 bits */
  322. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_4 0x60 /* BOP: last char is 4 bits */
  323. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_5 0x80 /* BOP: last char is 5 bits */
  324. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_6 0xa0 /* BOP: last char is 6 bits */
  325. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_7 0xc0 /* BOP: last char is 7 bits */
  326. #define DUSCC_OMR_TX_RES_CHAR_LENGTH_TPR 0xe0 /* BOP: last is TPR[1:0] bits */
  327. /* equates for pin configuration register (PCRA, PCRB) */
  328. #define DUSCC_PCR_TRXC_INPUT 0x00 /* TRxC function: input */
  329. #define DUSCC_PCR_TRXC_XTAL_2 0x01 /* TRxC function: XTAL/2 */
  330. #define DUSCC_PCR_TRXC_DPLL 0x02 /* TRxC function: DPLL output */
  331. #define DUSCC_PCR_TRXC_CT 0x03 /* TRxC function: count/timer */
  332. #define DUSCC_PCR_TRXC_TXCLK_16x 0x04 /* TRxC function: TTRx16 */
  333. #define DUSCC_PCR_TRXC_RXCLK_16x 0x05 /* TRxC function: RTRx16 */
  334. #define DUSCC_PCR_TRXC_TXCLK_1x 0x06 /* TRxC function: TXC output */
  335. #define DUSCC_PCR_TRXC_RXCLK_1x 0x07 /* TRxC function: RXC output */
  336. #define DUSCC_PCR_RTXC_INPUT 0x00 /* RTxC function: input */
  337. #define DUSCC_PCR_RTXC_CT 0x08 /* RTxC function: count/timer */
  338. #define DUSCC_PCR_RTXC_TXCLK_1x 0x10 /* RTxC function: TXC output */
  339. #define DUSCC_PCR_RTXC_RXCLK_1x 0x18 /* RTxC function: RXC output */
  340. #define DUSCC_PCR_SYNOUT_RTS_SYNOUT 0x00 /* RTS is a SYNOUT */
  341. #define DUSCC_PCR_SYNOUT_RTS_RTS 0x20 /* RTS is an RTS */
  342. #define DUSCC_PCR_GPO2_RTS_GPO2 0x00 /* GPO2 is a GPO2 */
  343. #define DUSCC_PCR_GPO2_RTS_RTS 0x40 /* GPO2 is an RTS */
  344. #define DUSCC_PCR_X2_IDC_X2 0x00 /* X2 is crystal connection */
  345. #define DUSCC_PCR_X2_IDC_IDC 0x80 /* X2 is int. daisy chain */
  346. /* equates for channel command register (CCRA, CCRB) commands */
  347. #define DUSCC_CCR_TX_RESET_TX 0x00 /* reset transmitter */
  348. #define DUSCC_CCR_TX_RESET_TXCRC 0x01 /* reset transmit CRC */
  349. #define DUSCC_CCR_TX_ENABLE_TX 0x02 /* enable transmitter */
  350. #define DUSCC_CCR_TX_DISABLE_TX 0x03 /* disable transmitter */
  351. #define DUSCC_CCR_TX_TX_TSOM 0x04 /* transmit start of message */
  352. #define DUSCC_CCR_TX_TX_TSOMP 0x05 /* tx start of msg with pad */
  353. #define DUSCC_CCR_TX_TX_TEOM 0x06 /* transmit end-of-message */
  354. #define DUSCC_CCR_TX_TX_TABRK 0x07 /* transmit async break */
  355. #define DUSCC_CCR_TX_TX_TABORT 0x07 /* transmit BOP abort */
  356. #define DUSCC_CCR_TX_TX_DLE 0x08 /* transmit DLE */
  357. #define DUSCC_CCR_TX_ACT_ON_POLL 0x09 /* go active on poll */
  358. #define DUSCC_CCR_TX_RESET_ON_POLL 0x0a /* reset go active on poll */
  359. #define DUSCC_CCR_TX_GO_ON_LOOP 0x0b /* go on-loop */
  360. #define DUSCC_CCR_TX_GO_OFF_LOOP 0x0c /* go off-loop */
  361. #define DUSCC_CCR_TX_EXCLD_CRC 0x0d /* exclude from CRC */
  362. #define DUSCC_CCR_RX_RESET_RX 0x40 /* reset receiver */
  363. #define DUSCC_CCR_RX_ENABLE_RX 0x42 /* enable receiver */
  364. #define DUSCC_CCR_RX_DISABLE_RX 0x43 /* disable receiver */
  365. #define DUSCC_CCR_CT_START 0x80 /* start counter/timer */
  366. #define DUSCC_CCR_CT_STOP 0x81 /* stop counter/timer */
  367. #define DUSCC_CCR_CT_PRE_FFFF 0x82 /* preset counter/timer to -1 */
  368. #define DUSCC_CCR_CT_PRE_CTPRHL 0x83 /* counter/timer CTPRH/CTPRL */
  369. #define DUSCC_CCR_DPLL_ENTR_SEARCH 0xc0 /* DPLL: enter search mode */
  370. #define DUSCC_CCR_DPLL_DISABLE_DPLL 0xc1 /* DPLL: disable */
  371. #define DUSCC_CCR_DPLL_SET_FM 0xc2 /* DPLL: set FM mode */
  372. #define DUSCC_CCR_DPLL_SET_NRZ1 0xc3 /* DPLL: set NRZI mode */
  373. /* equates for receiver status register (RSRA, RSRB) */
  374. #define DUSCC_RSR_ASYNC_PARITY_ERROR 0x01 /* parity error detected */
  375. #define DUSCC_RSR_ASYNC_FRAMING_ERR 0x02 /* framing error detected */
  376. #define DUSCC_RSR_ASYNC_BRK_STR_DET 0x04 /* break start detected */
  377. #define DUSCC_RSR_ASYNC_BRK_END_DET 0x08 /* break detected */
  378. #define DUSCC_RSR_ASYNC_OVERN_ERROR 0x20 /* overrun error */
  379. #define DUSCC_RSR_ASYNC_RTS_NEGATED 0x40 /* RTS negated when FIFO full */
  380. #define DUSCC_RSR_ASYNC_CHAR_COMP 0x80 /* character compared to S1R */
  381. #define DUSCC_RSR_COP_PARITY_ERROR 0x01 /* parity error detected */
  382. #define DUSCC_RSR_COP_CRC_ERROR 0x02 /* CRC error detected */
  383. #define DUSCC_RSR_COP_SYN_DETET 0x04 /* SYN detected */
  384. #define DUSCC_RSR_COP_OVERN_ERROR 0x20 /* overrun error */
  385. #define DUSCC_RSR_COP_PAD_ERROR 0x40 /* PAD error detected */
  386. #define DUSCC_RSR_COP_EOM_DETET 0x80 /* end-of-message detected */
  387. #define DUSCC_RSR_BOP_RCL_NOT_ZERO 0x01 /* non-zero character len. */
  388. #define DUSCC_RSR_BOP_FCS_ERROR 0x02 /* FCS error detected */
  389. #define DUSCC_RSR_BOP_FLAG_DETECT 0x04 /* FLAG sequence detected */
  390. #define DUSCC_RSR_BOP_IDLE_DETECT 0x08 /* idle sequence detected */
  391. #define DUSCC_RSR_BOP_SHORT_FRAM_DET 0x10 /* missing fields */
  392. #define DUSCC_RSR_BOP_OVERN_ERROR 0x20 /* overrun error */
  393. #define DUSCC_RSR_BOP_ABORT_DETECT 0x40 /* abort sequence detected */
  394. #define DUSCC_RSR_BOP_EOM_DETECT 0x80 /* end-of-message detected */
  395. #define DUSCC_RSR_BOP_LOOP_RCL_NOT_ZERO 0x01 /* non-zero char len. */
  396. #define DUSCC_RSR_BOP_LOOP_FCS_ERROR 0x02 /* FCS error */
  397. #define DUSCC_RSR_BOP_LOOP_FLAG_DETECT 0x04 /* FLAG sequence */
  398. #define DUSCC_RSR_BOP_LOOP_TURN_DETECT 0x08 /* turnaround seq. */
  399. #define DUSCC_RSR_BOP_LOOP_SHORT_FRAM_DET 0x10 /* missing fields */
  400. #define DUSCC_RSR_BOP_LOOP_OVERN_ERROR 0x20 /* overrun error */
  401. #define DUSCC_RSR_BOP_LOOP_ABORT_DETECT 0x40 /* abort sequence */
  402. #define DUSCC_RSR_BOP_LOOP_EOM_DETECT 0x80 /* end-of-message */
  403. /* equates for transmitter and receiver status register (TRSRA, TRSRB) */
  404. #define DUSCC_TRSR_ASYNC_DPLL_ERROR 0x08 /* async: DPLL lost lock */
  405. #define DUSCC_TRSR_ASYNC_SND_BRK_ACK 0x10 /* async: transmitting break */
  406. #define DUSCC_TRSR_ASYNC_CTS_UNDERRUN 0x40 /* async: CTS underrun */
  407. #define DUSCC_TRSR_ASYNC_TX_EMPTY 0x80 /* async: transmit empty */
  408. #define DUSCC_TRSR_COP_RX_XPRNT 0x01 /* COP: rx in transparent mode*/
  409. #define DUSCC_TRSR_COP_RX_HUNT 0x02 /* COP: rx hunting for SYN */
  410. #define DUSCC_TRSR_COP_DPLL_ERROR 0x08 /* COP: DPLL lost lock */
  411. #define DUSCC_TRSR_COP_SND_ACK 0x10 /* COP: xmit now sending ACK */
  412. #define DUSCC_TRSR_COP_FRAME_COMP 0x20 /* COP: end of message */
  413. #define DUSCC_TRSR_COP_CTS_UNDERRUN 0x40 /* COP: CTS underrun */
  414. #define DUSCC_TRSR_COP_TX_EMPTY 0x80 /* COP: transmit empty */
  415. #define DUSCC_TRSR_BOP_RESDL_RX_0BIT 0x00 /* BOP: received residual len */
  416. #define DUSCC_TRSR_BOP_RESDL_RX_1BIT 0x01 /* BOP: received residual len */
  417. #define DUSCC_TRSR_BOP_RESDL_RX_2BIT 0x02 /* BOP: received residual len */
  418. #define DUSCC_TRSR_BOP_RESDL_RX_3BIT 0x03 /* BOP: received residual len */
  419. #define DUSCC_TRSR_BOP_RESDL_RX_4BIT 0x04 /* BOP: received residual len */
  420. #define DUSCC_TRSR_BOP_RESDL_RX_5BIT 0x05 /* BOP: received residual len */
  421. #define DUSCC_TRSR_BOP_RESDL_RX_6BIT 0x06 /* BOP: received residual len */
  422. #define DUSCC_TRSR_BOP_RESDL_RX_7BIT 0x07 /* BOP: received residual len */
  423. #define DUSCC_TRSR_BOP_DPLL_ERROR 0x08 /* BOP: DPLL lost lock */
  424. #define DUSCC_TRSR_BOP_SND_ABRT_ACK 0x10 /* BOP: tx now sending ABORT */
  425. #define DUSCC_TRSR_BOP_FRAME_COMPLETE 0x20 /* BOP: end of msg */
  426. #define DUSCC_TRSR_BOP_CTS_UNDERRUN 0x40 /* BOP: CTS underrun */
  427. #define DUSCC_TRSR_BOP_TX_EMPTY 0x80 /* BOP: transmit empty */
  428. #define DUSCC_TRSR_LOOP_LOOP_SND 0x40 /* LOOP: EOP sequence found */
  429. /* equates for input and counter/timer status register (ICTSRA, ICTSRB) */
  430. #define DUSCC_ICTSR_GPI1 0x01 /* state of GPI1 pin */
  431. #define DUSCC_ICTSR_GPI2 0x02 /* state of GPI2 pin */
  432. #define DUSCC_ICTSR_CTSLC 0x04 /* state of CTLSC pin */
  433. #define DUSCC_ICTSR_DCD 0x08 /* state of DCD pin */
  434. #define DUSCC_ICTSR_DELTA_CTSLC 0x10 /* CTS/LC changed */
  435. #define DUSCC_ICTSR_DELTA_DCD 0x20 /* DCD changed */
  436. #define DUSCC_ICTSR_CT_ZERO_COUNT 0x40 /* 1 = zero detected */
  437. #define DUSCC_ICTSR_CT_RUNNING 0x80 /* counter/timer is running */
  438. /* equates for general status register (GSR) */
  439. #define DUSCC_GSR_A_RXRDY 0x01 /* received a character on A */
  440. #define DUSCC_GSR_A_TXRDY 0x02 /* ready to tx character on A */
  441. #define DUSCC_GSR_A_RXTX_STATUS 0x04 /* RSRA[7:0], TRSRA[7:3] */
  442. #define DUSCC_GSR_A_EXTERNAL_STATUS 0x08 /* refer to ICTSRA[6:4] */
  443. #define DUSCC_GSR_A_ALL 0x0f /* mask for above */
  444. #define DUSCC_GSR_B_RXRDY 0x10 /* received a character on B */
  445. #define DUSCC_GSR_B_TXRDY 0x20 /* ready to tx character on B */
  446. #define DUSCC_GSR_B_RXTX_STATUS 0x40 /* RSRB[7:0], TRSRB[7:3] */
  447. #define DUSCC_GSR_B_EXTERNAL_STATUS 0x80 /* refer to ICTSRB[6:4] */
  448. #define DUSCC_GSR_B_ALL 0xf0 /* mask for above */
  449. /* equates for interrupt enable register (IERA, IERB) */
  450. #define DUSCC_IER_RSR_1_0 0x01 /* interrupt if RSR [0 or 1] */
  451. #define DUSCC_IER_RSR_3_2 0x02 /* interrupt if RSR [2 or 3] */
  452. #define DUSCC_IER_RSR_5_4 0x04 /* interrupt if RSR [4 or 5] */
  453. #define DUSCC_IER_RSR_7_6 0x08 /* interrupt if RSR [6 or 7] */
  454. #define DUSCC_IER_RXRDY 0x10 /* interrupt if RxRDY */
  455. #define DUSCC_IER_TRSR 0x20 /* interrupt if TRSR bits 3-7 */
  456. #define DUSCC_IER_TXRDY 0x40 /* interrupt if TxRDY */
  457. #define DUSCC_IER_DCD_CTS 0x80 /* interrupt if DCD or CTS */
  458. /* equates for interrupt control register (ICR) */
  459. #define DUSCC_ICR_CHAN_B_MAST_INT_EN 0x01 /* chnl B master int. enable */
  460. #define DUSCC_ICR_CHAN_A_MAST_INT_EN 0x02 /* chnl A master int. enable */
  461. #define DUSCC_ICR_VECT_INCLDS_STATUS 0x04 /* 1 = use IVRM, 0 = use IVR */
  462. #define DUSCC_ICR_BITS_MOD_2_0 0x00 /* modify vector bits 2:0 */
  463. #define DUSCC_ICR_BITS_MOD_4_2 0x08 /* modify vector bits 4:2 */
  464. #define DUSCC_ICR_VECT_MODE_VECT 0x00 /* interrupts are vectored */
  465. #define DUSCC_ICR_VECT_MODE_NOT_VECT 0x30 /* interrupts non-vectored */
  466. #define DUSCC_ICR_CHN_AB_INT_PRI_A 0x00 /* channel A highest priority */
  467. #define DUSCC_ICR_CHN_AB_INT_PRI_B 0x40 /* interleaved pri, A favored */
  468. #define DUSCC_ICR_CHN_AB_INT_PRI_INTL_A 0x80 /* channel B highest priority */
  469. #define DUSCC_ICR_CHN_AB_INT_PRI_INTL_B 0xc0 /* interleaved pri, B favored */
  470. /* equates for interrupt vector - as modified by IVRM */
  471. #define DUSCC_IVRM_MASK 0x07 /* bits that can be modified */
  472. #define DUSCC_IVRM_MASK_CHANNEL 0x04 /* 1 = chnl B, 0 = chnl A */
  473. #define DUSCC_IVRM_RXRDY 0x00 /* RxRDY interrupt */
  474. #define DUSCC_IVRM_TXRDY 0x01 /* TxRDY interrupt */
  475. #define DUSCC_IVRM_RX_TX_EXCEPTION 0x02 /* rx/tx error interrupt */
  476. #define DUSCC_IVRM_EXTERN_OR_CT 0x03 /* ext. & cnt/timer interrupt */
  477. /* function declarations */
  478. #ifndef INCLUDE_TY_CO_DRV_50
  479. #ifndef _ASMLANGUAGE
  480. #if defined(__STDC__) || defined(__cplusplus)
  481. IMPORT  void    tyCoTxInt (FAST TY_CO_DEV * pTyCoDv);
  482. IMPORT  void    tyCoRxInt (FAST TY_CO_DEV * pTyCoDv);
  483. IMPORT  void    tyCoRxTxErrInt (FAST TY_CO_DEV * pTyCoDv);
  484. #else /* __STDC__ */
  485. IMPORT  void    tyCoTxInt ();
  486. IMPORT  void    tyCoRxInt ();
  487. IMPORT  void    tyCoRxTxErrInt ();
  488. #endif /* __STDC__ */
  489. #endif /* _ASMLANGUAGE */
  490. #endif /* INCLUDE_TY_CO_DRV_50 */
  491. #ifdef __cplusplus
  492. }
  493. #endif
  494. #endif /* __INCm68562h */