Module capsules_extra::analog_comparator
source · Expand description
Provides userspace access to the analog comparators on a board.
§Usage
ⓘ
let ac_channels = static_init!(
[&'static sam4l::acifc::AcChannel; 2],
[
&sam4l::acifc::CHANNEL_AC0,
&sam4l::acifc::CHANNEL_AC1,
]
);
let analog_comparator = static_init!(
capsules::analog_comparator::AnalogComparator<'static, sam4l::acifc::Acifc>,
capsules::analog_comparator::AnalogComparator::new(&mut sam4l::acifc::ACIFC, ac_channels)
);
sam4l::acifc::ACIFC.set_client(analog_comparator);
§Number of Analog Comparators
The number of analog comparators available depends on the microcontroller/board used.
§Normal or Interrupt-based Comparison
For a normal comparison or an interrupt-based comparison, just one analog comparator is necessary.
For more information on how this capsule works, please take a look at the README: 00007_analog_comparator.md in doc/syscalls.