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