public class OutPort extends Object
Vector pins = new Vector(4); Vector values = new Vector(4); pins.addElement("GPIO10"); values.addElement(Integer.valueOf("1")); pins.addElement("GPIO3"); values.addElement(Integer.valueOf("0")); pins.addElement("GPIO5"); values.addElement(Integer.valueOf("0")); pins.addElement("GPIO1"); values.addElement(Integer.valueOf("1")); OutPort outport = new OutPort(pins,values);
A group of maximum 10 pins can be configured to act as a parallel port.
A pin can only be added once to a port, and only to a port. A maximun of 5 GPIO ports
can be configured.
Constructor and Description |
---|
OutPort(Vector pins,
Vector values)
Creates a new instance of a GPIO port of output pins.
|
Modifier and Type | Method and Description |
---|---|
Vector |
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 pins, Vector values) throws IOException
pins
- pin configuration of port. First pin in vector is the LSBvalues
- values of pins. First value is value of the LSBIOException
- if creating the GPIO port instance failspublic void release() throws IOException
IOException
- if releasing the GPIO port instance failspublic void setValue(int portValue) throws IOException
IOException
- if creating the GPIO port instance failedpublic int getValue() throws IOException
IOException
- if creating the GPIO port instance failedpublic Vector getPins()
IOException
- if creating the GPIO port instance failedCopyright (c) 1990, 2012, Oracle and/or its affiliates. All rights reserved.