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

VxWorks

开发平台:

C/C++

  1. /* we32104.h - Western Electric 32104 DMA controller header file */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01f,22sep92,rrr  added support for c++
  7. 01e,26may92,rrr  the tree shuffle
  8. 01d,26may92,ajm  got rid of HOST_DEC def's (new compiler)
  9.                   updated copyright
  10. 01c,04oct91,rrr  passed through the ansification filter
  11.   -changed copyright notice
  12. 01b,28sep91,ajm  ifdef'd HOST_DEC for compiler problem
  13. 01e,02Aug91,rfs  created
  14. */
  15. #ifndef __INCwe32104h
  16. #define __INCwe32104h
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. typedef struct we32104_chan
  21.     {
  22.     volatile u_int SourceAdd;
  23.     volatile u_int DestAdd;
  24.     u_int Dummy1;
  25.     volatile u_int BaseAdd;
  26.     volatile u_int TranCount;
  27.     u_int Dummy2;
  28.     volatile u_int IntVect;
  29.     u_int Dummy3;
  30.     volatile u_int StatCont;
  31.     u_int Mode;
  32.     u_int DevControl;
  33.     u_int Fill [21];
  34.     } WE32104_CHAN;
  35. typedef struct we32104
  36.     {
  37.     WE32104_CHAN Ch0;
  38.     WE32104_CHAN Ch1;
  39.     WE32104_CHAN Ch2;
  40.     WE32104_CHAN Ch3;
  41.     u_int Dummy1 [4];
  42.     u_int Mask;
  43.     u_int Dummy5 [123];
  44.     volatile u_int DataBuf0 [8];
  45.     u_int Dummy6 [24];
  46.     volatile u_int DataBuf1 [8];
  47.     u_int Dummy7 [24];
  48.     volatile u_int DataBuf2 [8];
  49.     u_int Dummy8 [24];
  50.     volatile u_int DataBuf3 [8];
  51.     } WE32104;
  52. /***** mode register bit defs *****/
  53. #define MODE_IE 0x0004 /* interrupt enable */
  54. #define MODE_DS_MASK 0x00e0 /* system buss data size bits */
  55. #define MODE_DS_CHAR 0x00e0 /* size is   8 bits */
  56. #define MODE_DS_SHORT 0x00c0 /* size is  16 bits */
  57. #define MODE_DS_LONG 0x0080 /* size is  32 bits */
  58. #define MODE_DS_DOUBLE 0x00a0 /* size is  64 bits */
  59. #define MODE_DS_QUAD 0x0000 /* size is 128 bits */
  60. #define MODE_DAC 0x0200 /* dest addr constant */
  61. #define MODE_SAC 0x0800 /* src addr constant */
  62. #define MODE_TT_MASK 0x6000 /* transfer type bits */
  63. #define MODE_TT_MM 0x0000 /* memory to memory */
  64. #define MODE_TT_PM 0x2000 /* peripheral to memory */
  65. #define MODE_TT_MP 0x4000 /* memory to peripheral */
  66. #define MODE_TT_MF 0x6000 /* memory fill */
  67. #define MODE_BR 0x8000 /* burst mode */
  68. /***** device control register bit defs *****/
  69. #define DCR_PA_MASK 0x007c /* peripheral buss address bits.
  70.  * there are 32 possible addresses,
  71.  * too many to give indidual defs.
  72.  */
  73. #define DCR_SF_MASK 0x0380 /* stretch field bits, in sync mode */
  74. #define DCR_SF_0 0x0000 /* insert 0 wait state */
  75. #define DCR_SF_1 0x0010 /* insert 1 wait state, etc. */
  76. #define DCR_SF_2 0x0100
  77. #define DCR_SF_4 0x0180
  78. #define DCR_SF_8 0x0200
  79. #define DCR_SF_16 0x0280
  80. #define DCR_SF_32 0x0300
  81. #define DCR_SF_64 0x0380
  82. #define DCR_SA_MASK 0x0400 /* sync/async bit mask */
  83. #define DCR_SYNC 0x0400 /* sync mode, use SF field */
  84. #define DCR_ASYNC 0x0000 /* async mode */
  85. #define DCR_BL 0x2000 /* burst length */
  86. #define DCR_CS_MASK 0xc000 /* peripheral buss chip select bits */
  87. #define DCR_CS_0 0x0000 /* chip select 0 */
  88. #define DCR_CS_1 0x4000 /* chip select 1 */
  89. #define DCR_CS_2 0x8000 /* chip select 2 */
  90. #define DCR_CS_3 0xc000 /* chip select 3 */
  91. /***** status and control register bit defs *****/
  92. #define SCR_NT 0x0001 /* normal transfer complete */
  93. #define SCR_ERR_MASK 0x0037 /* error bits mask */
  94. #define SCR_ERR_NONE 0x0000
  95. #define SCR_ERR_BERR 0x0002 /* buss error */
  96. #define SCR_ERR_CS 0x0004 /* CS pin active when master */
  97. #define SCR_ERR_SA 0x0008 /* software abort issued */
  98. #define SCR_ERR_TIME 0x0020 /* peripheral buss time out */
  99. #define SCR_ACT 0x0100 /* channel is active status */
  100. #define SCR_SA 0x0200 /* software abort cmd */
  101. #define SCR_HB 0x0400 /* channel halt cmd */
  102. #define SCR_STR 0x0800 /* channel start cmd */
  103. #define SCR_CH 0x1000 /* use chaining cmd */
  104. /***** mask register bit defs *****/
  105. #define MASK_CH0 0x1
  106. #define MASK_CH1 0x2
  107. #define MASK_CH2 0x4
  108. #define MASK_CH3 0x8
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112. #endif /* __INCwe32104h */