LibDriver SHT35
Loading...
Searching...
No Matches
sht35 base driver function

sht35 base driver modules More...

Collaboration diagram for sht35 base driver function:

Data Structures

struct  sht35_handle_s
 sht35 handle structure definition More...
struct  sht35_info_s
 sht35 information structure definition More...

Typedefs

typedef struct sht35_handle_s sht35_handle_t
 sht35 handle structure definition
typedef struct sht35_info_s sht35_info_t
 sht35 information structure definition

Enumerations

enum  sht35_address_t { SHT35_ADDRESS_0 = (0x44 << 1) , SHT35_ADDRESS_1 = (0x45 << 1) }
 sht35 address enumeration definition More...
enum  sht35_bool_t { SHT35_BOOL_FALSE = 0x00 , SHT35_BOOL_TRUE = 0x01 }
 sht35 bool enumeration definition More...
enum  sht35_rate_t {
  SHT35_RATE_0P5HZ = 0x20 , SHT35_RATE_1HZ = 0x21 , SHT35_RATE_2HZ = 0x22 , SHT35_RATE_4HZ = 0x23 ,
  SHT35_RATE_10HZ = 0x27
}
 sht35 rate enumeration definition More...
enum  sht35_repeatability_t { SHT35_REPEATABILITY_HIGH = 0x00 , SHT35_REPEATABILITY_MEDIUM = 0x01 , SHT35_REPEATABILITY_LOW = 0x02 }
 sht35 repeatability enumeration definition More...
enum  sht35_status_t {
  SHT35_STATUS_ALERT_PENDING_STATUS = (1 << 15) , SHT35_STATUS_HEATER_ON = (1 << 13) , SHT35_STATUS_HUMIDITY_ALERT = (1 << 11) , SHT35_STATUS_TEMPERATURE_ALERT = (1 << 10) ,
  SHT35_STATUS_SYSTEM_RESET = (1 << 4) , SHT35_STATUS_COMMAND_STATUS = (1 << 1) , SHT35_STATUS_CHECKSUM_STATUS = (1 << 0)
}
 sht35 status enumeration definition More...

Functions

uint8_t sht35_info (sht35_info_t *info)
 get chip's information
uint8_t sht35_set_addr_pin (sht35_handle_t *handle, sht35_address_t addr_pin)
 set the iic address pin
uint8_t sht35_get_addr_pin (sht35_handle_t *handle, sht35_address_t *addr_pin)
 get the iic address pin
uint8_t sht35_irq_handler (sht35_handle_t *handle)
 irq handler
uint8_t sht35_init (sht35_handle_t *handle)
 initialize the chip
uint8_t sht35_deinit (sht35_handle_t *handle)
 close the chip
