procedure Ack_IRQ (Channel : DMA_Channel_Id;
IRQ : DMA_IRQ_Id)
type Address_Update is (Static, Increment);
function Busy
(Channel : DMA_Channel_Id)
return Boolean
function Checksum
return HAL.UInt32
type Checksum_Algorithm is
(CRC_32,
CRC_32R,
CRC_16,
CRC_16R,
EVEN,
SUM);
CRC-32 (IEEE802.3 polynomial)
CRC-32 (IEEE802.3 polynomial) with bit reversed data
CRC-16-CCITT
CRC-16-CCITT with bit reversed data
XOR reduction over all data. == 1 if total 1 population count is odd
Calculate a simple 32-bit checksum (addition with 32 bit accumulator)
procedure Configure
(Channel : DMA_Channel_Id;
Config : DMA_Configuration)
procedure Disable
(Channel : DMA_Channel_Id)
procedure Disable_IRQ (Channel : DMA_Channel_Id;
IRQ : DMA_IRQ_Id)
type DMA_Channel_Id is range 0 .. 11
with Size => 4;
type DMA_Configuration is record
High_Priority : Boolean := False;
Data_Size : Transfer_Width := Transfer_8;
Read_Address : Address_Update := Static;
Write_Address : Address_Update := Static;
Ring_Size : HAL.UInt4 := 0;
Ring_Wrap : Ring_Wrap_Select := Wrap_Read;
Chain_To : DMA_Channel_Id := 0;
Trigger : DMA_Request_Trigger := PERMANENT;
Quiet : Boolean := False;
Byte_Swap : Boolean := False;
Sniff : Boolean := False;
end record;
Schedule this channel before others
Bits per transfer (byte, halfword, word)
Increment read address after transfer
Increment write address after transfer
Ring buffer size
Read or write buffer is a ring buffer
Trigger another channel after transfer.
Set to this channel to disable chaining.
Trigger a transfer on this signal
Disable interrupts
Reverse byte order
Send data to sniff checksum
subtype DMA_IRQ_Id is Natural range 0 .. 1;
type DMA_Request_Trigger is
(PIO0_TX0, PIO0_TX1, PIO0_TX2, PIO0_TX3, PIO0_RX0, PIO0_RX1, PIO0_RX2, PIO0_RX3, …,
PERMANENT)
with Size => 6;
type DMA_Status is record
Enabled : Boolean := False;
Busy : Boolean := False;
Write_Error : Boolean := False;
Read_Error : Boolean := False;
AHB_Error : Boolean := False;
Transfers_Remaining : Natural := 0;
end record;
subtype DMA_Timer_Id is DMA_Request_Trigger range TIMER0 .. TIMER3;
type DMA_Transfer_Count is range 0 .. 2 ** 32 - 1
with Size => 32;
procedure Enable
procedure Enable_Checksum
(Channel : DMA_Channel_Id;
Algorithm : Checksum_Algorithm;
Byte_Swap : Boolean := False;
Reversed : Boolean := False;
Inverted : Boolean := False)
procedure Enable_IRQ (Channel : DMA_Channel_Id;
IRQ : DMA_IRQ_Id)
function IRQ_Status (Channel : DMA_Channel_Id;
IRQ : DMA_IRQ_Id)
return Boolean
Return True if the IRQ is triggered
type Ring_Wrap_Select is (Wrap_Read, Wrap_Write)
with Size => 1;
procedure Set_Checksum
(Value : HAL.UInt32)
procedure Set_Pacing_Timer
(Timer : DMA_Timer_Id;
X, Y : HAL.UInt16)
The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.
procedure Setup
(Channel : DMA_Channel_Id;
From, To : System.Address;
Count : DMA_Transfer_Count)
procedure Start
(Channel : DMA_Channel_Id)
Setup must be called before Start. If you call Start more than once and Increment_Read or Increment_Write are True, these pointers are not reset to their initial Setup values, unless you've configured the channel with Ring_Wrap and Ring_Size.
procedure Start
(Channel : DMA_Channel_Id;
From, To : System.Address;
Count : DMA_Transfer_Count)
This version of Start performs the Setup for you.
function Status
(Channel : DMA_Channel_Id)
return DMA_Status
type Transfer_Width is (Transfer_8, Transfer_16, Transfer_32)
with Size => 2;