Ethy_Soft/runtime/adainclude/interfaces-rp2040-pio.ads
2025-06-27 21:54:10 +02:00

98 lines
3.1 KiB
Ada

with System.Storage_Elements; use System.Storage_Elements;
package Interfaces.RP2040.PIO is
type CTRL_Type is
record
SM_Enable : Bit_4;
SM_Restart : Bit_4;
CLKDIV_Restart : Bit_4;
Reserved : Bit_20;
end record
with Object_Size => 32, Bit_Order => System.Low_Order_First,
Volatile, Full_Access_Only;
for CTRL_Type use
record
SM_Enable at 0 range 0 .. 3;
SM_Restart at 0 range 4 .. 7;
CLKDIV_Restart at 0 range 8 .. 11;
Reserved at 0 range 12 .. 31;
end record;
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;
end record
with Object_Size => 32, Bit_Order => System.Low_Order_First,
Volatile, Full_Access_Only;
for FSTAT_Type use
record
RXFULL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
RXEMPTY at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
TXFULL at 0 range 16 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
TXEMPTY at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
type PIO_Type is
record
CTRL : CTRL_Type;
FSTAT : FSTAT_Type;
end record;
type Direct_PIO_Type is
record
CTRL : Bit_32;
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#);
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#);
end Interfaces.RP2040.PIO;