Module com.pi4j

Class I2CBase

All Implemented Interfaces:
Describable, Identity, Lifecycle, Extension, I2C, I2CRegisterDataReader, I2CRegisterDataReaderWriter, I2CRegisterDataWriter, IO<I2C,I2CConfig,I2CProvider>, IODataReader, IODataWriter, AutoCloseable, Readable

public abstract class I2CBase extends IOBase<I2C,I2CConfig,I2CProvider> implements I2C

Abstract I2CBase class.

Version:
$Id: $Id
Author:
Robert Savage (http://www.savagehomeautomation.com)
  • Field Details

    • isOpen

      protected boolean isOpen
  • Constructor Details

  • Method Details

    • isOpen

      public boolean isOpen()
      I2C Device Communication State is OPEN
      Specified by:
      isOpen in interface I2C
      Returns:
      The I2C device communication state
    • close

      public void close()

      close.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface I2C
    • getRegister

      public I2CRegister getRegister(int address)
      Get an encapsulated interface for reading and writing to a specific I2C device register Get an encapsulated interface for reading and writing to a specific I2C device register
      Specified by:
      getRegister in interface I2C
      Parameters:
      address - a int.
      Returns:
      a I2CRegister object.
    • shutdown

      public I2C shutdown(Context context) throws ShutdownException

      shutdown.

      Specified by:
      shutdown in interface Lifecycle
      Overrides:
      shutdown in class IOBase<I2C,I2CConfig,I2CProvider>
      Parameters:
      context - a Context object.
      Returns:
      a T object.
      Throws:
      ShutdownException - if an error occurs during shutdown.