Firmware SDK
|
Driver for HARDWARIO Lux Meter Module. More...
Typedefs | |
typedef twr_opt3001_t | twr_tag_lux_meter_t |
HARDWARIO Lux Meter Module instance. | |
Enumerations | |
enum | twr_tag_lux_meter_i2c_address_t { TWR_TAG_LUX_METER_I2C_ADDRESS_DEFAULT = 0x44 , TWR_TAG_LUX_METER_I2C_ADDRESS_ALTERNATE = 0x45 } |
I2C address. More... | |
enum | twr_tag_lux_meter_event_t { TWR_TAG_LUX_METER_EVENT_ERROR = TWR_OPT3001_EVENT_ERROR , TWR_TAG_LUX_METER_EVENT_UPDATE = TWR_OPT3001_EVENT_UPDATE } |
Callback events. More... | |
Functions | |
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. More... | |
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. More... | |
void | twr_tag_lux_meter_set_update_interval (twr_tag_lux_meter_t *self, twr_tick_t interval) |
Set measurement interval. More... | |
bool | twr_tag_lux_meter_measure (twr_tag_lux_meter_t *self) |
Start measurement manually. More... | |
bool | twr_tag_lux_meter_get_illuminance_raw (twr_tag_lux_meter_t *self, uint16_t *raw) |
Get measured illuminance as raw value. More... | |
bool | twr_tag_lux_meter_get_illuminance_lux (twr_tag_lux_meter_t *self, float *lux) |
Get measured illuminance in lux. More... | |
Driver for HARDWARIO Lux Meter Module.
Callback events.
Enumerator | |
---|---|
TWR_TAG_LUX_METER_EVENT_ERROR | Error event. |
TWR_TAG_LUX_METER_EVENT_UPDATE | Update event. |
Definition at line 24 of file twr_tag_lux_meter.h.
I2C address.
Enumerator | |
---|---|
TWR_TAG_LUX_METER_I2C_ADDRESS_DEFAULT | Default I2C address. |
TWR_TAG_LUX_METER_I2C_ADDRESS_ALTERNATE | Alternate I2C address. |
Definition at line 12 of file twr_tag_lux_meter.h.
bool twr_tag_lux_meter_get_illuminance_lux | ( | twr_tag_lux_meter_t * | self, |
float * | lux | ||
) |
Get measured illuminance in lux.
[in] | self | Instance |
[in] | lux | Pointer to variable where result will be stored |
Definition at line 28 of file twr_tag_lux_meter.c.
bool twr_tag_lux_meter_get_illuminance_raw | ( | twr_tag_lux_meter_t * | self, |
uint16_t * | raw | ||
) |
Get measured illuminance as raw value.
[in] | self | Instance |
[in] | raw | Pointer to variable where result will be stored |
Definition at line 23 of file twr_tag_lux_meter.c.
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.
[in] | self | Instance |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 3 of file twr_tag_lux_meter.c.
bool twr_tag_lux_meter_measure | ( | twr_tag_lux_meter_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 18 of file twr_tag_lux_meter.c.
void twr_tag_lux_meter_set_event_handler | ( | twr_tag_lux_meter_t * | self, |
void(*)(twr_tag_lux_meter_t *, twr_tag_lux_meter_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 8 of file twr_tag_lux_meter.c.
void twr_tag_lux_meter_set_update_interval | ( | twr_tag_lux_meter_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 13 of file twr_tag_lux_meter.c.