RP.SPI

Entities

Simple Types

Record Types

Tagged Types

Subtypes

Constants

Subprograms

Description

Clear_IRQ

procedure Clear_IRQ (This : in out SPI_Port;
                     IRQ  :        SPI_IRQ_Flag)

Clear the given IRQ flag

Parameters
This
IRQ

Configure

procedure Configure
   (This   : in out SPI_Port;
    Config : SPI_Configuration := Default_SPI_Configuration)
Parameters
This
Config

Data_Size

function Data_Size
   (This : SPI_Port)
   return SPI_Data_Size
Parameters
This
Return Value

Default_SPI_Configuration

Default_SPI_Configuration : constant SPI_Configuration := (others => <>);

Disable_IRQ

procedure Disable_IRQ (This : in out SPI_Port;
                       IRQ  :        SPI_IRQ_Flag)

Disable the given IRQ flag

Parameters
This
IRQ

Enable_IRQ

procedure Enable_IRQ (This : in out SPI_Port;
                      IRQ  :        SPI_IRQ_Flag)

Enable the given IRQ flag

Parameters
This
IRQ

FIFO_Address

function FIFO_Address
   (This : SPI_Port)
   return System.Address
Parameters
This
Return Value

Masked_IRQ_Status

function Masked_IRQ_Status (This : SPI_Port;
                            IRQ  : SPI_IRQ_Flag)
                            return Boolean

Return true if the given IRQ flag is signaled and enabled

Parameters
This
IRQ
Return Value

Raw_IRQ_Status

function Raw_IRQ_Status (This : SPI_Port;
                         IRQ  : SPI_IRQ_Flag)
                         return Boolean

Return true if the given IRQ flag is signaled even if the flag is not enabled.

Parameters
This
IRQ
Return Value

Receive

procedure Receive
   (This    : in out SPI_Port;
    Data    : out SPI_Data_16b;
    Status  : out SPI_Status;
    Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Receive

procedure Receive
   (This    : in out SPI_Port;
    Data    : out SPI_Data_8b;
    Status  : out SPI_Status;
    Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Receive_Status

function Receive_Status
   (This : SPI_Port)
   return SPI_FIFO_Status
Parameters
This
Return Value

Set_Speed

procedure Set_Speed
   (This : in out SPI_Port;
    Baud : Hertz)
Parameters
This
Baud

SPI_Configuration

type SPI_Configuration is record
   Role      : SPI_Role := Master;
   Baud      : Hertz := 1_000_000;
   Data_Size : SPI_Data_Size := Data_Size_8b;
   Polarity  : SPI_Polarity := Active_Low;
   Phase     : SPI_Phase := Rising_Edge;
   Blocking  : Boolean := True;
   Loopback  : Boolean := False;
end record;
Record fields
Role
Baud
Data_Size
Polarity
Phase
Blocking

Wait for Transmit FIFO to be empty before returning

Loopback

SPI_FIFO_Status

type SPI_FIFO_Status is (Empty, Not_Full, Busy, Full, Invalid);
Enumeration Literal
Empty
Not_Full
Busy
Full
Invalid

SPI_IRQ_Flag

type SPI_IRQ_Flag is
  (Receive_Overrun,
   Receive_FIFO_Not_Empty,
   Receive_FIFO_Half_Full,
   Transmit_FIFO_Half_Empty);
Enumeration Literal
Receive_Overrun
Receive_FIFO_Not_Empty
Receive_FIFO_Half_Full
Transmit_FIFO_Half_Empty

SPI_Number

subtype SPI_Number is Natural range 0 .. 1;

SPI_Phase

type SPI_Phase is (Rising_Edge, Falling_Edge);
Enumeration Literal
Rising_Edge
Falling_Edge

SPI_Polarity

type SPI_Polarity is (Active_Low, Active_High);
Enumeration Literal
Active_Low
Active_High

SPI_Port

type SPI_Port
   (Num    : SPI_Number;
    Periph : not null access RP2040_SVD.SPI.SPI_Peripheral)
is new HAL.SPI.SPI_Port with record
   Blocking : Boolean := True;
end record;
Record fields
Num
Periph
Blocking

SPI_Role

type SPI_Role is (Master, Slave);
Enumeration Literal
Master
Slave

Transmit

procedure Transmit
   (This    : in out SPI_Port;
    Data    : SPI_Data_16b;
    Status  : out SPI_Status;
    Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Transmit

procedure Transmit
   (This    : in out SPI_Port;
    Data    : SPI_Data_8b;
    Status  : out SPI_Status;
    Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Transmit_Status

function Transmit_Status
   (This : SPI_Port)
   return SPI_FIFO_Status
Parameters
This
Return Value