Skip to content

Commit a792c39

Browse files
committed
remove deliberate provider selection. channel chipselect, addreess BCM deprecae updates
1 parent f267237 commit a792c39

66 files changed

Lines changed: 1332 additions & 1167 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pom.xml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464

6565

6666
<!-- DEPENDENCIES VERSIONS 2.0.3 -SNAPSHOT -->
67-
<slf4j.version>1.7.30</slf4j.version>
68-
<pi4j.version>4.0.0-SNAPSHOT</pi4j.version>
67+
<slf4j.version>2.0.17</slf4j.version>
68+
<pi4j.version>4.1.0-SNAPSHOT</pi4j.version>
6969

7070
<!-- BUILD PLUGIN VERSIONS -->
7171
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
@@ -103,23 +103,20 @@
103103
</repository>
104104
</repositories>
105105
<dependencies>
106-
<dependency>
107-
<groupId>org.slf4j</groupId>
108-
<artifactId>slf4j-api</artifactId>
109-
<version>${slf4j.version}</version>
110-
</dependency>
106+
111107
<!-- change to use the default slf4 simple -->
112108
<dependency>
113109
<groupId>com.pi4j</groupId>
114110
<artifactId>pi4j-plugin-gpiod</artifactId>
115111
<version>${pi4j.version}</version>
116112
</dependency>
117-
<!-- change to use the default slf4 simple -->
113+
<!-->
118114
<dependency>
119115
<groupId>com.pi4j</groupId>
120-
<artifactId>pi4j-library-linuxfs</artifactId>
116+
<artifactId>pi4j-plugin-ffm</artifactId>
121117
<version>${pi4j.version}</version>
122118
</dependency>
119+
<-->
123120
<dependency>
124121
<groupId>com.pi4j</groupId>
125122
<artifactId>pi4j-plugin-linuxfs</artifactId>
@@ -131,12 +128,16 @@
131128
<version>5.12.1</version>
132129
</dependency>
133130
<dependency>
131+
<groupId>org.slf4j</groupId>
132+
<artifactId>slf4j-api</artifactId>
133+
<version>${slf4j.version}</version>
134+
</dependency>
135+
<dependency>
134136
<groupId>org.slf4j</groupId>
135137
<artifactId>slf4j-simple</artifactId>
136138
<version>${slf4j.version}</version>
137139
</dependency>
138-
139-
<!-- include Pi4J Core -->
140+
<!-- include Pi4J Core -->
140141
<dependency>
141142
<groupId>com.pi4j</groupId>
142143
<artifactId>pi4j-core</artifactId>
@@ -147,11 +148,7 @@
147148
<artifactId>pi4j-plugin-pigpio</artifactId>
148149
<version>${pi4j.version}</version>
149150
</dependency-->
150-
<!--dependency>
151-
<groupId>com.pi4j</groupId>
152-
<artifactId>pi4j-plugin-rp1spi</artifactId>
153-
<version>${pi4j.version}</version>
154-
</dependency-->
151+
155152
<!--- log4j - version 2 -->
156153

157154
<!-- include Pi4J Plugins (Platforms and I/O Providers) -->

src/main/java/com/pi4j/devices/ads1256/ADS1255.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,27 @@
3838

3939
import com.pi4j.context.Context;
4040
import com.pi4j.io.spi.SpiBus;
41-
import com.pi4j.io.spi.SpiChipSelect;
4241
import com.pi4j.util.Console;
4342

4443
public final class ADS1255 extends AbstractADS125x {
4544

4645
@SuppressWarnings("exports")
47-
public ADS1255(Context pi4j, SpiBus spiBus, SpiChipSelect chipSelect,
48-
boolean reset, int drdyPin, int csPin, int rstPin,
49-
boolean crtRstGpio, int pdwnPin, boolean crtPdwnGpio,
50-
Console console, String traceLevel, double vref, DataRate sampleRate, boolean useBuffer)
51-
throws InterruptedException {
52-
super(pi4j, spiBus, chipSelect, reset, drdyPin, csPin, rstPin, crtRstGpio,
53-
pdwnPin, crtPdwnGpio, console, traceLevel, vref, sampleRate, useBuffer);
46+
public ADS1255(Context pi4j, SpiBus spiBus, int chipSelect,
47+
boolean reset, int drdyPin, int csPin, int rstPin,
48+
boolean crtRstGpio, int pdwnPin, boolean crtPdwnGpio,
49+
Console console, String traceLevel, double vref, DataRate sampleRate, boolean useBuffer)
50+
throws InterruptedException {
51+
super(pi4j, spiBus, chipSelect, reset, drdyPin, csPin, rstPin, crtRstGpio,
52+
pdwnPin, crtPdwnGpio, console, traceLevel, vref, sampleRate, useBuffer);
5453
}
5554

5655
@Override
5756
public int getNumGpioPins() {
58-
return 2;
57+
return 2;
5958
}
6059

6160
@Override
6261
public int getNumAnalogPins() {
63-
return 2;
62+
return 2;
6463
}
6564
}//end ADS1255

src/main/java/com/pi4j/devices/ads1256/ADS1256.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838

3939
import com.pi4j.context.Context;
4040
import com.pi4j.io.spi.SpiBus;
41-
import com.pi4j.io.spi.SpiChipSelect;
4241
import com.pi4j.util.Console;
4342

4443
public final class ADS1256 extends AbstractADS125x {
4544

4645
@SuppressWarnings("exports")
47-
public ADS1256(Context pi4j, SpiBus spiBus, SpiChipSelect chipSelect,
46+
public ADS1256(Context pi4j, SpiBus spiBus, int chipSelect,
4847
boolean reset, int drdyPin, int csPin, int rstPin,
4948
boolean crtRstGpio, int pdwnPin, boolean crtPdwnGpio,
5049
Console console, String traceLevel, double vref, DataRate sampleRate, boolean useBuffer)
@@ -57,6 +56,7 @@ public ADS1256(Context pi4j, SpiBus spiBus, SpiChipSelect chipSelect,
5756
public int getNumGpioPins() {
5857
return 4;
5958
}
59+
6060
@Override
6161
public int getNumAnalogPins() {
6262
return 8;

src/main/java/com/pi4j/devices/ads1256/ADS1256App.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.pi4j.io.exception.IOException;
4444
import com.pi4j.io.gpio.digital.DigitalState;
4545
import com.pi4j.io.spi.SpiBus;
46-
import com.pi4j.io.spi.SpiChipSelect;
4746
import com.pi4j.util.Console;
4847

4948
public class ADS1256App {
@@ -68,7 +67,7 @@ public static void main(String[] args) throws InterruptedException, IOException
6867
int rsrtPin = 18;
6968
int pdwnPin = 27;
7069
boolean resetChip = false;
71-
SpiChipSelect chipSelect = SpiChipSelect.CS_0;
70+
int chipSelect = 0;
7271
SpiBus spiBus = SpiBus.BUS_0;
7372
DigitalState newState = DigitalState.UNKNOWN;
7473
boolean setPinState = false;
@@ -146,7 +145,7 @@ public static void main(String[] args) throws InterruptedException, IOException
146145
crtPdwn = true;
147146
} else if (o.contentEquals("-cNotUsed")) {
148147
String a = args[i + 1];
149-
chipSelect = SpiChipSelect.getByNumber(Short.parseShort(a.substring(2), 16));
148+
chipSelect = Integer.parseInt(a);
150149
i++;
151150
} else if (o.contentEquals("-x")) {
152151
resetChip = true;

0 commit comments

Comments
 (0)