public class GPIOComponent extends java.lang.Object implements Component
A classical pin means a pin that is not reserved for I2C, UART or PWM components.
You can easily access the corresponding pins using the GPIOPin
enum created for this.
Modifier and Type | Field and Description |
---|---|
protected static com.pi4j.io.gpio.GpioController |
gpio
The default instance of GpioController.
|
Modifier | Constructor and Description |
---|---|
protected |
GPIOComponent()
Protected constructor to hide the implicit public one.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getType()
Get the String representation of the type of the component.
|
protected static final com.pi4j.io.gpio.GpioController gpio
The GpioFactory.getInstance()
is not a thread safe singleton pattern implementation.
Implementation does not provide any synchronization or mechanisms to prevent instantiation of two instances.
We then use a static variable to share this GpioController instance with each GPIOComponent
.