You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @Register macro generates Read and Write structs using the properties of the given struct. Those generated structs are the ones that will be read from or written to. I think the macro name @Register is a little misleading because it is those generated structs that will be read from or written to, not the given struct.
By contrast, the Register struct is well-named. The struct is initialized with the memory address of the register and provides the caller with an API to access the Read/Write structs that were generated from the @Register struct:
I propose renaming @Register to @RegisterDescriptor to make it clear that the struct is only used to describe the register and that one still needs to use the Register struct (with the @RegisterDescriptor type as a generic type parameter) to access the register’s memory.
The text was updated successfully, but these errors were encountered:
(I originally proposed this change here.)
The
@Register
macro is used like so:The
@Register
macro generatesRead
andWrite
structs using the properties of the given struct. Those generated structs are the ones that will be read from or written to. I think the macro name@Register
is a little misleading because it is those generated structs that will be read from or written to, not the given struct.By contrast, the
Register
struct is well-named. The struct is initialized with the memory address of the register and provides the caller with an API to access theRead
/Write
structs that were generated from the@Register
struct:I propose renaming
@Register
to@RegisterDescriptor
to make it clear that the struct is only used to describe the register and that one still needs to use theRegister
struct (with the@RegisterDescriptor
type as a generic type parameter) to access the register’s memory.The text was updated successfully, but these errors were encountered: