writeBytesReg method

void writeBytesReg(
  1. int address,
  2. int register,
  3. List<int> byteData, [
  4. BitOrder order = BitOrder.msbLast,
  5. RegisterWidth width = RegisterWidth.bits8,
])

Writes byteData to the register of the I2C device with the address The optional register parameters bit order/width enables 16-bit registers.

The bit order depends on the I2C device.

Implementation

void writeBytesReg(int address, int register, List<int> byteData,
    [BitOrder order = BitOrder.msbLast,
    RegisterWidth width = RegisterWidth.bits8]) {
  var data = <I2Cmsg>[];
  var bData = <int>[];
  bData.addAll(_adjustRegister(register, order, width));
  bData.addAll(byteData);
  data.add(I2Cmsg.buffer(address, [], bData));
  var result = transfer(data);
  result.dispose();
}