stm32h7xx-hal
stm32h7xx-hal copied to clipboard
Add inner and inner_mut functions to peripherals where it's easy to do so
Where the registers are owned by a single struct and not shared amongst many channels, etc.
Fixes #232
I just added methods to access the peripheral in a DMA Transfer. My first thought was that these should be unsafe since you could read/write to registers while the DMA is reading/writing the same registers. However the hardware synchronizes register access in some fashion and pause() already gives access to the peripheral while the stream is executing. Feel like I might be missing something.
I'm less keen on those methods to access the peripheral in a DMA Transfer. Whilst I see your argument, I'd like to get more experience with actually using the DMA API before deciding what to do. You're right that pause() allows access, but it also mutates the stream state (disables it) so maybe more obvious for users what the outcome will be.
@mattico Do you mind if I pick only the first commit and merge that for now?
@richardeoin fine with me!