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

VxWorks

开发平台:

C/C++

  1. /* i534.h - Header file for the intel 534 serial board. */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01j,22sep92,rrr  added support for c++
  7. 01i,26may92,rrr  the tree shuffle
  8. 01h,04oct91,rrr  passed through the ansification filter
  9.   -changed copyright notice
  10. 01g,05oct90,shl  added copyright notice.
  11. 01f,08jan87,jlf  added ifndef's to keep from being included twice.
  12. 01e,23jul84,ecs  Brought definition of IO_534 back here from hwConfig.h.
  13. 01d,02aug83,dnw  Removed I534_BASE, now IO_534 in ioLib.h.
  14.  Added PIC poll status definitions.
  15. 01c,16may83,jlf  Put parens around address definitions.
  16.  Coerced I534_BASE to type (char *).
  17. 01b,29mar83,jlf  Moved Buffer-size parameter to ty534Drv.c
  18. 01a,10mar83,jlf  written
  19. */
  20. #ifndef __INCi534h
  21. #define __INCi534h
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Strapable parameters */
  26. #define PIT_CLOCK_RATE 1228800 /* 1.2288 MHz into the PIT */
  27. #define N_534_CHANNELS 4 /* Number of serial channels on bd */
  28. /* The following addresses can only be accessed with the data block
  29.    selected */
  30. #define IO_534 ((char *) 0xef0020) /* 0x10 bytes */
  31. #define I534_U0_D (IO_534) /* UART 0 data */
  32. #define I534_U0_S (IO_534 + 1) /* UART 0 status and command */
  33. #define I534_U1_D (IO_534 + 2) /* UART 1 data */
  34. #define I534_U1_S (IO_534 + 3) /* UART 1 status and command */
  35. #define I534_U2_D (IO_534 + 4) /* UART 2 data */
  36. #define I534_U2_S (IO_534 + 5) /* UART 2 status and command */
  37. #define I534_U3_D (IO_534 + 6) /* UART 3 data */
  38. #define I534_U3_S (IO_534 + 7) /* UART 3 status and command */
  39. #define I534_PIC0_B0 (IO_534 + 8) /* 8259, byte 0 - write ICW1, OCW2, */
  40. /*   OCW3, read status */
  41. #define I534_PIC0_B1 (IO_534 + 9) /* 8259, byte 1 - write ICW2, OCW1, */
  42. /*   read OCW1     */
  43. #define I534_PIC1_B0 (IO_534 + 0xa) /* Unused 8259, byte 0 */
  44. #define I534_PIC1_B1 (IO_534 + 0xb) /* Unused 8259, byte 1 */
  45. /* The following can only be accessed with the control block selected */
  46. #define I534_PIT0_0 (IO_534) /* 8253 PIT 0, counter 0 */
  47. #define I534_PIT0_1 (IO_534 + 1) /* 8253 PIT 0, counter 1 */
  48. #define I534_PIT0_2 (IO_534 + 2) /* 8253 PIT 0, counter 2 */
  49. #define I534_PIT0_C (IO_534 + 3) /* 8253 PIT 0, control */
  50. #define I534_PIT1_0 (IO_534 + 4) /* 8253 PIT 1, counter 0 */
  51. #define I534_PIT1_1 (IO_534 + 5) /* 8253 PIT 1, counter 1 */
  52. #define I534_PIT1_2 (IO_534 + 6) /* 8253 PIT 1, counter 2 */
  53. #define I534_PIT1_C (IO_534 + 7) /* 8253 PIT 1, control */
  54. #define I534_PPI_A (IO_534 + 8) /* 8255 PPI, Port A in */
  55. #define I534_PPI_B (IO_534 + 9) /* PPI, Port B in */
  56. #define I534_PPI_C (IO_534 + 0xa) /* PPI, Port C out and stat */
  57. #define I534_PPI_CTL (IO_534 + 0xb) /* PPI control */
  58. /* The following can be accessed with either block selected */
  59. #define I534_SEL_C (IO_534 + 0xc) /* Select Control Block */
  60. #define I534_SEL_D (IO_534 + 0xd) /* Select Data Block */
  61. #define I534_TEST (IO_534 + 0xe) /* Select test mode */
  62. #define I534_RESET (IO_534 + 0xf) /* Board Reset */
  63. /* USART Mode Word bits */
  64. #define U_1_STOP 0x40
  65. #define U_2_STOP 0xc0
  66. #define U_PARITY_EVEN 0x20
  67. #define U_PARITY_ENABLE 0x10
  68. #define U_7_DBITS 0x08
  69. #define U_8_DBITS 0x0c
  70. #define U_X16 0x02
  71. #define U_X1 0x01
  72. /* USART Command Word bits */
  73. #define U_RESET 0x40 /* 1 returns 8251 to mode word */
  74. #define U_RTS 0x20 /* 1 forces RTS/ output to 0 */
  75. #define U_ERR_RESET 0x10 /* Reset all error flags */
  76. #define U_BREAK 0x08 /* 1 forces TxD low */
  77. #define U_RX_ENABLE 0x04
  78. #define U_DTR 0x02 /* 1 forces DTR/ output to 0 */
  79. #define U_TX_ENABLE 0x01
  80. /* USART Status Word bits */
  81. #define U_DSR 0x80
  82. #define U_FRAME_ERR 0x20
  83. #define U_OVE_ERR 0x10
  84. #define U_PARITY_ERR 0x08
  85. #define U_TX_EMPTY 0x04
  86. #define U_RX_READY 0x02
  87. #define U_TX_READY 0x01
  88. /* PIT Mode Word bits */
  89. #define PIT_SEL_C_0 0x00
  90. #define PIT_SEL_C_1 0x40
  91. #define PIT_SEL_C_2 0x80
  92. #define PIT_BOTH_BYTES 0x30
  93. #define PIT_MODE_3 0x06
  94. /* PIC ICW1 */
  95. #define PIC_ICW1_ID 0x10 /* Must be used to identify ICW1 */
  96. #define PIC_ADR_7_5 0xe0 /* Mask for bits 7-5 of lower */
  97. /* routine address */
  98. #define PIC_INTERVAL_4 0x04
  99. #define PIC_INTERVAL_8 0x00
  100. #define PIC_SINGLE 0x02
  101. /* PIC OCW2 */
  102. #define PIC_ROT_PRI 0x80 /* Rotate priority */
  103. #define PIC_SEOI 0x60 /* Specific end of interrupt */
  104. #define PIC_EOI 0x20 /* Non-specific End of int */
  105. /* PIC OCW3 */
  106. #define PIC_OCW3_ID 0x08 /* Must be set to identify OCW3 */
  107. #define PIC_SET_SMASK 0x60 /* Set special mask */
  108. #define PIC_RST_SMASK 0x40 /* Reset special mask */
  109. #define PIC_POLLING 0x04
  110. #define PIC_READ_IR 0x02
  111. #define PIC_READ_IS 0x03
  112. /* PIC Poll status */
  113. #define PIC_IL_REQUEST 0x80 /* interrupt requesting */
  114. #define PIC_IL_MASK 0x07 /* interrupt level mask */
  115. #define PIC_IL_CHAN0 0x00 /* channel 0 interrupt level */
  116. #define PIC_IL_CHAN1 0x02 /* channel 1 interrupt level */
  117. #define PIC_IL_CHAN2 0x04 /* channel 2 interrupt level */
  118. #define PIC_IL_CHAN3 0x06 /* channel 3 interrupt level */
  119. #define PIC_IL_TX 0x01 /* transmitter buffer empty interrupt */
  120. /* Default baud rates for the 4 USARTs. */
  121. #define BAUD_0 9600
  122. #define BAUD_1 9600
  123. #define BAUD_2 9600
  124. #define BAUD_3 9600
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128. #endif /* __INCi534h */