RP.UART

Entities

Simple Types

Record Types

Tagged Types

Subtypes

Constants

Subprograms

Description

Clear_IRQ

procedure Clear_IRQ (This : in out UART_Port;
                     IRQ  :        UART_IRQ_Flag)

Clear the given IRQ flag

Parameters
This
IRQ

Configure

procedure Configure
   (This   : in out UART_Port;
    Config : UART_Configuration := Default_UART_Configuration)
Parameters
This
Config

Data_Size

function Data_Size
   (Port : UART_Port)
   return UART_Data_Size
Parameters
Port
Return Value

Default_UART_Configuration

Default_UART_Configuration : constant UART_Configuration := (others => <>);

Disable_IRQ

procedure Disable_IRQ (This : in out UART_Port;
                       IRQ  :        UART_IRQ_Flag)

Disable the given IRQ flag

Parameters
This
IRQ

Enable_IRQ

procedure Enable_IRQ (This : in out UART_Port;
                      IRQ  :        UART_IRQ_Flag)

Enable the given IRQ flag

Parameters
This
IRQ

FIFO_Address

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

FIFO_IRQ_Level

type FIFO_IRQ_Level is (Lvl_Eighth,
                        Lvl_Quarter,
                        Lvl_Half,
                        Lvl_Three_Quarter,
                        Lvl_Seven_Eighth);
Enumeration Literal
Lvl_Eighth
Lvl_Quarter
Lvl_Half
Lvl_Three_Quarter
Lvl_Seven_Eighth

Frame_Time

function Frame_Time
   (This : UART_Port)
   return Microseconds
Parameters
This
Return Value

Masked_IRQ_Status

function Masked_IRQ_Status (This : UART_Port;
                            IRQ  : UART_IRQ_Flag)
                            return Boolean

Return true if the given IRQ flag is signaled and enabled

Parameters
This
IRQ
Return Value

Microseconds

subtype Microseconds is Integer;

Raw_IRQ_Status

function Raw_IRQ_Status (This : UART_Port;
                         IRQ  : UART_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 UART_Port;
   Data    : out UART_Data_8b;
   Status  : out UART_Status;
   Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Receive

procedure Receive
  (This    : in out UART_Port;
   Data    : out UART_Data_9b;
   Status  : out UART_Status;
   Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Receive_Status

function Receive_Status
   (This : UART_Port)
   return UART_FIFO_Status
Parameters
This
Return Value

Send_Break

procedure Send_Break
   (This     : in out UART_Port;
    Delays   : HAL.Time.Any_Delays;
    Duration : Microseconds;
    Start    : Boolean := True)
Parameters
This
Delays
Duration
Start

Set_FIFO_IRQ_Level

procedure Set_FIFO_IRQ_Level (This : in out UART_Port;
                              RX   :        FIFO_IRQ_Level;
                              TX   :        FIFO_IRQ_Level)

Set the trigger point for receive and transmit FIFO interrupt. For the receive FIFO, the interrupt is triggered when the FIFO level is above or equal to the set level. For the transmit FIFO, the interrupt is triggered when the FIFO level is below or equal to the set level.

Parameters
This
RX
TX

Set_Stick_Parity

procedure Set_Stick_Parity
   (This    : in out UART_Port;
    Enabled : Boolean)
Parameters
This
Enabled

Symbol_Time

function Symbol_Time
   (This : UART_Port)
   return Microseconds
Parameters
This
Return Value

Transmit

procedure Transmit
  (This    : in out UART_Port;
   Data    : UART_Data_8b;
   Status  : out UART_Status;
   Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Transmit

procedure Transmit
  (This    : in out UART_Port;
   Data    : UART_Data_9b;
   Status  : out UART_Status;
   Timeout : Natural := 1000)
Parameters
This
Data
Status
Timeout

Transmit_Status

function Transmit_Status
   (This : UART_Port)
   return UART_FIFO_Status
Parameters
This
Return Value

UART_Configuration

type UART_Configuration is record
   Baud         : Hertz := 115_200;
   Word_Size    : UART_Word_Size := 8;
   Parity       : Boolean := False;
   Stop_Bits    : UART_Stop_Bits := 1;
   Parity_Type  : UART_Parity_Type := Even;
   Frame_Length : Positive := 1;
   Loopback     : Boolean := False;
   Enable_FIFOs : Boolean := True;
end record;
Record fields
Baud
Word_Size
Parity
Stop_Bits
Parity_Type

has no effect when Parity = False

Frame_Length

Words per frame. Used to calculate break timing.

Loopback
Enable_FIFOs

Enable TX and RX FIFOs

UART_FIFO_Status

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

UART_IRQ_Flag

type UART_IRQ_Flag is
  (Modem_RI, Modem_CTS, Modem_DCD, Modem_DSR,
   Receive,
   Transmit,
   Receive_Timeout,
   Framing_Error,
   Parity_Error,
   Break_Error,
   Overrun_Error);
Enumeration Literal
Modem_RI
Modem_CTS
Modem_DCD
Modem_DSR
Receive
Transmit
Receive_Timeout
Framing_Error
Parity_Error
Break_Error
Overrun_Error

UART_Number

subtype UART_Number is Natural range 0 .. 1;

UART_Parity_Type

type UART_Parity_Type is (Even, Odd);
Enumeration Literal
Even
Odd

UART_Port

type UART_Port
   (Num    : UART_Number;
    Periph : not null access RP2040_SVD.UART.UART_Peripheral)
is new HAL.UART.UART_Port with record
   Config : UART_Configuration;
end record;
Record fields
Num
Periph
Config

UART_Stop_Bits

subtype UART_Stop_Bits is Integer range 1 .. 2;

UART_Word_Size

subtype UART_Word_Size is Integer range 5 .. 8;