Support Direct Memory Access (Compact 7)
3/12/2014
Direct memory access (DMA) is a method that you can use to transfer data from a device to memory, from memory to a device, or from memory to memory, without the help of the microprocessor. In a standard DMA transfer, a DMA controller performs the transfer. In a bus master transfer, a peripheral performs the transfer. Common buffer DMA operations use a contiguous buffer in main memory, while scatter/gather DMA uses multiple blocks at different memory addresses. The type of DMA transfer you choose depends on the design of your hardware device. You can perform common buffer and scatter/gather DMA operations by using CEDDK.dll DMA functions or by directly calling kernel functions.
In Windows Embedded Compact, you can perform DMA in three ways:
- By using common DMA functions such as HalAllocateCommonBuffer, HalFreeCommonBuffer, and HalTranslateSystemAddress
- By using DMA abstraction functions
- By directly calling kernel functions, such as AllocPhysMem and FreePhysMem
The method you use depends on your device, the type of memory alignment it uses, whether it supports scatter/gather DMA, and whether you implement your driver for bus independence. The following sections explain each of these methods in more detail.
In This Section
- Common DMA Functions
Lists the common DMA functions and provides an example of code that allocates a buffer.
- DMA Abstraction Layer
Describes the components that make up the DMA abstraction layer and lists the DMA abstraction layer functions.
- Direct Calls to Kernel Functions
Lists the kernel functions that you call to allocate and deallocate a physical memory buffer for DMA transfers.