Package com.pi4j.io.i2c
Interface I2CBus
-
- All Known Implementing Classes:
I2CBusImpl
public interface I2CBus
This is abstraction of i2c bus. This interface allows the bus to return i2c device.- Author:
- Daniel Sendula, refactored by RasPelikan
-
-
Field Summary
Fields Modifier and Type Field Description static int
BUS_0
static int
BUS_1
static int
BUS_10
static int
BUS_11
static int
BUS_12
static int
BUS_13
static int
BUS_14
static int
BUS_15
static int
BUS_16
static int
BUS_17
static int
BUS_2
static int
BUS_3
static int
BUS_4
static int
BUS_5
static int
BUS_6
static int
BUS_7
static int
BUS_8
static int
BUS_9
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes this bus.int
getBusNumber()
I2CDevice
getDevice(int address)
Returns i2c device.
-
-
-
Field Detail
-
BUS_0
static final int BUS_0
- See Also:
- Constant Field Values
-
BUS_1
static final int BUS_1
- See Also:
- Constant Field Values
-
BUS_2
static final int BUS_2
- See Also:
- Constant Field Values
-
BUS_3
static final int BUS_3
- See Also:
- Constant Field Values
-
BUS_4
static final int BUS_4
- See Also:
- Constant Field Values
-
BUS_5
static final int BUS_5
- See Also:
- Constant Field Values
-
BUS_6
static final int BUS_6
- See Also:
- Constant Field Values
-
BUS_7
static final int BUS_7
- See Also:
- Constant Field Values
-
BUS_8
static final int BUS_8
- See Also:
- Constant Field Values
-
BUS_9
static final int BUS_9
- See Also:
- Constant Field Values
-
BUS_10
static final int BUS_10
- See Also:
- Constant Field Values
-
BUS_11
static final int BUS_11
- See Also:
- Constant Field Values
-
BUS_12
static final int BUS_12
- See Also:
- Constant Field Values
-
BUS_13
static final int BUS_13
- See Also:
- Constant Field Values
-
BUS_14
static final int BUS_14
- See Also:
- Constant Field Values
-
BUS_15
static final int BUS_15
- See Also:
- Constant Field Values
-
BUS_16
static final int BUS_16
- See Also:
- Constant Field Values
-
BUS_17
static final int BUS_17
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDevice
I2CDevice getDevice(int address) throws IOException
Returns i2c device.- Parameters:
address
- i2c device's address (7-bit address only: 0-127)- Returns:
- i2c device
- Throws:
IOException
- thrown in case this bus cannot return i2c device.
-
getBusNumber
int getBusNumber()
- Returns:
- The bus' number
-
close
void close() throws IOException
Closes this bus. This usually means closing underlying file.- Throws:
IOException
- thrown in case there are problems closing this i2c bus.
-
-