temphum24
2.1.0.0
|
API for configuring and manipulating TempHum 24 Click driver. More...
Modules | |
TempHum 24 Commands List | |
List of commands of TempHum 24 Click driver. | |
TempHum 24 Registers Settings | |
Settings for registers of TempHum 24 Click driver. | |
TempHum 24 MikroBUS Map | |
MikroBUS pin mapping of TempHum 24 Click driver. | |
Functions | |
void | temphum24_cfg_setup (temphum24_cfg_t *cfg) |
TempHum 24 configuration object setup function. More... | |
err_t | temphum24_init (temphum24_t *ctx, temphum24_cfg_t *cfg) |
TempHum 24 initialization function. More... | |
err_t | temphum24_default_cfg (temphum24_t *ctx) |
TempHum 24 default configuration function. More... | |
err_t | temphum24_write_cmd (temphum24_t *ctx, uint16_t cmd) |
TempHum 24 write cmd function. More... | |
err_t | temphum24_write_cmd_config (temphum24_t *ctx, uint16_t cmd, uint16_t config) |
TempHum 24 write cmd config function. More... | |
err_t | temphum24_read_single (temphum24_t *ctx, uint16_t *data_out) |
TempHum 24 read single function. More... | |
err_t | temphum24_read_multi (temphum24_t *ctx, uint16_t *data1_out, uint16_t *data2_out) |
TempHum 24 read multi function. More... | |
err_t | temphum24_write_then_read_single (temphum24_t *ctx, uint16_t cmd, uint16_t *data_out) |
TempHum 24 write then read single function. More... | |
err_t | temphum24_write_then_read_multi (temphum24_t *ctx, uint16_t cmd, uint16_t *data1_out, uint16_t *data2_out) |
TempHum 24 write then read multi function. More... | |
void | temphum24_enable_device (temphum24_t *ctx) |
TempHum 24 enable device function. More... | |
void | temphum24_disable_device (temphum24_t *ctx) |
TempHum 24 disable device function. More... | |
void | temphum24_reset_device (temphum24_t *ctx) |
TempHum 24 reset device function. More... | |
uint8_t | temphum24_get_alert_pin (temphum24_t *ctx) |
TempHum 24 get alert pin function. More... | |
err_t | temphum24_check_communication (temphum24_t *ctx) |
TempHum 24 check communication function. More... | |
err_t | temphum24_read_temp_and_rh (temphum24_t *ctx, float *temp, float *hum) |
TempHum 24 read temp and rh function. More... | |
err_t | temphum24_read_temp_history (temphum24_t *ctx, float *temp_min, float *temp_max) |
TempHum 24 read temp history function. More... | |
err_t | temphum24_read_rh_history (temphum24_t *ctx, float *hum_min, float *hum_max) |
TempHum 24 read rh history function. More... | |
err_t | temphum24_start_measurement (temphum24_t *ctx) |
TempHum 24 start measurement function. More... | |
err_t | temphum24_stop_measurement (temphum24_t *ctx) |
TempHum 24 stop measurement function. More... | |
err_t | temphum24_get_serial_number (temphum24_t *ctx, uint16_t *serial_number) |
TempHum 24 read serial number function. More... | |
API for configuring and manipulating TempHum 24 Click driver.
void temphum24_cfg_setup | ( | temphum24_cfg_t * | cfg | ) |
TempHum 24 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See temphum24_cfg_t object definition for detailed explanation. |
err_t temphum24_check_communication | ( | temphum24_t * | ctx | ) |
TempHum 24 check communication function.
This function checks the communication by reading and verifying the manufacturer ID.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_default_cfg | ( | temphum24_t * | ctx | ) |
TempHum 24 default configuration function.
This function executes a default configuration of TempHum 24 click board.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void temphum24_disable_device | ( | temphum24_t * | ctx | ) |
TempHum 24 disable device function.
This function disables device by setting the rst pin to low logic state.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
void temphum24_enable_device | ( | temphum24_t * | ctx | ) |
TempHum 24 enable device function.
This function enables device by setting the rst pin to low logic state.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
uint8_t temphum24_get_alert_pin | ( | temphum24_t * | ctx | ) |
TempHum 24 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
err_t temphum24_get_serial_number | ( | temphum24_t * | ctx, |
uint16_t * | serial_number | ||
) |
TempHum 24 read serial number function.
This function reads the serial number/NIST ID.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | serial_number | : Pointer to the memory location where serial number value be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_init | ( | temphum24_t * | ctx, |
temphum24_cfg_t * | cfg | ||
) |
TempHum 24 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See temphum24_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_read_multi | ( | temphum24_t * | ctx, |
uint16_t * | data1_out, | ||
uint16_t * | data2_out | ||
) |
TempHum 24 read multi function.
This function reads two data words from the device by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | data1_out | : Output read word data 1. |
[out] | data2_out | : Output read word data 2. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_read_rh_history | ( | temphum24_t * | ctx, |
float * | hum_min, | ||
float * | hum_max | ||
) |
TempHum 24 read rh history function.
This function reads the relative humidity minimum and maximum values since the beginning of measurements.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | hum_min | : Minimum relative humidity level in percents. |
[out] | hum_max | : Maximum relative humidity level in percents. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_read_single | ( | temphum24_t * | ctx, |
uint16_t * | data_out | ||
) |
TempHum 24 read single function.
This function reads a single data word from the device by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | data_out | : Output read word data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_read_temp_and_rh | ( | temphum24_t * | ctx, |
float * | temp, | ||
float * | hum | ||
) |
TempHum 24 read temp and rh function.
This function reads the temperature in celsius and the relative humidity level in percents.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | temp | : Temperature measurements in celsius. |
[out] | hum | : Humidity measurements in percents. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_read_temp_history | ( | temphum24_t * | ctx, |
float * | temp_min, | ||
float * | temp_max | ||
) |
TempHum 24 read temp history function.
This function reads the temperature minimum and maximum values since the beginning of measurements.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[out] | temp_min | : Minimum temperature value in celsius. |
[out] | temp_max | : Maximum temperature value in celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void temphum24_reset_device | ( | temphum24_t * | ctx | ) |
TempHum 24 reset device function.
This function resets device by toggling the rst pin state.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
err_t temphum24_start_measurement | ( | temphum24_t * | ctx | ) |
TempHum 24 start measurement function.
This function starts the auto measurement with 1 Hz rate and default low power mode.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_stop_measurement | ( | temphum24_t * | ctx | ) |
TempHum 24 stop measurement function.
This function exits the auto measurement mode and returns to sleep mode.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_write_cmd | ( | temphum24_t * | ctx, |
uint16_t | cmd | ||
) |
TempHum 24 write cmd function.
This function writes the selected command word by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_write_cmd_config | ( | temphum24_t * | ctx, |
uint16_t | cmd, | ||
uint16_t | config | ||
) |
TempHum 24 write cmd config function.
This function writes a desired config to the selected command word by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[in] | cmd | : Command word to configure. |
[in] | config | : Command config to be set. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_write_then_read_multi | ( | temphum24_t * | ctx, |
uint16_t | cmd, | ||
uint16_t * | data1_out, | ||
uint16_t * | data2_out | ||
) |
TempHum 24 write then read multi function.
This function writes command word then reads two data words from the device by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
[out] | data1_out | : Output read word data 1. |
[out] | data2_out | : Output read word data 2. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum24_write_then_read_single | ( | temphum24_t * | ctx, |
uint16_t | cmd, | ||
uint16_t * | data_out | ||
) |
TempHum 24 write then read single function.
This function write command word then reads a single data word from the device by using I2C serial interface.
[in] | ctx | : Click context object. See temphum24_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
[out] | data_out | : Output read word data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.