-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathGPIO.java
More file actions
executable file
·38 lines (33 loc) · 803 Bytes
/
Copy pathGPIO.java
File metadata and controls
executable file
·38 lines (33 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package javaforce.pi;
import javaforce.api.*;
import javaforce.ffm.*;
/** GPIO.
*
* Used to configure/read/write Raspberry PI GPIO pins.
*
* @author pquiring
*/
public class GPIO {
private GPIOAPI api;
public static GPIO getInstance() {
return new GPIO(GPIOFFM.getInstance());
}
public GPIO(GPIOAPI api) {
this.api = api;
}
public boolean gpioSetup(int idx) {
return api.gpioSetup(idx);
}
public boolean gpioConfigOutput(int idx) {
return api.gpioConfigOutput(idx);
}
public boolean gpioConfigInput(int idx) {
return api.gpioConfigInput(idx);
}
public boolean gpioWrite(int idx, boolean state) {
return api.gpioWrite(idx, state);
}
public boolean gpioRead(int idx) {
return api.gpioRead(idx);
}
}