private bool ReadEEPROM(ref BCamCalibration calibration) { this.camRegisters.registers[129] |= (byte)1; if (!this.SendRegisters()) { return(false); } if (this.USB3) { Thread.Sleep(20); } else { Thread.Sleep(100); } this.camRegisters.registerTemp = Enumerable.Repeat <byte>((byte)0, 256).ToArray <byte>(); int len = ((IEnumerable <byte>) this.camRegisters.registerTemp).Count <byte>(); if (this.InEndpt.XferData(ref this.camRegisters.registerTemp, ref len)) { this.camRegisters.registers[129] &= (byte)253; } this.camRegisters.registers[129] &= (byte)254; if (!this.SendRegisters()) { return(false); } calibration.Read(this.camRegisters.registerTemp); for (int index = 148; index < 224; ++index) { this.camRegisters.registers[index] = this.camRegisters.registerTemp[index]; } return(true); }
internal void SendCalibration(ref BCamCalibration calibration) { this.camRegisters.registerTemp = Enumerable.Repeat <byte>((byte)0, 256).ToArray <byte>(); calibration.Write(this.camRegisters.registerTemp); for (int index = 216; index <= (int)byte.MaxValue; ++index) { this.camRegisters.registers[index] = this.camRegisters.registerTemp[index]; } this.SendRegisters(); }
internal bool ReadCalibration(ref BCamCalibration calibration) { if (!this.SendRegisters()) { return(false); } this.camRegisters.registers[129] &= (byte)254; this.camRegisters.registers[128] = (byte)0; if (!this.SendRegisters()) { return(false); } this.camRegisters.registerTemp = Enumerable.Repeat <byte>((byte)0, 256).ToArray <byte>(); this.ReadEEPROM(ref calibration); return(true); }
internal void Set10BitDepthRegisters(ref BCamCalibration calibration) { this.registers[72] = (byte)0; this.registers[80] = byte.MaxValue; this.registers[81] = byte.MaxValue; this.registers[98] = calibration.lpszRegister98_10; this.registers[99] = calibration.lpszRegister99_10; this.registers[100] = calibration.lpszRegister100_10; this.registers[101] = calibration.lpszRegister101_10; this.registers[102] = calibration.lpszRegister102_10; this.registers[121] = calibration.lpszRegister121_10; this.registers[103] = calibration.lpszRegister103_10; this.registers[111] = (byte)1; this.registers[112] = (byte)0; this.registers[116] = (byte)41; this.registers[117] = (byte)8; this.registers[129] = (byte)8; }
internal void Set12BitDepthRegisters(ref BCamCalibration calibration) { this.registers[72] = (byte)2; this.registers[80] = (byte)34; this.registers[81] = (byte)34; this.registers[98] = calibration.lpszRegister98_12; this.registers[99] = calibration.lpszRegister99_12; this.registers[100] = calibration.lpszRegister100_12; this.registers[101] = calibration.lpszRegister101_12; this.registers[102] = calibration.lpszRegister102_12; this.registers[103] = calibration.lpszRegister103_12; this.registers[121] = calibration.lpszRegister121_12; this.registers[111] = (byte)0; this.registers[112] = (byte)2; this.registers[116] = (byte)43; this.registers[117] = (byte)4; this.registers[129] = (byte)0; }