/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal override void ReadFromDevice(Bmxx80Base bmxx80Base) { // Read temperature calibration data. DigT1 = bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_T1); DigT2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_T2); DigT3 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_T3); // Read humidity calibration data. DigH1 = (ushort)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H1_MSB) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H1_LSB) & 0b0000_1111)); DigH2 = (ushort)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H2_MSB) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H2_LSB) >> 4)); DigH3 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H3); DigH4 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H4); DigH5 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H5); DigH6 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H6); DigH7 = (sbyte)(bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H7)); // Read pressure calibration data. DigP1 = bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P1_LSB); DigP2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P2_LSB); DigP3 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P3); DigP4 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P4_LSB); DigP5 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P5_LSB); DigP6 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P6); DigP7 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P7); DigP8 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P8_LSB); DigP9 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P9_LSB); DigP10 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P10); }
/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal override void ReadFromDevice(Bmxx80Base bmxx80Base) { // Read humidity calibration data. DigH1 = bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H1); DigH2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme280Register.DIG_H2); DigH3 = bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H3); DigH4 = (short)((bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H4) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H4 + 1) & 0xF)); DigH5 = (short)((bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H5 + 1) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H5) >> 4)); DigH6 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme280Register.DIG_H6); base.ReadFromDevice(bmxx80Base); }
/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal override void ReadFromDevice(Bmxx80Base bmxx80Base) { // Read temperature calibration data DigT1 = bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_T1); DigT2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_T2); DigT3 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_T3); // Read pressure calibration data DigP1 = bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P1); DigP2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P2); DigP3 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P3); DigP4 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P4); DigP5 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P5); DigP6 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P6); DigP7 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P7); DigP8 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P8); DigP9 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bmx280Register.DIG_P9); }
/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal override void ReadFromDevice(Bmxx80Base bmxx80Base) { // Read temperature calibration data. DigT1 = bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_T1); DigT2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_T2); DigT3 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_T3); // Read humidity calibration data. DigH1 = (ushort)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H1_MSB) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H1_LSB) & (byte)Bme680Mask.BIT_H1_DATA_MSK)); DigH2 = (ushort)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H2_MSB) << 4) | (bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H2_LSB) >> 4)); DigH3 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H3); DigH4 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H4); DigH5 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H5); DigH6 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H6); DigH7 = (sbyte)(bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_H7)); // Read pressure calibration data. DigP1 = bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P1_LSB); DigP2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P2_LSB); DigP3 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P3); DigP4 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P4_LSB); DigP5 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P5_LSB); DigP6 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P6); DigP7 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P7); DigP8 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P8_LSB); DigP9 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_P9_LSB); DigP10 = bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_P10); // read gas calibration data. DigGh1 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_GH1); DigGh2 = (short)bmxx80Base.Read16BitsFromRegister((byte)Bme680Register.DIG_GH2); DigGh3 = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.DIG_GH3); // read heater calibration data ResHeatRange = (byte)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.RES_HEAT_RANGE) & (byte)Bme680Mask.RH_RANGE) >> 4); RangeSwErr = (sbyte)((bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.RANGE_SW_ERR) & (byte)Bme680Mask.RS_ERROR) >> 4); ResHeatVal = (sbyte)bmxx80Base.Read8BitsFromRegister((byte)Bme680Register.RES_HEAT_VAL); }
/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal virtual void ReadFromDevice(Bmxx80Base bmxx80Base) { }
/// <summary> /// Read coefficient data from device. /// </summary> /// <param name="bmxx80Base">The <see cref="Bmxx80Base"/> to read coefficient data from.</param> protected internal abstract void ReadFromDevice(Bmxx80Base bmxx80Base);