temphum20
2.0.0.0
|
API for configuring and manipulating TempHum 20 Click driver. More...
Modules | |
TempHum 20 Registers List | |
List of registers of TempHum 20 Click driver. | |
TempHum 20 Registers Settings | |
Settings for registers of TempHum 20 Click driver. | |
TempHum 20 MikroBUS Map | |
MikroBUS pin mapping of TempHum 20 Click driver. | |
Functions | |
void | temphum20_cfg_setup (temphum20_cfg_t *cfg) |
TempHum 20 configuration object setup function. More... | |
err_t | temphum20_init (temphum20_t *ctx, temphum20_cfg_t *cfg) |
TempHum 20 initialization function. More... | |
err_t | temphum20_default_cfg (temphum20_t *ctx) |
TempHum 20 default configuration function. More... | |
err_t | temphum20_write_data (temphum20_t *ctx, uint8_t *tx_buf, uint8_t tx_len) |
TempHum 20 I2C writing function. More... | |
err_t | temphum20_read_data (temphum20_t *ctx, uint8_t *rx_buf, uint8_t rx_len) |
TempHum 20 I2C reading function. More... | |
void | temphum20_set_en_pin (temphum20_t *ctx, uint8_t state) |
TempHum 20 set EN pin function. More... | |
uint8_t | temphum20_get_int_pin (temphum20_t *ctx) |
TempHum 20 get INT pin function. More... | |
uint8_t | temphum20_get_alarm_high_pin (temphum20_t *ctx) |
TempHum 20 get alarm high pin function. More... | |
uint8_t | temphum20_get_alarm_low_pin (temphum20_t *ctx) |
TempHum 20 get alarm low pin function. More... | |
void | temphum20_reset_device (temphum20_t *ctx) |
TempHum 20 reset device function. More... | |
err_t | temphum20_write_command (temphum20_t *ctx, uint8_t cmd_byte, uint16_t cmd_data) |
TempHum 20 write command function. More... | |
err_t | temphum20_get_measurement (temphum20_t *ctx, float *temp, float *hum) |
TempHum 20 get measurement function. More... | |
err_t | temphum20_set_operating_mode (temphum20_t *ctx, uint8_t op_mode) |
TempHum 20 set operating mode function. More... | |
API for configuring and manipulating TempHum 20 Click driver.
void temphum20_cfg_setup | ( | temphum20_cfg_t * | cfg | ) |
TempHum 20 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See temphum20_cfg_t object definition for detailed explanation. |
err_t temphum20_default_cfg | ( | temphum20_t * | ctx | ) |
TempHum 20 default configuration function.
This function executes a default configuration of TempHum 20 click board.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint8_t temphum20_get_alarm_high_pin | ( | temphum20_t * | ctx | ) |
TempHum 20 get alarm high pin function.
This function returns the alarm high (ALH) pin logic state.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
uint8_t temphum20_get_alarm_low_pin | ( | temphum20_t * | ctx | ) |
TempHum 20 get alarm low pin function.
This function returns the alarm low (ALL) pin logic state.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
uint8_t temphum20_get_int_pin | ( | temphum20_t * | ctx | ) |
TempHum 20 get INT pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
err_t temphum20_get_measurement | ( | temphum20_t * | ctx, |
float * | temp, | ||
float * | hum | ||
) |
TempHum 20 get measurement function.
This function waits for the data to be ready, and then reads the temperature and humidity data and converts them to Celsius and Percents, respectively.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[out] | temp | : Temperature data in Celsius. |
[out] | hum | : Humidity data in Percents. |
0
- Success, -1
- Error.err_t temphum20_init | ( | temphum20_t * | ctx, |
temphum20_cfg_t * | cfg | ||
) |
TempHum 20 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See temphum20_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t temphum20_read_data | ( | temphum20_t * | ctx, |
uint8_t * | rx_buf, | ||
uint8_t | rx_len | ||
) |
TempHum 20 I2C reading function.
This function reads a desired number of data bytes by using I2C serial interface.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.void temphum20_reset_device | ( | temphum20_t * | ctx | ) |
TempHum 20 reset device function.
This function resets the device by toggling the EN pin.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
void temphum20_set_en_pin | ( | temphum20_t * | ctx, |
uint8_t | state | ||
) |
TempHum 20 set EN pin function.
This function sets the EN pin to a desired logic state.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t temphum20_set_operating_mode | ( | temphum20_t * | ctx, |
uint8_t | op_mode | ||
) |
TempHum 20 set operating mode function.
This function sets the device operating mode.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[in] | op_mode | :
|
0
- Success, -1
- Error.err_t temphum20_write_command | ( | temphum20_t * | ctx, |
uint8_t | cmd_byte, | ||
uint16_t | cmd_data | ||
) |
TempHum 20 write command function.
This function writes a desired command data to the selected command byte.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[in] | cmd_byte | : Command byte. |
[in] | cmd_data | : Command data. |
0
- Success, -1
- Error.err_t temphum20_write_data | ( | temphum20_t * | ctx, |
uint8_t * | tx_buf, | ||
uint8_t | tx_len | ||
) |
TempHum 20 I2C writing function.
This function writes a desired number of data bytes by using I2C serial interface.
[in] | ctx | : Click context object. See temphum20_t object definition for detailed explanation. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.