Skip to main content

Module cmp

Module cmp 

Source
Expand description

Analog comparator.

ⓘ
let parts = dp.gpioa.split(&mut rcu);
let pos = parts.pa1.into_analog();
let config = CmpConfig::new(Speed::High);
let cmp = Cmp::new(&mut rcu, dp.cmp, pos, VrefintHalf, config).enable();
cortex_m::asm::delay(4_800);
let above = cmp.output();

Structs§

Cmp
The comparator, configured and stopped.
CmpConfig
Everything the comparator is set up with, apart from its inputs.
CmpRunning
The comparator, running.
Locked
Typestate: the control register is frozen until the next system reset.
Unlocked
Typestate: the control register still accepts writes.
Vrefint
The internal reference itself.
VrefintHalf
Half of the internal reference.
VrefintQuarter
A quarter of the internal reference.
VrefintThreeQuarters
Three quarters of the internal reference.

Enums§

Hysteresis
Hysteresis on the comparator output, suppressing chatter near the threshold.
OutputSel
Where the comparator output is routed on top of the pin.
Polarity
Polarity of the comparator output.
Speed
Propagation delay traded against current draw.

Traits§

InvertingInput
A source the inverting input can be tied to.
NonInvertingInput
What the non-inverting input consists of.