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

Virtual Barometric Pressure Sensor Interface. More...

#include <barometric_pressure_sensor.h>

Public Attributes

bool(* readPressure )(uint32_t *const pressure)
 Read the current pressure from the device. More...
 

Detailed Description

Virtual Barometric Pressure Sensor Interface.

A standard interface for a device which can measure barometric pressure.

This is a simple interface, which only provides the ability to read the current sample.

Fundamental Assumptions

Implementation Notes

Definition at line 52 of file barometric_pressure_sensor.h.

Member Data Documentation

◆ readPressure

bool(* BarometricPressureSensor::readPressure) (uint32_t *const pressure)

Read the current pressure from the device.

Precondition
The pressure sensor has been properly initialized by the system.
The pressure parameter is not NULL.
Postcondition
If the measurement is valid, the data pointed to by the pressure parameter will be updated with the latest reading.
If the measurement is invalid, the data pointed to by the pressure parameter will remain unchanged.
Parameters
[in,out]pressurePointer which will be used for storing the latest pressure reading. This pointer must not be null.

Pressure will be formatted as a 32-bit fixed-point integer with format UQ22.10, giving a resolution of 0.001 hPa.

Returns
True if the sample is valid, false if invalid (e.g., an error occured)

Definition at line 72 of file barometric_pressure_sensor.h.


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