Table of Contents

Class Bmp280

Namespace
Pamoja.Sensors
Assembly
Pamoja.Sensors.dll

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

config PamojaBmp280Config

The config.

Returns

byte

The value the C ABI computes.

ConfigFromBits(byte)

Parses a BMP280 config register value.

public static PamojaBmp280Config ConfigFromBits(byte bits)

Parameters

bits byte

The 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

config PamojaBmp280CtrlMeas

The 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

bits byte

The 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

status byte

The 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

pressure uint

The pressure.

temperature uint

The temperature.

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

status byte

The 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

code byte

The 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

data ReadOnlySpan<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

code byte

The code.

Returns

uint

The value the C ABI computes.