Difference between revisions of "Unit DMA"
From Ultibo.org
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Ultibo DMA | + | '''Ultibo DMA Interface unit''' |
The DMA interfaces are 1 tier (Host only) whereas the USB interface is 3 tier (Host, Device and Driver). | The DMA interfaces are 1 tier (Host only) whereas the USB interface is 3 tier (Host, Device and Driver). | ||
Line 705: | Line 705: | ||
|- | |- | ||
! Note | ! Note | ||
− | | Does not check for cache coherency requirements (Shared, Non Cached) only alignment and size. Buffers used as the source of a DMA request do not | + | | Does not check for cache coherency requirements (Shared, Non Cached) only alignment and size. Buffers used as the source of a DMA request do not necessarily need to meet alignment and size requirements, however buffers used as a destination must meet these requirements or the caller must take appropriate actions to prevent undesirable side effects from cache invalidation. |
|- | |- | ||
|} | |} | ||
Line 1,056: | Line 1,056: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 DMAGetCount:LongWord | + | <pre style="border: 0; padding-bottom:0px;">function DMAGetCount:LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current DMA host count</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current DMA host count</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
Line 1,068: | Line 1,068: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 DMAHostGetDefault:PDMAHost | + | <pre style="border: 0; padding-bottom:0px;">function DMAHostGetDefault:PDMAHost;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default DMA host</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current default DMA host</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> |
Latest revision as of 04:51, 10 October 2023
Return to Unit Reference
Contents
[hide]Description
Ultibo DMA Interface unit
The DMA interfaces are 1 tier (Host only) whereas the USB interface is 3 tier (Host, Device and Driver).
Constants
[Expand]
DMA specific constants
DMA_*
[Expand]
DMA host type
DMA_TYPE_*
[Expand]
DMA host state
DMA_STATE_*
[Expand]
DMA host flag
DMA_FLAG_*
[Expand]
DMA data flag
DMA_DATA_FLAG_*
[Expand]
DMA request flag
DMA_REQUEST_FLAG_*
[Expand]
DMA logging
DMA_LOG_*
Type definitions
DMA properties
DMA enumeration callback
TDMAEnumerate = function(DMA:PDMAHost; Data:Pointer):LongWord;
|
DMA notification callback
TDMANotification = function(Device:PDevice; Data:Pointer; Notification:LongWord):LongWord;
|
DMA host start
TDMAHostStart = function(DMA:PDMAHost):LongWord;
|
DMA host stop
TDMAHostStop = function(DMA:PDMAHost):LongWord;
|
DMA host reset
TDMAHostReset = function(DMA:PDMAHost):LongWord;
|
DMA host submit
TDMAHostSubmit = function(DMA:PDMAHost; Request:PDMARequest):LongWord;
|
DMA host cancel
TDMAHostCancel = function(DMA:PDMAHost; Request:PDMARequest):LongWord;
|
DMA host properties
TDMAHostProperties = function(DMA:PDMAHost; Properties:PDMAProperties):LongWord;
|
DMA host
DMA request completed
TDMARequestCompleted = procedure(Request:PDMARequest);
|
DMA request
Public variables
DMA logging
DMA_DEFAULT_LOG_LEVEL:LongWord = DMA_LOG_LEVEL_DEBUG;
|
Minimum level for DMA messages. Only messages with level greater than or equal to this will be printed. |
DMA_LOG_ENABLED:Boolean;
|
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
[Expand]
procedure DMATransferRequestComplete(Request:PDMARequest);
Description: Called when a DMA transfer request completes
RTL DMA functions
[Expand]
function SysDMATransfer(Data:PDMAData; Direction,Peripheral:LongWord):LongWord;
Description: Perform a DMA transfer using the list of DMA data blocks provided
[Expand]
function SysDMAFillMemory(Dest:Pointer; Size:LongWord; Value:Byte):LongWord;
Description: Fill memory at the destination address using DMA
[Expand]
function SysDMACopyMemory(Source,Dest:Pointer; Size:LongWord):LongWord;
Description: Copy memory from the source to the destination address using DMA
[Expand]
function SysDMAReadPeripheral(Address,Dest:Pointer; Size,Peripheral:LongWord):LongWord;
Description: Read from a periperal address to the destination address using DMA
[Expand]
function SysDMAWritePeripheral(Source,Address:Pointer; Size,Peripheral:LongWord):LongWord;
Description: Write to a peripheral address from the source address using DMA
[Expand]
function SysDMAAllocateBuffer(Size:LongWord):Pointer;
Description: Allocate a buffer compatible with DMA memory reads or writes
[Expand]
function SysDMAAllocateBufferEx(var Size:LongWord):Pointer;
Description: Allocate a buffer compatible with DMA memory reads or writes
[Expand]
function SysDMAReleaseBuffer(Buffer:Pointer):LongWord;
Description: Release a buffer allocated with DMAAllocateBuffer
DMA helper functions
[Expand]
function DMAHostSetDefault(DMA:PDMAHost):LongWord;
Description: Set the current default DMA device
[Expand]
function DMAHostCheck(DMA:PDMAHost):PDMAHost;
Description: Check if the supplied DMA is in the DMA host table
[Expand]
function DMATypeToString(DMAType:LongWord):String;
Description: Convert a DMA type value to a string
[Expand]
function DMAStateToString(DMAState:LongWord):String;
Description: Convert a DMA state value to a string
[Expand]
procedure DMALog(Level:Integer; DMA:PDMAHost; const AText:String);
Description: To be documented
[Expand]
procedure DMALogInfo(DMA:PDMAHost; const AText:String); inline;
Description: To be documented
[Expand]
procedure DMALogWarn(DMA:PDMAHost; const AText:String); inline;
Description: To be documented
[Expand]
procedure DMALogError(DMA:PDMAHost; const AText:String); inline;
Description: To be documented
[Expand]
procedure DMALogDebug(DMA:PDMAHost; const AText:String); inline;
Description: To be documented
Return to Unit Reference