Handle

Struct Handle 

Source
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>

Source

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>

Source

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.

Auto Trait Implementations§

§

impl<State> Freeze for Handle<State>

§

impl<State> RefUnwindSafe for Handle<State>
where State: RefUnwindSafe,

§

impl<State> Send for Handle<State>
where State: Send,

§

impl<State = Enabled> !Sync for Handle<State>

§

impl<State> Unpin for Handle<State>
where State: Unpin,

§

impl<State> UnwindSafe for Handle<State>
where State: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.