public byte ReadByte(byte page, byte readAddress) { lock (ReadWriteLock) { SetPage((byte)page); return(I2C.I2C_RandomRead(Qsfp100GRegister.I2CAddress, readAddress)); } }
public byte[] Read(byte page, byte readAddress, byte numBytes) { var readData = new byte[numBytes]; lock (ReadWriteLock) { SetPage((byte)page); I2C.I2C_RandomRead(Qsfp100GRegister.I2CAddress, readAddress, numBytes, ref readData); } return(readData); }
public ushort ReadWord(byte page, byte readAddress) { var readData = new byte[2]; lock (ReadWriteLock) { SetPage((byte)page); I2C.I2C_RandomRead(Qsfp100GRegister.I2CAddress, readAddress, 2, ref readData); } return(BitConverter.ToUInt16(new byte[2] { readData[1], readData[0] }, 0)); }