This is a Linux industrial I/O (IIO) subsystem driver, targeting single-channel serial interface DACs. The industrial I/O subsystem provides a unified framework for drivers for many different types of converters and sensors using a number of different physical interfaces (i2c, spi, etc). See IIO for more information.
Function | File |
---|---|
driver | drivers/iio/dac/ad7303.c |
Required devicetree properties:
Optional devicetree properties:
dac_vdd: fixedregulator@0 { compatible = "regulator-fixed"; regulator-name = "fixed-supply"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-boot-on; }; axi_spi_0: spi@42000000 { #address-cells = <1>; #size-cells = <0>; compatible = "xlnx,axi-spi-1.02.a", "xlnx,xps-spi-2.00.a"; ... ad7303@0 { compatible = "adi,ad7303"; reg = <0>; spi-max-frequency = <1000000>; Vdd-supply = <&dac_vdd>; }; };
Each and every IIO device, typically a hardware chip, has a device folder under /sys/bus/iio/devices/iio:deviceX. Where X is the IIO index of the device. Under every of these directory folders reside a set of files, depending on the characteristics and features of the hardware device in question. These files are consistently generalized and documented in the IIO ABI documentation. In order to determine which IIO deviceX corresponds to which hardware device, the user can read the name file /sys/bus/iio/devices/iio:deviceX/name. In case the sequence in which the iio device drivers are loaded/registered is constant, the numbering is constant and may be known in advance.
This specifies any shell prompt running on the target
root:/> cd /sys/bus/iio/devices/ root:/sys/bus/iio/devices> ls iio:device0 root:/sys/bus/iio/devices> cd iio/:device0 root:/sys/bus/iio/devices/iio:device0> ls -l drwxr-xr-x 2 root root 0 Jul 5 05:10 buffer -r--r--r-- 1 root root 4096 Jul 5 05:10 dev -r--r--r-- 1 root root 4096 Jul 5 05:10 name -rw-r--r-- 1 root root 4096 Jul 5 05:10 out_voltage0_powerdown -rw-r--r-- 1 root root 4096 Jul 5 05:10 out_voltage0_raw -rw-r--r-- 1 root root 4096 Jul 5 05:10 out_voltage1_powerdown -rw-r--r-- 1 root root 4096 Jul 5 05:10 out_voltage1_raw -rw-r--r-- 1 root root 4096 Jul 5 05:10 out_voltage_scale drwxr-xr-x 2 root root 0 Jul 5 05:10 power drwxr-xr-x 2 root root 0 Jul 5 05:10 scan_elements lrwxrwxrwx 1 root root 0 Jan 1 1970 subsystem -> ../../../../../../../bus/iio drwxr-xr-x 2 root root 0 Jul 5 05:10 trigger -rw-r--r-- 1 root root 4096 Jan 1 1970 uevent
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat name ad7303
Description:
scale to be applied to out_voltage0_raw and out_voltage1_raw in order to obtain the measured voltage in millivolts.
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> cat out_voltage_scale 12.890625
Description:
/sys/bus/iio/devices/iio:deviceX/out_voltageY_raw
Raw (unscaled, no bias etc.) output voltage for channel Y.
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> echo 100 > out_voltage0_raw
U = out_voltage0_raw * out_voltage_scale = 100 * 12.890625 mV = 1289.0625 mV
/sys/bus/iio/devices/iio:deviceX/out_voltageY_powerdown
Description:
Writing 1 causes output Y to enter the power down mode. Clearing returns to normal operation.
This specifies any shell prompt running on the target
root:/sys/bus/iio/devices/iio:device0> echo 1 > out_voltage0_powerdown root:/sys/bus/iio/devices/iio:device0> cat out_voltage0_powerdown 1 root:/sys/bus/iio/devices/iio:device0> echo 0 > out_voltage0_powerdown root:/sys/bus/iio/devices/iio:device0> cat out_voltage0_powerdown 0
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !