Class I2CDevice.Builder

  • Enclosing class:
    I2CDevice

    public static class I2CDevice.Builder
    extends Object
    I2C device builder. Default values:
    • Constructor Detail

      • Builder

        protected Builder​(int address)
    • Method Detail

      • setFactory

        public I2CDevice.Builder setFactory​(I2CDeviceFactoryInterface factory)
        Set the I2C device factory to use for provisioning I2C device instances
        Parameters:
        factory - the I2C device factory to use for provisioning I2C device instances
        Returns:
        this builder instance
      • setController

        public I2CDevice.Builder setController​(int controller)
        Set the I2C bus controller
        Parameters:
        controller - the I2C bus controller number (/dev/i2c-<controller>)
        Returns:
        this builder instance
      • setAddress

        public I2CDevice.Builder setAddress​(int address)
        Set the I2c device address
        Parameters:
        address - the I2C device address
        Returns:
        this builder instance
      • setByteOrder

        public I2CDevice.Builder setByteOrder​(ByteOrder byteOrder)
        Set the Default byte order for this device
        Parameters:
        byteOrder - the byte order that is only used in the additional non-SMBus I2C device utility methods
        Returns:
        this builder instance
      • build

        public I2CDevice build()
        Construct a new I2CDevice instance
        Returns:
        a new I2C device