Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tag_lux_meter

Driver for BigClown Lux Meter Tag. More...

Typedefs

typedef bc_opt3001_t bc_tag_lux_meter_t
 BigClown Lux Meter Tag instance.
 

Enumerations

enum  bc_tag_lux_meter_i2c_address_t {
  BC_TAG_LUX_METER_I2C_ADDRESS_DEFAULT = 0x44,
  BC_TAG_LUX_METER_I2C_ADDRESS_ALTERNATE = 0x45
}
 I2C address. More...
 
enum  bc_tag_lux_meter_event_t {
  BC_TAG_LUX_METER_EVENT_ERROR = BC_OPT3001_EVENT_ERROR,
  BC_TAG_LUX_METER_EVENT_UPDATE = BC_OPT3001_EVENT_UPDATE
}
 Callback events. More...
 

Functions

void bc_tag_lux_meter_init (bc_tag_lux_meter_t *self, bc_i2c_channel_t i2c_channel, bc_tag_lux_meter_i2c_address_t i2c_address)
 Initialize BigClown Lux Meter Tag. More...
 
void bc_tag_lux_meter_set_event_handler (bc_tag_lux_meter_t *self, void(*event_handler)(bc_tag_lux_meter_t *, bc_tag_lux_meter_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_tag_lux_meter_set_update_interval (bc_tag_lux_meter_t *self, bc_tick_t interval)
 Set measurement interval. More...
 
bool bc_tag_lux_meter_measure (bc_tag_lux_meter_t *self)
 Start measurement manually. More...
 
bool bc_tag_lux_meter_get_illuminance_raw (bc_tag_lux_meter_t *self, uint16_t *raw)
 Get measured illuminance as raw value. More...
 
bool bc_tag_lux_meter_get_illuminance_lux (bc_tag_lux_meter_t *self, float *lux)
 Get measured illuminance in lux. More...
 

Detailed Description

Driver for BigClown Lux Meter Tag.

Enumeration Type Documentation

Callback events.

Enumerator
BC_TAG_LUX_METER_EVENT_ERROR 

Error event.

BC_TAG_LUX_METER_EVENT_UPDATE 

Update event.

Definition at line 24 of file bc_tag_lux_meter.h.

I2C address.

Enumerator
BC_TAG_LUX_METER_I2C_ADDRESS_DEFAULT 

Default I2C address.

BC_TAG_LUX_METER_I2C_ADDRESS_ALTERNATE 

Alternate I2C address.

Definition at line 12 of file bc_tag_lux_meter.h.

Function Documentation

bool bc_tag_lux_meter_get_illuminance_lux ( bc_tag_lux_meter_t self,
float *  lux 
)

Get measured illuminance in lux.

Parameters
[in]selfInstance
[in]luxPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 28 of file bc_tag_lux_meter.c.

Here is the call graph for this function:

bool bc_tag_lux_meter_get_illuminance_raw ( bc_tag_lux_meter_t self,
uint16_t *  raw 
)

Get measured illuminance as raw value.

Parameters
[in]selfInstance
[in]rawPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 23 of file bc_tag_lux_meter.c.

Here is the call graph for this function:

void bc_tag_lux_meter_init ( bc_tag_lux_meter_t self,
bc_i2c_channel_t  i2c_channel,
bc_tag_lux_meter_i2c_address_t  i2c_address 
)

Initialize BigClown Lux Meter Tag.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 3 of file bc_tag_lux_meter.c.

Here is the call graph for this function:

bool bc_tag_lux_meter_measure ( bc_tag_lux_meter_t self)

Start measurement manually.

Parameters
[in]selfInstance
Returns
true On success
false When other measurement is in progress

Definition at line 18 of file bc_tag_lux_meter.c.

Here is the call graph for this function:

void bc_tag_lux_meter_set_event_handler ( bc_tag_lux_meter_t self,
void(*)(bc_tag_lux_meter_t *, bc_tag_lux_meter_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 8 of file bc_tag_lux_meter.c.

Here is the call graph for this function:

void bc_tag_lux_meter_set_update_interval ( bc_tag_lux_meter_t self,
bc_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 13 of file bc_tag_lux_meter.c.

Here is the call graph for this function: