Class Bmp280Calibration
A BMP280's factory calibration, read once out of the registers and reused for every measurement, since the compensation the datasheet specifies needs it.
public sealed class Bmp280Calibration : IDisposable
- Inheritance
-
Bmp280Calibration
- Implements
- Inherited Members
Constructors
Bmp280Calibration(ReadOnlySpan<byte>)
Builds a calibration from the bytes read out of the registers.
public Bmp280Calibration(ReadOnlySpan<byte> bytes)
Parameters
bytesReadOnlySpan<byte>The 24-byte coefficient block from 0x88.
Exceptions
- PamojaException
The block is the wrong length.
Methods
Coefficients()
Reads the individual coefficients the compensation is computed from.
public PamojaBmp280Coefficients Coefficients()
Returns
- PamojaBmp280Coefficients
The coefficients as the datasheet names them.
Exceptions
- PamojaException
The calibration has been disposed.
Compensate(ReadOnlySpan<byte>)
Turns a six-byte burst read into a compensated reading.
public Bmp280Reading Compensate(ReadOnlySpan<byte> measurement)
Parameters
measurementReadOnlySpan<byte>The six measurement registers from 0xF7.
Returns
- Bmp280Reading
The compensated reading.
Exceptions
- PamojaException
The measurement is not six bytes.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
ToBytes()
Rebuilds the register bytes the coefficients were read from.
public byte[] ToBytes()
Returns
- byte[]
The 24 coefficient bytes in register order.
Exceptions
- PamojaException
The calibration has been disposed.