uint8_t sht35_single_read (sht35_handle_t *handle, sht35_bool_t clock_stretching_enable, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read data once
uint8_t sht35_start_continuous_read (sht35_handle_t *handle, sht35_rate_t rate)
 start reading
uint8_t sht35_stop_continuous_read (sht35_handle_t *handle)
 stop reading
uint8_t sht35_continuous_read (sht35_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read data continuously
uint8_t sht35_get_status (sht35_handle_t *handle, uint16_t *status)
 get the current status
uint8_t sht35_clear_status (sht35_handle_t *handle)
 clear the current status
uint8_t sht35_set_repeatability (sht35_handle_t *handle, sht35_repeatability_t repeatability)
 set the measurement repeatability
uint8_t sht35_get_repeatability (sht35_handle_t *handle, sht35_repeatability_t *repeatability)
 get the measurement repeatability
uint8_t sht35_set_art (sht35_handle_t *handle)
 set the chip art
uint8_t sht35_soft_reset (sht35_handle_t *handle)
 soft reset the chip
uint8_t sht35_set_heater (sht35_handle_t *handle, sht35_bool_t enable)
 enable or disable the chip heater
uint8_t sht35_get_serial_number (sht35_handle_t *handle, uint8_t sn[4])
 get serial number
uint8_t sht35_set_high_alert_limit (sht35_handle_t *handle, uint16_t set, uint16_t clear)
 set high alert limit
uint8_t sht35_get_high_alert_limit (sht35_handle_t *handle, uint16_t *set, uint16_t *clear)
 get high alert limit
uint8_t sht35_set_low_alert_limit (sht35_handle_t *handle, uint16_t set, uint16_t clear)
 set low alert limit
uint8_t sht35_get_low_alert_limit (sht35_handle_t *handle, uint16_t *set, uint16_t *clear)
 get low alert limit
uint8_t sht35_alert_limit_convert_to_register (sht35_handle_t *handle, float temperature, float humidity, uint16_t *reg)
 alert limit convert to register raw data

Detailed Description

sht35 base driver modules

Typedef Documentation

◆ sht35_handle_t

sht35 handle structure definition

◆ sht35_info_t

typedef struct sht35_info_s sht35_info_t

sht35 information structure definition

Enumeration Type Documentation

◆ sht35_address_t

sht35 address enumeration definition

Enumerator
SHT35_ADDRESS_0 

ADDR pin connected to GND

SHT35_ADDRESS_1 

ADDR pin connected to VCC

Definition at line 63 of file driver_sht35.h.

◆ sht35_bool_t

sht35 bool enumeration definition

Enumerator
SHT35_BOOL_FALSE 

disable function

SHT35_BOOL_TRUE 

enable function

Definition at line 72 of file driver_sht35.h.

◆ sht35_rate_t

sht35 rate enumeration definition

Enumerator
SHT35_RATE_0P5HZ 

0.5Hz sample rate

SHT35_RATE_1HZ 

1Hz sample rate

SHT35_RATE_2HZ 

2Hz sample rate

SHT35_RATE_4HZ 

4Hz sample rate

SHT35_RATE_10HZ 

10Hz sample rate

Definition at line 81 of file driver_sht35.h.

◆ sht35_repeatability_t

sht35 repeatability enumeration definition

Enumerator
SHT35_REPEATABILITY_HIGH 

high repeatability

SHT35_REPEATABILITY_MEDIUM 

medium repeatability

SHT35_REPEATABILITY_LOW 

low repeatability

Definition at line 93 of file driver_sht35.h.

◆ sht35_status_t

sht35 status enumeration definition

Enumerator
SHT35_STATUS_ALERT_PENDING_STATUS 

alert pending status

SHT35_STATUS_HEATER_ON 

heater on

SHT35_STATUS_HUMIDITY_ALERT 

humidity alert

SHT35_STATUS_TEMPERATURE_ALERT 

temperature alert

SHT35_STATUS_SYSTEM_RESET 

system reset

SHT35_STATUS_COMMAND_STATUS 

command status

SHT35_STATUS_CHECKSUM_STATUS 

checksum status

Definition at line 103 of file driver_sht35.h.

Function Documentation

◆ sht35_alert_limit_convert_to_register()

uint8_t sht35_alert_limit_convert_to_register ( sht35_handle_t * handle,
float temperature,
float humidity,
uint16_t * reg )

alert limit convert to register raw data

Parameters
[in]*handlepointer to an sht35 handle structure
[in]temperatureconverted temperature
[in]humidityconverted humidity
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1225 of file driver_sht35.c.

◆ sht35_clear_status()

uint8_t sht35_clear_status ( sht35_handle_t * handle)

clear the current status

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 clear status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 385 of file driver_sht35.c.

◆ sht35_continuous_read()

uint8_t sht35_continuous_read ( sht35_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s,
uint16_t * humidity_raw,
float * humidity_s )

read data continuously

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 760 of file driver_sht35.c.

◆ sht35_deinit()

uint8_t sht35_deinit ( sht35_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 249 of file driver_sht35.c.

◆ sht35_get_addr_pin()

uint8_t sht35_get_addr_pin ( sht35_handle_t * handle,
sht35_address_t * addr_pin )

get the iic address pin

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*addr_pinpointer to a chip iic address pin buffer
Returns
status code
  • 0 success
  • 1 get addr pin failed
  • 2 handle is NULL
Note
none

Definition at line 314 of file driver_sht35.c.

◆ sht35_get_high_alert_limit()

uint8_t sht35_get_high_alert_limit ( sht35_handle_t * handle,
uint16_t * set,
uint16_t * clear )

get high alert limit

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*setpointer to a high alert limit set buffer
[out]*clearpointer to a high alert limit clear buffer
Returns
status code
  • 0 success
  • 1 get high alert limit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1047 of file driver_sht35.c.

◆ sht35_get_low_alert_limit()

uint8_t sht35_get_low_alert_limit ( sht35_handle_t * handle,
uint16_t * set,
uint16_t * clear )

get low alert limit

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*setpointer to a low alert limit set buffer
[out]*clearpointer to a low alert limit clear buffer
Returns
status code
  • 0 success
  • 1 get low alert limit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1163 of file driver_sht35.c.

◆ sht35_get_repeatability()

uint8_t sht35_get_repeatability ( sht35_handle_t * handle,
sht35_repeatability_t * repeatability )

get the measurement repeatability

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*repeatabilitypointer to a measurement repeatability buffer
Returns
status code
  • 0 success
  • 1 get repeatability failed
  • 2 handle is NULL
Note
none

Definition at line 447 of file driver_sht35.c.

◆ sht35_get_serial_number()

uint8_t sht35_get_serial_number ( sht35_handle_t * handle,
uint8_t sn[4] )

get serial number

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*snpointer to a serial number buffer
Returns
status code
  • 0 success
  • 1 get serial number failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 938 of file driver_sht35.c.

◆ sht35_get_status()

uint8_t sht35_get_status ( sht35_handle_t * handle,
uint16_t * status )

get the current status

Parameters
[in]*handlepointer to an sht35 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 337 of file driver_sht35.c.

◆ sht35_info()

uint8_t sht35_info ( sht35_info_t * info)

get chip's information

Parameters
[out]*infopointer to an sht35 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1387 of file driver_sht35.c.

◆ sht35_init()

uint8_t sht35_init ( sht35_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 175 of file driver_sht35.c.

◆ sht35_irq_handler()

uint8_t sht35_irq_handler ( sht35_handle_t * handle)

irq handler

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1258 of file driver_sht35.c.

◆ sht35_set_addr_pin()

uint8_t sht35_set_addr_pin ( sht35_handle_t * handle,
sht35_address_t addr_pin )

set the iic address pin

Parameters
[in]*handlepointer to an sht35 handle structure
[in]addr_pinchip iic address pin
Returns
status code
  • 0 success
  • 1 set addr pin failed
  • 2 handle is NULL
Note
none

Definition at line 292 of file driver_sht35.c.

◆ sht35_set_art()

uint8_t sht35_set_art ( sht35_handle_t * handle)

set the chip art

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 set art failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 815 of file driver_sht35.c.

◆ sht35_set_heater()

uint8_t sht35_set_heater ( sht35_handle_t * handle,
sht35_bool_t enable )

enable or disable the chip heater

Parameters
[in]*handlepointer to an sht35 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set heater failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 888 of file driver_sht35.c.

◆ sht35_set_high_alert_limit()

uint8_t sht35_set_high_alert_limit ( sht35_handle_t * handle,
uint16_t set,
uint16_t clear )

set high alert limit

Parameters
[in]*handlepointer to an sht35 handle structure
[in]sethigh alert limit set
[in]clearhigh alert limit clear
Returns
status code
  • 0 success
  • 1 set high alert limit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 993 of file driver_sht35.c.

◆ sht35_set_low_alert_limit()

uint8_t sht35_set_low_alert_limit ( sht35_handle_t * handle,
uint16_t set,
uint16_t clear )

set low alert limit

Parameters
[in]*handlepointer to an sht35 handle structure
[in]setlow alert limit set
[in]clearlow alert limit clear
Returns
status code
  • 0 success
  • 1 set low alert limit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1109 of file driver_sht35.c.

◆ sht35_set_repeatability()

uint8_t sht35_set_repeatability ( sht35_handle_t * handle,
sht35_repeatability_t repeatability )

set the measurement repeatability

Parameters
[in]*handlepointer to an sht35 handle structure
[in]repeatabilitymeasurement repeatability
Returns
status code
  • 0 success
  • 1 set repeatability failed
  • 2 handle is NULL
Note
none

Definition at line 421 of file driver_sht35.c.

◆ sht35_single_read()

uint8_t sht35_single_read ( sht35_handle_t * handle,
sht35_bool_t clock_stretching_enable,
uint16_t * temperature_raw,
float * temperature_s,
uint16_t * humidity_raw,
float * humidity_s )

read data once

Parameters
[in]*handlepointer to an sht35 handle structure
[in]clock_stretching_enableclock stretching bool value
[out]*temperature_rawpointer to a raw temperature buffer
[out]*temperature_spointer to a converted temperature buffer
[out]*humidity_rawpointer to a raw humidity buffer
[out]*humidity_spointer to a converted humidity buffer
Returns
status code
  • 0 success
  • 1 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 478 of file driver_sht35.c.

◆ sht35_soft_reset()

uint8_t sht35_soft_reset ( sht35_handle_t * handle)

soft reset the chip

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 soft reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 851 of file driver_sht35.c.

◆ sht35_start_continuous_read()

uint8_t sht35_start_continuous_read ( sht35_handle_t * handle,
sht35_rate_t rate )

start reading

Parameters
[in]*handlepointer to an sht35 handle structure
[in]ratesample rate
Returns
status code
  • 0 success
  • 1 start continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 592 of file driver_sht35.c.

◆ sht35_stop_continuous_read()

uint8_t sht35_stop_continuous_read ( sht35_handle_t * handle)

stop reading

Parameters
[in]*handlepointer to an sht35 handle structure
Returns
status code
  • 0 success
  • 1 stop continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 720 of file driver_sht35.c.