embeded/raspberry pi

linux iio adc + rpi

구차니 2022. 6. 20. 14:42

industrial io(iio)

The mcp320x driver interface is through sysfs.
The first device will be found here /sys/bus/iio/devices/iio:device0

# ls /sys/bus/iio/devices/iio\:device0
dev                       in_voltage2-voltage3_raw  in_voltage5_raw           name
in_voltage-voltage_scale  in_voltage2_raw           in_voltage6-voltage7_raw  of_node
in_voltage0-voltage1_raw  in_voltage3_raw           in_voltage6_raw           power
in_voltage0_raw           in_voltage4-voltage5_raw  in_voltage7_raw           subsystem
in_voltage1_raw           in_voltage4_raw           in_voltage_scale          uevent

# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
514

[링크 : https://jumpnowtek.com/rpi/Using-mcp3008-ADCs-with-Raspberry-Pis.html]


[링크 :
https://github.com/scottellis/mcp3008-poll/blob/master/mcp3008-poll.c]

[링크 : https://github.com/scottellis/mcp3008-poll]