FastPin

Struct FastPin 

Source
pub struct FastPin<R, N, MODE> { /* private fields */ }

Implementations§

Source§

impl<R: FastPinReg, N: FastPinNum, MODE> FastPin<R, N, MODE>

Source

pub const fn new() -> Self

Create a new instance of FastPin.

Source

pub fn into_input(&self, mode: FastPinModeInput) -> FastPin<R, N, InputFastPin>

Configure the pin as an input pin and return a new FastPin instance.

Source

pub fn into_output( &self, mode: FastPinModeOutput, ) -> FastPin<R, N, OutputFastPin>

Configure the pin as an output pin and return a new FastPin instance.

Source§

impl<R: FastPinReg, N: FastPinNum> FastPin<R, N, InputFastPin>

Source

pub fn is_input_high(&self) -> bool

Check if the input pin is high.

Source

pub fn is_input_low(&self) -> bool

Check if the input pin is low.

Source§

impl<R: FastPinReg, N: FastPinNum> FastPin<R, N, OutputFastPin>

Source

pub fn output_high(&self)

Set the output pin high.

Source

pub fn output_low(&self)

Set the output pin low.

Source

pub fn is_output_high(&self) -> bool

Check if the output pin is high.

Source

pub fn is_output_low(&self) -> bool

Check if the output pin is low.

Source

pub fn is_input_high(&self) -> bool

Check if the open drain pin is high.

Source

pub fn is_input_low(&self) -> bool

Check if the open drain pin is low.

Trait Implementations§

Source§

impl<R: Clone, N: Clone, MODE: Clone> Clone for FastPin<R, N, MODE>

Source§

fn clone(&self) -> FastPin<R, N, MODE>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug, N: Debug, MODE: Debug> Debug for FastPin<R, N, MODE>

Source§

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

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

impl<R: FastPinReg, N: FastPinNum, MODE> ErrorType for FastPin<R, N, MODE>

Source§

type Error = Infallible

Error type
Source§

impl<R: FastPinReg, N: FastPinNum> InputPin for FastPin<R, N, InputFastPin>

Source§

fn is_high(&mut self) -> Result<bool, Self::Error>

Is the input pin high?
Source§

fn is_low(&mut self) -> Result<bool, Self::Error>

Is the input pin low?
Source§

impl<R: FastPinReg, N: FastPinNum> InputPin for FastPin<R, N, OutputFastPin>

Source§

fn is_high(&mut self) -> Result<bool, Self::Error>

Is the input pin high?
Source§

fn is_low(&mut self) -> Result<bool, Self::Error>

Is the input pin low?
Source§

impl<R: FastPinReg, N: FastPinNum> OutputPin for FastPin<R, N, OutputFastPin>

Source§

fn set_high(&mut self) -> Result<(), Self::Error>

Drives the pin high. Read more
Source§

fn set_low(&mut self) -> Result<(), Self::Error>

Drives the pin low. Read more
Source§

fn set_state(&mut self, state: PinState) -> Result<(), Self::Error>

Drives the pin high or low depending on the provided value. Read more
Source§

impl<R: FastPinReg, N: FastPinNum> StatefulOutputPin for FastPin<R, N, OutputFastPin>

Source§

fn is_set_high(&mut self) -> Result<bool, Self::Error>

Is the pin in drive high mode? Read more
Source§

fn is_set_low(&mut self) -> Result<bool, Self::Error>

Is the pin in drive low mode? Read more
Source§

fn toggle(&mut self) -> Result<(), Self::Error>

Toggle pin output.
Source§

impl<R: Copy, N: Copy, MODE: Copy> Copy for FastPin<R, N, MODE>

Auto Trait Implementations§

§

impl<R, N, MODE> Freeze for FastPin<R, N, MODE>

§

impl<R, N, MODE> RefUnwindSafe for FastPin<R, N, MODE>

§

impl<R, N, MODE> Send for FastPin<R, N, MODE>
where R: Send, N: Send, MODE: Send,

§

impl<R, N, MODE> Sync for FastPin<R, N, MODE>
where R: Sync, N: Sync, MODE: Sync,

§

impl<R, N, MODE> Unpin for FastPin<R, N, MODE>
where R: Unpin, N: Unpin, MODE: Unpin,

§

impl<R, N, MODE> UnwindSafe for FastPin<R, N, MODE>
where R: UnwindSafe, N: UnwindSafe, MODE: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.