Class GpioService

All Implemented Interfaces:
CtxEventListener, ContextHandleAware, HandleAware, Ready, ReadyAndReadyListener, ReadyListener

public final class GpioService extends AbstractService
This service provides a way to interact with GPIO pins on the main cpu board. The GPIO adapter needs to be spawned which will then connect a session to this service.
Version:
2025-06-19
  • Method Details

    • createInputPin

      public GpioInputPin createInputPin(String name, int pin, boolean inverted, GpioInputPinListener listener)
      Create an input pin with the specified name for the local node. Allows the physical signal to be inverted to take advantage of the debouncing which is fast on, slow off.
      Parameters:
      name - the name of the pin bean
      pin - the pin number
      inverted - if true, invert the physical signal
      listener - listener for pin change events
    • createInputPin

      public GpioInputPin createInputPin(NodeId nodeId, String name, int pin, boolean inverted, GpioInputPinListener listener)
      Create an input pin with the specified name for the specified node. Allows the physical signal to be inverted to take advantage of the debouncing which is fast on, slow off.
      Parameters:
      name - the name of the pin bean
      pin - the pin number
      inverted - if true, invert the physical signal
      listener - listener for pin change events
    • createOutputPin

      public GpioOutputPin createOutputPin(int pin, boolean inverted, GpioOutputPinListener listener)
      Create an output pin for the specified pin number, on the local node.
      Parameters:
      pin - the pin number
      inverted - if true, invert the output signal
      listener - the output pin listener
    • createOutputPin

      public GpioOutputPin createOutputPin(NodeId nodeId, int pin, boolean inverted, GpioOutputPinListener listener)
      Create an output pin for the specified pin number, on the specified node.
      Parameters:
      pin - the pin number
      inverted - if true, invert the output signal
      listener - the output pin listener
    • addListener

      public void addListener(int pin, GpioListener listener)
      Add a listener for gpio events, on the local node.
      Parameters:
      pin - the pin to get events from
      listener - the listener to add
    • addListener

      public void addListener(NodeId nodeId, int pin, GpioListener listener)
      Add a listener for gpio events, on the specified node.
      Parameters:
      pin - the pin to get events from
      listener - the listener to add
    • getManifestService

      public ManifestService getManifestService()