Difference between revisions of "Unit DMA"
From Ultibo.org
Line 10: | Line 10: | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA specific constants''' <code> DMA_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_NAME_PREFIX = 'DMA';</code> | ||
+ | | Name prefix for DMA Hosts | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA host type constants''' <code> DMA_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_TYPE_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA host state constants''' <code> DMA_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_STATE_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>DMA_STATE_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA host flag constants''' <code> DMA_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DMA_FLAG_SHARED = $00000001;</code> | ||
+ | | Host requires data buffers in shared memory | ||
+ | |- | ||
+ | | <code>DMA_FLAG_NOCACHE = $00000002;</code> | ||
+ | | Host requires data buffers in non cached memory | ||
+ | |- | ||
+ | | <code>DMA_FLAG_COHERENT = $00000004;</code> | ||
+ | | Data buffers are cache coherent if allocated according to host configuration | ||
+ | |- | ||
+ | | <code>DMA_FLAG_STRIDE = $00000008;</code> | ||
+ | | Host supports 2D stride on source and/or dest address | ||
+ | |- | ||
+ | | <code>DMA_FLAG_DREQ = $00000010;</code> | ||
+ | | Host supports data request gating (DREQ) on source and/or dest address | ||
+ | |- | ||
+ | | <code>DMA_FLAG_NOINCREMENT = $00000020;</code> | ||
+ | | Host supports no increment on source and/or dest address | ||
+ | |- | ||
+ | | <code>DMA_FLAG_NOREAD = $00000040;</code> | ||
+ | | Host supports no read from source address (write to dest address only) (Zero fill the destination) | ||
+ | |- | ||
+ | | <code>DMA_FLAG_NOWRITE = $00000080;</code> | ||
+ | | Host supports no write to dest address (read from source address only) (Cache fill from the source) | ||
+ | |- | ||
+ | | <code>DMA_FLAG_WIDE = $00000100;</code> | ||
+ | | Host supports wide read and/or write | ||
+ | |- | ||
+ | | <code>DMA_FLAG_BULK = $00000200;</code> | ||
+ | | Host supports bulk transfer | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA request flag constants''' <code> DMA_REQUEST_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_REQUEST_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>DMA_REQUEST_FLAG_RELEASE = $00000001;</code> | ||
+ | | If set then release the request automatically after completion | ||
+ | |- | ||
+ | | <code>DMA_REQUEST_FLAG_CYCLIC = $00000002;</code> | ||
+ | | This is a cyclic request which loops around from tail to head | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''DMA logging constants''' <code> DMA_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>DMA_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | DMA debugging messages | ||
+ | |- | ||
+ | | <code>DMA_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | DMA informational messages, such as a device being attached or detached | ||
+ | |- | ||
+ | | <code>DMA_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | DMA error messages | ||
+ | |- | ||
+ | | <code>DMA_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No DMA messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
Line 24: | Line 138: | ||
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | + | ||
+ | |||
'''Initialization functions''' | '''Initialization functions''' | ||
Revision as of 00:15, 28 November 2016
Return to Unit Reference
Contents
[hide]Description
To be documented
Constants
[Expand]
DMA specific constants
DMA_*
[Expand]
DMA host type constants
DMA_TYPE_*
[Expand]
DMA host state constants
DMA_STATE_*
[Expand]
DMA host flag constants
DMA_FLAG_*
[Expand]
DMA request flag constants
DMA_REQUEST_FLAG_*
[Expand]
DMA logging constants
DMA_LOG_*
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
DMA transfer functions
[Expand]
function DMATransferRequest(DMA:PDMAHost; Data:PDMAData; Direction,Peripheral,Flags,Timeout:LongWord):LongWord;
Description: Perform a DMA transfer request with the supplied data blocks on the supplied host
[Expand]
function DMATransferRequestEx(DMA:PDMAHost; Data:PDMAData; Callback:TDMARequestCompleted; DriverData:Pointer; Direction,Peripheral,Flags:LongWord):LongWord;
Description: Perform a DMA transfer request with the supplied data blocks on the supplied host
Return to Unit Reference