public class I2CBusImpl extends Object implements I2CBus
Modifier and Type | Field and Description |
---|---|
protected int |
fd
File handle for this i2c bus
|
protected String |
filename
File name of this i2c bus
|
Constructor and Description |
---|
I2CBusImpl(String filename)
Constructor of i2c bus implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this i2c bus
|
static I2CBus |
getBus(int busNumber)
Factory method that returns bus implementation.
|
I2CDevice |
getDevice(int address)
Returns i2c device implementation (
I2CDeviceImpl ). |
int |
getFileDescriptor() |
String |
getFileName() |
protected int fd
public I2CBusImpl(String filename) throws IOException
filename
- file name of device to be opened.IOException
- thrown in case that file cannot be openedpublic static I2CBus getBus(int busNumber) throws IOException
busNumber
- bus numberIOException
- thrown in case there is a problem opening bus file or bus number is not 0 or 1.public I2CDevice getDevice(int address) throws IOException
I2CDeviceImpl
).getDevice
in interface I2CBus
address
- address of i2c deviceIOException
- never in this implementationpublic void close() throws IOException
close
in interface I2CBus
IOException
- never in this implementationpublic String getFileName()
getFileName
in interface I2CBus
public int getFileDescriptor()
getFileDescriptor
in interface I2CBus
Copyright © 2012–2019 Pi4J. All rights reserved.