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

VxWorks

开发平台:

C/C++

  1. /* dma.h - DMA (direct memory access) header */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,22sep92,rrr  added support for c++
  7. 01d,04jul92,jcf  cleaned up.
  8. 01c,26may92,rrr  the tree shuffle
  9. 01b,04oct91,rrr  passed through the ansification filter
  10.   -fixed #else and #endif
  11.   -changed copyright notice
  12. 01a,20dec90,jcc  written.
  13. */
  14. #ifndef __INCdmah
  15. #define __INCdmah
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include "vxWorks.h"
  20. #include "private/semLibP.h"
  21. typedef struct dmaCtrl /* DMA_CTRL - generic DMA controller info */
  22.     {
  23.     SEMAPHORE ctrlMutexSem; /* semaphore for exclusive access */
  24.     SEMAPHORE ctrlSyncSem; /* semaphore for waiting on I/O interrupt */
  25.     BOOL intOnCompletion; /* whether ctrl can interrupt when done */
  26.     VOIDFUNCPTR dmaReset; /* function for resetting the DMA bus */
  27.     FUNCPTR dmaTransact; /* function for managing a DMA transaction */
  28.     FUNCPTR dmaBytesIn; /* function for DMA input */
  29.     FUNCPTR dmaBytesOut; /* function for DMA output */
  30.     FUNCPTR dmaBusPhaseGet; /* function returning the current bus phase */
  31.     UINT maxBytesPerXfer; /* upper bound of ctrl. tansfer counter */
  32.     UINT clkPeriod; /* period of the controller clock (nsec) */
  33.     int dmaPriority; /* priority of task when doing DMA I/O */
  34.     int dmaBusPhase; /* current phase of DMA */
  35.     } DMA_CTRL;
  36. /* structure to pass to ioctl call to execute a DMA command */
  37. typedef struct  /* DMA_TRANSACTION - information about a DMA transaction */
  38.     {
  39.     UINT8 *srcAddress; /* address of source data buffer */
  40.     UINT8 *destAddress; /* address of destination data buffer */
  41.     int dataLength; /* length of data buffer in bytes (0=no data) */
  42.     UINT8 statusByte; /* status byte returned from target */
  43.     } DMA_TRANSACTION;
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* __INCdmah */