public void SetStandbyTime(StandbyTime time) { byte[][] expected = { new byte[] { 0x12, 0x03, 0x2c, BarometerBoschTest.STANDBY_BITMASK[(int)time] } }; barometer.Configure(time: time); Assert.That(platform.GetCommands(), Is.EqualTo(expected)); }
/// <summary> /// Sets the standby time mode the device will used when operating in normal mode. /// </summary> /// <param name="standbyTime"></param> public void SetStandbyTime(StandbyTime standbyTime) { byte current = Read8BitsFromRegister((byte)Register.CONFIG); current = (byte)((current & 0b0001_1111) | (byte)standbyTime << 5); _i2cDevice.Write(new[] { (byte)Register.CONFIG, current }); }
public void Configure(Oversampling os = Oversampling.Standard, IirFilerCoeff coeff = IirFilerCoeff._0, StandbyTime time = StandbyTime._0_5ms) { var tempOversampling = (byte)((os == Oversampling.UltraHigh) ? 2 : 1); bridge.sendCommand(new byte[] { (byte)BAROMETER, CONFIG, (byte)(((byte)os << 2) | (tempOversampling << 5)), (byte)(((byte)coeff << 2) | ((byte)time << 5)) }); }
public static extern void SetStandbyTime(IntPtr config, StandbyTime time);
public static extern void SetStandbyTime(IntPtr config, StandbyTime time);