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

Virtual Temperature Sensor Interface. More...

#include <temperature_sensor.h>

Public Attributes

bool(* readTemperature )(int16_t *const temperature)
 Get the current temperature in °C. More...
 

Detailed Description

Virtual Temperature Sensor Interface.

A standard interface for a device which can measure temperature.

This device measures temperature in °C.

Fundamental Assumptions

Implementation Notes

Definition at line 62 of file temperature_sensor.h.

Member Data Documentation

◆ readTemperature

bool(* TemperatureSensor::readTemperature) (int16_t *const temperature)

Get the current temperature in °C.

Precondition
The sensor has been properly initialized by the system.
The temperature parameter is not NULL.
Postcondition
If the measurement is valid, the data pointed to by the temperature parameter will be updated with the latest reading.
If the measurement is invalid, the data pointed to by the temperature parameter will remain unchanged.
Parameters
[in,out]Currenttemperature in °C. Temperature readings will be provided as a signed 16-bit fixed point integer in format Q7.8
Returns
True if the sample is valid, false if invalid (e.g., an error occured)

Definition at line 78 of file temperature_sensor.h.


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