public interface I2C extends MetaWearController.ModuleController
Modifier and Type | Interface and Description |
---|---|
static class |
I2C.Callbacks
Callbacks for the I2C module
|
static class |
I2C.Register
Enumeration of registers for the I2C module
|
Modifier and Type | Method and Description |
---|---|
void |
readData(byte deviceAddr,
byte registerAddr,
byte numBytes)
Read data via the I2C bus without a user id identifying the read data.
|
void |
readData(byte deviceAddr,
byte registerAddr,
byte index,
byte numBytes)
Read data via the I2C bus.
|
void |
writeData(byte deviceAddr,
byte registerAddr,
byte[] data)
Write data via the I2C bus without attaching a user id to the data.
|
void |
writeData(byte deviceAddr,
byte registerAddr,
byte index,
byte[] data)
Write data via the I2C bus
|
void writeData(byte deviceAddr, byte registerAddr, byte index, byte[] data)
deviceAddr
- Device to write toregisterAddr
- Device's register to write toindex
- User defined index identifying the datadata
- Data to write, up to 10 bytesvoid writeData(byte deviceAddr, byte registerAddr, byte[] data)
deviceAddr
- Device to write toregisterAddr
- Device's register to write todata
- Data to write, up to 10 bytesvoid readData(byte deviceAddr, byte registerAddr, byte index, byte numBytes)
I2C.Callbacks.receivedI2CData(byte, byte[])
callback functiondeviceAddr
- Device to read fromregisterAddr
- Device's register to readindex
- User defined index identifying the datanumBytes
- Number of bytes to readvoid readData(byte deviceAddr, byte registerAddr, byte numBytes)
I2C.Callbacks.receivedI2CData(byte, byte[])
callback function with a user id of 0xffdeviceAddr
- Device to read fromregisterAddr
- Device's register to readnumBytes
- Number of bytes to read