On Thu Aug 6, 2026 at 1:35 AM JST, Gary Guo wrote:
<...>
> @@ -601,11 +605,22 @@ macro_rules! register {
> { $($fields:tt)* }
> $($rest:tt)*
> ) => {
> - $crate::register!(@bitfield $(#[$attr])* $vis struct $name($storage)
> { $($fields)* });
> - $crate::register!(@io_base $reg_base; $name
> - @ $crate::register!(@offset $(@ $offset)? $(=> $alias
> $([$alias_idx])?)?)
> + $crate::bitfield!(
> + #[allow(non_camel_case_types)]
> + $(#[$attr])* $vis struct $name($storage) { $($fields)* }
> );
> - $crate::register!(@io_fixed $(#[$attr])* $vis $name);
> +
> + impl $crate::io::register::FixedRegister for $name {
> + type Base = $reg_base;
> +
> + const OFFSET: usize =
> + $crate::register!(@offset $(@ $offset)? $(=> $alias
> $([$alias_idx])?)?);
Btw, are the bases properly checked when using aliases? It looks like we
are expecting the base type of the *current* register block instead of
the one of the alias, which if true could lead to inconsistencies.