java.lang.Object
com.pi4j.plugin.linuxfs.provider.i2c.LinuxFsI2CBus
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
<R> R
execute
(I2C i2c, CheckedFunction<LinuxFile, R> action) int
executeIOCTL
(I2C i2c, long command, ByteBuffer data, IntBuffer offsets) protected void
selectBusSlave
(I2C i2c) Selects the slave device if not already selected on this bus.
-
Field Details
-
DEFAULT_LOCK_ACQUIRE_TIMEOUT
public static final long DEFAULT_LOCK_ACQUIRE_TIMEOUT- See Also:
-
DEFAULT_LOCK_ACQUIRE_TIMEOUT_UNITS
-
logger
protected org.slf4j.Logger logger -
file
File handle for this i2c bus -
lockAquireTimeout
protected long lockAquireTimeout -
lockAquireTimeoutUnit
-
-
Constructor Details
-
LinuxFsI2CBus
-
-
Method Details
-
selectBusSlave
Selects the slave device if not already selected on this bus. Runs the required ioctl's via JNI.- Parameters:
i2c
- Device to select- Throws:
IOException
-
executeIOCTL
- Parameters:
i2c
-command
- From I2CConstantsdata
- values in bytes for all structures, with 4 or 8 byte alignment enforced by filling holes before pointersoffsets
- ByteBuffer: offsets of pointer/ byte offset of pointedToData- Returns:
- 0 if success, else -1
-
execute
-
close
public void close()
-