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.
- Vrefint
Half - Half of the internal reference.
- Vrefint
Quarter - A quarter of the internal reference.
- Vrefint
Three Quarters - Three quarters of the internal reference.
Enums§
- Hysteresis
- Hysteresis on the comparator output, suppressing chatter near the threshold.
- Output
Sel - 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§
- Inverting
Input - A source the inverting input can be tied to.
- NonInverting
Input - What the non-inverting input consists of.