SWM

Struct SWM 

Source
pub struct SWM<State = Enabled> { /* private fields */ }
Expand description

Entry point to the switch matrix (SWM) API

The SWM API is split into multiple parts, which are all available through swm::Parts. You can use SWM::split to gain access to swm::Parts.

You can also use this struct to gain access to the raw peripheral using SWM::free. This is the main reason this struct exists, as it’s no longer possible to do this after the API has been split.

Use Peripherals to gain access to an instance of this struct.

Please refer to the module documentation for more information.

Implementations§

Source§

impl<STATE> SWM<STATE>

Source

pub fn split(self) -> Parts<STATE>

Splits the SWM API into its component parts

This is the regular way to access the SWM API. It exists as an explicit step, as it’s no longer possible to gain access to the raw peripheral using SWM::free after you’ve called this method.

Source

pub fn free(self) -> SWM0

Return the raw peripheral

This method serves as an escape hatch from the HAL API. It returns the raw peripheral, allowing you to do whatever you want with it, without limitations imposed by the API.

If you are using this method because a feature you need is missing from the HAL API, please open an issue or, if an issue for your feature request already exists, comment on the existing issue, so we can prioritize it accordingly.

Auto Trait Implementations§

§

impl<State> Freeze for SWM<State>

§

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

§

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

§

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

§

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

§

impl<State> UnwindSafe for SWM<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.