Open rmsyn opened 2 months ago
Thanks! I'll review it ASAP
Using custom types (mainly enums) for setters and getters.
We could add another branch that takes an $var_ty: ident, [$($variant:ident, $variant_val:literal),*]$(,)
. That would allow to define a custom enum
type, and use that enum
in the getters/setters.
I can try to work something out.
I can try to work something out.
I added the enum
branches, and an extra helper macro.
Let me know what you think.
@rmsyn I'm on it, but macros are difficult to review... 😥
Looks great. The only thing now is that I prefer to leave some macros out of the equation, and then let us call the proper sequence of macros according to the CSR. I think this will help us in the future to deal with macros (modular vs monolithic).
Regarding from
and into
: if we can get help from From
and TryFrom
traits, I'd go for them instead of maintaining repetitive methods.
Great job!! I'll keep studying all your code 😁
Adds helper macros for defining CSR types:
read-write
:read-only
:write-only
:Related to: https://github.com/rust-embedded/riscv/issues/218