Struct imxrt_iomuxc::Pad

source ·
pub struct Pad<const MUX: u32, const PAD: u32> { /* private fields */ }
Expand description

An i.MXT RT pad

The Base is the pad tag, like GPIO_AD_B0. The Offset is the constant (type) that describes the pad number.

Pads have no size.

Implementations§

source§

impl<const MUX: u32, const PAD: u32> Pad<MUX, PAD>

source

pub const unsafe fn new() -> Self

Creates a handle to the pad

§Safety

new() may be called anywhere, by anyone. This could lead to multiple objects that mutate the same memory. Consider calling new() once, near startup, then passing objects and references throughout your program.

source§

impl<const MUX: u32, const PAD: u32> Pad<MUX, PAD>

source

pub const fn erase(self) -> ErasedPad

Erase the pad’s type, returning an ErasedPad

source

pub unsafe fn set_alternate(alt: u32)

Set the alternate value for this pad.

Performs a read-modify-write on the pad’s mux register to set the alternate value to alt.

§Safety

This function performs a read-modify-write operation on peripheral memory. It could race with other calls that modify this pad’s mux register. For a safer interface, see alternate().

source

pub unsafe fn set_sion()

Set the pad’s SION bit.

Performs a read-modify-write on the pad’s mux register to set the SION bit.

§Safety

This function performs a read-modify-write operation on peripheral memory. It could race with other calls that modify this pad’s mux register. For a safer interface, see set_sion().

source

pub unsafe fn clear_sion()

Clear the pad’s SION bit.

Performs a read-modify-write on the pad’s mux register to Clear the SION bit.

§Safety

This function performs a read-modify-write operation on peripheral memory. It could race with other calls that modify this pad’s mux register. For a safer interface, see clear_sion().

source

pub unsafe fn configure(config: Config)

Set the pad’s configuration.

§Safety

This function performs a read-modify-write operation on peripheral memory. It could race with any other function that modifies this pad’s registers. For a safer interface, see configure().

Trait Implementations§

source§

impl<const MUX: u32, const PAD: u32> Debug for Pad<MUX, PAD>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const MUX: u32, const PAD: u32> TryFrom<ErasedPad> for Pad<MUX, PAD>

§

type Error = WrongPadError

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

fn try_from(erased_pad: ErasedPad) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<const MUX: u32, const PAD: u32> Iomuxc for Pad<MUX, PAD>

source§

impl<const MUX: u32, const PAD: u32> Send for Pad<MUX, PAD>

Auto Trait Implementations§

§

impl<const MUX: u32, const PAD: u32> Freeze for Pad<MUX, PAD>

§

impl<const MUX: u32, const PAD: u32> RefUnwindSafe for Pad<MUX, PAD>

§

impl<const MUX: u32, const PAD: u32> !Sync for Pad<MUX, PAD>

§

impl<const MUX: u32, const PAD: u32> Unpin for Pad<MUX, PAD>

§

impl<const MUX: u32, const PAD: u32> UnwindSafe for Pad<MUX, PAD>

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

§

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

§

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.