LibDriver SHT85
Loading...
Searching...
No Matches
driver_sht85.c File Reference

driver sht85 source file More...

#include "driver_sht85.h"
Include dependency graph for driver_sht85.c:

Go to the source code of this file.

Macros

#define CHIP_NAME   "Sensirion SHT85"
 chip information definition
#define MANUFACTURER_NAME   "Sensirion"
#define SUPPLY_VOLTAGE_MIN   2.15f
#define SUPPLY_VOLTAGE_MAX   5.5f
#define MAX_CURRENT   1.5f
#define TEMPERATURE_MIN   -40.0f
#define TEMPERATURE_MAX   105.0f
#define DRIVER_VERSION   1000
#define SHT85_ADDRESS   (0x44 << 1)
 chip address definition
#define SHT85_COMMAND_FETCH_DATA   0xE000U
 chip command definition
#define SHT85_COMMAND_ART   0x2B32U
#define SHT85_COMMAND_BREAK   0x3093U
#define SHT85_COMMAND_SOFT_RESET   0x30A2U
#define SHT85_COMMAND_HEATER_ENABLE   0x306DU
#define SHT85_COMMAND_HEATER_DISABLE   0x3066U
#define SHT85_COMMAND_READ_STATUS   0xF32DU
#define SHT85_COMMAND_CLEAR_STATUS   0x3041U
#define SHT85_COMMAND_GET_SERIAL_NUMBER   0x3682U

Functions

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_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_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_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
uint8_t sht85_set_reg (sht85_handle_t *handle, uint16_t command)
 set the chip register
uint8_t sht85_get_reg (sht85_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
 get the chip register
uint8_t sht85_info (sht85_info_t *info)
 get chip's information

Detailed Description

driver sht85 source file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2025-11-03

history

Date Version Author Description
2025/11/03 1.0 Shifeng Li first upload

Definition in file driver_sht85.c.

Macro Definition Documentation

◆ CHIP_NAME

#define CHIP_NAME   "Sensirion SHT85"

chip information definition

chip name

Definition at line 42 of file driver_sht85.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   1000

driver version

Definition at line 49 of file driver_sht85.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "Sensirion"

manufacturer name

Definition at line 43 of file driver_sht85.c.

◆ MAX_CURRENT

#define MAX_CURRENT   1.5f

chip max current

Definition at line 46 of file driver_sht85.c.

◆ SHT85_ADDRESS

#define SHT85_ADDRESS   (0x44 << 1)

chip address definition

iic device address

Definition at line 54 of file driver_sht85.c.

◆ SHT85_COMMAND_ART

#define SHT85_COMMAND_ART   0x2B32U

art command

Definition at line 60 of file driver_sht85.c.

◆ SHT85_COMMAND_BREAK

#define SHT85_COMMAND_BREAK   0x3093U

break command

Definition at line 61 of file driver_sht85.c.

◆ SHT85_COMMAND_CLEAR_STATUS

#define SHT85_COMMAND_CLEAR_STATUS   0x3041U

clear status command

Definition at line 66 of file driver_sht85.c.

◆ SHT85_COMMAND_FETCH_DATA

#define SHT85_COMMAND_FETCH_DATA   0xE000U

chip command definition

fetch data command

Definition at line 59 of file driver_sht85.c.

◆ SHT85_COMMAND_GET_SERIAL_NUMBER

#define SHT85_COMMAND_GET_SERIAL_NUMBER   0x3682U

get serial number command

Definition at line 67 of file driver_sht85.c.

◆ SHT85_COMMAND_HEATER_DISABLE

#define SHT85_COMMAND_HEATER_DISABLE   0x3066U

heater disable command

Definition at line 64 of file driver_sht85.c.

◆ SHT85_COMMAND_HEATER_ENABLE

#define SHT85_COMMAND_HEATER_ENABLE   0x306DU

heater enable command

Definition at line 63 of file driver_sht85.c.

◆ SHT85_COMMAND_READ_STATUS

#define SHT85_COMMAND_READ_STATUS   0xF32DU

read status command

Definition at line 65 of file driver_sht85.c.

◆ SHT85_COMMAND_SOFT_RESET

#define SHT85_COMMAND_SOFT_RESET   0x30A2U

soft reset command

Definition at line 62 of file driver_sht85.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   5.5f

chip max supply voltage

Definition at line 45 of file driver_sht85.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   2.15f

chip min supply voltage

Definition at line 44 of file driver_sht85.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   105.0f

chip max operating temperature

Definition at line 48 of file driver_sht85.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -40.0f

chip min operating temperature

Definition at line 47 of file driver_sht85.c.