Share via


DMATransferOnBlocks (Compact 2013)

3/26/2014

This function is used to start a subordinate direct memory access (DMA) transfer that uses an associated memory block.

Syntax

BOOL DMATransferOnBlocks(
  DMA_BUFFER_HANDLE hBuffer,
  HANDLE hDmaChannel,
  PDMA_TRANSFER_HANDLE phDmaHandle,
  DWORD dwFlags,
  PVOID pBufferContext,
  HANDLE hNotifyHandle,
  PVOID Context1,
  PVOID Context2,
  PHYSICAL_ADDRESS phOpDeviceIoAddress
);

Parameters

  • hBuffer
    [in] Handle to a DMA block descriptor.
  • hDmaChannel
    [in] Handle to an allocated DMA channel.
  • phDmaHandle
    [in, out] When DMATranserOnBlocks returns TRUE, for success, term is a pointer to a DMA_TRANSFER_HANDLE.
  • dwFlags
    [in] Global DMA transfer flag. This flag is used to determine what kind of transfer the device wants.

    The following table shows the possible flags.

    Value

    Description

    DMA_FLAGS_WRITE_TO_DEVICE

    Set for write operation.

    DMA_FLAGS_INC_DEVICE_ADDRESS

    Indicates the operation requires incrementing the source and destination address. This flag can be used to accomplish memory to memory DMA transfers.

    DMA_FLAGS_RESET_DEVICE_ADDRESS

    Resets device address to the original value used by DMAAllocateChannel. The device address can be changed when a DMA transfer with the flag DMA_FLAGS_INC_DEVICE_ADDRESS executes.

    DMA_FLAGS_USER_OPTIONAL_DEVICE

    Sets the DMA transfer to automatically reload until it is explicitly canceled.

    DMA_FLAGS_NOT_AUTO_START

    Indicates the transfer is queued to hardware until a call to DMAStartTransfer.

  • pBufferContext
    [in] Pointer to handle associated content obtained by calling DMAGetContexts.
  • hNotifyHandle
    [in] Event handle used when SetEvent is called after the DMA transfer finishes. If this handle is NULL then no call to SetEvent is made when the transfer is finished.
  • Context1
    [in] Context1 allows a User to attach content to the DMA transfer. The content is retrieved using DMAGetContexts and a valid DMA Handle.
  • Context2
    [in] Context2 allows a User to attach content to the DMA transfer. The content is retrieved using DMAGetContexts and a valid DMA Handle.
  • phOpDeviceIoAddress
    [in] Optional Device Io Address for this DMA transfer. This parameter is only used when DMA_FLAGS_USER_OPTIONAL_DEVICE_ADDRESS is set. The phDeviceIoAddress, provided by DMAAllocateChannel, is ignored when DMA_FLAGS_USER_OPTIONAL_DEVICE_ADDRESS is set.

Return Value

Returns TRUE on success. The associated DMA handle for the DMA Transfer is returned through phDmaHandle.

Remarks

If physical memory block is allocated for bus mastering DMA then this function may fail. Under these circumstances the error code is the same seen in DMAIssueTransfer.

Requirements

Header

oaldma.h

Library

CEDDK.lib

See Also

Reference

Ceddk.dll DMA Functions
Ceddk.dll DMA Structures