-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Description
The Spi peripheral has Spi::inner() which is very useful for doing things that the HAL doesn't support yet. It's nicer, safer, and more discoverable than using unsafe { &*pac::UART8::ptr() }. We should add it to more peripherals, possibly all of them.
Open Questions
- When should we have
&mut? TheRegisterBlock'sRegs don't need&mut, even for register writes. Traits thatRegisterBlocks implement likeTargetAddressdon't need&muteither. However, we may want to use&mutto indicate that operations may semantically modify the peripheral, even though it is not required for memory safety. The HAL APIs generally use&mut selfas such to help keep things sane. We could keep bothinner()andinner_mut()and document thatinner_mut()is useful to get the compiler to ensure exclusive access. We could only haveinner_mut()to be on the safe side. I'm leaning towards keeping both. - Which peripherals
inner()functions should beunsafe. The DMA peripherals are obvious since they can be used to write to arbitrary memory. Are there any others?
andrewgazelka
Metadata
Metadata
Assignees
Labels
No labels