Class BoardHardware

java.lang.Object
com.codename1.hardware.Hardware
com.codename1.impl.KernelHardware
com.codename1.backend.BoardHardware

public final class BoardHardware extends com.codename1.impl.KernelHardware
The headless backend's Hardware: the same kernel interfaces as the Linux port, through the same C (cn1_hardware_impl.h, wrapped in cn1_backend_hardware.c). A gateway or sensor hub serves its REST API and drives its buses from one binary. Listener callbacks run on the pin's own watcher thread, since a server has no event dispatch thread. Built for a host other than Linux every primitive answers -ENOSYS.
  • Method Details

    • install

      public static void install()
      Makes this the instance Hardware.getInstance() returns. The server calls it as it starts; calling it again does nothing.
    • rawList

      protected String rawList(int kind)
      Description copied from class: com.codename1.impl.KernelHardware
      kind: 0 GPIO chips, 1 I2C buses, 2 SPI devices, 3 serial ports, 4 CAN interfaces. Names separated by newlines.
      Specified by:
      rawList in class com.codename1.impl.KernelHardware
    • rawBacklight

      protected int rawBacklight(int op, int value)
      Description copied from class: com.codename1.impl.KernelHardware
      op: 0 read, 1 maximum, 2 write value.
      Specified by:
      rawBacklight in class com.codename1.impl.KernelHardware
    • rawGpioOpen

      protected int rawGpioOpen(String chip, int line, boolean output, boolean high, int bias, int edges)
      Specified by:
      rawGpioOpen in class com.codename1.impl.KernelHardware
    • rawGpioRead

      protected int rawGpioRead(int handle)
      Specified by:
      rawGpioRead in class com.codename1.impl.KernelHardware
    • rawGpioWrite

      protected int rawGpioWrite(int handle, boolean high)
      Specified by:
      rawGpioWrite in class com.codename1.impl.KernelHardware
    • rawGpioWaitEdge

      protected int rawGpioWaitEdge(int handle, int timeoutMs, long[] timestampOut)
      Specified by:
      rawGpioWaitEdge in class com.codename1.impl.KernelHardware
    • rawI2cOpen

      protected int rawI2cOpen(int bus, int address)
      Specified by:
      rawI2cOpen in class com.codename1.impl.KernelHardware
    • rawI2cTransfer

      protected int rawI2cTransfer(int handle, byte[] write, int writeLen, byte[] read, int readLen)
      Specified by:
      rawI2cTransfer in class com.codename1.impl.KernelHardware
    • rawSpiOpen

      protected int rawSpiOpen(int bus, int chipSelect, int mode, int speedHz, int bitsPerWord)
      Specified by:
      rawSpiOpen in class com.codename1.impl.KernelHardware
    • rawSpiTransfer

      protected int rawSpiTransfer(int handle, byte[] tx, byte[] rx, int len)
      Specified by:
      rawSpiTransfer in class com.codename1.impl.KernelHardware
    • rawSerialOpen

      protected int rawSerialOpen(String device, int baud, int dataBits, int parity, int stopBits)
      Specified by:
      rawSerialOpen in class com.codename1.impl.KernelHardware
    • rawSerialRead

      protected int rawSerialRead(int handle, byte[] buf, int off, int len, int timeoutMs)
      Specified by:
      rawSerialRead in class com.codename1.impl.KernelHardware
    • rawSerialWrite

      protected int rawSerialWrite(int handle, byte[] buf, int off, int len)
      Specified by:
      rawSerialWrite in class com.codename1.impl.KernelHardware
    • rawPwmOpen

      protected int rawPwmOpen(int chip, int channel)
      Specified by:
      rawPwmOpen in class com.codename1.impl.KernelHardware
    • rawPwmConfigure

      protected int rawPwmConfigure(int handle, long periodNanos, long dutyNanos, boolean enabled)
      Specified by:
      rawPwmConfigure in class com.codename1.impl.KernelHardware
    • rawCanOpen

      protected int rawCanOpen(String iface)
      Specified by:
      rawCanOpen in class com.codename1.impl.KernelHardware
    • rawCanSend

      protected int rawCanSend(int handle, int id, boolean extended, byte[] data, int len)
      Specified by:
      rawCanSend in class com.codename1.impl.KernelHardware
    • rawCanReceive

      protected int rawCanReceive(int handle, int[] idOut, byte[] data, int timeoutMs)
      Specified by:
      rawCanReceive in class com.codename1.impl.KernelHardware
    • rawWatchdogOpen

      protected int rawWatchdogOpen(int timeoutSeconds)
      Specified by:
      rawWatchdogOpen in class com.codename1.impl.KernelHardware
    • rawWatchdogKick

      protected int rawWatchdogKick(int handle)
      Specified by:
      rawWatchdogKick in class com.codename1.impl.KernelHardware
    • rawClose

      protected void rawClose(int handle, boolean disarm)
      Specified by:
      rawClose in class com.codename1.impl.KernelHardware