temphum21 2.0.0.0
|
API for configuring and manipulating TempHum 21 Click driver. More...
Topics | |
TempHum 21 Registers List | |
List of registers of TempHum 21 Click driver. | |
TempHum 21 Registers Settings | |
Settings for registers of TempHum 21 Click driver. | |
TempHum 21 MikroBUS Map | |
MikroBUS pin mapping of TempHum 21 Click driver. | |
Functions | |
void | temphum21_cfg_setup (temphum21_cfg_t *cfg) |
TempHum 21 configuration object setup function. | |
err_t | temphum21_init (temphum21_t *ctx, temphum21_cfg_t *cfg) |
TempHum 21 initialization function. | |
err_t | temphum21_default_cfg (temphum21_t *ctx) |
TempHum 21 default configuration function. | |
err_t | temphum21_request_measurement (temphum21_t *ctx) |
TempHum 21 request measurement function. | |
err_t | temphum21_read_measurement (temphum21_t *ctx, float *temperature, float *humidity) |
TempHum 21 read measurement function. | |
uint8_t | temphum21_get_all_pin (temphum21_t *ctx) |
TempHum 21 get all pin function. | |
uint8_t | temphum21_get_alh_pin (temphum21_t *ctx) |
TempHum 21 get alh pin function. | |
void | temphum21_enable_device (temphum21_t *ctx) |
TempHum 21 enable device function. | |
void | temphum21_disable_device (temphum21_t *ctx) |
TempHum 21 disable device function. | |
err_t | temphum21_enter_command_mode (temphum21_t *ctx) |
TempHum 21 enter command mode function. | |
err_t | temphum21_exit_command_mode (temphum21_t *ctx) |
TempHum 21 exit command mode function. | |
err_t | temphum21_eeprom_read (temphum21_t *ctx, uint8_t address, uint8_t *status, uint16_t *data_out) |
TempHum 21 eeprom read function. | |
err_t | temphum21_eeprom_write (temphum21_t *ctx, uint8_t address, uint16_t data_in) |
TempHum 21 eeprom write function. | |
API for configuring and manipulating TempHum 21 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void temphum21_cfg_setup | ( | temphum21_cfg_t * | cfg | ) |
TempHum 21 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See temphum21_cfg_t object definition for detailed explanation. |
err_t temphum21_default_cfg | ( | temphum21_t * | ctx | ) |
TempHum 21 default configuration function.
This function executes a default configuration of TempHum 21 click board.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void temphum21_disable_device | ( | temphum21_t * | ctx | ) |
TempHum 21 disable device function.
This function disables the device by setting the EN pin to LOW logic state.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
err_t temphum21_eeprom_read | ( | temphum21_t * | ctx, |
uint8_t | address, | ||
uint8_t * | status, | ||
uint16_t * | data_out ) |
TempHum 21 eeprom read function.
This function reads data from a desired eeprom address.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
[in] | address | : Address to read data from. |
[out] | status | : Status byte read (Status-Diagnostic-Response bits: SS-DDDD-RR). |
[out] | data_out | : Output data read. |
0
- Success. -1
- Error. See #err_t definition for detailed explanation. err_t temphum21_eeprom_write | ( | temphum21_t * | ctx, |
uint8_t | address, | ||
uint16_t | data_in ) |
TempHum 21 eeprom write function.
This function writes data to a desired eeprom address.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
[in] | address | : Address to write data to. |
[in] | data_in | : Data to be written. |
0
- Success. -1
- Error. See #err_t definition for detailed explanation. void temphum21_enable_device | ( | temphum21_t * | ctx | ) |
TempHum 21 enable device function.
This function enables the device by setting the EN pin to HIGH logic state.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
err_t temphum21_enter_command_mode | ( | temphum21_t * | ctx | ) |
TempHum 21 enter command mode function.
This function enters the command mode.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
0
- Success. -1
- Error. See #err_t definition for detailed explanation. err_t temphum21_exit_command_mode | ( | temphum21_t * | ctx | ) |
TempHum 21 exit command mode function.
This function exits the command mode and enters the normal operating mode.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
0
- Success. -1
- Error. See #err_t definition for detailed explanation. uint8_t temphum21_get_alh_pin | ( | temphum21_t * | ctx | ) |
TempHum 21 get alh pin function.
This function returns the alarm high (ALH) pin logic state.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
uint8_t temphum21_get_all_pin | ( | temphum21_t * | ctx | ) |
TempHum 21 get all pin function.
This function returns the alarm low (ALL) pin logic state.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
err_t temphum21_init | ( | temphum21_t * | ctx, |
temphum21_cfg_t * | cfg ) |
TempHum 21 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See temphum21_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t temphum21_read_measurement | ( | temphum21_t * | ctx, |
float * | temperature, | ||
float * | humidity ) |
TempHum 21 read measurement function.
This function requests measurement and waits for a measurement to complete and after that reads temperature in Celsius and relative humidity in percents.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
[out] | humidity | : Relative humidity in Percents. |
0x80
- Device in Command Mode - Command Mode is used for programming the sensor. 0x40
- Stale Data: Data that has already been fetched since the last measurement cycle, or data fetched before the first measurement has been completed. 0x00
- Normal Operation, Valid Data that has not been fetched since the last measurement cycle. -1
- Error. See #err_t definition for detailed explanation. err_t temphum21_request_measurement | ( | temphum21_t * | ctx | ) |
TempHum 21 request measurement function.
This function sends a request mesurement command.
[in] | ctx | : Click context object. See temphum21_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.