Embedded Artistry C Interfaces
A reference collection of abstract interfaces in C.
|
Virtual Temperature Sensor Interface with Callback Support. More...
#include <temperature_sensor.h>
Public Attributes | |
bool(* | readTemperature )(int16_t *const temperature) |
Get the current temperature in °C. More... | |
void(* | registerNewSampleCb )(const NewTemperatureSampleCb callback) |
Register a NewTemperatureSampleCb function. More... | |
void(* | unregisterNewSampleCb )(const NewTemperatureSampleCb callback) |
Remove a registered NewTemperatureSampleCb function. More... | |
void(* | registerErrorCb )(const TemperatureErrorCb callback) |
Register a TemperatureErrorCb function. More... | |
void(* | unregisterErrorCb )(const TemperatureErrorCb callback) |
Remove a registered TemperatureErrorCb function. More... | |
Virtual Temperature Sensor Interface with Callback Support.
A standard interface for a device which can measure temperature. Interested parties can receive callbacks when new samples are available.
This device measures temperature in °C.
Definition at line 144 of file temperature_sensor.h.
bool(* TemperatureSensor_withCb::readTemperature) (int16_t *const temperature) |
Get the current temperature in °C.
[in,out] | temperature | Pointer which will be used for storing the latest temperature reading. |
If temperature is NULL, the function will only supply the temperature sample to registered callback functions.
Temperature readings will be provided as a signed 16-bit fixed point integer in format Q7.8
[in,out] | Current | temperature in °C. Temperature readings will be provided as a signed 16-bit fixed point integer in format Q7.8 |
Definition at line 173 of file temperature_sensor.h.
void(* TemperatureSensor_withCb::registerErrorCb) (const TemperatureErrorCb callback) |
Register a TemperatureErrorCb function.
This function will add the callback input to a list of functions to execute when a temperature sensor error occurs.
[in] | callback | The callback function pointer to register on the "error" callback list. |
Definition at line 212 of file temperature_sensor.h.
void(* TemperatureSensor_withCb::registerNewSampleCb) (const NewTemperatureSampleCb callback) |
Register a NewTemperatureSampleCb function.
This function will add the callback input to a list of functions to execute when a new and valid sample is available.
[in] | callback | The callback function pointer to register on the "new sample" callback list. |
Definition at line 186 of file temperature_sensor.h.
void(* TemperatureSensor_withCb::unregisterErrorCb) (const TemperatureErrorCb callback) |
Remove a registered TemperatureErrorCb function.
This function will remove a callback function from the registered list of "error" callbacks. If the function has not been previously registered, the parameter will be ignored and the list will be unchanged.
[in] | callback | The callback function pointer to remove from the "error" callback list. |
Definition at line 225 of file temperature_sensor.h.
void(* TemperatureSensor_withCb::unregisterNewSampleCb) (const NewTemperatureSampleCb callback) |
Remove a registered NewTemperatureSampleCb function.
This function will remove a callback function from the registered list of "new sample" callbacks. If the function has not been previously registered, the parameter will be ignored and the list will be unchanged.
[in] | callback | The callback function pointer to remove from the "new sample" callback list. |
Definition at line 199 of file temperature_sensor.h.