RP.PIO

Entities

Simple Types

Array Types

Record Types

Subtypes

Constants

Subprograms

Description

Ack_SM_IRQ

procedure Ack_SM_IRQ (This : in out PIO_Device;
                      Flag :        PIO_SM_IRQ_Flag)

Acknolege a state-machine-level IRQ

Parameters
This
Flag

Clear_FIFO_Status

procedure Clear_FIFO_Status
   (This  : in out PIO_Device;
    SM    : PIO_SM;
    Flags : SM_FIFO_Status := (others => True))
Parameters
This
SM
Flags

Clear_FIFOs

procedure Clear_FIFOs
   (This    : in out PIO_Device;
    SM      : PIO_SM)
Parameters
This
SM

Clear_Force_IRQ_Flag

procedure Clear_Force_IRQ_Flag (This : in out PIO_Device;
                                IRQ  :        PIO_IRQ_ID;
                                Flag :        PIO_IRQ_Flag)

Clear force a system-level IRQ

Parameters
This
IRQ
Flag

Clear_Force_SM_IRQ

procedure Clear_Force_SM_IRQ (This : in out PIO_Device;
                              Flag :        PIO_SM_IRQ_Flag)

Clear force a state-machine-level IRQ

Parameters
This
Flag

Default_SM_Config

function Default_SM_Config
   return PIO_SM_Config
Return Value

Disable

procedure Disable
   (This : in out PIO_Device)
Parameters
This

Disable_IRQ

procedure Disable_IRQ (This : in out PIO_Device;
                       IRQ  :        PIO_IRQ_ID)
Parameters
This
IRQ

Disable_IRQ_Flag

procedure Disable_IRQ_Flag (This : in out PIO_Device;
                            IRQ  :        PIO_IRQ_ID;
                            Flag :        PIO_IRQ_Flag)

Disable a system-level IRQ

Parameters
This
IRQ
Flag

Divider_Fraction

Divider_Fraction : constant := 1.0 / 2.0 ** SM0_CLKDIV_FRAC_Field'Size;

DMA_RX_Trigger

function DMA_RX_Trigger
   (This : PIO_Device;
    SM   : PIO_SM)
    return RP.DMA.DMA_Request_Trigger
Parameters
This
SM
Return Value

DMA_TX_Trigger

function DMA_TX_Trigger
   (This : PIO_Device;
    SM   : PIO_SM)
    return RP.DMA.DMA_Request_Trigger
Parameters
This
SM
Return Value

Enable

procedure Enable
   (This : in out PIO_Device)
Parameters
This

Enable_IRQ

procedure Enable_IRQ (This : in out PIO_Device;
                      IRQ  :        PIO_IRQ_ID)
Parameters
This
IRQ

Enable_IRQ_Flag

procedure Enable_IRQ_Flag (This : in out PIO_Device;
                           IRQ  :        PIO_IRQ_ID;
                           Flag :        PIO_IRQ_Flag)

Enable a system-level IRQ

Parameters
This
IRQ
Flag

Enabled

function Enabled
   (This : PIO_Device)
   return PIO_SM_Mask
Parameters
This
Return Value

Execute

procedure Execute
   (This        : in out PIO_Device;
    SM          : PIO_SM;
    Instruction : PIO_Instruction)
Parameters
This
SM
Instruction

FIFO_Status

function FIFO_Status
   (This : PIO_Device;
    SM   : PIO_SM)
    return SM_FIFO_Status
Parameters
This
SM
Return Value

Force_IRQ_Flag

procedure Force_IRQ_Flag (This : in out PIO_Device;
                          IRQ  :        PIO_IRQ_ID;
                          Flag :        PIO_IRQ_Flag)

Force a system-level IRQ

Parameters
This
IRQ
Flag

Force_SM_IRQ

procedure Force_SM_IRQ (This : in out PIO_Device;
                        Flag :        PIO_SM_IRQ_Flag)

Force a state-machine-level IRQ

Parameters
This
Flag

Get

procedure Get
   (This : in out PIO_Device;
    SM   : PIO_SM;
    Data : out UInt32)
Parameters
This
SM
Data

Get

procedure Get
   (This : in out PIO_Device;
    SM   : PIO_SM;
    Data : out UInt32_Array)
