COOLPI CM5 AD7606 8-channel synchronous sampling
-
-
Using SPI serial communication interface, the circuit is as follows
-
Standard IIO driver configuration
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-cpcm5-evb-v11.dts b/arch/arm64/boot/dts/rockchip/rk3588-cpcm5-evb-v11.dts index 5b04c9d3f354..550b320403d7 100755 --- a/arch/arm64/boot/dts/rockchip/rk3588-cpcm5-evb-v11.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-cpcm5-evb-v11.dts @@ -486,6 +486,34 @@ &sdmmc { status = "okay"; }; +&spi0 { + status = "okay"; + assigned-clocks = <&cru CLK_SPI0>; + pinctrl-names = "default"; + pinctrl-0 = <&spi0m2_cs0 &spi0m2_pins>; + + ad7606@0 { + compatible = "adi,ad7606-8"; + reg = <0>; + spi-max-frequency = <20000000>; + spi-cpol; + spi-cpha; + avcc-supply = <&vcc5v0_sys>; + interrupts = <8 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpio1>; + adi,conversion-start-gpios = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; + adi,range-gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 RK_PD3 GPIO_ACTIVE_HIGH>; + adi,oversampling-ratio-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>, + <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>, + <&gpio1 RK_PD6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&ad7606_busy &ad7606_conver &ad7606_range &ad7606_reset &ad7606_os0 &ad7606_os1 &ad7606_os2>; + //adi,sw-mode; + status = "okay"; + }; +}; + &dsi0 { status = "disabled"; //rockchip,lane-rate = <1000>; @@ -1330,6 +1358,30 @@ &rng { }; &pinctrl { + ad7606 { + ad7606_busy: ad7606-busy { + rockchip,pins = <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_conver: ad7606-conver { + rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_range: ad7606-range { + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_reset: ad7606-reset { + rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_os0: ad7606-os0 { + rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_os1: ad7606-os1 { + rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + ad7606_os2: ad7606-os2 { + rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + hym8563 { hym8563_int: hym8563-int { rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>; diff --git a/arch/arm64/configs/rk3588_cpcm5_evb_defconfig b/arch/arm64/configs/rk3588_cpcm5_evb_defconfig index 92e6983d3a40..9365319f866d 100644 --- a/arch/arm64/configs/rk3588_cpcm5_evb_defconfig +++ b/arch/arm64/configs/rk3588_cpcm5_evb_defconfig @@ -891,6 +891,8 @@ CONFIG_ARM_ROCKCHIP_BUS_DEVFREQ=y CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ=y CONFIG_DEVFREQ_EVENT_ROCKCHIP_NOCP=y CONFIG_IIO=y +CONFIG_AD7606_IFACE_PARALLEL=y +CONFIG_AD7606_IFACE_SPI=y CONFIG_ROCKCHIP_SARADC=y CONFIG_SENSORS_ISL29018=y CONFIG_SENSORS_TSL2563=y
- test method
Single sampling
cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw
Continuous Samples
/*Modify node permissions*/ sudo chmod 777 /sys/bus/iio/devices/iio:device0/ -R /*Enable sampling channel*/ echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage0_en // echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage1_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage2_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage3_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage4_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage5_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage6_en echo 1 > /sys/bus/iio/devices/iio:device0/scan_elements/in_voltage7_en /*Configure buffer size*/ echo 128 > /sys/bus/iio/devices/iio:device0/buffer/length /*Start sampling*/ echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable /*View Results*/ cat /dev/iio\:device0 |xxd -
- The schematic and PCB files can be downloaded from the wiki,Some empty PCBs can also be given away for free.
-