pub struct AnyPin<'d> { /* private fields */ }Expand description
A type-erased pin that can represent any GPIO pin.
Implementations§
Source§impl<'d> AnyPin<'d>
impl<'d> AnyPin<'d>
Sourcepub unsafe fn steal(pin: u8) -> Self
pub unsafe fn steal(pin: u8) -> Self
Create an AnyPin from a raw pin number without checking.
§Safety
The pin must be valid (0-18). This bypasses the type system.
Sourcepub fn init_input(self, config: InputConfig) -> Input<'d>
pub fn init_input(self, config: InputConfig) -> Input<'d>
Initialize this pin as a GPIO input.
Applies config.pull to the pad via the IO_CONFIG pad register
(apply_pull; pins 0..=14 have a pad-control register).
Sourcepub fn init_output(self, config: OutputConfig) -> Output<'d>
pub fn init_output(self, config: OutputConfig) -> Output<'d>
Initialize this pin as a GPIO output.
Sourcepub fn init_flex(self, config: OutputConfig) -> Flex<'d>
pub fn init_flex(self, config: OutputConfig) -> Flex<'d>
Initialize this pin as a Flex (combined input/output) driver.
Auto Trait Implementations§
impl<'d> !UnwindSafe for AnyPin<'d>
impl<'d> Freeze for AnyPin<'d>
impl<'d> RefUnwindSafe for AnyPin<'d>
impl<'d> Send for AnyPin<'d>
impl<'d> Sync for AnyPin<'d>
impl<'d> Unpin for AnyPin<'d>
impl<'d> UnsafeUnpin for AnyPin<'d>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more