|
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.InPort
This class supports the access and configuration of a port of input 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
input port constructor and after release the input port again.
For example, to create a GPIO port of input pins:
Vector pins = new Vector(); pins.addElement("GPIO10"); pins.addElement("GPIO5"); pins.addElement("GPIO3"); pins.addElement("GPIO1"); InPort inport = new InPort(pins);
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 | |
InPort(Vector pins)
Creates a new instance of a GPIO port of input pins. |
Method Summary | |
void |
addListener(InPortListener listener)
Registers listeners to receive value changes at an input port. |
void |
clearListener()
Removes all listener objects which have been previously added to this input port. |
Vector |
getPins()
Gets the given pin configuration of an instance of a GPIO port of input pins. |
int |
getValue()
Gets the current value of an instance of a GPIO port of input pins. |
void |
release()
Releases an instance of a GPIO port of input pins. |
void |
removeListener(InPortListener listener)
Removes a listener object which has been previously added from the internal list table of listener objects. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InPort(Vector pins) throws IOException
pins
- pin configuration of port. First pin in vector is the LSB
IOException
- if creating the GPIO port instance failsMethod Detail |
public void release() throws IOException
IOException
- if releasing the GPIO port instance failspublic int getValue() throws IOException
IOException
- if getting value failedpublic Vector getPins()
IOException
- if creating the GPIO port instance failedpublic void addListener(InPortListener listener)
listener
- The InPortListener object to be registered.InPortListener
,
removeListener(com.siemens.icm.io.InPortListener)
,
clearListener()
public void removeListener(InPortListener listener)
listener
- The InPortListener object to be removed from the list.InPortListener
,
addListener(com.siemens.icm.io.InPortListener)
,
clearListener()
public void clearListener()
InPortListener
,
addListener(com.siemens.icm.io.InPortListener)
,
removeListener(com.siemens.icm.io.InPortListener)
|
IM Profile | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |