pub struct Handle<State = Enabled> { /* private fields */ }Expand description
Handle to the SWM peripheral
Can be used to enable and disable the switch matrix. It is also required by other parts of the HAL API to synchronize access the the underlying registers, wherever this is required.
This struct is part of swm::Parts.
Please refer to the module documentation for more information about the PMU.
Implementations§
Source§impl Handle<Disabled>
impl Handle<Disabled>
Sourcepub fn enable(self, syscon: &mut Handle) -> Handle<Enabled>
pub fn enable(self, syscon: &mut Handle) -> Handle<Enabled>
Enable the switch matrix
This method is only available, if swm::Handle is in the Disabled
state. Code that attempts to call this method when the peripheral is
already enabled will not compile.
Consumes this instance of swm::Handle and returns another instance
that has its State type parameter set to Enabled.
Source§impl Handle<Enabled>
impl Handle<Enabled>
Sourcepub fn disable(self, syscon: &mut Handle) -> Handle<Disabled>
pub fn disable(self, syscon: &mut Handle) -> Handle<Disabled>
Disable the switch matrix
The switch matrix retains it’s configuration while disabled, but doesn’t allow modifications
This method is only available, if swm::Handle is in the Enabled
state. Code that attempts to call this method when the peripheral is
already disabled will not compile.
Consumes this instance of swm::Handle and returns another instance
that has its State type parameter set to Disabled.