|
temphum27 2.2.0
|
API for configuring and manipulating TempHum 27 Click driver. More...
Topics | |
| TempHum 27 Registers List | |
| List of registers of TempHum 27 Click driver. | |
| TempHum 27 Registers Settings | |
| Settings for registers of TempHum 27 Click driver. | |
| TempHum 27 MikroBUS Map | |
| MikroBUS pin mapping of TempHum 27 Click driver. | |
Functions | |
| void | temphum27_cfg_setup (temphum27_cfg_t *cfg) |
| TempHum 27 configuration object setup function. | |
| err_t | temphum27_init (temphum27_t *ctx, temphum27_cfg_t *cfg) |
| TempHum 27 initialization function. | |
| err_t | temphum27_write_reg (temphum27_t *ctx, uint8_t reg, uint8_t data_in) |
| TempHum 27 write register function. | |
| err_t | temphum27_read_reg (temphum27_t *ctx, uint8_t reg, uint8_t *data_out) |
| TempHum 27 read register function. | |
| err_t | temphum27_read_data_hold (temphum27_t *ctx, float *temp, float *hum) |
| TempHum 27 read data (hold mode) function. | |
| err_t | temphum27_read_data_no_hold (temphum27_t *ctx, float *temp, float *hum) |
| TempHum 27 read data (no hold mode) function. | |
| err_t | temphum27_start_periodic_meas (temphum27_t *ctx, uint8_t freq) |
| TempHum 27 start periodic measurement function. | |
| err_t | temphum27_stop_periodic_meas (temphum27_t *ctx) |
| TempHum 27 stop periodic measurement function. | |
| err_t | temphum27_read_data_periodic (temphum27_t *ctx, float *temp, float *hum) |
| TempHum 27 read data in periodic mode function. | |
| err_t | temphum27_read_data_periodic_al (temphum27_t *ctx, float *temp, float *hum, uint8_t *alert) |
| TempHum 27 read data and alert in periodic mode function. | |
| err_t | temphum27_read_sensor_id (temphum27_t *ctx, uint32_t *sensor_id) |
| TempHum 27 read sensor ID function. | |
| void | temphum27_enable_device (temphum27_t *ctx) |
| TempHum 27 enable device function. | |
| void | temphum27_disable_device (temphum27_t *ctx) |
| TempHum 27 disable device function. | |
| void | temphum27_reset_device (temphum27_t *ctx) |
| TempHum 27 reset device function. | |
| uint8_t | temphum27_get_alert_pin (temphum27_t *ctx) |
| TempHum 27 get alert pin function. | |
API for configuring and manipulating TempHum 27 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void temphum27_cfg_setup | ( | temphum27_cfg_t * | cfg | ) |
TempHum 27 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See temphum27_cfg_t object definition for detailed explanation. |
| void temphum27_disable_device | ( | temphum27_t * | ctx | ) |
TempHum 27 disable device function.
This function sets the EN pin to low logic level to disable the device.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| void temphum27_enable_device | ( | temphum27_t * | ctx | ) |
TempHum 27 enable device function.
This function sets the EN pin to high logic level to enable the device.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| uint8_t temphum27_get_alert_pin | ( | temphum27_t * | ctx | ) |
TempHum 27 get alert pin function.
This function reads the logic level of the ALR (alert) pin.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| err_t temphum27_init | ( | temphum27_t * | ctx, |
| temphum27_cfg_t * | cfg ) |
TempHum 27 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See temphum27_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t temphum27_read_data_hold | ( | temphum27_t * | ctx, |
| float * | temp, | ||
| float * | hum ) |
TempHum 27 read data (hold mode) function.
This function reads temperature and/or humidity in hold mode and converts to physical values.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [out] | temp | : Pointer to temperature in Celsius. |
| [out] | hum | : Pointer to relative humidity in percentage. |
0 - Success, -1 - Error. | err_t temphum27_read_data_no_hold | ( | temphum27_t * | ctx, |
| float * | temp, | ||
| float * | hum ) |
TempHum 27 read data (no hold mode) function.
This function performs a no-hold measurement and reads temperature and/or humidity.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [out] | temp | : Pointer to temperature in Celsius. |
| [out] | hum | : Pointer to relative humidity in percentage. |
0 - Success, -1 - Error. | err_t temphum27_read_data_periodic | ( | temphum27_t * | ctx, |
| float * | temp, | ||
| float * | hum ) |
TempHum 27 read data in periodic mode function.
This function reads temperature and/or humidity data in periodic measurement mode.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [out] | temp | : Pointer to temperature in Celsius. |
| [out] | hum | : Pointer to relative humidity in percentage. |
0 - Success, -1 - Error. | err_t temphum27_read_data_periodic_al | ( | temphum27_t * | ctx, |
| float * | temp, | ||
| float * | hum, | ||
| uint8_t * | alert ) |
TempHum 27 read data and alert in periodic mode function.
This function reads temperature, humidity, and alert status during periodic measurements.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [out] | temp | : Pointer to temperature in Celsius. |
| [out] | hum | : Pointer to relative humidity in percentage. |
| [out] | alert | : Pointer to alert flag byte. |
0 - Success, -1 - Error. | err_t temphum27_read_reg | ( | temphum27_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
TempHum 27 read register function.
This function reads a byte of data from the selected register using I2C communication.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to memory where the read byte will be stored. |
0 - Success, -1 - Error. | err_t temphum27_read_sensor_id | ( | temphum27_t * | ctx, |
| uint32_t * | sensor_id ) |
TempHum 27 read sensor ID function.
This function reads the unique 32-bit sensor ID.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [out] | sensor_id | : Pointer to memory where sensor ID will be stored. |
0 - Success, -1 - Error. | void temphum27_reset_device | ( | temphum27_t * | ctx | ) |
TempHum 27 reset device function.
This function performs a hardware reset by toggling the EN pin.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| err_t temphum27_start_periodic_meas | ( | temphum27_t * | ctx, |
| uint8_t | freq ) |
TempHum 27 start periodic measurement function.
This function configures and starts periodic measurement mode at the specified frequency.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [in] | freq | : Measurement frequency.
|
0 - Success, -1 - Error. | err_t temphum27_stop_periodic_meas | ( | temphum27_t * | ctx | ) |
TempHum 27 stop periodic measurement function.
This function stops any ongoing periodic measurement.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t temphum27_write_reg | ( | temphum27_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
TempHum 27 write register function.
This function writes a data byte to the selected register using I2C communication.
| [in] | ctx | : Click context object. See temphum27_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to be written. |
0 - Success, -1 - Error.