i2cMsgFlags2Int static method

int i2cMsgFlags2Int(
  1. I2CmsgFlags flag
)

Converts I2CmsgFlags to the native bit mask value.

Implementation

static int i2cMsgFlags2Int(I2CmsgFlags flag) {
  switch (flag) {
    case I2CmsgFlags.i2c_m_ten:
      return 0x0010;
    case I2CmsgFlags.i2c_m_rd:
      return 0x0001;
    case I2CmsgFlags.i2c_m_stop:
      return 0x8000;
    case I2CmsgFlags.i2c_m_nostart:
      return 0x4000;
    case I2CmsgFlags.i2c_m_rev_dir_addr:
      return 0x2000;
    case I2CmsgFlags.i2c_m_ignore_nak:
      return 0x1000;
    case I2CmsgFlags.i2c_m_no_rd_ack:
      return 0x0800;
    case I2CmsgFlags.i2c_m_recv_len:
      return 0x0400;
  }
}