Firmware SDK
twr_tag_temperature

Driver for HARDWARIO Temperature Module. More...

Typedefs

typedef twr_tmp112_t twr_tag_temperature_t
 HARDWARIO Temperature Module instance.
 

Enumerations

enum  twr_tag_temperature_i2c_address_t {
  TWR_TAG_TEMPERATURE_I2C_ADDRESS_DEFAULT = 0x48 ,
  TWR_TAG_TEMPERATURE_I2C_ADDRESS_ALTERNATE = 0x49
}
 I2C address. More...
 
enum  twr_tag_temperature_event_t {
  TWR_TAG_TEMPERATURE_EVENT_ERROR = TWR_TMP112_EVENT_ERROR ,
  TWR_TAG_TEMPERATURE_EVENT_UPDATE = TWR_TMP112_EVENT_UPDATE
}
 Callback events. More...
 

Functions

void twr_tag_temperature_init (twr_tag_temperature_t *self, twr_i2c_channel_t i2c_channel, twr_tag_temperature_i2c_address_t i2c_address)
 Initialize HARDWARIO Temperature Module. More...
 
void twr_tag_temperature_set_event_handler (twr_tag_temperature_t *self, void(*event_handler)(twr_tag_temperature_t *, twr_tag_temperature_event_t, void *), void *event_param)
 Set callback function. More...
 
void twr_tag_temperature_set_update_interval (twr_tag_temperature_t *self, twr_tick_t interval)
 Set measurement interval. More...
 
bool twr_tag_temperature_measure (twr_tag_temperature_t *self)
 Start measurement manually. More...
 
bool twr_tag_temperature_get_temperature_raw (twr_tag_temperature_t *self, int16_t *raw)
 Get measured temperature as raw value. More...
 
bool twr_tag_temperature_get_temperature_celsius (twr_tag_temperature_t *self, float *celsius)
 Get measured temperature in degrees of Celsius. More...
 
bool twr_tag_temperature_get_temperature_fahrenheit (twr_tag_temperature_t *self, float *fahrenheit)
 Get measured temperature in degrees of Fahrenheit. More...
 
bool twr_tag_temperature_get_temperature_kelvin (twr_tag_temperature_t *self, float *kelvin)
 Get measured temperature in kelvin. More...
 

Detailed Description

Driver for HARDWARIO Temperature Module.

Enumeration Type Documentation

◆ twr_tag_temperature_event_t

Callback events.

Enumerator
TWR_TAG_TEMPERATURE_EVENT_ERROR 

Error event.

TWR_TAG_TEMPERATURE_EVENT_UPDATE 

Update event.

Definition at line 24 of file twr_tag_temperature.h.

◆ twr_tag_temperature_i2c_address_t

I2C address.

Enumerator
TWR_TAG_TEMPERATURE_I2C_ADDRESS_DEFAULT 

Default I2C address.

TWR_TAG_TEMPERATURE_I2C_ADDRESS_ALTERNATE 

Alternate I2C address.

Definition at line 12 of file twr_tag_temperature.h.

Function Documentation

◆ twr_tag_temperature_get_temperature_celsius()

bool twr_tag_temperature_get_temperature_celsius ( twr_tag_temperature_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 28 of file twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_get_temperature_fahrenheit()

bool twr_tag_temperature_get_temperature_fahrenheit ( twr_tag_temperature_t self,
float *  fahrenheit 
)

Get measured temperature in degrees of Fahrenheit.

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

Definition at line 33 of file twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_get_temperature_kelvin()

bool twr_tag_temperature_get_temperature_kelvin ( twr_tag_temperature_t self,
float *  kelvin 
)

Get measured temperature in kelvin.

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

Definition at line 38 of file twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_get_temperature_raw()

bool twr_tag_temperature_get_temperature_raw ( twr_tag_temperature_t self,
int16_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 23 of file twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_init()

void twr_tag_temperature_init ( twr_tag_temperature_t self,
twr_i2c_channel_t  i2c_channel,
twr_tag_temperature_i2c_address_t  i2c_address 
)

Initialize HARDWARIO Temperature Module.

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

Definition at line 3 of file twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_measure()

bool twr_tag_temperature_measure ( twr_tag_temperature_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 twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_set_event_handler()

void twr_tag_temperature_set_event_handler ( twr_tag_temperature_t self,
void(*)(twr_tag_temperature_t *, twr_tag_temperature_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 twr_tag_temperature.c.

Here is the call graph for this function:

◆ twr_tag_temperature_set_update_interval()

void twr_tag_temperature_set_update_interval ( twr_tag_temperature_t self,
twr_tick_t  interval 
)

Set measurement interval.

Parameters
[in]selfInstance
[in]intervalMeasurement interval

Definition at line 13 of file twr_tag_temperature.c.

Here is the call graph for this function: