procedure Ack_SM_IRQ (This : in out PIO_Device;
Flag : PIO_SM_IRQ_Flag)
Acknolege a state-machine-level IRQ
procedure Clear_FIFO_Status
(This : in out PIO_Device;
SM : PIO_SM;
Flags : SM_FIFO_Status := (others => True))
procedure Clear_FIFOs
(This : in out PIO_Device;
SM : PIO_SM)
procedure Clear_Force_IRQ_Flag (This : in out PIO_Device;
IRQ : PIO_IRQ_ID;
Flag : PIO_IRQ_Flag)
Clear force a system-level IRQ
procedure Clear_Force_SM_IRQ (This : in out PIO_Device;
Flag : PIO_SM_IRQ_Flag)
Clear force a state-machine-level IRQ
function Default_SM_Config
return PIO_SM_Config
procedure Disable
(This : in out PIO_Device)
procedure Disable_IRQ (This : in out PIO_Device;
IRQ : PIO_IRQ_ID)
procedure Disable_IRQ_Flag (This : in out PIO_Device;
IRQ : PIO_IRQ_ID;
Flag : PIO_IRQ_Flag)
Disable a system-level IRQ
Divider_Fraction : constant := 1.0 / 2.0 ** SM0_CLKDIV_FRAC_Field'Size;
function DMA_RX_Trigger
(This : PIO_Device;
SM : PIO_SM)
return RP.DMA.DMA_Request_Trigger
function DMA_TX_Trigger
(This : PIO_Device;
SM : PIO_SM)
return RP.DMA.DMA_Request_Trigger
procedure Enable
(This : in out PIO_Device)
procedure Enable_IRQ (This : in out PIO_Device;
IRQ : PIO_IRQ_ID)
procedure Enable_IRQ_Flag (This : in out PIO_Device;
IRQ : PIO_IRQ_ID;
Flag : PIO_IRQ_Flag)
Enable a system-level IRQ
function Enabled
(This : PIO_Device)
return PIO_SM_Mask
procedure Execute
(This : in out PIO_Device;
SM : PIO_SM;
Instruction : PIO_Instruction)
function FIFO_Status
(This : PIO_Device;
SM : PIO_SM)
return SM_FIFO_Status
procedure Force_IRQ_Flag (This : in out PIO_Device;
IRQ : PIO_IRQ_ID;
Flag : PIO_IRQ_Flag)
Force a system-level IRQ
procedure Force_SM_IRQ (This : in out PIO_Device;
Flag : PIO_SM_IRQ_Flag)
Force a state-machine-level IRQ
procedure Get
(This : in out PIO_Device;
SM : PIO_SM;
Data : out UInt32)
procedure Get
(This : in out PIO_Device;
SM : PIO_SM;
Data : out UInt32_Array)
function GPIO_Function
(PIO : PIO_Device)
return RP.GPIO.GPIO_Function
function IRQ_Flag_Status (This : in out PIO_Device;
IRQ : PIO_IRQ_ID;
Flag : PIO_IRQ_Flag)
return Boolean
Return True if a system-level IRQ is signaled (after masking and forcing)
procedure Load
(This : in out PIO_Device;
Prog : Program;
Offset : PIO_Address)
subtype Pin_Count is Natural range 0 .. 32;
subtype PIO_Address is Natural range 0 .. 31;
type PIO_Device
(Num : PIO_Number;
Periph : not null access PIO_Peripheral)
is tagged null record;
subtype PIO_Instruction is UInt16;
type PIO_IRQ_Flag is
(SM0_RXNEMPTY, SM1_RXNEMPTY, SM2_RXNEMPTY, SM3_RXNEMPTY,
SM0_TXNFULL, SM1_TXNFULL, SM2_TXNFULL, SM3_TXNFULL,
SM_IRQ0, SM_IRQ1, SM_IRQ2, SM_IRQ3
);
FIFO RX Not Empty flag for each State Machine
FIFO RX Not Empty flag for each State Machine
FIFO RX Not Empty flag for each State Machine
FIFO RX Not Empty flag for each State Machine
FIFO TX Not Full flag for each State Machine
FIFO TX Not Full flag for each State Machine
FIFO TX Not Full flag for each State Machine
FIFO TX Not Full flag for each State Machine
type PIO_IRQ_ID is range 0 .. 1;
type PIO_MOV_Status_Type is (TX_Less_Than, RX_Less_Than);
subtype PIO_Number is Natural range 0 .. 1;
type PIO_Peripheral is private;
type PIO_Pin_Direction is (Input, Output);
type PIO_SM is range 0 .. 3;
type PIO_SM_Config is private;
type PIO_SM_IRQ_Flag is range 0 .. 7;
type PIO_SM_Mask is array (PIO_SM) of Boolean
with Component_Size => 1,
Size => 4;
type Program is array (PIO_Address range <>) of PIO_Instruction;
procedure Put
(This : in out PIO_Device;
SM : PIO_SM;
Data : UInt32)
procedure Put
(This : in out PIO_Device;
SM : PIO_SM;
Data : UInt32_Array)
function RX_FIFO_Address
(This : PIO_Device;
SM : PIO_SM)
return System.Address
procedure Set_Clkdiv_Int_Frac
(Config : in out PIO_SM_Config;
Div_Int : UInt16;
Div_Frac : UInt8)
procedure Set_Clock_Divider
(Config : in out PIO_SM_Config;
Div : Divider)
procedure Set_Clock_Frequency
(Config : in out PIO_SM_Config;
Frequency : Hertz)
procedure Set_Config
(This : in out PIO_Device;
SM : PIO_SM;
Config : PIO_SM_Config)
procedure Set_Enabled
(This : in out PIO_Device;
SM : PIO_SM;
Enabled : Boolean)
procedure Set_Enabled
(This : in out PIO_Device;
SM : PIO_SM_Mask)
procedure Set_FIFO_Join
(Config : in out PIO_SM_Config;
Join_TX : Boolean;
Join_RX : Boolean)
procedure Set_In_Pins
(Config : in out PIO_SM_Config;
In_Base : GPIO_Pin)
procedure Set_In_Shift
(Config : in out PIO_SM_Config;
Shift_Right : Boolean;
Autopush : Boolean;
Push_Threshold : Shift_Threshold)
procedure Set_Jmp_Pin
(Config : in out PIO_SM_Config;
Pin : GPIO_Pin)
procedure Set_MOV_Status
(Config : in out PIO_SM_Config;
Status_Sel : PIO_MOV_Status_Type;
Status_N : UInt4)
procedure Set_Out_Pins
(Config : in out PIO_SM_Config;
Out_Base : GPIO_Pin;
Out_Count : Pin_Count)
procedure Set_Out_Shift
(Config : in out PIO_SM_Config;
Shift_Right : Boolean;
Autopull : Boolean;
Pull_Threshold : Shift_Threshold)
procedure Set_Out_Special
(Config : in out PIO_SM_Config;
Sticky : Boolean;
Has_Enable_Pin : Boolean;
Enable_Pin_Index : GPIO_Pin)
procedure Set_Pin_Direction
(This : in out PIO_Device;
SM : PIO_SM;
Pin : GPIO_Pin;
Direction : PIO_Pin_Direction)
procedure Set_Set_Pins
(Config : in out PIO_SM_Config;
Set_Base : GPIO_Pin;
Set_Count : Pin_Count)
procedure Set_Sideset
(Config : in out PIO_SM_Config;
Bit_Count : Sideset_Bit_Count;
Optional : Boolean;
Pindirs : Boolean)
procedure Set_Sideset_Pins
(Config : in out PIO_SM_Config;
Sideset_Base : GPIO_Pin)
procedure Set_Wrap
(Config : in out PIO_SM_Config;
Wrap_Target : PIO_Address;
Wrap : PIO_Address)
subtype Shift_Threshold is Natural range 1 .. 32;
subtype Sideset_Bit_Count is Natural range 0 .. 5;
type SM_FIFO_Status is record
TXSTALL : Boolean;
TXOVER : Boolean;
RXUNDER : Boolean;
RXSTALL : Boolean;
end record;
State machine has stalled on empty TX FIFO during a blocking PULL, or an OUT with autopull enabled.
TX FIFO overflow (i.e. write-on-full by the system) has occurred. Write-on-full does not alter the state or contents of the FIFO in any way, but the data that the system attempted to write is dropped, so if this flag is set, your software has quite likely dropped some data on the floor.
RX FIFO underflow (i.e. read-on-empty by the system) has occurred. Read-on-empty does not perturb the state of the FIFO in any way, but the data returned by reading from an empty FIFO is undefined, so this flag generally only becomes set due to some kind of software error.
procedure SM_Initialize
(This : in out PIO_Device;
SM : PIO_SM;
Initial_PC : PIO_Address;
Config : PIO_SM_Config)
function SM_IRQ_Status (This : in out PIO_Device;
Flag : PIO_SM_IRQ_Flag)
return Boolean
Return True if a state-machine-level IRQ is signaled
function TX_FIFO_Address
(This : PIO_Device;
SM : PIO_SM)
return System.Address