Firmware SDK
|
Driver for HDC2080 humidity sensor. More...
Typedefs | |
typedef struct twr_hdc2080_t | twr_hdc2080_t |
HDC2080 instance. | |
Enumerations | |
enum | twr_hdc2080_event_t { TWR_HDC2080_EVENT_ERROR = 0 , TWR_HDC2080_EVENT_UPDATE = 1 } |
Callback events. More... | |
Functions | |
void | twr_hdc2080_init (twr_hdc2080_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address) |
Initialize HDC2080. More... | |
void | twr_hdc2080_deinit (twr_hdc2080_t *self) |
Deinitialize HDC2080. More... | |
void | twr_hdc2080_set_event_handler (twr_hdc2080_t *self, void(*event_handler)(twr_hdc2080_t *, twr_hdc2080_event_t, void *), void *event_param) |
Set callback function. More... | |
void | twr_hdc2080_set_update_interval (twr_hdc2080_t *self, twr_tick_t interval) |
Set measurement interval. More... | |
bool | twr_hdc2080_measure (twr_hdc2080_t *self) |
Start measurement manually. More... | |
bool | twr_hdc2080_get_humidity_raw (twr_hdc2080_t *self, uint16_t *raw) |
Get measured humidity as raw value. More... | |
bool | twr_hdc2080_get_humidity_percentage (twr_hdc2080_t *self, float *percentage) |
Get measured humidity as percentage. More... | |
bool | twr_hdc2080_get_temperature_raw (twr_hdc2080_t *self, uint16_t *raw) |
Get measured temperature as raw value. More... | |
bool | twr_hdc2080_get_temperature_celsius (twr_hdc2080_t *self, float *celsius) |
Get measured temperature in degrees of Celsius. More... | |
Driver for HDC2080 humidity sensor.
enum twr_hdc2080_event_t |
Callback events.
Enumerator | |
---|---|
TWR_HDC2080_EVENT_ERROR | Error event. |
TWR_HDC2080_EVENT_UPDATE | Update event. |
Definition at line 13 of file twr_hdc2080.h.
void twr_hdc2080_deinit | ( | twr_hdc2080_t * | self | ) |
Deinitialize HDC2080.
[in] | self | Instance |
Definition at line 27 of file twr_hdc2080.c.
bool twr_hdc2080_get_humidity_percentage | ( | twr_hdc2080_t * | self, |
float * | percentage | ||
) |
Get measured humidity as percentage.
[in] | self | Instance |
[in] | percentage | Pointer to variable where result will be stored |
Definition at line 84 of file twr_hdc2080.c.
Referenced by twr_tag_humidity_get_humidity_percentage().
bool twr_hdc2080_get_humidity_raw | ( | twr_hdc2080_t * | self, |
uint16_t * | raw | ||
) |
Get measured humidity as raw value.
[in] | self | Instance |
[in] | raw | Pointer to variable where result will be stored |
Definition at line 72 of file twr_hdc2080.c.
Referenced by twr_hdc2080_get_humidity_percentage(), and twr_tag_humidity_get_humidity_raw().
bool twr_hdc2080_get_temperature_celsius | ( | twr_hdc2080_t * | self, |
float * | celsius | ||
) |
Get measured temperature in degrees of Celsius.
[in] | self | Instance |
[in] | celsius | Pointer to variable where result will be stored |
Definition at line 115 of file twr_hdc2080.c.
Referenced by twr_tag_humidity_get_temperature_celsius().
bool twr_hdc2080_get_temperature_raw | ( | twr_hdc2080_t * | self, |
uint16_t * | raw | ||
) |
Get measured temperature as raw value.
[in] | self | Instance |
[in] | raw | Pointer to variable where result will be stored |
Definition at line 103 of file twr_hdc2080.c.
Referenced by twr_hdc2080_get_temperature_celsius(), and twr_tag_humidity_get_temperature_raw().
void twr_hdc2080_init | ( | twr_hdc2080_t * | self, |
twr_i2c_channel_t | i2c_channel, | ||
uint8_t | i2c_address | ||
) |
Initialize HDC2080.
[in] | self | Instance |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 12 of file twr_hdc2080.c.
Referenced by twr_tag_humidity_init().
bool twr_hdc2080_measure | ( | twr_hdc2080_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 58 of file twr_hdc2080.c.
Referenced by twr_hdc2080_set_update_interval(), and twr_tag_humidity_measure().
void twr_hdc2080_set_event_handler | ( | twr_hdc2080_t * | self, |
void(*)(twr_hdc2080_t *, twr_hdc2080_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 36 of file twr_hdc2080.c.
Referenced by twr_tag_humidity_init().
void twr_hdc2080_set_update_interval | ( | twr_hdc2080_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 42 of file twr_hdc2080.c.
Referenced by twr_tag_humidity_set_update_interval().