public static void SetBits(this I2CDevice device, I2CDevice.Configuration config, int timeout, byte register, byte bitstart, byte length, byte value) { if (!device.TrySetBits(config, timeout, register, bitstart, length, value)) { throw new Exception(); } }