Firmware SDK
twr_module_climate

Driver for HARDWARIO Climate Module. More...

Enumerations

enum  twr_module_climate_event_t {
  TWR_MODULE_CLIMATE_EVENT_ERROR_THERMOMETER = 0 ,
  TWR_MODULE_CLIMATE_EVENT_ERROR_HYGROMETER = 1 ,
  TWR_MODULE_CLIMATE_EVENT_ERROR_LUX_METER = 2 ,
  TWR_MODULE_CLIMATE_EVENT_ERROR_BAROMETER = 3 ,
  TWR_MODULE_CLIMATE_EVENT_UPDATE_THERMOMETER = 4 ,
  TWR_MODULE_CLIMATE_EVENT_UPDATE_HYGROMETER = 5 ,
  TWR_MODULE_CLIMATE_EVENT_UPDATE_LUX_METER = 6 ,
  TWR_MODULE_CLIMATE_EVENT_UPDATE_BAROMETER = 7
}
 Callback events. More...
 
enum  twr_module_climate_revision_t {
  TWR_MODULE_CLIMATE_REVISION_R1 = 0 ,
  TWR_MODULE_CLIMATE_REVISION_R2 = 1
}
 Climate Module hardware revision. More...
 

Functions

void twr_module_climate_init (void)
 Initialize HARDWARIO Climate Module.
 
void twr_module_climate_set_event_handler (void(*event_handler)(twr_module_climate_event_t, void *), void *event_param)
 Set callback function. More...
 
void twr_module_climate_set_update_interval_all_sensors (twr_tick_t interval)
 Set measurement interval for all sensors. More...
 
void twr_module_climate_set_update_interval_thermometer (twr_tick_t interval)
 Set measurement interval for thermometer. More...
 
void twr_module_climate_set_update_interval_hygrometer (twr_tick_t interval)
 Set measurement interval for hygrometer. More...
 
void twr_module_climate_set_update_interval_lux_meter (twr_tick_t interval)
 Set measurement interval for lux meter. More...
 
void twr_module_climate_set_update_interval_barometer (twr_tick_t interval)
 Set measurement interval for barometer. More...
 
bool twr_module_climate_measure_all_sensors (void)
 Start measurement of all sensors manually. More...
 
bool twr_module_climate_measure_thermometer (void)
 Start thermometer measurement manually. More...
 
bool twr_module_climate_measure_hygrometer (void)
 Start hygrometer measurement manually. More...
 
bool twr_module_climate_measure_lux_meter (void)
 Start lux meter measurement manually. More...
 
bool twr_module_climate_measure_barometer (void)
 Start barometer measurement manually. More...
 
bool twr_module_climate_get_temperature_celsius (float *celsius)
 Get measured temperature in degrees of Celsius. More...
 
bool twr_module_climate_get_temperature_fahrenheit (float *fahrenheit)
 Get measured temperature in degrees of Fahrenheit. More...
 
bool twr_module_climate_get_temperature_kelvin (float *kelvin)
 Get measured temperature in kelvin. More...
 
bool twr_module_climate_get_humidity_percentage (float *percentage)
 Get measured humidity as percentage. More...
 
bool twr_module_climate_get_illuminance_lux (float *lux)
 Get measured illuminance in lux. More...
 
bool twr_module_climate_get_altitude_meter (float *meter)
 Get measured altitude in meters. More...
 
bool twr_module_climate_get_pressure_pascal (float *pascal)
 Get measured pressure in Pascal. More...
 
twr_module_climate_revision_t twr_module_climate_get_revision (void)
 Get hardware revision.
 

Detailed Description

Driver for HARDWARIO Climate Module.

Enumeration Type Documentation

◆ twr_module_climate_event_t

Callback events.

Enumerator
TWR_MODULE_CLIMATE_EVENT_ERROR_THERMOMETER 

Error event for thermometer.

TWR_MODULE_CLIMATE_EVENT_ERROR_HYGROMETER 

Error event for hygrometer.

TWR_MODULE_CLIMATE_EVENT_ERROR_LUX_METER 

Error event for lux meter.

TWR_MODULE_CLIMATE_EVENT_ERROR_BAROMETER 

Error event for barometer.

TWR_MODULE_CLIMATE_EVENT_UPDATE_THERMOMETER 

Update event for thermometer.

