dma.h
上传用户:dzdeming
上传日期:2022-08-03
资源大小:381k
文件大小:2k
源码类别:

Windows CE

开发平台:

Visual C++

  1. #ifndef DMA_ADMIN_H
  2. #define DMA_ADMIN_H
  3. #define MAX_DMA_CHANNEL 4
  4. //#define DMA_IS_USED 1
  5. #define DMA_IS_HWTRIG 2
  6. #define DMA_IS_SWTRIG 1
  7. #define DMA_IS_FREE 0
  8. // request source
  9. #define REQ_XDREQ0 0
  10. #define REQ_UART0 1
  11. #define REQ_SDI 2
  12. #define REQ_TIMER 3
  13. #define REQ_USB_EP1 4
  14. #define REQ_XDREQ1 0x10
  15. #define REQ_UART1 0x11
  16. //#define REQ_IISDI 0x12
  17. #define REQ_SPI 0x13
  18. #define REQ_USB_EP2 0x14
  19. #define REQ_IISDO 0x20
  20. #define REQ_IISDI 0x21
  21. //#define REQ_SDI 0x22
  22. //#define REQ_TIMER 0x23
  23. #define REQ_USB_EP3 0x24
  24. #define REQ_UART2 0x30
  25. //#define REQ_SDI 0x31
  26. //#define REQ_SPI 0x32
  27. //#define REQ_TIMER 0x33
  28. #define REQ_USB_EP4 0x34
  29. // DISRCC, DIDSTC parameters
  30. #define SRC_LOC_APB 0x200
  31. #define SRC_LOC_AHB 0
  32. #define SRC_ADDR_FIXED 0x100
  33. #define SRC_ADDR_INC 0
  34. #define DST_LOC_APB 0x2000
  35. #define DST_LOC_AHB 0
  36. #define DST_ADDR_FIXED 0x1000
  37. #define DST_ADDR_INC 0
  38. // DCON paramaters
  39. #define HANDSHAKE_MODE 0x80000000 //[31]
  40. #define DEMAND_MODE 0x00000000
  41. #define SYNC_AHB 0x40000000 //[30]
  42. #define SYNC_APB 0x00000000
  43. #define DONE_GEN_INT 0x20000000 //[29]
  44. #define DONE_NO_INT 0x00000000
  45. #define TSZ_BURST 0x10000000 //[28]
  46. #define TSZ_UNIT 0x00000000
  47. #define WHOLE_SVC 0x08000000 //[27]
  48. #define SINGLE_SVC 0x00000000
  49. #define HW_TRIG 0x00800000 //[23]
  50. #define SW_TRIG 0x00000000
  51. #define RELOAD_OFF 0x00400000 //[22]
  52. #define RELOAD_ON 0x00000000
  53. #define DSZ_8b 0x00000000
  54. #define DSZ_16b 0x00100000
  55. #define DSZ_32b 0x00200000 //[21:20]
  56. ///////////////////////////////////////////////////////
  57. #define DMA_START 0x8000
  58. #define REQUEST_DMA_FAIL 0x1000
  59. /*
  60. U32 RequestDMAChannel(U16 ch, U16 DevID);
  61. U32 QueryDMAChannel(U16 ch);
  62. void ReleaseDMAChannel(U16 ch);
  63. */
  64. U32 RequestDMASW(U32 attr, U32 mode);
  65. U32 RequestDMA(U32 attr, U32 mode);
  66. U16 ReleaseDMA(U32 attr);
  67. U16 StartDMA(U32 attr);
  68. U16 StopDMA(U32 attr);
  69. U16 SetDMARun(U32 attr, U32 src_addr, U32 dst_addr, U32 len);
  70. U32 QueryDMAStat(U32 attr);
  71. U32 QueryDMASrc(U32 attr);
  72. U32 QueryDMADst(U32 attr);
  73. #endif /* DMA_ADMIN_H */