Firmware SDK
|
Driver for TMP112 temperature sensor. More...
Typedefs | |
typedef struct twr_tmp112_t | twr_tmp112_t |
TMP112 instance. | |
Enumerations | |
enum | twr_tmp112_event_t { TWR_TMP112_EVENT_ERROR = 0 , TWR_TMP112_EVENT_UPDATE = 1 } |
Callback events. More... | |
Functions | |
void | twr_tmp112_init (twr_tmp112_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address) |
Initialize TMP112. More... | |
void | twr_tmp112_deinit (twr_tmp112_t *self) |
Deinitialize TMP112. More... | |
void | twr_tmp112_set_event_handler (twr_tmp112_t *self, void(*event_handler)(twr_tmp112_t *, twr_tmp112_event_t, void *), void *event_param) |
Set callback function. More... | |
void | twr_tmp112_set_update_interval (twr_tmp112_t *self, twr_tick_t interval) |
Set measurement interval. More... | |
bool | twr_tmp112_measure (twr_tmp112_t *self) |
Start measurement manually. More... | |
bool | twr_tmp112_get_temperature_raw (twr_tmp112_t *self, int16_t *raw) |
Get measured temperature as raw value. More... | |
bool | twr_tmp112_get_temperature_celsius (twr_tmp112_t *self, float *celsius) |
Get measured temperature in degrees of Celsius. More... | |
bool | twr_tmp112_get_temperature_fahrenheit (twr_tmp112_t *self, float *fahrenheit) |
Get measured temperature in degrees of Fahrenheit. More... | |
bool | twr_tmp112_get_temperature_kelvin (twr_tmp112_t *self, float *kelvin) |
Get measured temperature in kelvin. More... | |
Driver for TMP112 temperature sensor.
enum twr_tmp112_event_t |
Callback events.
Enumerator | |
---|---|
TWR_TMP112_EVENT_ERROR | Error event. |
TWR_TMP112_EVENT_UPDATE | Update event. |
Definition at line 13 of file twr_tmp112.h.
void twr_tmp112_deinit | ( | twr_tmp112_t * | self | ) |
Deinitialize TMP112.
[in] | self | Instance |
Definition at line 26 of file twr_tmp112.c.
bool twr_tmp112_get_temperature_celsius | ( | twr_tmp112_t * | self, |
float * | celsius | ||
) |
Get measured temperature in degrees of Celsius.
[in] | self | Instance |
[out] | celsius | Pointer to variable where result will be stored |
Definition at line 83 of file twr_tmp112.c.
Referenced by twr_module_climate_get_temperature_celsius(), twr_tag_temperature_get_temperature_celsius(), twr_tmp112_get_temperature_fahrenheit(), and twr_tmp112_get_temperature_kelvin().
bool twr_tmp112_get_temperature_fahrenheit | ( | twr_tmp112_t * | self, |
float * | fahrenheit | ||
) |
Get measured temperature in degrees of Fahrenheit.
[in] | self | Instance |
[out] | fahrenheit | Pointer to variable where result will be stored |
Definition at line 97 of file twr_tmp112.c.
Referenced by twr_module_climate_get_temperature_fahrenheit(), and twr_tag_temperature_get_temperature_fahrenheit().
bool twr_tmp112_get_temperature_kelvin | ( | twr_tmp112_t * | self, |
float * | kelvin | ||
) |
Get measured temperature in kelvin.
[in] | self | Instance |
[out] | kelvin | Pointer to variable where result will be stored |
Definition at line 111 of file twr_tmp112.c.
Referenced by twr_module_climate_get_temperature_kelvin(), and twr_tag_temperature_get_temperature_kelvin().
bool twr_tmp112_get_temperature_raw | ( | twr_tmp112_t * | self, |
int16_t * | raw | ||
) |
Get measured temperature as raw value.
[in] | self | Instance |
[out] | raw | Pointer to variable where result will be stored |
Definition at line 71 of file twr_tmp112.c.
Referenced by twr_tag_temperature_get_temperature_raw(), and twr_tmp112_get_temperature_celsius().
void twr_tmp112_init | ( | twr_tmp112_t * | self, |
twr_i2c_channel_t | i2c_channel, | ||
uint8_t | i2c_address | ||
) |
Initialize TMP112.
[in] | self | Instance |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 11 of file twr_tmp112.c.
Referenced by twr_module_climate_init(), and twr_tag_temperature_init().
bool twr_tmp112_measure | ( | twr_tmp112_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 57 of file twr_tmp112.c.
Referenced by twr_module_climate_measure_all_sensors(), twr_module_climate_measure_thermometer(), twr_tag_temperature_measure(), and twr_tmp112_set_update_interval().
void twr_tmp112_set_event_handler | ( | twr_tmp112_t * | self, |
void(*)(twr_tmp112_t *, twr_tmp112_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 35 of file twr_tmp112.c.
Referenced by twr_module_climate_init(), and twr_tag_temperature_set_event_handler().
void twr_tmp112_set_update_interval | ( | twr_tmp112_t * | self, |
twr_tick_t | interval | ||
) |
Set measurement interval.
[in] | self | Instance |
[in] | interval | Measurement interval |
Definition at line 41 of file twr_tmp112.c.
Referenced by twr_module_climate_set_update_interval_all_sensors(), twr_module_climate_set_update_interval_thermometer(), and twr_tag_temperature_set_update_interval().