Embedded Artistry C Interfaces
A reference collection of abstract interfaces in C.
humidity_sensor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2022 Embedded Artistry LLC <contact@embeddedartistry.com>
2// SPDX-License-Identifier: MIT
3
4#include <stdbool.h>
5#include <stdint.h>
6
38#pragma mark - Basic Interface -
39
60typedef struct
61{
76 bool (*getHumidity)(uint8_t* const humidity);
78
79#pragma mark - With Callbacks -
80
81#pragma mark - With Callback Support -
82
96typedef void (*NewHumiditySampleCb)(uint8_t humidity);
97
111typedef void (*HumidityErrorCb)(void);
112
141typedef struct
142{
163 bool (*readHumidity)(uint8_t* const humidity);
164
176 void (*registerNewSampleCb)(const NewHumiditySampleCb callback);
177
189 void (*unregisterNewSampleCb)(const NewHumiditySampleCb callback);
190
202 void (*registerErrorCb)(const HumidityErrorCb callback);
203
215 void (*unregisterErrorCb)(const HumidityErrorCb callback);
void(* HumidityErrorCb)(void)
Callback function prototype for humidity sensor errors.
void(* NewHumiditySampleCb)(uint8_t humidity)
Callback function prototype for processing new humidity samples.
Virtual Relative Humidity Sensor Interface with Callback Support.
Virtual Relative Humidity Sensor Interface.