Open SamP20 opened 5 years ago
however I can see this being useful for splitting I/O ports into thread safe groups.
There's been some discussion on the svd2rust issue tracker that could be another solution to this issue, here: https://github.com/rust-embedded/svd2rust/issues/213
The suggestion to split registers into ownable fields comes later in the issue: https://github.com/rust-embedded/svd2rust/issues/213#issuecomment-434116049
The suggestion to split registers into ownable fields comes later in the issue
That's an option too. I did notice just after posting this that VolatileCell
has an as_ptr
method, so it would be possible to implement something at a higher level.
The ARMv6 and ARMv7 instruction sets contain the LDREX and STREX instructions. It would be handy to add an
AtomicOps
trait withatomic_get
/atomic_set
and/oratomic_modify
methods based on these instructions. This is possibly duplicating theAtomicXXX
types in the core library, however I can see this being useful for splitting I/O ports into thread safe groups.