Class Bmx280Base
Represents the core functionality of the Bmx280 family.
[Interface("Represents the core functionality of the Bmx280 family.")]
public abstract class Bmx280Base : Bmxx80Base
- Inheritance
-
Bmx280Base
- Derived
- Inherited Members
Constructors
Bmx280Base(byte, I2cDevice)
Initializes a new instance of the Bmx280Base class.
protected Bmx280Base(byte deviceId, I2cDevice i2cDevice)
Parameters
Fields
DefaultI2cAddress
Default I2C bus address.
public const byte DefaultI2cAddress = 119
Field Value
OsToMeasCycles
Converts oversampling to needed measurement cycles for that oversampling.
protected static readonly int[] OsToMeasCycles
Field Value
- int[]
SecondaryI2cAddress
Secondary I2C bus address.
public const byte SecondaryI2cAddress = 118
Field Value
Properties
FilterMode
Gets or sets the IIR filter mode.
[Property]
public Bmx280FilteringMode FilterMode { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Thrown when the Bmx280FilteringMode is set to an undefined mode.
StandbyTime
Gets or sets the standby time between two consecutive measurements.
[Property]
public StandbyTime StandbyTime { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Thrown when the StandbyTime is set to an undefined mode.
Methods
GetMeasurementDuration()
Gets the required time in ms to perform a measurement with the current sampling modes.
[Property("MeasurementDuration")]
public virtual int GetMeasurementDuration()
Returns
- int
The time it takes for the chip to read data in milliseconds rounded up.
ReadPowerMode()
Read the Bmx280PowerMode state.
[Property("PowerMode")]
public Bmx280PowerMode ReadPowerMode()
Returns
- Bmx280PowerMode
The current Bmx280PowerMode.
Exceptions
- NotImplementedException
Thrown when the power mode does not match a defined mode in Bmx280PowerMode.
ReadStatus()
Get the current status of the device.
[Telemetry("Status")]
public DeviceStatus ReadStatus()
Returns
- DeviceStatus
The DeviceStatus.
SetDefaultConfiguration()
Sets the default configuration for the sensor.
[Command]
protected override void SetDefaultConfiguration()
SetPowerMode(Bmx280PowerMode)
Sets the power mode to the given mode.
[Property("PowerMode")]
public void SetPowerMode(Bmx280PowerMode powerMode)
Parameters
powerMode
Bmx280PowerModeThe Bmx280PowerMode to set.
TryReadAltitude(out Length)
Calculates the altitude in meters from the mean sea-level pressure.
public bool TryReadAltitude(out Length altitude)
Parameters
altitude
LengthContains the calculated metres above sea-level if the PressureSampling was not set to Skipped. Contains NaN otherwise.
Returns
- bool
if pressure measurement was not skipped, otherwisetrue
.false
TryReadAltitude(Pressure, out Length)
Calculates the altitude in meters from the specified sea-level pressure(in hPa).
public bool TryReadAltitude(Pressure seaLevelPressure, out Length altitude)
Parameters
seaLevelPressure
PressureSea-level pressure.
altitude
LengthContains the calculated metres above sea-level if the PressureSampling was not set to Skipped. Contains NaN otherwise.
Returns
- bool
if pressure measurement was not skipped, otherwisetrue
.false
TryReadPressure(out Pressure)
Reads the pressure. A return value indicates whether the reading succeeded.
[Telemetry("Pressure")]
public override bool TryReadPressure(out Pressure pressure)
Parameters
pressure
PressureContains the measured pressure in Pa if the PressureSampling was not set to Skipped. Contains NaN otherwise.
Returns
- bool
if measurement was not skipped, otherwisetrue
.false
TryReadPressureCore(out Pressure, bool)
Performs a pressure reading.
protected bool TryReadPressureCore(out Pressure pressure, bool skipTempFineRead = false)
Parameters
Returns
- bool
True if the reading was sucesfully performed.
TryReadTemperature(out Temperature)
Reads the temperature. A return value indicates whether the reading succeeded.
[Telemetry("Temperature")]
public override bool TryReadTemperature(out Temperature temperature)
Parameters
temperature
TemperatureContains the measured temperature if the TemperatureSampling was not set to Skipped. Contains NaN otherwise.
Returns
- bool
if measurement was not skipped, otherwisetrue
.false
TryReadTemperatureCore(out Temperature)
Performs a temperature reading.
protected bool TryReadTemperatureCore(out Temperature temperature)
Parameters
temperature
TemperatureCurrent temperature reading.
Returns
- bool
True if reading was sucesfully performed.