Add script to read ADC
This MR adds a script that allows for reading the ADC counts via the command line. It is based of the read-register script, except that it configures the ADC before reading the MonitoringDataAdc
register. The script reads the Imux pad instead of Vmux if option -I
is given. The output is given in volts / microAmps unless -R
is specificed, in which the raw ADC count is returned instead.
Example reading VMUX2 and IMUX3 pad through ADC:
/home/eathompson/Yarr$ ./bin/read-adc -r configs/controller/[...] -c configs/connectivity/[...] -i 0 2
0.0673481 V
Done.
/home/eathompson/Yarr$ ./bin/read-adc -r configs/controller/[...] -c configs/connectivity/[...] -i 0 2 -R
321
Done.
/home/eathompson/Yarr$ ./bin/read-adc -r configs/controller/[...] -c configs/connectivity/[...] -i 0 3 -I
2.72066 uA
Done.
/home/eathompson/Yarr$ ./bin/read-adc -r configs/controller/[...] -c configs/connectivity/[...] -i 0 3 -I -R
40
Done.
Tagging @theim for review.