Parameters
This
SM
Data

GPIO_Function

function GPIO_Function
   (PIO : PIO_Device)
   return RP.GPIO.GPIO_Function
Parameters
PIO
Return Value

IRQ_Flag_Status

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)

Parameters
This
IRQ
Flag
Return Value

Load

procedure Load
   (This        : in out PIO_Device;
    Prog        : Program;
    Offset      : PIO_Address)
Parameters
This
Prog
Offset

Pin_Count

subtype Pin_Count is Natural range 0 .. 32;

PIO_Address

subtype PIO_Address is Natural range 0 .. 31;

PIO_Device

type PIO_Device
   (Num    : PIO_Number;
    Periph : not null access PIO_Peripheral)
is tagged null record;
Record fields
Num
Periph

PIO_Instruction

subtype PIO_Instruction is UInt16;

PIO_IRQ_Flag

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
  );
Enumeration Literal
SM0_RXNEMPTY

FIFO RX Not Empty flag for each State Machine

SM1_RXNEMPTY

FIFO RX Not Empty flag for each State Machine

SM2_RXNEMPTY

FIFO RX Not Empty flag for each State Machine

SM3_RXNEMPTY

FIFO RX Not Empty flag for each State Machine

SM0_TXNFULL

FIFO TX Not Full flag for each State Machine

SM1_TXNFULL

FIFO TX Not Full flag for each State Machine

SM2_TXNFULL

FIFO TX Not Full flag for each State Machine

SM3_TXNFULL

FIFO TX Not Full flag for each State Machine

SM_IRQ0
SM_IRQ1
SM_IRQ2
SM_IRQ3

PIO_IRQ_ID

type PIO_IRQ_ID is range 0 .. 1;

PIO_MOV_Status_Type

type PIO_MOV_Status_Type is (TX_Less_Than, RX_Less_Than);
Enumeration Literal
TX_Less_Than
RX_Less_Than

PIO_Number

subtype PIO_Number is Natural range 0 .. 1;

PIO_Peripheral

type PIO_Peripheral is private;

PIO_Pin_Direction

type PIO_Pin_Direction is (Input, Output);
Enumeration Literal
Input
Output

PIO_SM

type PIO_SM is range 0 .. 3;

PIO_SM_Config

type PIO_SM_Config is private;

PIO_SM_IRQ_Flag

type PIO_SM_IRQ_Flag is range 0 .. 7;

PIO_SM_Mask

type PIO_SM_Mask is array (PIO_SM) of Boolean
   with Component_Size => 1,
        Size           => 4;

Program

type Program is array (PIO_Address range <>) of PIO_Instruction;

Put

procedure Put
   (This : in out PIO_Device;
    SM   : PIO_SM;
    Data : UInt32)
Parameters
This
SM
Data

Put

procedure Put
   (This : in out PIO_Device;
    SM   : PIO_SM;
    Data : UInt32_Array)
Parameters
This
SM
Data

RX_FIFO_Address

function RX_FIFO_Address
   (This : PIO_Device;
    SM   : PIO_SM)
   return System.Address
Parameters
This
SM
Return Value

Set_Clkdiv_Int_Frac

procedure Set_Clkdiv_Int_Frac
   (Config    : in out PIO_SM_Config;
    Div_Int   : UInt16;
    Div_Frac  : UInt8)
Parameters
Config
Div_Int
Div_Frac

Set_Clock_Divider

procedure Set_Clock_Divider
   (Config : in out PIO_SM_Config;
    Div    : Divider)
Parameters
Config
Div

Set_Clock_Frequency

procedure Set_Clock_Frequency
   (Config    : in out PIO_SM_Config;
    Frequency : Hertz)
Parameters
Config
Frequency

Set_Config

procedure Set_Config
   (This   : in out PIO_Device;
    SM     : PIO_SM;
    Config : PIO_SM_Config)
Parameters
This
SM
Config

Set_Enabled

procedure Set_Enabled
   (This    : in out PIO_Device;
    SM      : PIO_SM;
    Enabled : Boolean)
Parameters
This
SM
Enabled

Set_Enabled

procedure Set_Enabled
   (This : in out PIO_Device;
    SM   : PIO_SM_Mask)
Parameters
This
SM

Set_FIFO_Join

