Пример #1
0
 public byte ReadByte(byte page, byte readAddress)
 {
     lock (ReadWriteLock)
     {
         SetPage((byte)page);
         return(I2C.I2C_RandomRead(Qsfp100GRegister.I2CAddress, readAddress));
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        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));
        }