Class GpioPin

java.lang.Object
com.kosdev.kos.core.service.gpio.GpioPin
Direct Known Subclasses:
GpioInputPin, GpioOutputPin

public class GpioPin extends Object
Base class fir GPIO pins.
Since:
9
Version:
9
  • Constructor Details

    • GpioPin

      public GpioPin()
  • Method Details

    • getPinBinding

      public GpioPinBinding getPinBinding()
      Return the pin binding provided at the time the pin was created. This is used to bind the software pin to an actual physical pin on the device when it comes online.
      Since:
      9
    • getChipNum

      public int getChipNum()
      Return the resolved chip number. This will be -1 until the chip is bound to real hardware. If the definition specifies a name that doesn't match any chip, or a chip number that doesn't actually exist, this will remain -1 . This can be useful for debugging chip / pin mappings.
      Returns:
      the GPIO chip number
    • getPinNum

      public int getPinNum()
      Return the resolved pin number on the specified chip. This will be -1 until the chip is bound to real hardware and the pin number is verified. If the definition specifies a name that doesn't match any pin, or a pin number that doesn't actually exist, this will remain -1 . This can be useful for debugging chip / pin mappings.
      Returns:
      the GPIO pin number
      Since:
      9
    • isConnected

      public boolean isConnected()
      Return true if the pin connected to hardware. This means the hardware is online and the pin definition matches the hardware. It is possible for the pin to disconnect if the remote node the pin is on reboots, or the adapter restarts.
      Returns:
      true if the pin is connected to hardware
      Since:
      9