Standardize register access

This commit is contained in:
Folkert Kevelam 2025-06-27 21:04:49 +02:00
parent 5e42b68f47
commit c044e5243b
2 changed files with 21 additions and 25 deletions

View File

@ -1,22 +1,14 @@
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);
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;
with Object_Size => 32, Bit_Order => System.Low_Order_First,
Volatile, Full_Access_Only;
for CTRL_Type use
record
@ -28,16 +20,17 @@ package Interfaces.RP2040.PIO is
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);
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;
with Object_Size => 32, Bit_Order => System.Low_Order_First,
Volatile, Full_Access_Only;
for FSTAT_Type use
record
@ -66,7 +59,7 @@ package Interfaces.RP2040.PIO is
PIO_1 : PIO_Type
with Address => PIO_1_Base, Volatile;
Direct_PIO_1 : PIO_Type
Direct_PIO_1 : Direct_PIO_Type
with Address => PIO_1_Base, Volatile;
end Interfaces.RP2040.PIO;

View File

@ -10,7 +10,10 @@ package Interfaces
type Bit_4 is mod 2**4
with Size => 4;
type Bit_31 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;