sht 2.0.0.0
|
Functions | |
void | sht_cfg_setup (sht_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | sht_init (sht_t *ctx, sht_cfg_t *cfg) |
Initialization function. | |
void | sht_generic_write (sht_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | sht_generic_read (sht_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | sht_reset (sht_t *ctx) |
Resets settings. | |
void | sht_hw_reset (sht_t *ctx) |
Resets device. | |
uint8_t | sht_int_get (sht_t *ctx) |
Int status. | |
void | sht_rst_set (sht_t *ctx, uint8_t state) |
Int status. | |
void | sht_set_clk_strecth (sht_t *ctx, uint8_t clk_stretching) |
Sets the clock stretching state. | |
void | sht_set_repeats (sht_t *ctx, uint8_t repeatability) |
Sets the repeatability value. | |
void | sht_set_mps (sht_t *ctx, uint8_t measure_per_second) |
Measurements per Second. | |
float | sht_temp_ss (sht_t *ctx) |
Single Shot Temperature Measurement. | |
float | sht_hum_ss (sht_t *ctx) |
Single Shot Humidity Measurement. | |
void | sht_start_pm (sht_t *ctx) |
Start Periodic Measurement. | |
float | sht_temp_pm (sht_t *ctx) |
Periodic Mode Temperature. | |
float | sht_hum_pm (sht_t *ctx) |
Periodic Mode Humidity. | |
void | sht_stop_pm (sht_t *ctx) |
Stop Periodic Measurement. | |
void | sht_software_rst (sht_t *ctx) |
Software Reset. | |
void | sht_heater_control (sht_t *ctx, uint8_t state) |
Heater State. | |
void | sht_clear_status (sht_t *ctx) |
Clears Status Register. | |
uint8_t | sht_alert_status (sht_t *ctx) |
Alert Status. | |
uint8_t | sht_heater_status (sht_t *ctx) |
Heater State. | |
uint8_t | sht_hum_status (sht_t *ctx) |
Humidity Alert. | |
uint8_t | sht_temp_status (sht_t *ctx) |
Temperature Alert. | |
uint8_t | sht_reset_status (sht_t *ctx) |
System Reset. | |
uint8_t | sht_cmd_status (sht_t *ctx) |
Command Status. | |
uint8_t | sht_wr_chksum_status (sht_t *ctx) |
Checksum Status. | |
uint8_t sht_alert_status | ( | sht_t * | ctx | ) |
Alert Status.
ctx | Click object. |
Returns does device have pending status about any of posibile error.
void sht_cfg_setup | ( | sht_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void sht_clear_status | ( | sht_t * | ctx | ) |
Clears Status Register.
ctx | Click object. |
The status register contains informations about the operational status of the heater, the alert mode and on the execution status of the last command and the last write sequence.
uint8_t sht_cmd_status | ( | sht_t * | ctx | ) |
Command Status.
ctx | Click object. |
Returns information about last command execution.
void sht_generic_read | ( | sht_t * | ctx, |
uint8_t * | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
This function reads data from the desired register.
void sht_generic_write | ( | sht_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
This function writes data to the desired register.
void sht_heater_control | ( | sht_t * | ctx, |
uint8_t | state ) |
Heater State.
ctx | Click object. |
state | ( true / false ) |
Sets the heater state.
uint8_t sht_heater_status | ( | sht_t * | ctx | ) |
Heater State.
ctx | Click object. |
Returns information about current heater state.
float sht_hum_pm | ( | sht_t * | ctx | ) |
Periodic Mode Humidity.
ctx | Click object. |
Returns humidity measurement in periodic mode.
float sht_hum_ss | ( | sht_t * | ctx | ) |
Single Shot Humidity Measurement.
Returns humidity measurement in single shot mode.
uint8_t sht_hum_status | ( | sht_t * | ctx | ) |
Humidity Alert.
ctx | Click object. |
Returns does humididty tracking alert exists.
void sht_hw_reset | ( | sht_t * | ctx | ) |
Resets device.
ctx | Click object. |
Hardware reset of the device.
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
uint8_t sht_int_get | ( | sht_t * | ctx | ) |
Int status.
ctx | Click object. |
Gets int_pin status.
void sht_reset | ( | sht_t * | ctx | ) |
Resets settings.
ctx | Click object. |
Calling of this function will reset all of the settings to defaults.
uint8_t sht_reset_status | ( | sht_t * | ctx | ) |
System Reset.
ctx | Click object. |
Returns information does module detected any kind of reset during current power on time.
void sht_rst_set | ( | sht_t * | ctx, |
uint8_t | state ) |
Int status.
ctx | Click object. |
state | Pin state value. |
sets rst pin to the desired value.
void sht_set_clk_strecth | ( | sht_t * | ctx, |
uint8_t | clk_stretching ) |
Sets the clock stretching state.
ctx | Click object. |
clk_stretching | ( true / false ) |
When a clock stretching is disabled, the sensor responds to a read header with a not acknowledge (NACK), if no data is present. Otherwise sensor responds to a read header with an ACK and subsequently pulls down the SCL line. The SCL line is pulled down until the measurement is complete. As soon as the measurement is complete, the sensor releases the SCL line and sends the measurement results. By default stretching is disabled after initialization.
void sht_set_mps | ( | sht_t * | ctx, |
uint8_t | measure_per_second ) |
Measurements per Second.
ctx | Click object. |
measure_per_second | ( MPS_05 / MPS_1 / MPS_2 / MPS_4 / MPS_10 ) |
Sets the measurement per second value used for periodic type of measurement. MPS_05 - 1 measurement on every 2 seconds MPS_1 - 1 measurement per second MPS_2 - 2 measurements per second MPS_4 - 4 measurements per second MPS_10 - 10 measurements per second
void sht_set_repeats | ( | sht_t * | ctx, |
uint8_t | repeatability ) |
Sets the repeatability value.
ctx | Click object. |
repeatability | ( RPT_HIGH / RPT_MEDIUM / RPT_LOW ) |
Repeatability setting influences the measurement duration and thus the overall energy consumption of the sensor. RPT_MEDIUM is default value after initialization.
void sht_software_rst | ( | sht_t * | ctx | ) |
Software Reset.
ctx | Click object. |
Forces the device into a well-defined state without removing the power supply. This triggers the sensor to reset its system controller and reloads calibration data from the memory.
void sht_start_pm | ( | sht_t * | ctx | ) |
Start Periodic Measurement.
ctx | Click object. |
Starts periodic measurement with current settings.
void sht_stop_pm | ( | sht_t * | ctx | ) |
Stop Periodic Measurement.
ctx | Click object. |
Stops periodic measurement instantly. This must be called before call of any other function except the periodic measurement read functions.
float sht_temp_pm | ( | sht_t * | ctx | ) |
Periodic Mode Temperature.
ctx | Click object. |
Returns temperature measurement in periodic mode.
float sht_temp_ss | ( | sht_t * | ctx | ) |
Single Shot Temperature Measurement.
ctx | Click object. |
Returns temperature measurement in single shot mode.
uint8_t sht_temp_status | ( | sht_t * | ctx | ) |
Temperature Alert.
ctx | Click object. |
Returns does temperature tracking alert exists.
uint8_t sht_wr_chksum_status | ( | sht_t * | ctx | ) |
Checksum Status.
ctx | Click object. |
Returns information about last cheksum