Firmware SDK
twr_tag_humidity

Driver for HARDWARIO Humidity Module. More...

Typedefs

typedef struct twr_tag_humidity_t twr_tag_humidity_t
 HARDWARIO Humidity Module instance.
 

Enumerations

enum  twr_tag_humidity_revision_t {
  TWR_TAG_HUMIDITY_REVISION_R1 = 0 ,
  TWR_TAG_HUMIDITY_REVISION_R2 = 1 ,
  TWR_TAG_HUMIDITY_REVISION_R3 = 2 ,
  TWR_TAG_HUMIDITY_REVISION_R4 = 3
}
 Humidity Tag hardware revision. More...
 
enum  twr_tag_humidity_i2c_address_t {
  TWR_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT = 0 ,
  TWR_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE = 1
}
 I2C address. More...
 
enum  twr_tag_humidity_event_t {
  TWR_TAG_HUMIDITY_EVENT_ERROR = 0 ,
  TWR_TAG_HUMIDITY_EVENT_UPDATE = 1
}
 Callback events. More...
 

Functions

void twr_tag_humidity_init (twr_tag_humidity_t *self, twr_tag_humidity_revision_t revision, twr_i2c_channel_t i2c_channel, twr_tag_humidity_i2c_address_t i2c_address)
 Initialize HARDWARIO Humidity Module. More...
 
void twr_tag_humidity_set_event_handler (twr_tag_humidity_t *self, void(*event_handler)(twr_tag_humidity_t *, twr_tag_humidity_event_t, void *), void *event_param)
 Set callback function. More...
 
void twr_tag_humidity_set_update_interval (twr_tag_humidity_t *self, twr_tick_t interval)
 Set measurement interval. More...
 
bool twr_tag_humidity_measure (twr_tag_humidity_t *self)
 Start measurement manually. More...
 
bool twr_tag_humidity_get_temperature_raw (twr_tag_humidity_t *self, uint16_t *raw)
 Get measured temperature as raw value. More...
 
bool twr_tag_humidity_get_temperature_celsius (twr_tag_humidity_t *self, float *celsius)
 Get measured temperature in degrees of Celsius. More...
 
bool twr_tag_humidity_get_humidity_raw (twr_tag_humidity_t *self, uint16_t *raw)
 Get measured humidity as raw value. More...
 
bool twr_tag_humidity_get_humidity_percentage (twr_tag_humidity_t *self, float *percentage)
 Get measured humidity as percentage. More...
 

Detailed Description

Driver for HARDWARIO Humidity Module.

Enumeration Type Documentation

◆ twr_tag_humidity_event_t

Callback events.

Enumerator
TWR_TAG_HUMIDITY_EVENT_ERROR 

Error event.

TWR_TAG_HUMIDITY_EVENT_UPDATE 

Update event.

Definition at line 46 of file twr_tag_humidity.h.

◆ twr_tag_humidity_i2c_address_t

I2C address.

Enumerator
TWR_TAG_HUMIDITY_I2C_ADDRESS_DEFAULT 

Default I2C address.

TWR_TAG_HUMIDITY_I2C_ADDRESS_ALTERNATE 

Alternate I2C address.

Definition at line 34 of file twr_tag_humidity.h.

◆ twr_tag_humidity_revision_t

Humidity Tag hardware revision.

Enumerator
TWR_TAG_HUMIDITY_REVISION_R1 

Hardware revision R1.

TWR_TAG_HUMIDITY_REVISION_R2 

Hardware revision R2.

TWR_TAG_HUMIDITY_REVISION_R3 

Hardware revision R3.

TWR_TAG_HUMIDITY_REVISION_R4 

Hardware revision R4.

Definition at line 15 of file twr_tag_humidity.h.

Function Documentation

◆ twr_tag_humidity_get_humidity_percentage()

bool twr_tag_humidity_get_humidity_percentage ( twr_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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_get_humidity_raw()

bool twr_tag_humidity_get_humidity_raw ( twr_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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_get_temperature_celsius()

bool twr_tag_humidity_get_temperature_celsius ( twr_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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_get_temperature_raw()

bool twr_tag_humidity_get_temperature_raw ( twr_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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_init()

void twr_tag_humidity_init ( twr_tag_humidity_t self,
twr_tag_humidity_revision_t  revision,
twr_i2c_channel_t  i2c_channel,
twr_tag_humidity_i2c_address_t  i2c_address 
)

Initialize HARDWARIO Humidity Module.

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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_measure()

bool twr_tag_humidity_measure ( twr_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 twr_tag_humidity.c.

Here is the call graph for this function:

◆ twr_tag_humidity_set_event_handler()

void twr_tag_humidity_set_event_handler ( twr_tag_humidity_t self,
void(*)(twr_tag_humidity_t *, twr_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 twr_tag_humidity.c.

◆ twr_tag_humidity_set_update_interval()

void twr_tag_humidity_set_update_interval ( twr_tag_humidity_t self,
twr_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 49 of file twr_tag_humidity.c.

Here is the call graph for this function: