I want to write a very simple driver to initialize, write to/read from some peripherals on a microcontroller, the same way I have done it in C. I am using as an example a GPIO peripheral to initialize, write and read.
GPIOA : GPIO_Register with
Volatile,
Address => System'To_Address (GPIOA_Base);
pragma Import (Ada, GPIOA);
If I declare a list to access all the GPIOs:
type GPIO_Register_ptr is access all GPIO_Register with volatile;
Gpio_List_Pointers : array (Integer range 1 .. 8) of aliased GPIO_Register_ptr;
And then assign:
Gpio_List_Pointers(1) := GPIOA'Access;
I get the error :
142:29 prefix of "ACCESS" attribute must be aliased
Any ideas how to sort it out ?