5 #include <twr_scheduler.h>
31 TWR_HTS221_STATE_ERROR = -1,
32 TWR_HTS221_STATE_INITIALIZE = 0,
33 TWR_HTS221_STATE_MEASURE = 1,
34 TWR_HTS221_STATE_READ = 2,
35 TWR_HTS221_STATE_UPDATE = 3
47 bool _measurement_active;
49 twr_hts221_state_t _state;
52 int16_t _reg_humidity;
void twr_hts221_deinit(twr_hts221_t *self)
Deinitialize HTS221.
void twr_hts221_set_update_interval(twr_hts221_t *self, twr_tick_t interval)
Set measurement interval.
bool twr_hts221_measure(twr_hts221_t *self)
Start measurement manually.
struct twr_hts221_t twr_hts221_t
HTS221 instance.
bool twr_hts221_get_humidity_percentage(twr_hts221_t *self, float *percentage)
Get measured humidity as percentage.
void twr_hts221_set_event_handler(twr_hts221_t *self, void(*event_handler)(twr_hts221_t *, twr_hts221_event_t, void *), void *event_param)
Set callback function.
void twr_hts221_init(twr_hts221_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize HTS221.
twr_hts221_event_t
Callback events.
@ TWR_HTS221_EVENT_ERROR
Error event.
@ TWR_HTS221_EVENT_UPDATE
Update event.
twr_i2c_channel_t
I2C channels.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
uint64_t twr_tick_t
Timestamp data type.