Difference between revisions of "Unit DMA"

From Ultibo.org
Jump to: navigation, search
Line 556: Line 556:
 
</div></div>
 
</div></div>
 
<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 DMATransferRequestEx(DMA:PDMAHost; Data:PDMAData; Callback:TDMARequestCompleted; DriverData:Pointer; Direction,Peripheral,Flags:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function DMATransferRequestEx(DMA:PDMAHost; Data:PDMAData; Callback:TDMARequestCompleted; DriverData:Pointer; Direction,Peripheral,Flags:LongWord):LongWord;</pre>
Line 601: Line 600:
 
! '''Note'''
 
! '''Note'''
 
| This is the internal callback for DMATransferRequest
 
| This is the internal callback for DMATransferRequest
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''RTL DMA 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 SysDMAAvailable:Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a DMA host is available</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Note'''
 +
| None documented
 +
|-
 +
|}
 +
</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 SysDMATransfer(Data:PDMAData; Direction,Peripheral:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a DMA transfer using the list of DMA data blocks provided</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Data'''
 +
| A linked list of DMA data blocks for the transfer
 +
|-
 +
! '''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)
 +
|-
 +
|}
 +
</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 SysDMAFillMemory(Dest:Pointer; Size:LongWord; Value:Byte):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Fill memory at the destination address using DMA</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Dest'''
 +
| The address to start the memory fill
 +
|-
 +
! '''Size'''
 +
| The size of memory to fill in bytes
 +
|-
 +
! '''Value'''
 +
| The value to fill the memory with
 +
|-
 +
|}
 +
</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 SysDMACopyMemory(Source,Dest:Pointer; Size:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Copy memory from the source to the destination address using DMA</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Source'''
 +
| The source address to start the memory copy
 +
|-
 +
! '''Dest'''
 +
| The destination address to start the memory copy
 +
|-
 +
! '''Size'''
 +
| The size of memory to copy in bytes
 +
|-
 +
|}
 +
</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 SysDMAReadPeripheral(Address,Dest:Pointer; Size,Peripheral:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read from a periperal address to the destination address using DMA</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Address'''
 +
| The address of the periperhal register to read from
 +
|-
 +
! '''Dest'''
 +
| The destination address to start writing to
 +
|-
 +
! '''Size'''
 +
| The size of the read in bytes
 +
|-
 +
! '''Peripheral'''
 +
| The peripheral ID for data request gating (eg DMA_DREQ_ID_UART_RX)
 +
|-
 +
|}
 +
</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 SysDMAWritePeripheral(Source,Address:Pointer; Size,Peripheral:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write to a peripheral address from the source address using DMA</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Source'''
 +
| The source address to start reading from
 +
|-
 +
! '''Address'''
 +
| The address of the peripheral register to write to
 +
|-
 +
! '''Size'''
 +
| The size of the write in bytes
 +
|-
 +
! '''Peripheral'''
 +
| The peripheral ID for data request gating (eg DMA_DREQ_ID_UART_TX)
 +
|-
 +
|}
 +
</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 SysDMAAllocateBuffer(Size:LongWord):Pointer;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a buffer compatible with DMA memory reads or writes</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Size'''
 +
| The size of the buffer to allocate
 +
|-
 +
|}
 +
</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 SysDMAAllocateBufferEx(var Size:LongWord):Pointer;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a buffer compatible with DMA memory reads or writes</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Size'''
 +
| The size of the buffer to allocate (Updated on return to actual size)
 +
|-
 +
|}
 +
</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 SysDMAReleaseBuffer(Buffer:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a buffer allocated with DMAAllocateBuffer</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! '''Buffer'''
 +
| The buffer to be released
 
|-
 
|-
 
|}
 
|}

Revision as of 04:43, 30 November 2016

Return to Unit Reference


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

[Expand]
procedure DMAInit;
Description: To be documented


DMA host functions

[Expand]
function DMAHostStart(DMA:PDMAHost):LongWord;
Description: To be documented


[Expand]
function DMAHostStop(DMA:PDMAHost):LongWord;
Description: To be documented


[Expand]
function DMAHostReset(DMA:PDMAHost):LongWord;
Description: To be documented


[Expand]
function DMAHostProperties(DMA:PDMAHost; Properties:PDMAProperties):LongWord;
Description: To be documented


[Expand]
function DMAHostCreate:PDMAHost;
Description: Create a new DMA entry


[Expand]
function DMAHostCreateEx(Size:LongWord):PDMAHost;
Description: Create a new DMA entry


[Expand]
function DMAHostDestroy(DMA:PDMAHost):LongWord;
Description: Destroy an existing DMA entry


[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 DMAHostFind(DMAId:LongWord):PDMAHost;
Description: To be documented


[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 SysDMAAvailable:Boolean;
Description: Check if a DMA host is available


[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


Return to Unit Reference