Compare commits
No commits in common. "35003ed1879f02c7dce04d1a6abac164a458009c" and "c4ebe23f73e481e5edef37fee6de6ac78864c80c" have entirely different histories.
35003ed187
...
c4ebe23f73
|
|
@ -1,16 +1,22 @@
|
|||
with System.Storage_Elements; use System.Storage_Elements;
|
||||
|
||||
package Interfaces.RP2040.PIO is
|
||||
|
||||
type Bit is range 0 .. 1;
|
||||
for Bit'Size use 1;
|
||||
|
||||
type Bit_32 is mod 2**32;
|
||||
for Bit_32'Size use 32;
|
||||
|
||||
type Bit_Array is array (Natural range <>) of Bit
|
||||
with Pack;
|
||||
|
||||
type CTRL_Type is
|
||||
record
|
||||
SM_Enable : Bit_4;
|
||||
SM_Restart : Bit_4;
|
||||
CLKDIV_Restart : Bit_4;
|
||||
Reserved : Bit_20;
|
||||
SM_Enable : Bit_Array (0 .. 3);
|
||||
SM_Restart : Bit_Array (0 .. 3);
|
||||
CLKDIV_Restart : Bit_Array (0 .. 3);
|
||||
Reserved : Bit_Array (0 .. 19);
|
||||
end record
|
||||
with Object_Size => 32, Bit_Order => System.Low_Order_First,
|
||||
Volatile, Full_Access_Only;
|
||||
with Object_Size => 32, Bit_Order => System.Low_Order_First;
|
||||
|
||||
for CTRL_Type use
|
||||
record
|
||||
|
|
@ -22,17 +28,16 @@ package Interfaces.RP2040.PIO is
|
|||
|
||||
type FSTAT_Type is
|
||||
record
|
||||
RXFULL : Bit_4;
|
||||
Reserved_4_7 : Bit_4;
|
||||
RXEMPTY : Bit_4;
|
||||
Reserved_12_15 : Bit_4;
|
||||
TXFULL : Bit_4;
|
||||
Reserved_20_23 : Bit_4;
|
||||
TXEMPTY : Bit_4;
|
||||
Reserved_28_31 : Bit_4;
|
||||
RXFULL : Bit_Array (0 .. 3);
|
||||
Reserved_4_7 : Bit_Array (4 .. 7);
|
||||
RXEMPTY : Bit_Array (8 .. 11);
|
||||
Reserved_12_15 : Bit_Array (12 .. 15);
|
||||
TXFULL : Bit_Array (16 .. 19);
|
||||
Reserved_20_23 : Bit_Array (20 .. 23);
|
||||
TXEMPTY : Bit_Array (24 .. 27);
|
||||
Reserved_28_31 : Bit_Array (28 .. 31);
|
||||
end record
|
||||
with Object_Size => 32, Bit_Order => System.Low_Order_First,
|
||||
Volatile, Full_Access_Only;
|
||||
with Object_Size => 32, Bit_Order => System.Low_Order_First;
|
||||
|
||||
for FSTAT_Type use
|
||||
record
|
||||
|
|
@ -58,40 +63,10 @@ package Interfaces.RP2040.PIO is
|
|||
FSTAT : Bit_32;
|
||||
end record;
|
||||
|
||||
PIO_0 : PIO_Type
|
||||
with Volatile, Address => PIO_0_Base;
|
||||
PIO_0_XOR : PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#1000#);
|
||||
PIO_0_Set : PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#2000#);
|
||||
PIO_0_Clear : PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#3000#);
|
||||
|
||||
Direct_PIO_0 : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_0_Base;
|
||||
Direct_PIO_0_XOR : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#1000#);
|
||||
Direct_PIO_0_Set : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#2000#);
|
||||
Direct_PIO_0_Clear : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_0_Base + Storage_Offset (16#3000#);
|
||||
|
||||
PIO_1 : PIO_Type
|
||||
with Volatile, Address => PIO_1_Base;
|
||||
PIO_1_XOR : PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#1000#);
|
||||
PIO_1_Set : PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#2000#);
|
||||
PIO_1_Clear : PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#3000#);
|
||||
with Address => PIO_1_Base, Volatile;
|
||||
|
||||
Direct_PIO_1 : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_1_Base;
|
||||
Direct_PIO_1_XOR : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#1000#);
|
||||
Direct_PIO_1_Set : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#2000#);
|
||||
Direct_PIO_1_Clear : Direct_PIO_Type
|
||||
with Volatile, Address => PIO_1_Base + Storage_Offset (16#3000#);
|
||||
Direct_PIO_1 : PIO_Type
|
||||
with Address => PIO_1_Base, Volatile;
|
||||
|
||||
end Interfaces.RP2040.PIO;
|
||||
|
|
|
|||
|
|
@ -1,32 +1,18 @@
|
|||
package Interfaces
|
||||
with Pure is
|
||||
|
||||
type Bit_1 is mod 2**1
|
||||
with Size => 1;
|
||||
type Bit_2 is mod 2**2
|
||||
with Size => 2;
|
||||
type Bit_3 is mod 2**3
|
||||
with Size => 3;
|
||||
type Bit_4 is mod 2**4
|
||||
with Size => 4;
|
||||
type Integer_32 is range -2**31 .. 2**31 - 1;
|
||||
type Unsigned_32 is mod 2**32;
|
||||
|
||||
type Bit_20 is mod 2**20
|
||||
with Size => 20;
|
||||
|
||||
type Bit_31 is mod 2**31
|
||||
with Size => 31;
|
||||
type Bit_32 is mod 2**32
|
||||
with Size => 32;
|
||||
|
||||
function Shift_Left (Value : Bit_32; Amount : Natural)
|
||||
return Bit_32 with Import, Convention => Intrinsic;
|
||||
function Shift_Right (Value : Bit_32; Amount : Natural)
|
||||
return Bit_32 with Import, Convention => Intrinsic;
|
||||
function Shift_Right_Arithmetic (Value : Bit_32; Amount : Natural)
|
||||
return Bit_32 with Import, Convention => Intrinsic;
|
||||
function Rotate_Left (Value : Bit_32; Amount : Natural)
|
||||
return Bit_32 with Import, Convention => Intrinsic;
|
||||
function Rotate_Right (Value : Bit_32; Amount : Natural)
|
||||
return Bit_32 with Import, Convention => Intrinsic;
|
||||
function Shift_Left (Value : Unsigned_32; Amount : Natural)
|
||||
return Unsigned_32 with Import, Convention => Intrinsic;
|
||||
function Shift_Right (Value : Unsigned_32; Amount : Natural)
|
||||
return Unsigned_32 with Import, Convention => Intrinsic;
|
||||
function Shift_Right_Arithmetic (Value : Unsigned_32; Amount : Natural)
|
||||
return Unsigned_32 with Import, Convention => Intrinsic;
|
||||
function Rotate_Left (Value : Unsigned_32; Amount : Natural)
|
||||
return Unsigned_32 with Import, Convention => Intrinsic;
|
||||
function Rotate_Right (Value : Unsigned_32; Amount : Natural)
|
||||
return Unsigned_32 with Import, Convention => Intrinsic;
|
||||
|
||||
end Interfaces;
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
package System.Storage_Elements
|
||||
with Pure is
|
||||
|
||||
type Storage_Offset is range -2**31 .. 2**31 - 1;
|
||||
subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;
|
||||
|
||||
type Storage_Element is mod 2**8;
|
||||
for Storage_Element'Size use Storage_Unit;
|
||||
|
||||
type Storage_Array is array
|
||||
(Storage_Offset range <>) of aliased Storage_Element;
|
||||
for Storage_Array'Component_Size use Storage_Unit;
|
||||
|
||||
function "+" (Left : Address; Right : Storage_Offset) return Address
|
||||
with Import, Convention => Intrinsic;
|
||||
function "+" (Left : Storage_Offset; Right : Address) return Address
|
||||
with Import, Convention => Intrinsic;
|
||||
function "-" (Left : Address; Right : Storage_Offset) return Address
|
||||
with Import, Convention => Intrinsic;
|
||||
function "-" (Left : Storage_Offset; Right : Address) return Address
|
||||
with Import, Convention => Intrinsic;
|
||||
|
||||
type Integer_Address is mod 2**32;
|
||||
function To_Address (Value : Integer_Address) return Address
|
||||
with Import, Convention => Intrinsic;
|
||||
function To_Integer (Value : Address) return Integer_Address
|
||||
with Import, Convention => Intrinsic;
|
||||
|
||||
end System.Storage_Elements;
|
||||
Loading…
Reference in New Issue
Block a user