public class InPort extends Object
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 and Description |
---|
InPort(Vector pins)
Creates a new instance of a GPIO port of input pins.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public InPort(Vector pins) throws IOException
pins
- pin configuration of port. First pin in vector is the LSBIOException
- if creating the GPIO port instance failspublic 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.cinterion.io.InPortListener)
,
clearListener()
public void removeListener(InPortListener listener)
listener
- The InPortListener object to be removed from the list.InPortListener
,
addListener(com.cinterion.io.InPortListener)
,
clearListener()
public void clearListener()
Copyright (c) 1990, 2012, Oracle and/or its affiliates. All rights reserved.