Firmware SDK
twr_tag_lux_meter.h
1 #ifndef _TWR_TAG_LUX_METER_H
2 #define _TWR_TAG_LUX_METER_H
3 
4 #include <twr_opt3001.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
21 
23 
24 typedef enum
25 {
28 
31 
33 
35 
37 
42 
44 
49 
50 void twr_tag_lux_meter_set_event_handler(twr_tag_lux_meter_t *self, void (*event_handler)(twr_tag_lux_meter_t *, twr_tag_lux_meter_event_t, void *), void *event_param);
51 
55 
57 
62 
64 
70 
72 
78 
80 
82 
83 #endif // _TWR_TAG_LUX_METER_H
twr_i2c_channel_t
I2C channels.
Definition: twr_i2c.h:16
struct twr_opt3001_t twr_opt3001_t
OPT3001 instance.
Definition: twr_opt3001.h:25
@ TWR_OPT3001_EVENT_UPDATE
Update event.
Definition: twr_opt3001.h:19
@ TWR_OPT3001_EVENT_ERROR
Error event.
Definition: twr_opt3001.h:16
bool twr_tag_lux_meter_get_illuminance_raw(twr_tag_lux_meter_t *self, uint16_t *raw)
Get measured illuminance as raw value.
twr_opt3001_t twr_tag_lux_meter_t
HARDWARIO Lux Meter Module instance.
bool twr_tag_lux_meter_measure(twr_tag_lux_meter_t *self)
Start measurement manually.
bool twr_tag_lux_meter_get_illuminance_lux(twr_tag_lux_meter_t *self, float *lux)
Get measured illuminance in lux.
twr_tag_lux_meter_event_t
Callback events.
void twr_tag_lux_meter_set_event_handler(twr_tag_lux_meter_t *self, void(*event_handler)(twr_tag_lux_meter_t *, twr_tag_lux_meter_event_t, void *), void *event_param)
Set callback function.
void twr_tag_lux_meter_init(twr_tag_lux_meter_t *self, twr_i2c_channel_t i2c_channel, twr_tag_lux_meter_i2c_address_t i2c_address)
Initialize HARDWARIO Lux Meter Module.
twr_tag_lux_meter_i2c_address_t
I2C address.
void twr_tag_lux_meter_set_update_interval(twr_tag_lux_meter_t *self, twr_tick_t interval)
Set measurement interval.
@ TWR_TAG_LUX_METER_EVENT_ERROR
Error event.
@ TWR_TAG_LUX_METER_EVENT_UPDATE
Update event.
@ TWR_TAG_LUX_METER_I2C_ADDRESS_ALTERNATE
Alternate I2C address.
@ TWR_TAG_LUX_METER_I2C_ADDRESS_DEFAULT
Default I2C address.
uint64_t twr_tick_t
Timestamp data type.
Definition: twr_tick.h:16