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

VxWorks

开发平台:

C/C++

  1. /* i8237Dma.h - Intel 8237 DMA controller header */
  2. /* Copyright 1984-1993 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,30sep93,hdn  written.
  7. */
  8. #ifndef __INCi8237Dmah
  9. #define __INCi8237Dmah
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* DMA chip-1 IO address */
  14. #define DMA1_BASE 0x00
  15. #define DMA1_ADDR(chan) (DMA1_BASE + (chan << 1))
  16. #define DMA1_COUNT(chan) (DMA1_BASE + (chan << 1) + 1)
  17. #define DMA1_STATUS 0x08
  18. #define DMA1_CMD 0x08
  19. #define DMA1_MASK_SINGLE 0x0a
  20. #define DMA1_MODE 0x0b
  21. #define DMA1_CLEAR_FF 0x0c
  22. #define DMA1_CLEAR_ALL 0x0d
  23. #define DMA1_CLEAR_MASK 0x0e
  24. #define DMA1_MASK_ALL 0x0f
  25. /* DMA chip-2 IO address */
  26. #define DMA2_BASE 0xc0
  27. #define DMA2_ADDR(chan) (DMA2_BASE + ((chan - 4) << 2))
  28. #define DMA2_COUNT(chan) (DMA2_BASE + ((chan - 4) << 2) + 2)
  29. #define DMA2_STATUS 0xd0
  30. #define DMA2_CMD 0xd0
  31. #define DMA2_MASK_SINGLE 0xd4
  32. #define DMA2_MODE 0xd6
  33. #define DMA2_CLEAR_FF 0xd8
  34. #define DMA2_CLEAR_ALL 0xda
  35. #define DMA2_CLEAR_MASK 0xdc
  36. #define DMA2_MASK_ALL 0xde
  37. /* mode register bit */
  38. #define DMA_MODE_DEMAND 0x00
  39. #define DMA_MODE_SINGLE 0x40
  40. #define DMA_MODE_BLOCK 0x80
  41. #define DMA_MODE_CASCADE 0xc0
  42. #define DMA_MODE_DECREMENT 0x20
  43. #define DMA_MODE_INCREMENT 0x00
  44. #define DMA_MODE_AUTO_ENABLE 0x10
  45. #define DMA_MODE_AUTO_DISABLE 0x00
  46. #define DMA_MODE_WRITE 0x08
  47. #define DMA_MODE_READ 0x04
  48. /* mask register bit */
  49. #define DMA_MASK_SET 0x04
  50. #define DMA_MASK_RESET 0x00
  51. /* function declarations */
  52. #if defined(__STDC__) || defined(__cplusplus)
  53. STATUS dmaSetup (int direction, void *pBuf, UINT nBytes, UINT chan);
  54. #else
  55. STATUS dmaSetup ();
  56. #endif  /* __STDC__ */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __INCi8237Dmah */