Skip to content

Commit 0931d1d

Browse files
Erik Sejrpopcornmix
Erik Sejr
authored andcommitted
Add ads1015 overlay
See: #1520
1 parent b16a3eb commit 0931d1d

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ifeq ($(CONFIG_ARCH_BCM2835),y)
1313
endif
1414

1515
dtbo-$(RPI_DT_OVERLAYS) += adau1977-adc.dtbo
16+
dtbo-$(RPI_DT_OVERLAYS) += ads1015.dtbo
1617
dtbo-$(RPI_DT_OVERLAYS) += ads7846.dtbo
1718
dtbo-$(RPI_DT_OVERLAYS) += akkordion-iqdacplus.dtbo
1819
dtbo-$(RPI_DT_OVERLAYS) += at86rf233.dtbo

arch/arm/boot/dts/overlays/README

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,28 @@ Load: dtoverlay=adau1977-adc
168168
Params: <None>
169169

170170

171+
Name: ads1015
172+
Info: Overlay for activation of Texas Instruments ADS1015 ADC over I2C
173+
Load: dtoverlay=ads1015,<param>=<val>
174+
Params: addr I2C bus address of device. Set based on how the
175+
addr pin is wired. (default=0x48 assumes addr
176+
is pulled to GND)
177+
cha_enable Enable virtual channel a. (default=true)
178+
cha_cfg Set the configuration for virtual channel a.
179+
(default=4 configures this channel for the
180+
voltage at A0 with respect to GND)
181+
cha_datarate Set the datarate (samples/sec) for this channel.
182+
(default=4 sets 1600 sps)
183+
cha_gain Set the gain of the Programmable Gain
184+
Amplifier for this channel. (default=2 sets the
185+
full scale of the channel to 2.048 Volts)
186+
187+
Channel (ch) parameters can be set for each enabled channel.
188+
A maximum of 4 channels can be enabled (letters a thru d).
189+
For more information refer to the device datasheet at:
190+
http://www.ti.com/lit/ds/symlink/ads1015.pdf
191+
192+
171193
Name: ads7846
172194
Info: ADS7846 Touch controller
173195
Load: dtoverlay=ads7846,<param>=<val>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
* 2016 - Erik Sejr
3+
*/
4+
/dts-v1/;
5+
/plugin/;
6+
7+
/ {
8+
compatible = "brcm,bcm2708";
9+
/* ----------- ADS1015 ------------ */
10+
fragment@0 {
11+
target = <&i2c_arm>;
12+
__overlay__ {
13+
#address-cells = <1>;
14+
#size-cells = <0>;
15+
status = "okay";
16+
ads1015: ads1015 {
17+
compatible = "ti,ads1015";
18+
status = "okay";
19+
#address-cells = <1>;
20+
#size-cells = <0>;
21+
reg = <0x48>;
22+
};
23+
};
24+
};
25+
26+
fragment@1 {
27+
target-path = "i2c_arm/ads1015";
28+
__overlay__ {
29+
#address-cells = <1>;
30+
#size-cells = <0>;
31+
channel_a: channel_a {
32+
reg = <4>;
33+
ti,gain = <2>;
34+
ti,datarate = <4>;
35+
};
36+
};
37+
};
38+
39+
fragment@2 {
40+
target-path = "i2c_arm/ads1015";
41+
__dormant__ {
42+
#address-cells = <1>;
43+
#size-cells = <0>;
44+
channel_b: channel_b {
45+
reg = <5>;
46+
ti,gain = <2>;
47+
ti,datarate = <4>;
48+
};
49+
};
50+
};
51+
52+
fragment@3 {
53+
target-path = "i2c_arm/ads1015";
54+
__dormant__ {
55+
#address-cells = <1>;
56+
#size-cells = <0>;
57+
channel_c: channel_c {
58+
reg = <6>;
59+
ti,gain = <2>;
60+
ti,datarate = <4>;
61+
};
62+
};
63+
};
64+
65+
fragment@4 {
66+
target-path = "i2c_arm/ads1015";
67+
__dormant__ {
68+
#address-cells = <1>;
69+
#size-cells = <0>;
70+
channel_d: channel_d {
71+
reg = <7>;
72+
ti,gain = <2>;
73+
ti,datarate = <4>;
74+
};
75+
};
76+
};
77+
78+
__overrides__ {
79+
addr = <&ads1015>,"reg:0";
80+
cha_enable = <0>,"=1";
81+
cha_cfg = <&channel_a>,"reg:0";
82+
cha_gain = <&channel_a>,"ti,gain:0";
83+
cha_datarate = <&channel_a>,"ti,datarate:0";
84+
chb_enable = <0>,"=2";
85+
chb_cfg = <&channel_b>,"reg:0";
86+
chb_gain = <&channel_b>,"ti,gain:0";
87+
chb_datarate = <&channel_b>,"ti,datarate:0";
88+
chc_enable = <0>,"=3";
89+
chc_cfg = <&channel_c>,"reg:0";
90+
chc_gain = <&channel_c>,"ti,gain:0";
91+
chc_datarate = <&channel_c>,"ti,datarate:0";
92+
chd_enable = <0>,"=4";
93+
chd_cfg = <&channel_d>,"reg:0";
94+
chd_gain = <&channel_d>,"ti,gain:0";
95+
chd_datarate = <&channel_d>,"ti,datarate:0";
96+
};
97+
98+
};

0 commit comments

Comments
 (0)