@ProviderType
public interface KuraGPIOPin
getValue()
or by attaching a
PinStatusListener
to the pin.Modifier and Type | Method and Description |
---|---|
void |
addPinStatusListener(PinStatusListener listener)
Adds a
PinStatusListener to this input pin. |
void |
close()
Closes this pin and deallocates the resources needed to communicate with it.
If there is a PinStatusListener attached to this pin, the implementation should remove it
before closing the resource. |
KuraGPIODirection |
getDirection() |
int |
getIndex() |
KuraGPIOMode |
getMode() |
java.lang.String |
getName() |
KuraGPIOTrigger |
getTrigger() |
boolean |
getValue()
Used to get the current value of a pin, either output or input
|
boolean |
isOpen() |
void |
open()
Opens the pin and allocates the needed resources to communicate with it.
|
void |
removePinStatusListener(PinStatusListener listener)
Removes a
PinStatusListener from this input pin.If the pin has no listeners attached, this method should fail silently. |
void |
setValue(boolean active)
Used to set the value of an output pin.
|
void setValue(boolean active) throws KuraUnavailableDeviceException, KuraClosedDeviceException, java.io.IOException
active
- New state of the pin.KuraUnavailableDeviceException
- when the GPIO resource is not availableKuraClosedDeviceException
- when the GPIO resource has not yet been openedjava.io.IOException
- if an I/O error occursboolean getValue() throws KuraUnavailableDeviceException, KuraClosedDeviceException, java.io.IOException
KuraUnavailableDeviceException
- when the GPIO resource is not availableKuraClosedDeviceException
- when the GPIO resource has not yet been openedjava.io.IOException
- if an I/O error occursvoid addPinStatusListener(PinStatusListener listener) throws KuraClosedDeviceException, java.io.IOException
PinStatusListener
to this input pin. The listener will be notified when the status of this input
changes.listener
- Listener to be added to this pinKuraClosedDeviceException
- when the GPIO resource has not yet been openedjava.io.IOException
- if an I/O error occursvoid removePinStatusListener(PinStatusListener listener) throws KuraClosedDeviceException, java.io.IOException
PinStatusListener
from this input pin.listener
- Listener to be removed from this pinKuraClosedDeviceException
- when the GPIO resource has not yet been openedjava.io.IOException
- if an I/O error occursvoid open() throws KuraGPIODeviceException, KuraUnavailableDeviceException, java.io.IOException
KuraGPIODeviceException
- when an exception occurs opening the pinKuraUnavailableDeviceException
- when the GPIO resource is not availablejava.io.IOException
- if a generic I/O error occursvoid close() throws java.io.IOException
PinStatusListener
attached to this pin, the implementation should remove it
before closing the resource.java.io.IOException
- if a generic I/O error occursKuraGPIODirection getDirection()
KuraGPIODirection
representing the direction (Input/Output) of the PINKuraGPIOMode getMode()
KuraGPIOMode
representing the mode of the pun.KuraGPIOTrigger getTrigger()
KuraGPIOTrigger
representing the trigger mode for this pin.java.lang.String getName()
int getIndex()
boolean isOpen()