common:: peripherals:: PeripheralManagement
A structure encapsulating a peripheral should implement this trait.
fn get_registers(&self) -> &Self::RegisterType
How to get a reference to the physical hardware registers (the MMIO struct).
fn get_clock(&self) -> &C
Which clock feeds this peripheral.
For peripherals with no clock, use
fn before_peripheral_access(&self, _: &C, _: &Self::RegisterType)
Called before peripheral access.
Responsible for ensure the periphal can be safely accessed, e.g. that its clock is powered on.
fn after_peripheral_access(&self, _: &C, _: &Self::RegisterType)
Called after periphal access.
Currently used primarily for power management to check whether the peripheral can be powered off.