Class LinuxFsI2CBus

java.lang.Object
com.pi4j.io.i2c.I2CBusBase
com.pi4j.plugin.linuxfs.provider.i2c.LinuxFsI2CBus
All Implemented Interfaces:
I2CBus

public class LinuxFsI2CBus extends I2CBusBase
  • Field Details

    • logger

      protected org.slf4j.Logger logger
    • file

      protected LinuxFile file
      File handle for this i2c bus
  • Constructor Details

    • LinuxFsI2CBus

      public LinuxFsI2CBus(I2CConfig config)
  • Method Details

    • execute

      public <R> R execute(I2C i2c, Callable<R> action)
    • execute

      public <R> R execute(I2C i2c, CheckedFunction<LinuxFile,R> action)
    • executeIOCTL

      public void executeIOCTL(I2C i2c, long command, ByteBuffer data, IntBuffer offsets)
      Parameters:
      i2c - the device to select before performing the ioctl command
      command - From I2CConstants
      data - values in bytes for all structures, with 4 or 8 byte alignment enforced by filling holes before pointers
      offsets - ByteBuffer: offsets of pointer/ byte offset of pointedToData
    • selectBusSlave

      protected void selectBusSlave(I2C i2c) throws IOException
      Selects the slave device if not already selected on this bus. Runs the required ioctl's via JNI.
      Parameters:
      i2c - Device to select
      Throws:
      IOException
    • close

      public void close()