Analog-to-digital driver

The ADC driver provides simple access to the analogue ports on the PIC32 chip. Enable with:

  • DRIVER_ADC = yes
Options:
  • None
Major device id:
  • 8
Devices:
  • /dev/adc0 … /dev/adc15

Reading from a /dev/adcX device will automatically enable the ADC peripheral and configure the equivalent AN pin on the PIC32 to analogue input. The value us sampled and returned through the device as a simple numeric string.

Programs:
  • /bin/adc-demo
Usage:
adc-demo {option...}
Options:
-d delay Delay “delay” miliseconds between samples
Examples:
$ cat /dev/adc0
23
24
22
12
23
38
40
48
89
193
304
948
1023
1023
1023
1010
193
9
0
^C
$ adc-demo -d 10
(demo will start - press CTRL-C to abort)
API:

There is no API to this device yet. Suggestions welcome.