Difference between revisions of "Unit DMA"
From Ultibo.org
Line 305: | Line 305: | ||
! '''Return''' | ! '''Return''' | ||
| ERROR_SUCCESS on success or another error code on failure | | ERROR_SUCCESS on success or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''DMA request functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function DMARequestAllocate(DMA:PDMAHost; Data:PDMAData; Callback:TDMARequestCompleted; DriverData:Pointer; Direction,Peripheral,Flags:LongWord):PDMARequest;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a new DMA request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''DMA''' | ||
+ | | The DMA host this request will be sent to | ||
+ | |- | ||
+ | ! '''Data''' | ||
+ | | A linked list of DMA data blocks for the transfer (Optional) | ||
+ | |- | ||
+ | ! '''Callback''' | ||
+ | | The callback function to be called on completion of the request | ||
+ | |- | ||
+ | ! '''DriverData''' | ||
+ | | Driver private data for the callback (Optional) | ||
+ | |- | ||
+ | ! '''Direction''' | ||
+ | | The direction of the DMA request (eg DMA_DIR_MEM_TO_MEM) | ||
+ | |- | ||
+ | ! '''Peripheral''' | ||
+ | | The peripheral ID for data request gating (eg DMA_DREQ_ID_NONE) | ||
+ | |- | ||
+ | ! '''Flags''' | ||
+ | | Additional flags for this request (eg DMA_REQUEST_FLAG_CYCLIC) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The newly allocated request or nil on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function DMARequestRelease(Request:PDMARequest):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release and destroy a DMA request</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The request to be released | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS on success or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function DMARequestSubmit(Request:PDMARequest):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Submit a DMA request to a DMA host</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The request to be submitted | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | The request will be completed asynchronously by the DMA host and the completion callback will be called when the request has either succeeded or failed | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function DMARequestCancel(Request:PDMARequest):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Cancel a DMA request previously submitted to a DMA host</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The request to be cancelled | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure DMARequestComplete(Request:PDMARequest);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called by a DMA host when a DMA request completes</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The DMA request which has completed | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | DMA host drivers may call this on a worker thread | ||
|- | |- | ||
|} | |} |
Revision as of 03:24, 28 July 2016
Return to Unit Reference
Contents
[hide]Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
DMA host functions
[Expand]
function DMAHostProperties(DMA:PDMAHost; Properties:PDMAProperties):LongWord;
Description: To be documented
[Expand]
function DMAHostRegister(DMA:PDMAHost):LongWord;
Description: Register a new DMA in the DMA host table
[Expand]
function DMAHostDeregister(DMA:PDMAHost):LongWord;
Description: Deregister a DMA from the DMA host table
[Expand]
function DMAHostEnumerate(Callback:TDMAEnumerate; Data:Pointer):LongWord;
Description: To be documented
[Expand]
function DMAHostNotification(DMA:PDMAHost; Callback:TDMANotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: To be documented
DMA data functions
[Expand]
function DMADataCount(Data:PDMAData):LongWord;
Description: Return the total number of data blocks in the linked list
[Expand]
function DMADataFlags(Data:PDMAData):LongWord;
Description: Return the combined flags of the data blocks in the linked list
[Expand]
function DMADataMaximum(Data:PDMAData):LongWord;
Description: Return the size of the largest data block in the linked list
DMA buffer functions
[Expand]
function DMABufferAllocate(DMA:PDMAHost; Size:LongWord):Pointer; inline;
Description: Allocate a data buffer for a DMA request
[Expand]
function DMABufferAllocateEx(DMA:PDMAHost; var Size:LongWord):Pointer;
Description: Allocate a data buffer for a DMA request
[Expand]
function DMABufferValidate(DMA:PDMAHost; Buffer:Pointer; Size:LongWord):LongWord;
Description: Validate a data buffer for a DMA request against the DMA host requirements
[Expand]
function DMABufferRelease(Buffer:Pointer):LongWord;
Description: Release a data buffer from a DMA request
DMA request functions
[Expand]
function DMARequestAllocate(DMA:PDMAHost; Data:PDMAData; Callback:TDMARequestCompleted; DriverData:Pointer; Direction,Peripheral,Flags:LongWord):PDMARequest;
Description: Allocate a new DMA request
[Expand]
function DMARequestRelease(Request:PDMARequest):LongWord;
Description: Release and destroy a DMA request
[Expand]
function DMARequestSubmit(Request:PDMARequest):LongWord;
Description: Submit a DMA request to a DMA host
[Expand]
function DMARequestCancel(Request:PDMARequest):LongWord;
Description: Cancel a DMA request previously submitted to a DMA host
[Expand]
procedure DMARequestComplete(Request:PDMARequest);
Description: Called by a DMA host when a DMA request completes
Return to Unit Reference