Initial idea for PIO Block registers

This commit is contained in:
Folkert Kevelam 2025-06-25 23:18:34 +02:00
parent b899c9f4ce
commit 120781866f

View File

@ -0,0 +1,78 @@
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_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;
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_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;
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;
for PIO_Type use
record
CTRL at 0 range 0 .. 31;
FSTAT at 1 range 0 .. 31;
end record;
type Direct_PIO_Type is
record
CTRL : Bit_32;
FSTAT : Bit_32;
end record;
PIO_1 : PIO_Type
with Address => PIO_1_Base, Volatile;
Direct_PIO_1 : PIO_Type
with Address => PIO_1_Base, Volatile;
end Interfaces.RP2040.PIO;