On Thu Oct 9, 2025 at 8:16 PM JST, Danilo Krummrich wrote:
> On Thu Oct 9, 2025 at 8:59 AM CEST, Dirk Behme wrote:
>> Assuming that register.rs is supposed to become the "generic" way to 
>> access hardware registers I started to have a look to it. Some weeks 
>> back testing interrupts I used some quite simple timer with 4 registers 
>> [1]. Now, thinking about converting it to register!() I have three 
>> understanding / usage questions:
>>
>> * At the moment register!() is for 32-bit registers, only? So it can't 
>> be used for my example having 8-bit and 16-bit registers as well?
>
> Yes, currently the register!() macro always generates a 32-bit register type
> (mainly because nova-core did not need anything else). However, this will of
> course be generalized (which should be pretty straight forward).
>
> Having a brief look at the TMU datasheet it looks like you should be able to
> treat TSTR and TCR as 32-bit registers without any issues for testing the
> register!() macro today. I.e. you can just define it as:
>
>       register!(TSTR @ 0x04, "Timer Start Register" {
>           2:2    str2 as bool, "Specifies whether TCNT2 is operated or 
> stopped.";
>           1:1    str1 as bool, "Specifies whether TCNT1 is operated or 
> stopped.";
>           0:0    str0 as bool, "Specifies whether TCNT0 is operated or 
> stopped.";
>       });
>
> Same for TCR.

Patch 2 of this series actually adds support for 16 and 8 bit register
storage.

Reply via email to