LibDriver SHT85
Loading...
Searching...
No Matches
sht85 base driver function

sht85 base driver modules More...

Collaboration diagram for sht85 base driver function:

Data Structures

struct  sht85_handle_s
 sht85 handle structure definition More...
struct  sht85_info_s
 sht85 information structure definition More...

Typedefs

typedef struct sht85_handle_s sht85_handle_t
 sht85 handle structure definition
typedef struct sht85_info_s sht85_info_t
 sht85 information structure definition

Enumerations

enum  sht85_bool_t { SHT85_BOOL_FALSE = 0x00 , SHT85_BOOL_TRUE = 0x01 }
 sht85 bool enumeration definition More...
enum  sht85_rate_t {
  SHT85_RATE_0P5HZ = 0x20 , SHT85_RATE_1HZ = 0x21 , SHT85_RATE_2HZ = 0x22 , SHT85_RATE_4HZ = 0x23 ,
  SHT85_RATE_10HZ = 0x27
}
 sht85 rate enumeration definition More...
enum  sht85_repeatability_t { SHT85_REPEATABILITY_HIGH = 0x00 , SHT85_REPEATABILITY_MEDIUM = 0x01 , SHT85_REPEATABILITY_LOW = 0x02 }
 sht85 repeatability enumeration definition More...
enum  sht85_status_t {
  SHT85_STATUS_ALERT_PENDING_STATUS = (1 << 15) , SHT85_STATUS_HEATER_ON = (1 << 13) , SHT85_STATUS_HUMIDITY_ALERT = (1 << 11) , SHT85_STATUS_TEMPERATURE_ALERT = (1 << 10) ,
  SHT85_STATUS_SYSTEM_RESET = (1 << 4) , SHT85_STATUS_COMMAND_STATUS = (1 << 1) , SHT85_STATUS_CHECKSUM_STATUS = (1 << 0)
}
 sht85 status enumeration definition More...

Functions

uint8_t sht85_info (sht85_info_t *info)
 get chip's information
uint8_t sht85_init (sht85_handle_t *handle)
 initialize the chip
uint8_t sht85_deinit (sht85_handle_t *handle)
 close the chip
