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

Driver for BigClown Humidity Tag. More...

Typedefs

typedef struct bc_tag_humidity_t bc_tag_humidity_t
 BigClown Humidity Tag instance.
 

Enumerations

enum  bc_tag_humidity_revision_t {
  BC_TAG_HUMIDITY_REVISION_R1 = 0,
  BC_TAG_HUMIDITY_REVISION_R2 = 1,
  BC_TAG_HUMIDITY_REVISION_R3 = 2,
  BC_TAG_HUMIDITY_REVISION_R4 = 3
}
 Humidity Tag hardware revision. More...
 
enum  bc_tag_humidity_i2c_address_t {
  BC_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT = 0,
  BC_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE = 1
}
 I2C address. More...
 
enum  bc_tag_humidity_event_t {
  BC_TAG_HUMIDITY_EVENT_ERROR = 0,
  BC_TAG_HUMIDITY_EVENT_UPDATE = 1
}
 Callback events. More...
 

Functions

void bc_tag_humidity_init (bc_tag_humidity_t *self, bc_tag_humidity_revision_t revision, bc_i2c_channel_t i2c_channel, bc_tag_humidity_i2c_address_t i2c_address)
 Initialize BigClown Humidity Tag. More...
 
void bc_tag_humidity_set_event_handler (bc_tag_humidity_t *self, void(*event_handler)(bc_tag_humidity_t *, bc_tag_humidity_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_tag_humidity_set_update_interval (bc_tag_humidity_t *self, bc_tick_t interval)
 Set measurement interval. More...
 
bool bc_tag_humidity_measure (bc_tag_humidity_t *self)
 Start measurement manually. More...
 
bool bc_tag_humidity_get_temperature_raw (bc_tag_humidity_t *self, uint16_t *raw)
 Get measured temperature as raw value. More...
 
bool bc_tag_humidity_get_temperature_celsius (bc_tag_humidity_t *self, float *celsius)
 Get measured temperature in degrees of Celsius. More...
 
bool bc_tag_humidity_get_humidity_raw (bc_tag_humidity_t *self, uint16_t *raw)
 Get measured humidity as raw value. More...
 
bool bc_tag_humidity_get_humidity_percentage (bc_tag_humidity_t *self, float *percentage)
 Get measured humidity as percentage. More...
 

Detailed Description

Driver for BigClown Humidity Tag.

Enumeration Type Documentation

Callback events.

Enumerator
BC_TAG_HUMIDITY_EVENT_ERROR 

Error event.

BC_TAG_HUMIDITY_EVENT_UPDATE 

Update event.

Definition at line 46 of file bc_tag_humidity.h.

I2C address.

Enumerator
BC_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT 

Default I2C address.

BC_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE 

Alternate I2C address.

Definition at line 34 of file bc_tag_humidity.h.

Humidity Tag hardware revision.

Enumerator
BC_TAG_HUMIDITY_REVISION_R1 

Hardware revision R1.

BC_TAG_HUMIDITY_REVISION_R2 

Hardware revision R2.

BC_TAG_HUMIDITY_REVISION_R3 

Hardware revision R3.

BC_TAG_HUMIDITY_REVISION_R4 

Hardware revision R4.

Definition at line 15 of file bc_tag_humidity.h.

Function Documentation

bool bc_tag_humidity_get_humidity_percentage ( bc_tag_humidity_t self,
float *  percentage 
)

Get measured humidity as percentage.

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

Definition at line 149 of file bc_tag_humidity.c.

Here is the call graph for this function:

bool bc_tag_humidity_get_humidity_raw ( bc_tag_humidity_t self,
uint16_t *  raw 
)

Get measured humidity 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 129 of file bc_tag_humidity.c.

Here is the call graph for this function:

bool bc_tag_humidity_get_temperature_celsius ( bc_tag_humidity_t self,
float *  celsius 
)

Get measured temperature in degrees of Celsius.

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

Definition at line 109 of file bc_tag_humidity.c.

Here is the call graph for this function:

bool bc_tag_humidity_get_temperature_raw ( bc_tag_humidity_t self,
uint16_t *  raw 
)

Get measured temperature 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 89 of file bc_tag_humidity.c.

Here is the call graph for this function:

void bc_tag_humidity_init ( bc_tag_humidity_t self,
bc_tag_humidity_revision_t  revision,
bc_i2c_channel_t  i2c_channel,
bc_tag_humidity_i2c_address_t  i2c_address 
)

Initialize BigClown Humidity Tag.

Parameters
[in]selfInstance
[in]revisionHardware revision of connected Humidity Tag
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 11 of file bc_tag_humidity.c.

Here is the call graph for this function:

bool bc_tag_humidity_measure ( bc_tag_humidity_t self)

Start measurement manually.

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

Definition at line 69 of file bc_tag_humidity.c.

Here is the call graph for this function:

void bc_tag_humidity_set_event_handler ( bc_tag_humidity_t self,
void(*)(bc_tag_humidity_t *, bc_tag_humidity_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 43 of file bc_tag_humidity.c.

void bc_tag_humidity_set_update_interval ( bc_tag_humidity_t self,
bc_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 49 of file bc_tag_humidity.c.

Here is the call graph for this function: