105 uint8_t (*
iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
107 uint8_t (*
iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len);
150#define DRIVER_SHT2X_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
158#define DRIVER_SHT2X_LINK_IIC_INIT(HANDLE, FUC) (HANDLE)->iic_init = FUC
166#define DRIVER_SHT2X_LINK_IIC_DEINIT(HANDLE, FUC) (HANDLE)->iic_deinit = FUC
174#define DRIVER_SHT2X_LINK_IIC_WRITE_COMMAND(HANDLE, FUC) (HANDLE)->iic_write_cmd = FUC
182#define DRIVER_SHT2X_LINK_IIC_WRITE(HANDLE, FUC) (HANDLE)->iic_write = FUC
190#define DRIVER_SHT2X_LINK_IIC_READ_COMMAND(HANDLE, FUC) (HANDLE)->iic_read_cmd = FUC
198#define DRIVER_SHT2X_LINK_IIC_READ(HANDLE, FUC) (HANDLE)->iic_read = FUC
206#define DRIVER_SHT2X_LINK_IIC_READ_WITH_WAIT(HANDLE, FUC) (HANDLE)->iic_read_with_wait = FUC
214#define DRIVER_SHT2X_LINK_IIC_READ_ADDRESS16(HANDLE, FUC) (HANDLE)->iic_read_address16 = FUC
222#define DRIVER_SHT2X_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
230#define DRIVER_SHT2X_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
293 uint16_t *humidity_raw,
float *humidity_s);
struct sht2x_info_s sht2x_info_t
sht2x information structure definition
uint8_t sht2x_set_heater(sht2x_handle_t *handle, sht2x_bool_t enable)
enable or disable heater
uint8_t sht2x_read(sht2x_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
read data
uint8_t sht2x_get_status(sht2x_handle_t *handle, sht2x_status_t *status)
get status
sht2x_mode_t
sht2x mode enumeration definition
uint8_t sht2x_init(sht2x_handle_t *handle)
initialize the chip
uint8_t sht2x_soft_reset(sht2x_handle_t *handle)
soft reset the chip
uint8_t sht2x_get_mode(sht2x_handle_t *handle, sht2x_mode_t *mode)
get chip mode
uint8_t sht2x_get_disable_otp_reload(sht2x_handle_t *handle, sht2x_bool_t *enable)
get disable otp reload status
uint8_t sht2x_info(sht2x_info_t *info)
get chip's information
uint8_t sht2x_get_resolution(sht2x_handle_t *handle, sht2x_resolution_t *resolution)
get resolution
uint8_t sht2x_set_resolution(sht2x_handle_t *handle, sht2x_resolution_t resolution)
set resolution
struct sht2x_handle_s sht2x_handle_t
sht2x handle structure definition
uint8_t sht2x_set_disable_otp_reload(sht2x_handle_t *handle, sht2x_bool_t enable)
enable or disable disable otp reload
uint8_t sht2x_get_serial_number(sht2x_handle_t *handle, uint8_t sn[8])
get serial number
sht2x_status_t
sht2x status enumeration definition
uint8_t sht2x_deinit(sht2x_handle_t *handle)
close the chip
uint8_t sht2x_set_mode(sht2x_handle_t *handle, sht2x_mode_t mode)
set chip mode
sht2x_resolution_t
sht2x resolution enumeration definition
uint8_t sht2x_get_heater(sht2x_handle_t *handle, sht2x_bool_t *enable)
get heater status
sht2x_bool_t
sht2x bool enumeration definition
@ SHT2X_MODE_NO_HOLD_MASTER
@ SHT35_STATUS_VDD_LESS_2P25V
@ SHT35_STATUS_VDD_OVER_2P25V
@ SHT2X_RESOLUTION_RH_11BIT_T_11BIT
@ SHT2X_RESOLUTION_RH_12BIT_T_14BIT
@ SHT2X_RESOLUTION_RH_10BIT_T_13BIT
@ SHT2X_RESOLUTION_RH_8BIT_T_12BIT
uint8_t sht2x_get_cmd(sht2x_handle_t *handle, uint8_t *data, uint16_t len)
get command
uint8_t sht2x_get_reg(sht2x_handle_t *handle, uint8_t reg, uint8_t *data, uint16_t len)
get the chip register
uint8_t sht2x_get_reg16(sht2x_handle_t *handle, uint16_t reg, uint8_t *data, uint16_t len)
get the chip register16
uint8_t sht2x_set_cmd(sht2x_handle_t *handle, uint8_t *data, uint16_t len)
set command
uint8_t sht2x_set_reg(sht2x_handle_t *handle, uint8_t reg, uint8_t *data, uint16_t len)
set the chip register
sht2x handle structure definition
void(* delay_ms)(uint32_t ms)
uint8_t(* iic_read_address16)(uint8_t addr, uint16_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
uint8_t(* iic_init)(void)
uint8_t(* iic_read_with_wait)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
uint8_t(* iic_write)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_read)(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* iic_deinit)(void)
uint8_t(* iic_write_cmd)(uint8_t addr, uint8_t *buf, uint16_t len)
sht2x information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v