Module com.pi4j

Interface I2CBus

All Known Implementing Classes:
I2CBusBase

public interface I2CBus
This interface defines method to be performed on an I2C bus. Most importantly the execute(I2C, Callable) allows to perform bulk operations on the bus in a thread safe manner.
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> R
    execute(I2C i2c, Callable<R> action)
    Executes the given action, which typically performs multiple I2C reads and/or writes on the I2C bus in a thread safe manner, i.e.
  • Method Details

    • execute

      <R> R execute(I2C i2c, Callable<R> action)
      Executes the given action, which typically performs multiple I2C reads and/or writes on the I2C bus in a thread safe manner, i.e. the bus is blocked till the action is completed.
      Type Parameters:
      R - the result type of the action, if any
      Parameters:
      i2c - the device for which to perform the action
      action - the action to perform
      Returns:
      the result of the action