function CC_To_Usb_Error (CC : Completion_Code) return Error
is
- use type HW.DbC.Error;
Err : Error;
begin
case CC is
(Word32 (Length) and 16#1_ffff#);
end Set_Length;
- function Get_Event_Length (Data : T) return Natural
+ procedure Get_Event_Length (Data : in T; Length : out Natural)
is
Status : constant Word32 := Data.Status;
begin
- return Natural (Status and 16#ff_ffff#);
+ Length := Natural (Status and 16#ff_ffff#);
end Get_Event_Length;
----------------------------------------------------------------------------
- function Get_Completion_Code (Data : T) return Completion_Code
+ procedure Get_Completion_Code (Data : in T; Code : out Completion_Code)
is
Status : constant Word32 := Data.Status;
begin
- return Completion_Code (Shift_Right (Status, 24));
+ Code := Completion_Code (Shift_Right (Status, 24));
end Get_Completion_Code;
----------------------------------------------------------------------------
Data.Control := (Control and not 1) or Word32 (Cycle);
end Set_Cycle;
- function Get_Cycle (Data : T) return Bit
+ procedure Get_Cycle (Data : in T; Cycle : out Bit)
is
Control : constant Word32 := Data.Control;
begin
- return Bit (Control and 1);
+ Cycle := Bit (Control and 1);
end Get_Cycle;
procedure Set_Toggle_Cycle (Data : in out T)
Shift_Left (Word32 (TRB_Type), 10);
end Set_Type;
- function Get_Type (Data : T) return TRB_Types
+ procedure Get_Type (Data : in T; TRB_Type : out TRB_Types)
is
Control : constant Word32 := Data.Control;
begin
- return TRB_Types (Shift_Right (Control, 10) and 63);
+ TRB_Type := TRB_Types (Shift_Right (Control, 10) and 63);
end Get_Type;
----------------------------------------------------------------------------
- function Get_Endpoint_ID (Data : T) return Natural
+ procedure Get_Endpoint_ID (Data : in T; Endpoint_ID : out Natural)
is
Control : constant Word32 := Data.Control;
begin
- return Natural (Shift_Right (Control, 16) and 16#1f#);
+ Endpoint_ID := Natural (Shift_Right (Control, 16) and 16#1f#);
end Get_Endpoint_ID;
- function Get_Slot_ID (Data : T) return Word8
+ procedure Get_Slot_ID (Data : in T; Slot_ID : out Word8)
is
Control : constant Word32 := Data.Control;
begin
- return Word8 (Shift_Right (Control, 24));
+ Slot_ID := Word8 (Shift_Right (Control, 24));
end Get_Slot_ID;
----------------------------------------------------------------------------
Data.Parameter := Parameter;
end Set_Parameter;
- function Get_Parameter (Data : T) return Word64
+ procedure Get_Parameter (Data : in T; Parameter : out Word64)
is
- Result : constant Word64 := Data.Parameter;
begin
- return Result;
+ Parameter := Data.Parameter;
end Get_Parameter;
----------------------------------------------------------------------------