Class Bmp280
A Bosch BMP280 pressure and temperature sensor. Every call goes straight to the pamoja C ABI, which decodes exactly what the manufacturer's datasheet specifies.
public static class Bmp280
- Inheritance
-
Bmp280
- Inherited Members
Methods
ConfigBits(PamojaBmp280Config)
Assembles a BMP280 config register value.
public static byte ConfigBits(PamojaBmp280Config config)
Parameters
configPamojaBmp280ConfigThe config.
Returns
- byte
The value the C ABI computes.
ConfigFromBits(byte)
Parses a BMP280 config register value.
public static PamojaBmp280Config ConfigFromBits(byte bits)
Parameters
bitsbyteThe bits.
Returns
- PamojaBmp280Config
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
CtrlMeasBits(PamojaBmp280CtrlMeas)
Assembles a BMP280 ctrl_meas register value.
public static byte CtrlMeasBits(PamojaBmp280CtrlMeas config)
Parameters
configPamojaBmp280CtrlMeasThe config.
Returns
- byte
The value the C ABI computes.
CtrlMeasFromBits(byte)
Parses a BMP280 ctrl_meas register value.
public static PamojaBmp280CtrlMeas CtrlMeasFromBits(byte bits)
Parameters
bitsbyteThe bits.
Returns
- PamojaBmp280CtrlMeas
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
ImageUpdating(byte)
Reports whether a BMP280 status byte says the calibration image is loading.
public static bool ImageUpdating(byte status)
Parameters
statusbyteThe status.
Returns
- bool
The value the C ABI computes.
MeasurementBytes(uint, uint)
Builds the six data bytes a BMP280 holding these codes would return.
public static byte[] MeasurementBytes(uint pressure, uint temperature)
Parameters
Returns
- byte[]
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
Measuring(byte)
Reports whether a BMP280 status byte says a conversion is running.
public static bool Measuring(byte status)
Parameters
statusbyteThe status.
Returns
- bool
The value the C ABI computes.
OversamplingFactor(byte)
Returns how many samples a BMP280 oversampling code averages.
public static byte OversamplingFactor(byte code)
Parameters
codebyteThe code.
Returns
- byte
The value the C ABI computes.
ParseMeasurement(ReadOnlySpan<byte>)
Unpacks the six data bytes a BMP280 burst read returns.
public static PamojaBmp280Measurement ParseMeasurement(ReadOnlySpan<byte> data)
Parameters
dataReadOnlySpan<byte>The data.
Returns
- PamojaBmp280Measurement
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
StandbyMicros(byte)
Returns the normal-mode standby period a BMP280 code selects.
public static uint StandbyMicros(byte code)
Parameters
codebyteThe code.
Returns
- uint
The value the C ABI computes.