1 #ifndef _TWR_MODULE_INFRA_GRID_H
2 #define _TWR_MODULE_INFRA_GRID_H
5 #include <twr_tca9534a.h>
6 #include <twr_scheduler.h>
44 TWR_MODULE_INFRA_GRID_STATE_ERROR = -1,
45 TWR_MODULE_INFRA_GRID_STATE_INITIALIZE = 0,
46 TWR_MODULE_INFRA_GRID_STATE_MODE_CHANGE = 1,
47 TWR_MODULE_INFRA_GRID_STATE_POWER_UP = 2,
48 TWR_MODULE_INFRA_GRID_STATE_INITIAL_RESET = 3,
49 TWR_MODULE_INFRA_GRID_STATE_FLAG_RESET = 4,
50 TWR_MODULE_INFRA_GRID_STATE_MEASURE = 5,
51 TWR_MODULE_INFRA_GRID_STATE_READ = 6,
52 TWR_MODULE_INFRA_GRID_STATE_UPDATE = 7
54 } twr_module_infra_grid_state_t;
58 int16_t _sensor_data[64];
68 bool _measurement_active;
70 twr_module_infra_grid_state_t _state;
72 bool _temperature_valid;
twr_i2c_channel_t
I2C channels.
twr_module_infra_grid_revision_t twr_module_infra_grid_get_revision(twr_module_infra_grid_t *self)
Get module revision.
bool twr_module_infra_grid_get_temperatures_celsius(twr_module_infra_grid_t *self, float *values)
Get measured temperature in degrees of Celsius as a array of float numbers.
void twr_module_infra_grid_set_update_interval(twr_module_infra_grid_t *self, twr_tick_t interval)
Set measurement interval.
float twr_module_infra_grid_read_thermistor(twr_module_infra_grid_t *self)
Read and return thermistor temperature sensor value.
twr_module_infra_grid_event_t
Callback events.
bool twr_module_infra_grid_measure(twr_module_infra_grid_t *self)
Start measurement manually.
twr_module_infra_grid_revision_t
Infragrid Module Revision.
void twr_module_infra_grid_init(twr_module_infra_grid_t *self)
Initialize Infra Grid Module.
bool twr_module_infra_grid_read_values(twr_module_infra_grid_t *self)
Read measured data from sensor to the buffer.
void twr_module_infra_grid_set_event_handler(twr_module_infra_grid_t *self, void(*event_handler)(twr_module_infra_grid_t *, twr_module_infra_grid_event_t, void *), void *event_param)
Set callback function.
struct twr_module_infra_grid_t twr_module_infra_grid_t
Infra Grid Module instance.
@ TWR_MODULE_INFRA_GRID_EVENT_UPDATE
Update event.
@ TWR_MODULE_INFRA_GRID_EVENT_ERROR
Error event.
@ TWR_MODULE_INFRA_GRID_REVISION_R1_1
Revision 1.1.
@ TWR_MODULE_INFRA_GRID_REVISION_R1_0
Revision 1.0.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
uint64_t twr_tick_t
Timestamp data type.