temphum25
2.1.0.0
|
API for configuring and manipulating TempHum 25 Click driver. More...
Modules | |
TempHum 25 Registers List | |
List of registers of TempHum 25 Click driver. | |
TempHum 25 Registers Settings | |
Settings for registers of TempHum 25 Click driver. | |
TempHum 25 MikroBUS Map | |
MikroBUS pin mapping of TempHum 25 Click driver. | |
Functions | |
void | temphum25_cfg_setup (temphum25_cfg_t *cfg) |
TempHum 25 configuration object setup function. More... | |
err_t | temphum25_init (temphum25_t *ctx, temphum25_cfg_t *cfg) |
TempHum 25 initialization function. More... | |
err_t | temphum25_send_command (temphum25_t *ctx, uint16_t cmd) |
TempHum 25 send command function. More... | |
err_t | temphum25_start_measurement (temphum25_t *ctx, uint16_t meas_cmd) |
TempHum 25 start measurement function. More... | |
err_t | temphum25_stop_measurement (temphum25_t *ctx) |
TempHum 25 stop measurement function. More... | |
err_t | temphum25_read_measurement (temphum25_t *ctx, float *temperature, float *humidity) |
TempHum 25 read measurement function. More... | |
err_t | temphum25_read_serial_num (temphum25_t *ctx, uint32_t *serial_num) |
TempHum 25 read serial num function. More... | |
err_t | temphum25_read_status (temphum25_t *ctx, uint16_t *status) |
TempHum 25 read status function. More... | |
err_t | temphum25_clear_status (temphum25_t *ctx) |
TempHum 25 clear status function. More... | |
err_t | temphum25_enable_heater (temphum25_t *ctx) |
TempHum 25 enable heater function. More... | |
err_t | temphum25_disable_heater (temphum25_t *ctx) |
TempHum 25 disable heater function. More... | |
err_t | temphum25_soft_reset (temphum25_t *ctx) |
TempHum 25 soft reset function. More... | |
void | temphum25_set_rst_pin (temphum25_t *ctx, uint8_t state) |
TempHum 25 set rst pin function. More... | |
void | temphum25_reset_device (temphum25_t *ctx) |
TempHum 25 reset device function. More... | |
uint8_t | temphum25_get_alert_pin (temphum25_t *ctx) |
TempHum 25 get alert pin function. More... | |
API for configuring and manipulating TempHum 25 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void temphum25_cfg_setup | ( | temphum25_cfg_t * | cfg | ) |
TempHum 25 configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See temphum25_cfg_t object definition for detailed explanation. |
err_t temphum25_clear_status | ( | temphum25_t * | ctx | ) |
TempHum 25 clear status function.
This function clears the status register.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_disable_heater | ( | temphum25_t * | ctx | ) |
TempHum 25 disable heater function.
This function disables the internal heater.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_enable_heater | ( | temphum25_t * | ctx | ) |
TempHum 25 enable heater function.
This function enables the internal heater.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t temphum25_get_alert_pin | ( | temphum25_t * | ctx | ) |
TempHum 25 get alert pin function.
This function returns the alert pin logic state.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
err_t temphum25_init | ( | temphum25_t * | ctx, |
temphum25_cfg_t * | cfg | ||
) |
TempHum 25 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See temphum25_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_read_measurement | ( | temphum25_t * | ctx, |
float * | temperature, | ||
float * | humidity | ||
) |
TempHum 25 read measurement function.
This function reads the temperature and humidity measurements results.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[out] | temperature | : Temperature measurement result in degrees Celsius. |
[out] | humidity | : Relative humidity measurement result in percents. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_read_serial_num | ( | temphum25_t * | ctx, |
uint32_t * | serial_num | ||
) |
TempHum 25 read serial num function.
This function reads the 4-bytes unique serial number by using I2C serial interface.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[out] | serial_num | : 4-bytes unique serial number. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_read_status | ( | temphum25_t * | ctx, |
uint16_t * | status | ||
) |
TempHum 25 read status function.
This function reads the 2-bytes status register by using I2C serial interface.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[out] | status | : 2-bytes status register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void temphum25_reset_device | ( | temphum25_t * | ctx | ) |
TempHum 25 reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
err_t temphum25_send_command | ( | temphum25_t * | ctx, |
uint16_t | cmd | ||
) |
TempHum 25 send command function.
This function sends the selected command word by using I2C serial interface.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[in] | cmd | : Command word to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void temphum25_set_rst_pin | ( | temphum25_t * | ctx, |
uint8_t | state | ||
) |
TempHum 25 set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t temphum25_soft_reset | ( | temphum25_t * | ctx | ) |
TempHum 25 soft reset function.
This function performs the software reset by sending the soft reset command.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_start_measurement | ( | temphum25_t * | ctx, |
uint16_t | meas_cmd | ||
) |
TempHum 25 start measurement function.
This function starts the measurement by sending the selected measurement command.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
[in] | meas_cmd | : Measurement command word to be written. See #TEMPHUM25_CMD_MEAS_x macros definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum25_stop_measurement | ( | temphum25_t * | ctx | ) |
TempHum 25 stop measurement function.
This function stops the continuous measurement.
[in] | ctx | : Click context object. See temphum25_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.