uint8_t sht85_single_read (sht85_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read data once
uint8_t sht85_start_continuous_read (sht85_handle_t *handle, sht85_rate_t rate)
 start reading
uint8_t sht85_stop_continuous_read (sht85_handle_t *handle)
 stop reading
uint8_t sht85_continuous_read (sht85_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read data continuously
uint8_t sht85_get_status (sht85_handle_t *handle, uint16_t *status)
 get the current status
uint8_t sht85_clear_status (sht85_handle_t *handle)
 clear the current status
uint8_t sht85_set_repeatability (sht85_handle_t *handle, sht85_repeatability_t repeatability)
 set the measurement repeatability
uint8_t sht85_get_repeatability (sht85_handle_t *handle, sht85_repeatability_t *repeatability)
 get the measurement repeatability
uint8_t sht85_set_art (sht85_handle_t *handle)
 set the chip art
uint8_t sht85_soft_reset (sht85_handle_t *handle)
 soft reset the chip
uint8_t sht85_set_heater (sht85_handle_t *handle, sht85_bool_t enable)
 enable or disable the chip heater
uint8_t sht85_get_serial_number (sht85_handle_t *handle, uint8_t sn[4])
 get serial number

Detailed Description

sht85 base driver modules

Typedef Documentation

◆ sht85_handle_t

sht85 handle structure definition

◆ sht85_info_t

typedef struct sht85_info_s sht85_info_t

sht85 information structure definition

Enumeration Type Documentation

◆ sht85_bool_t

sht85 bool enumeration definition

Enumerator
SHT85_BOOL_FALSE 

disable function

SHT85_BOOL_TRUE 

enable function

Definition at line 62 of file driver_sht85.h.

◆ sht85_rate_t

sht85 rate enumeration definition

Enumerator
SHT85_RATE_0P5HZ 

0.5Hz sample rate

SHT85_RATE_1HZ 

1Hz sample rate

SHT85_RATE_2HZ 

2Hz sample rate

SHT85_RATE_4HZ 

4Hz sample rate

SHT85_RATE_10HZ 

10Hz sample rate

Definition at line 71 of file driver_sht85.h.

◆ sht85_repeatability_t

sht85 repeatability enumeration definition

Enumerator
SHT85_REPEATABILITY_HIGH 

high repeatability

SHT85_REPEATABILITY_MEDIUM 

medium repeatability

SHT85_REPEATABILITY_LOW 

low repeatability

Definition at line 83 of file driver_sht85.h.

◆ sht85_status_t

sht85 status enumeration definition

Enumerator
SHT85_STATUS_ALERT_PENDING_STATUS 

alert pending status

SHT85_STATUS_HEATER_ON 

heater on

SHT85_STATUS_HUMIDITY_ALERT 

humidity alert

SHT85_STATUS_TEMPERATURE_ALERT 

temperature alert

SHT85_STATUS_SYSTEM_RESET 

system reset

SHT85_STATUS_COMMAND_STATUS 

command status

SHT85_STATUS_CHECKSUM_STATUS 

checksum status

Definition at line 93 of file driver_sht85.h.

Function Documentation

◆ sht85_clear_status()

uint8_t sht85_clear_status ( sht85_handle_t * handle)

clear the current status

Parameters
[in]*handlepointer to a sht85 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 311 of file driver_sht85.c.

◆ sht85_continuous_read()

uint8_t sht85_continuous_read ( sht85_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s,
uint16_t * humidity_raw,
float * humidity_s )

read data continuously

Parameters
[in]*handlepointer to a sht85 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 646 of file driver_sht85.c.

◆ sht85_deinit()

uint8_t sht85_deinit ( sht85_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a sht85 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 219 of file driver_sht85.c.

◆ sht85_get_repeatability()

uint8_t sht85_get_repeatability ( sht85_handle_t * handle,
sht85_repeatability_t * repeatability )

get the measurement repeatability

Parameters
[in]*handlepointer to a sht85 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 373 of file driver_sht85.c.

◆ sht85_get_serial_number()

uint8_t sht85_get_serial_number ( sht85_handle_t * handle,
uint8_t sn[4] )

get serial number

Parameters
[in]*handlepointer to a sht85 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 824 of file driver_sht85.c.

◆ sht85_get_status()

uint8_t sht85_get_status ( sht85_handle_t * handle,
uint16_t * status )

get the current status

Parameters
[in]*handlepointer to a sht85 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 263 of file driver_sht85.c.

◆ sht85_info()

uint8_t sht85_info ( sht85_info_t * info)

get chip's information

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

Definition at line 927 of file driver_sht85.c.

◆ sht85_init()

uint8_t sht85_init ( sht85_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a sht85 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 145 of file driver_sht85.c.

◆ sht85_set_art()

uint8_t sht85_set_art ( sht85_handle_t * handle)

set the chip art

Parameters
[in]*handlepointer to a sht85 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 701 of file driver_sht85.c.

◆ sht85_set_heater()

uint8_t sht85_set_heater ( sht85_handle_t * handle,
sht85_bool_t enable )

enable or disable the chip heater

Parameters
[in]*handlepointer to a sht85 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 774 of file driver_sht85.c.

◆ sht85_set_repeatability()

uint8_t sht85_set_repeatability ( sht85_handle_t * handle,
sht85_repeatability_t repeatability )

set the measurement repeatability

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

Definition at line 347 of file driver_sht85.c.

◆ sht85_single_read()

uint8_t sht85_single_read ( sht85_handle_t * handle,
uint16_t * temperature_raw,
float * temperature_s,
uint16_t * humidity_raw,
float * humidity_s )

read data once

Parameters
[in]*handlepointer to a sht85 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 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 403 of file driver_sht85.c.

◆ sht85_soft_reset()

uint8_t sht85_soft_reset ( sht85_handle_t * handle)

soft reset the chip

Parameters
[in]*handlepointer to a sht85 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 737 of file driver_sht85.c.

◆ sht85_start_continuous_read()

uint8_t sht85_start_continuous_read ( sht85_handle_t * handle,
sht85_rate_t rate )

start reading

Parameters
[in]*handlepointer to a sht85 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 478 of file driver_sht85.c.

◆ sht85_stop_continuous_read()

uint8_t sht85_stop_continuous_read ( sht85_handle_t * handle)

stop reading

Parameters
[in]*handlepointer to a sht85 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 606 of file driver_sht85.c.