procedure Set_FIFO_Join
   (Config  : in out PIO_SM_Config;
    Join_TX : Boolean;
    Join_RX : Boolean)
Parameters
Config
Join_TX
Join_RX

Set_In_Pins

procedure Set_In_Pins
   (Config    : in out PIO_SM_Config;
    In_Base   : GPIO_Pin)
Parameters
Config
In_Base

Set_In_Shift

procedure Set_In_Shift
   (Config         : in out PIO_SM_Config;
    Shift_Right    : Boolean;
    Autopush       : Boolean;
    Push_Threshold : Shift_Threshold)
Parameters
Config
Shift_Right
Autopush
Push_Threshold

Set_Jmp_Pin

procedure Set_Jmp_Pin
   (Config    : in out PIO_SM_Config;
    Pin       : GPIO_Pin)
Parameters
Config
Pin

Set_MOV_Status

procedure Set_MOV_Status
   (Config     : in out PIO_SM_Config;
    Status_Sel : PIO_MOV_Status_Type;
    Status_N   : UInt4)
Parameters
Config
Status_Sel
Status_N

Set_Out_Pins

procedure Set_Out_Pins
   (Config    : in out PIO_SM_Config;
    Out_Base  : GPIO_Pin;
    Out_Count : Pin_Count)
Parameters
Config
Out_Base
Out_Count

Set_Out_Shift

procedure Set_Out_Shift
   (Config         : in out PIO_SM_Config;
    Shift_Right    : Boolean;
    Autopull       : Boolean;
    Pull_Threshold : Shift_Threshold)
Parameters
Config
Shift_Right
Autopull
Pull_Threshold

Set_Out_Special

procedure Set_Out_Special
   (Config           : in out PIO_SM_Config;
    Sticky           : Boolean;
    Has_Enable_Pin   : Boolean;
    Enable_Pin_Index : GPIO_Pin)
Parameters
Config
Sticky
Has_Enable_Pin
Enable_Pin_Index

Set_Pin_Direction

procedure Set_Pin_Direction
   (This      : in out PIO_Device;
    SM        : PIO_SM;
    Pin       : GPIO_Pin;
    Direction : PIO_Pin_Direction)
Parameters
This
SM
Pin
Direction

Set_Set_Pins

procedure Set_Set_Pins
   (Config    : in out PIO_SM_Config;
    Set_Base  : GPIO_Pin;
    Set_Count : Pin_Count)
Parameters
Config
Set_Base
Set_Count

Set_Sideset

procedure Set_Sideset
   (Config    : in out PIO_SM_Config;
    Bit_Count : Sideset_Bit_Count;
    Optional  : Boolean;
    Pindirs   : Boolean)
Parameters
Config
Bit_Count
Optional
Pindirs

Set_Sideset_Pins

procedure Set_Sideset_Pins
   (Config       : in out PIO_SM_Config;
    Sideset_Base : GPIO_Pin)
Parameters
Config
Sideset_Base

Set_Wrap

procedure Set_Wrap
   (Config      : in out PIO_SM_Config;
    Wrap_Target : PIO_Address;
    Wrap        : PIO_Address)
Parameters
Config
Wrap_Target
Wrap

Shift_Threshold

subtype Shift_Threshold is Natural range 1 .. 32;

Sideset_Bit_Count

subtype Sideset_Bit_Count is Natural range 0 .. 5;

SM_FIFO_Status

type SM_FIFO_Status is record
   TXSTALL  : Boolean;
   TXOVER   : Boolean;
   RXUNDER  : Boolean;
   RXSTALL  : Boolean;
end record;
Record fields
TXSTALL

State machine has stalled on empty TX FIFO during a blocking PULL, or an OUT with autopull enabled.

TXOVER

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.

RXUNDER

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.

RXSTALL

SM_Initialize

procedure SM_Initialize
   (This       : in out PIO_Device;
    SM         : PIO_SM;
    Initial_PC : PIO_Address;
    Config     : PIO_SM_Config)
Parameters
This
SM
Initial_PC
Config

SM_IRQ_Status

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

Parameters
This
Flag
Return Value

TX_FIFO_Address

function TX_FIFO_Address
   (This : PIO_Device;
    SM   : PIO_SM)
   return System.Address
Parameters
This
SM
Return Value