C# Class Emlid.WindowsIot.Hardware.Components.Ms5611.Ms5611Device

MS5611 barometric pressure and temperature sensor (hardware device), connected via I2C.
Inheritance: DisposableObject
Datei anzeigen Open project: emlid/Navio-SDK-Windows-IoT

Private Properties

Property Type Description
Ms5611Device System

Public Methods

Method Description
Reset ( ) : void

Resets the device, updates PROM data and clears current measurements

Update ( ) : void

Converts then calculates the Measurement.

Protected Methods

Method Description
Calculate ( int rawPressure, int rawTemperature ) : void

Calculates the Measurement by applying the Prom coefficients and other rules to the raw measurements.

ConvertPressure ( Ms5611Osr rate ) : int

Executes the Ms5611Command.ConvertD1Pressure command to measure pressure at the specified OSR, waits then returns the result.

ConvertTemperature ( Ms5611Osr rate ) : int

Executes the Ms5611Command.ConvertD2Temperature command to measure pressure at the specified OSR, waits then returns the result.

Dispose ( bool disposing ) : void

DisposableObject.Dispose(bool).

GetConvertDelay ( Ms5611Osr rate ) : int

Gets the time to wait in milliseconds for conversion with the specified OSR.

ReadProm ( ) : bool

Reads calibration data from PROM, validates and updates the PROM data.

Should only be executed after Reset to get accurate values.

ReadPromCoefficient ( int index, byte buffer, int offset ) : void

Reads a coefficient value from the PROM.

Reads Ms5611PromData.CoefficientSize bytes into the target buffer at the specified offset.

WaitForConversion ( Ms5611Osr rate ) : void

Waits for conversion at the specified OSR.

Private Methods

Method Description
Ms5611Device ( Windows.Devices.I2c.I2cDevice device, Ms5611Osr rate ) : System

Method Details

Calculate() protected method

Calculates the Measurement by applying the Prom coefficients and other rules to the raw measurements.
protected Calculate ( int rawPressure, int rawTemperature ) : void
rawPressure int
rawTemperature int
return void

ConvertPressure() protected method

Executes the Ms5611Command.ConvertD1Pressure command to measure pressure at the specified OSR, waits then returns the result.
protected ConvertPressure ( Ms5611Osr rate ) : int
rate Ms5611Osr
return int

ConvertTemperature() protected method

Executes the Ms5611Command.ConvertD2Temperature command to measure pressure at the specified OSR, waits then returns the result.
protected ConvertTemperature ( Ms5611Osr rate ) : int
rate Ms5611Osr
return int

Dispose() protected method

DisposableObject.Dispose(bool).
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetConvertDelay() protected method

Gets the time to wait in milliseconds for conversion with the specified OSR.
protected GetConvertDelay ( Ms5611Osr rate ) : int
rate Ms5611Osr Over-Sampling Rate for which to return the delay.
return int

ReadProm() protected method

Reads calibration data from PROM, validates and updates the PROM data.
Should only be executed after Reset to get accurate values.
protected ReadProm ( ) : bool
return bool

ReadPromCoefficient() protected method

Reads a coefficient value from the PROM.
Reads Ms5611PromData.CoefficientSize bytes into the target buffer at the specified offset.
protected ReadPromCoefficient ( int index, byte buffer, int offset ) : void
index int Coefficient index (0-7).
buffer byte Target buffer.
offset int Target offset.
return void

Reset() public method

Resets the device, updates PROM data and clears current measurements
public Reset ( ) : void
return void

Update() public method

Converts then calculates the Measurement.
public Update ( ) : void
return void

WaitForConversion() protected method

Waits for conversion at the specified OSR.
protected WaitForConversion ( Ms5611Osr rate ) : void
rate Ms5611Osr Over-Sampling Rate to wait for.
return void