Skip to content

Commit 20de338

Browse files
Scott Ellispopcornmix
Scott Ellis
authored andcommitted
Add overlay for ads1115 ADCs (#1864)
1 parent 7fe7808 commit 20de338

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
44
adau1977-adc.dtbo \
55
adau7002-simple.dtbo \
66
ads1015.dtbo \
7+
ads1115.dtbo \
78
ads7846.dtbo \
89
akkordion-iqdacplus.dtbo \
910
allo-piano-dac-pcm512x-audio.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,28 @@ Params: addr I2C bus address of device. Set based on how the
196196
http://www.ti.com/lit/ds/symlink/ads1015.pdf
197197

198198

199+
Name: ads1115
200+
Info: Texas Instruments ADS1115 ADC
201+
Load: dtoverlay=ads1115,<param>[=<val>]
202+
Params: addr I2C bus address of device. Set based on how the
203+
addr pin is wired. (default=0x48 assumes addr
204+
is pulled to GND)
205+
cha_enable Enable virtual channel a.
206+
cha_cfg Set the configuration for virtual channel a.
207+
(default=4 configures this channel for the
208+
voltage at A0 with respect to GND)
209+
cha_datarate Set the datarate (samples/sec) for this channel.
210+
(default=7 sets 860 sps)
211+
cha_gain Set the gain of the Programmable Gain
212+
Amplifier for this channel. (Default 1 sets the
213+
full scale of the channel to 4.096 Volts)
214+
215+
Channel parameters can be set for each enabled channel.
216+
A maximum of 4 channels can be enabled (letters a thru d).
217+
For more information refer to the device datasheet at:
218+
http://www.ti.com/lit/ds/symlink/ads1115.pdf
219+
220+
199221
Name: ads7846
200222
Info: ADS7846 Touch controller
201223
Load: dtoverlay=ads7846,<param>=<val>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* TI ADS1115 multi-channel ADC overlay
3+
*/
4+
5+
/dts-v1/;
6+
/plugin/;
7+
8+
/ {
9+
compatible = "brcm,bcm2708";
10+
11+
fragment@0 {
12+
target = <&i2c_arm>;
13+
__overlay__ {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
status = "okay";
17+
18+
ads1115: ads1115 {
19+
compatible = "ti,ads1115";
20+
status = "okay";
21+
#address-cells = <1>;
22+
#size-cells = <0>;
23+
reg = <0x48>;
24+
};
25+
};
26+
};
27+
28+
fragment@1 {
29+
target-path = "i2c_arm/ads1115";
30+
__dormant__ {
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
34+
channel_a: channel_a {
35+
reg = <4>;
36+
ti,gain = <1>;
37+
ti,datarate = <7>;
38+
};
39+
};
40+
};
41+
42+
fragment@2 {
43+
target-path = "i2c_arm/ads1115";
44+
__dormant__ {
45+
#address-cells = <1>;
46+
#size-cells = <0>;
47+
48+
channel_b: channel_b {
49+
reg = <5>;
50+
ti,gain = <1>;
51+
ti,datarate = <7>;
52+
};
53+
};
54+
};
55+
56+
fragment@3 {
57+
target-path = "i2c_arm/ads1115";
58+
__dormant__ {
59+
#address-cells = <1>;
60+
#size-cells = <0>;
61+
62+
channel_c: channel_c {
63+
reg = <6>;
64+
ti,gain = <1>;
65+
ti,datarate = <7>;
66+
};
67+
};
68+
};
69+
70+
fragment@4 {
71+
target-path = "i2c_arm/ads1115";
72+
__dormant__ {
73+
#address-cells = <1>;
74+
#size-cells = <0>;
75+
76+
channel_d: channel_d {
77+
reg = <7>;
78+
ti,gain = <1>;
79+
ti,datarate = <7>;
80+
};
81+
};
82+
};
83+
84+
__overrides__ {
85+
addr = <&ads1115>,"reg:0";
86+
cha_enable = <0>,"=1";
87+
cha_cfg = <&channel_a>,"reg:0";
88+
cha_gain = <&channel_a>,"ti,gain:0";
89+
cha_datarate = <&channel_a>,"ti,datarate:0";
90+
chb_enable = <0>,"=2";
91+
chb_cfg = <&channel_b>,"reg:0";
92+
chb_gain = <&channel_b>,"ti,gain:0";
93+
chb_datarate = <&channel_b>,"ti,datarate:0";
94+
chc_enable = <0>,"=3";
95+
chc_cfg = <&channel_c>,"reg:0";
96+
chc_gain = <&channel_c>,"ti,gain:0";
97+
chc_datarate = <&channel_c>,"ti,datarate:0";
98+
chd_enable = <0>,"=4";
99+
chd_cfg = <&channel_d>,"reg:0";
100+
chd_gain = <&channel_d>,"ti,gain:0";
101+
chd_datarate = <&channel_d>,"ti,datarate:0";
102+
};
103+
};

0 commit comments

Comments
 (0)