// Grove I2C ADC // https://wiki.seeedstudio.com/Grove-I2C_ADC /dts-v1/; /plugin/; /{ compatible = "brcm,bcm2835"; // Create a fictitious voltage regulator for the ADC121C021 reference fragment@0 { target-path = "/"; __overlay__ { Grove3v0: Grove3v0 { compatible = "regulator-fixed"; regulator-name = "Grove3v0"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; regulator-always-on; status = "okay"; }; }; }; // Enable ADC121C021 on I2C1 fragment@1 { target = <&i2c_arm>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; adc121c021: adc121c021@50 { compatible = "ti,adc121c"; reg = <0x50>; status = "okay"; vref-supply = <&Grove3v0>; }; }; }; // Define parameters to change the I2C address and to calibrate the // ADC121C021 supply & reference voltage __overrides__ { addr = <&adc121c021>,"reg:0"; min = <&Grove3v0>, "regulator-min-microvolt:0"; max = <&Grove3v0>, "regulator-max-microvolt:0"; }; };