type Any_UART_Peripheral is access all UART_Peripheral;
procedure Clear_IRQ
(This : UART_Port;
IRQ : UART_IRQ_Flag)
procedure Configure
(This : in out UART_Port;
Config : UART_Configuration := Default_UART_Configuration)
function Data_Size
(Port : UART_Port)
return UART_Data_Size
Default_UART_Configuration : constant UART_Configuration := (others => <>);
procedure Disable_IRQ
(This : UART_Port;
IRQ : UART_IRQ_Flag)
procedure Enable_IRQ
(This : UART_Port;
IRQ : UART_IRQ_Flag)
function FIFO_Address
(This : UART_Port)
return System.Address
type FIFO_IRQ_Level is (Lvl_Eighth,
Lvl_Quarter,
Lvl_Half,
Lvl_Three_Quarter,
Lvl_Seven_Eighth);
function Frame_Time
(This : UART_Port)
return Microseconds
function Masked_IRQ_Status
(This : UART_Port;
IRQ : UART_IRQ_Flag)
return Boolean
subtype Microseconds is Integer;
function Raw_IRQ_Status
(This : UART_Port;
IRQ : UART_IRQ_Flag)
return Boolean
procedure Receive
(This : in out UART_Port;
Data : out UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000)
procedure Receive
(This : in out UART_Port;
Data : out UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000)
function Receive_Status
(This : UART_Port)
return UART_FIFO_Status
procedure Send_Break
(This : in out UART_Port;
Length : Microseconds;
Start : Boolean := True)
procedure Set_FIFO_IRQ_Level
(This : 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.
procedure Set_Stick_Parity
(This : in out UART_Port;
Enabled : Boolean)
function Symbol_Time
(This : UART_Port)
return Microseconds
procedure Transmit
(This : in out UART_Port;
Data : UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000)
procedure Transmit
(This : in out UART_Port;
Data : UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000)
function Transmit_Status
(This : UART_Port)
return UART_FIFO_Status
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;
has no effect when Parity = False
Words per frame. Used to calculate break timing.
Enable TX and RX FIFOs
type UART_FIFO_Status is (Empty, Not_Full, Full, Busy, Invalid);
type UART_IRQ_Flag is
(Modem_RI, Modem_CTS, Modem_DCD, Modem_DSR,
Receive,
Transmit,
Receive_Timeout,
Framing_Error,
…,
Overrun_Error);
subtype UART_Number is Natural range 0 .. 1;
type UART_Parity_Type is (Even, Odd);
type UART_Peripheral is private;
type UART_Port
(Num : UART_Number;
Periph : not null Any_UART_Peripheral)
is new HAL.UART.UART_Port with record
Config : UART_Configuration;
end record;
subtype UART_Stop_Bits is Integer range 1 .. 2;
subtype UART_Word_Size is Integer range 5 .. 8;