pub struct LED<const I: u8>(());
Expand description
The Ith LED (calling the LED<I>_{ON,OFF,TOGGLE}
macros).
The preferred interface for turning a LED on and off is switch_hal::OutputSwitch.
LEDs are accessible safely; any not implemented on a board are silently ignored.
Tuple Fields§
§0: ()
Implementations§
Source§impl<const I: u8> LED<I>
impl<const I: u8> LED<I>
pub const fn new() -> Self
.new()
will panic when used with a board that does not have that LED.Sourcepub const fn new_unchecked() -> Self
pub const fn new_unchecked() -> Self
Accesses the LED numbered I
as LED::<I>::new_unchecked()
.
It is not an error if this board does not have a LED with that number; the resulting struct will be available but its methods have no effect.
Sourcepub const fn new_checked() -> Result<Self, LedNotPresent>
pub const fn new_checked() -> Result<Self, LedNotPresent>
Accesses the LED numbered I
as LED::<I>::new_checked()?
.
An LED is returned if present on the board, which is known at build time.
const fn is_present() -> bool
Trait Implementations§
Auto Trait Implementations§
impl<const I: u8> Freeze for LED<I>
impl<const I: u8> RefUnwindSafe for LED<I>
impl<const I: u8> Send for LED<I>
impl<const I: u8> Sync for LED<I>
impl<const I: u8> Unpin for LED<I>
impl<const I: u8> UnwindSafe for LED<I>
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
Source§impl<T> IntoSwitch for T
impl<T> IntoSwitch for T
Source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
Source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes