:: Re: [DNG] Lua
Inizio della pagina
Delete this message
Reply to this message
Autore: Kevin Chadwick
Data:  
To: dng
Oggetto: Re: [DNG] Lua
On 20/10/2024 19:13, karl@??? wrote:
> I guess you do basically the same stuff in ADA.
> Yes it is messy and I guess that is why the commersial tool
> vendors have guis to configure such things.


You can shift and And in Ada but a better way is to create a memory overlay

https://github.com/AdaCore/Ada_Drivers_Library/blob/master/arch/ARM/STM32/svd/stm32f7x/stm32_svd-rng.ads

Then you can flip a bit with:

RNG_Device.CR.RNGEN := True;

It also allows only providing access when using the overlay library to 3 bits of
a 4 bit register (within a 32 bit register) via named enums etc.. Which is
really nice. Writing 32 bits if required is catered for by

with Volatile_Full_Access;

A program, called svd2ada can generate the overlays for your particular micro
but they are really useful created by hand in drivers and protocols and would be
for Linux too.