Embedded Artistry C Interfaces
A reference collection of abstract interfaces in C.
Public Attributes | List of all members
BarometricAltimeter Struct Reference

Virtual Barometric Altimeter Sensor Interface. More...

#include <barometric_altimeter.h>

Public Attributes

bool(* readAltitude )(int32_t *const altitude)
 Get the current altitude, corrected for SLP. More...
 
void(* setSeaLevelPressure )(const uint32_t slp)
 Set the sea level pressure. More...
 

Detailed Description

Virtual Barometric Altimeter Sensor Interface.

A standard interface for a device which can compute altitude by measuring barometric pressure. This virtual device provides both pressure and altitude measurements.

Fundamental Assumptions

Implementation Notes

Definition at line 49 of file barometric_altimeter.h.

Member Data Documentation

◆ readAltitude

bool(* BarometricAltimeter::readAltitude) (int32_t *const altitude)

Get the current altitude, corrected for SLP.

If no value for SLP has been supplied, calculations will assume 1013.25 hPa.

Precondition
The altimeter has been properly initialized by the system.
The altitude parameter is not NULL.
Postcondition
If the measurement is valid, the data pointed to by the altitude parameter will be updated with the latest reading.
If the measurement is invalid, the data pointed to by the altitude parameter will remain unchanged.
Parameters
[in,out]Currentaltitude in meters (m), corrected for sea level pressure. Altitude is specified as a signed 32-bit fixed-point number in format Q21.10.
Returns
True if the sample is valid, false if invalid (e.g., an error occured)

Definition at line 67 of file barometric_altimeter.h.

◆ setSeaLevelPressure

void(* BarometricAltimeter::setSeaLevelPressure) (const uint32_t slp)

Set the sea level pressure.

Parameters
[in]slpThe current sea level pressure in hPa. slp should be specified as an unsigned 32-bit fixed-point number in format UQ22.10.

Definition at line 74 of file barometric_altimeter.h.


The documentation for this struct was generated from the following file: