doc/syscalls/00007_analog_comparator.md
The Analog Comparator driver allows userspace to compare voltages and gives an output depending on this comparison.
Analog Comparators (ACs) can be first of all be configured in the 'normal mode', in which each AC performs a single comparison of two voltages. They can also be configured to send an interrupt as soon as a voltage is higher than another voltage, i.e. when a voltage exceeds a certain threshold.
A specific AC is referred to as ACx, where x is any number from 0 to n, and n is the index of the last AC module.
0Description: Does the driver exist?
Argument 1: unused
Argument 2: unused
Returns: Ok(()) if it exists, otherwise NODEVICE
1Description: Do a comparison of two inputs, referred to as the positive input voltage and the negative input voltage (Vp and Vn).
Argument 1: The index of the Analog Comparator for which the comparison needs to be made, starting at 0.
Argument 2: unused
Returns: The output of this function is True when Vp > Vn, and
False if Vp < Vn.
2Description: Start interrupts on an analog comparator. This analog comparator will then listen, and the callback set in subscribe will be called when the positive input voltage is higher than the negative input voltage (Vp > Vn).
Argument 1: The index of the Analog Comparator for which the comparison needs to be made, starting at 0.
Argument 2: unused
Returns: Ok(()) if starting interrupts was succesful.
3Description: Stop interrupts on an analog comparator.
Argument 1: The index of the Analog Comparator for which the comparison needs to be made, starting at 0.
Argument 2: unused
Returns: Ok(()) if stopping interrupts was succesful.
4Description: Get number of channels
Argument 1: unused
Argument 2: unused
Returns: Number of channels