Closed burrbull closed 8 months ago
r? @adamgreig
(rust-highfive has picked a reviewer for you, use r? to override)
What will it be like after this PR? From the brief intro, I imagine this:
// error
uart.thr.write(...);
// correct
uart.thr().write(...);
Is this the expected behavior?
Yes
Should we keep register blocks public under some feature gate? Rust kernel developers may still reuse this structure when writing drivers, as in this purpose the base address of peripherals are not fixed as bare metal when MMU comes in.
Should we keep register blocks public under some feature gate? Rust kernel developers may still reuse this structure when writing drivers, as in this purpose the base address of peripherals are not fixed as bare metal when MMU comes in.
It seems this PR only makes the field
s private and leaves RegisterBlock
as it is. If so, I think there is no problem to use with a virtual address.
I don't insist on this PR. It is just concept for discuss.
cc @rust-embedded/tools
I guess if someone needs a pointer to a field, they can still call as_ptr() on what the accessor returns?
Should be same as before.
All register/cluster access through methods. RegisterBlock fields are private
To access register or cluster instead of:
use