public class OutPort extends Object
OutPort
class supports the access and configuration of a port of output pins of the general purpose IO driver (GPIO).
The usage of all GPIO ports is restricted to the same interface where the GPIO driver was opened.
The parallel access of the GPIO driver by Java and another interface (i.e. AT commnad interface) is not supported.
When the module starts up, all GPIO pins are set to high-impedance state after initializing.
Therefore, it is recommended to connect pull-up or pull-down resistors to all GPIO pins you want to use as output.
This is necessary to keep these pins from floating or driving any external devices before all settings are done by the output port
constructor and after release the output port again.Constructor and Description |
---|
OutPort(Vector<String> pins,
Vector<Integer> values)
Creates a new instance of a GPIO port of output pins.
|
Modifier and Type | Method and Description |
---|---|
Vector<String> |
getPins()
Gets the given pin configuration of an instance of a GPIO port of output
pins.
|
int |
getValue()
Gets the current value of an instance of a GPIO port of output pins.
|
void |
release()
Releases an instance of a GPIO port of output pins.
|
void |
setValue(int portValue)
Sets the current value of an instance of a GPIO port of output pins.
|
public OutPort(Vector<String> pins, Vector<Integer> values) throws IOException
pins
- pin configuration of port. First pin in vector is the LSB.values
- values of pins. First value is value of the LSB.IOException
- on failure.public Vector<String> getPins()
public int getValue() throws IOException
IOException
- on failure.public void release() throws IOException
IOException
- on failure.public void setValue(int portValue) throws IOException
portValue
- The new value of the input port.IOException
- on failure.