Package crackers.kobots.devices.expander
Class I2CMultiplexer
-
- All Implemented Interfaces:
-
com.diozero.api.DeviceInterface
,java.lang.AutoCloseable
public final class I2CMultiplexer implements DeviceInterface
TCA9548A/PCA9548 I2C Multiplexer.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
DEFAULT_I2C_DEVICE
private final Integer
numberOfChannels
-
Constructor Summary
Constructors Constructor Description I2CMultiplexer(Integer numberOfChannels, I2CDevice i2cDevice)
-
Method Summary
Modifier and Type Method Description final Integer
getNumberOfChannels()
final I2CDeviceInterface
getI2CDevice(Integer channel, Integer deviceAddress)
Get the I2C device for the given channel and deviceAddress. Unit
close()
-
-
Constructor Detail
-
I2CMultiplexer
I2CMultiplexer(Integer numberOfChannels, I2CDevice i2cDevice)
-
-
Method Detail
-
getNumberOfChannels
final Integer getNumberOfChannels()
-
getI2CDevice
@Synchronized() final I2CDeviceInterface getI2CDevice(Integer channel, Integer deviceAddress)
Get the I2C device for the given channel and deviceAddress. Due to the way the multiplexer works, there may be timing issues with the underlying I2C bus, so additional error handling may be necessary.
-
-
-
-