Class SysFsI2CDevice
java.lang.Object
com.diozero.internal.provider.AbstractDevice
com.diozero.internal.provider.sysfs.SysFsI2CDevice
- All Implemented Interfaces:
DeviceInterface
,I2CDeviceInterface
,java.io.Closeable
,java.lang.AutoCloseable
public class SysFsI2CDevice extends AbstractDevice implements I2CDeviceInterface
-
Constructor Summary
Constructors Constructor Description SysFsI2CDevice(DeviceFactoryInterface deviceFactory, java.lang.String key, int controller, int address, int addressSize, int frequency)
-
Method Summary
Modifier and Type Method Description protected void
closeDevice()
boolean
probe(I2CDevice.ProbeMode mode)
void
read(java.nio.ByteBuffer dst)
byte
readByte()
byte
readByteData(int register)
void
readI2CBlockData(int register, int subAddressSize, java.nio.ByteBuffer dst)
void
write(java.nio.ByteBuffer src)
void
writeByte(byte b)
void
writeByteData(int register, byte b)
void
writeI2CBlockData(int register, int subAddressSize, java.nio.ByteBuffer src)
Methods inherited from class com.diozero.internal.provider.AbstractDevice
close, getDeviceFactory, getKey, isOpen
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.diozero.internal.provider.DeviceInterface
close, getKey, isOpen
-
Constructor Details
-
SysFsI2CDevice
public SysFsI2CDevice(DeviceFactoryInterface deviceFactory, java.lang.String key, int controller, int address, int addressSize, int frequency)
-
-
Method Details
-
probe
- Specified by:
probe
in interfaceI2CDeviceInterface
-
readByte
- Specified by:
readByte
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
writeByte
- Specified by:
writeByte
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
read
- Specified by:
read
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
write
- Specified by:
write
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
readByteData
- Specified by:
readByteData
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
writeByteData
- Specified by:
writeByteData
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
readI2CBlockData
public void readI2CBlockData(int register, int subAddressSize, java.nio.ByteBuffer dst) throws RuntimeIOException- Specified by:
readI2CBlockData
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
writeI2CBlockData
public void writeI2CBlockData(int register, int subAddressSize, java.nio.ByteBuffer src) throws RuntimeIOException- Specified by:
writeI2CBlockData
in interfaceI2CDeviceInterface
- Throws:
RuntimeIOException
-
closeDevice
- Specified by:
closeDevice
in classAbstractDevice
- Throws:
RuntimeIOException
-