|
IM Profile | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.siemens.icm.io.OutPort
This 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 paralel 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.
For example, to create a GPIO port of four output pins:
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 Summary | |
OutPort(Vector pins,
Vector values)
Creates a new instance of a GPIO port of output pins. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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 LSB
IOException
- if creating the GPIO port instance failsMethod Detail |
public 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 failed
|
IM Profile | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |