- java.lang.Object
-
- com.pi4j.plugin.linuxfs.provider.i2c.LinuxFsI2CBus
-
public class LinuxFsI2CBus extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_LOCK_ACQUIRE_TIMEOUTstatic TimeUnitDEFAULT_LOCK_ACQUIRE_TIMEOUT_UNITSprotected LinuxFilefileFile handle for this i2c busprotected longlockAquireTimeoutprotected TimeUnitlockAquireTimeoutUnitprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description LinuxFsI2CBus(I2CConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Rexecute(I2C i2c, CheckedFunction<LinuxFile,R> action)protected voidselectBusSlave(I2C i2c)Selects the slave device if not already selected on this bus.
-
-
-
Field Detail
-
DEFAULT_LOCK_ACQUIRE_TIMEOUT
public static final long DEFAULT_LOCK_ACQUIRE_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_LOCK_ACQUIRE_TIMEOUT_UNITS
public static final TimeUnit DEFAULT_LOCK_ACQUIRE_TIMEOUT_UNITS
-
logger
protected org.slf4j.Logger logger
-
file
protected LinuxFile file
File handle for this i2c bus
-
lockAquireTimeout
protected long lockAquireTimeout
-
lockAquireTimeoutUnit
protected TimeUnit lockAquireTimeoutUnit
-
-
Constructor Detail
-
LinuxFsI2CBus
public LinuxFsI2CBus(I2CConfig config)
-
-
Method Detail
-
selectBusSlave
protected void selectBusSlave(I2C i2c) throws IOException
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
-
execute
public <R> R execute(I2C i2c, CheckedFunction<LinuxFile,R> action)
-
-