Class GpioDevice

java.lang.Object
com.diozero.api.GpioDevice
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable
Direct Known Subclasses:
DigitalOutputDevice, GpioInputDevice, PwmOutputDevice, Servo

public abstract class GpioDevice
extends java.lang.Object
implements java.io.Closeable
Abstract base class for all GPIO related devices.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int gpio  
  • Constructor Summary

    Constructors 
    Constructor Description
    GpioDevice​(int gpio)  
  • Method Summary

    Modifier and Type Method Description
    int getGpio()
    Get the GPIO for this device.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.io.Closeable

    close
  • Field Details

    • gpio

      protected int gpio
  • Constructor Details

    • GpioDevice

      public GpioDevice​(int gpio)
      Parameters:
      gpio - GPIO to which the device is connected.
  • Method Details

    • getGpio

      public int getGpio()
      Get the GPIO for this device.
      Returns:
      GPIO for this device.