private void CheckDev(byte Address) { if (this.DeviceIDs[Address] < 1) { this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address); } }
public void Write(byte Address, byte[] Data) { if (this.DeviceIDs[Address] < 1) { this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address); } foreach (byte Byte in Data) { RaspberryPi.I2CWrite(this.DeviceIDs[Address], Byte); } }
public byte[] Read(byte Address, int DataLength) { if (this.DeviceIDs[Address] < 1) { this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address); } byte[] Buffer = new byte[DataLength]; for (int i = 0; i < DataLength; i++) { Buffer[i] = RaspberryPi.I2CRead(this.DeviceIDs[Address]); } return(Buffer); }