pub struct CmpConfig { /* private fields */ }Expand description
Everything the comparator is set up with, apart from its inputs.
ⓘ
CmpConfig::new(Speed::High)
.hysteresis(Hysteresis::Medium)
.output_sel(OutputSel::Timer0Break)Implementations§
Source§impl CmpConfig
impl CmpConfig
Sourcepub const fn new(speed: Speed) -> Self
pub const fn new(speed: Speed) -> Self
Creates a configuration with the given speed, no hysteresis, no output routing and a non-inverted output.
Speed is a required argument: it trades propagation delay against current draw, and neither choice is universal.
Sourcepub const fn hysteresis(self, hysteresis: Hysteresis) -> Self
pub const fn hysteresis(self, hysteresis: Hysteresis) -> Self
Sets the hysteresis. Defaults to Hysteresis::None.
Sourcepub const fn output_sel(self, output_sel: OutputSel) -> Self
pub const fn output_sel(self, output_sel: OutputSel) -> Self
Routes the output to a timer as well as the pin. Defaults to
OutputSel::None.
Sourcepub const fn polarity(self, polarity: Polarity) -> Self
pub const fn polarity(self, polarity: Polarity) -> Self
Sets the output polarity. Defaults to Polarity::NotInverted.
Trait Implementations§
impl Copy for CmpConfig
impl Eq for CmpConfig
impl StructuralPartialEq for CmpConfig
Auto Trait Implementations§
impl Freeze for CmpConfig
impl RefUnwindSafe for CmpConfig
impl Send for CmpConfig
impl Sync for CmpConfig
impl Unpin for CmpConfig
impl UnsafeUnpin for CmpConfig
impl UnwindSafe for CmpConfig
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