2020-02-02 13:10:39 +00:00
|
|
|
|
// Licensed to the .NET Foundation under one or more agreements.
|
|
|
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
2020-08-01 15:22:38 +00:00
|
|
|
|
using NucuCar.Sensors.Modules.Environment.Bmxx80.Register;
|
2020-02-02 13:10:39 +00:00
|
|
|
|
|
2020-08-01 15:22:38 +00:00
|
|
|
|
namespace NucuCar.Sensors.Modules.Environment.Bmxx80.CalibrationData
|
2020-02-02 13:10:39 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Calibration data for the BMP280.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class Bmp280CalibrationData : Bmxx80CalibrationData
|
|
|
|
|
{
|
|
|
|
|
/// <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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|