TWR_MODULE_CLIMATE_EVENT_UPDATE_HYGROMETER 

Update event for hygrometer.

TWR_MODULE_CLIMATE_EVENT_UPDATE_LUX_METER 

Update event for lux meter.

TWR_MODULE_CLIMATE_EVENT_UPDATE_BAROMETER 

Update event for barometer.

Definition at line 12 of file twr_module_climate.h.

◆ twr_module_climate_revision_t

Climate Module hardware revision.

Enumerator
TWR_MODULE_CLIMATE_REVISION_R1 

Hardware revision R1.

TWR_MODULE_CLIMATE_REVISION_R2 

Hardware revision R2.

Definition at line 42 of file twr_module_climate.h.

Function Documentation

◆ twr_module_climate_get_altitude_meter()

bool twr_module_climate_get_altitude_meter ( float *  meter)

Get measured altitude in meters.

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

Definition at line 200 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_humidity_percentage()

bool twr_module_climate_get_humidity_percentage ( float *  percentage)

Get measured humidity as percentage.

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

Definition at line 186 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_illuminance_lux()

bool twr_module_climate_get_illuminance_lux ( float *  lux)

Get measured illuminance in lux.

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

Definition at line 195 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_pressure_pascal()

bool twr_module_climate_get_pressure_pascal ( float *  pascal)

Get measured pressure in Pascal.

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

Definition at line 205 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_temperature_celsius()

bool twr_module_climate_get_temperature_celsius ( float *  celsius)

Get measured temperature in degrees of Celsius.

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

Definition at line 159 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_temperature_fahrenheit()

bool twr_module_climate_get_temperature_fahrenheit ( float *  fahrenheit)

Get measured temperature in degrees of Fahrenheit.

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

Definition at line 168 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_get_temperature_kelvin()

bool twr_module_climate_get_temperature_kelvin ( float *  kelvin)

Get measured temperature in kelvin.

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

Definition at line 177 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_measure_all_sensors()

bool twr_module_climate_measure_all_sensors ( void  )

Start measurement of all sensors manually.

Returns
true On success
false When other measurement is in progress

Definition at line 113 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_measure_barometer()

bool twr_module_climate_measure_barometer ( void  )

Start barometer measurement manually.

Returns
true On success
false When other measurement is in progress

Definition at line 154 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_measure_hygrometer()

bool twr_module_climate_measure_hygrometer ( void  )

Start hygrometer measurement manually.

Returns
true On success
false When other measurement is in progress

Definition at line 140 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_measure_lux_meter()

bool twr_module_climate_measure_lux_meter ( void  )

Start lux meter measurement manually.

Returns
true On success
false When other measurement is in progress

Definition at line 149 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_measure_thermometer()

bool twr_module_climate_measure_thermometer ( void  )

Start thermometer measurement manually.

Returns
true On success
false When other measurement is in progress

Definition at line 135 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_set_event_handler()

void twr_module_climate_set_event_handler ( void(*)(twr_module_climate_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

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

Definition at line 57 of file twr_module_climate.c.

◆ twr_module_climate_set_update_interval_all_sensors()

void twr_module_climate_set_update_interval_all_sensors ( twr_tick_t  interval)

Set measurement interval for all sensors.

Parameters
[in]intervalMeasurement interval

Definition at line 63 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_set_update_interval_barometer()

void twr_module_climate_set_update_interval_barometer ( twr_tick_t  interval)

Set measurement interval for barometer.

Parameters
[in]intervalMeasurement interval

Definition at line 108 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_set_update_interval_hygrometer()

void twr_module_climate_set_update_interval_hygrometer ( twr_tick_t  interval)

Set measurement interval for hygrometer.

Parameters
[in]intervalMeasurement interval

Definition at line 90 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_set_update_interval_lux_meter()

void twr_module_climate_set_update_interval_lux_meter ( twr_tick_t  interval)

Set measurement interval for lux meter.

Parameters
[in]intervalMeasurement interval

Definition at line 103 of file twr_module_climate.c.

Here is the call graph for this function:

◆ twr_module_climate_set_update_interval_thermometer()

void twr_module_climate_set_update_interval_thermometer ( twr_tick_t  interval)

Set measurement interval for thermometer.

Parameters
[in]intervalMeasurement interval

Definition at line 81 of file twr_module_climate.c.

Here is the call graph for this function: