pub enum PolarityMode {
ActiveHigh,
ActiveLow,
}Expand description
Runtime polarity mode.
Determines whether a logical ON maps to a physical High or Low pin level.
Chosen at construction time, making it suitable for polarity derived from
runtime configuration.
§Examples
ⓘ
use status_led::{Led, PolarityMode};
let pol = if config.active_low {
PolarityMode::ActiveLow
} else {
PolarityMode::ActiveHigh
};
let mut led = Led::new(pin, pol).unwrap();
led.on().unwrap();Variants§
Trait Implementations§
Source§impl Clone for PolarityMode
impl Clone for PolarityMode
Source§fn clone(&self) -> PolarityMode
fn clone(&self) -> PolarityMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PolarityMode
Source§impl Debug for PolarityMode
impl Debug for PolarityMode
impl Eq for PolarityMode
Source§impl PartialEq for PolarityMode
impl PartialEq for PolarityMode
impl StructuralPartialEq for PolarityMode
Auto Trait Implementations§
impl Freeze for PolarityMode
impl RefUnwindSafe for PolarityMode
impl Send for PolarityMode
impl Sync for PolarityMode
impl Unpin for PolarityMode
impl UnsafeUnpin for PolarityMode
impl UnwindSafe for PolarityMode
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