LibDriver SHT35
Loading...
Searching...
No Matches
driver_sht35.h File Reference

driver sht35 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_sht35.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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

Macros

#define DRIVER_SHT35_LINK_INIT(HANDLE, STRUCTURE)
 initialize sht35_handle_t structure
#define DRIVER_SHT35_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_SHT35_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_SHT35_LINK_IIC_READ_ADDRESS16(HANDLE, FUC)
 link iic_read_address16 function
#define DRIVER_SHT35_LINK_IIC_WRITE_ADDRESS16(HANDLE, FUC)
 link iic_write_address16 function
#define DRIVER_SHT35_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SHT35_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_SHT35_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

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
uint8_t sht35_set_reg (sht35_handle_t *handle, uint16_t command)
 set the chip register
uint8_t sht35_get_reg (sht35_handle_t *handle, uint16_t command, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver sht35 header 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
2.0.0
Author
Shifeng Li
Date
2021-03-05

history

Date Version Author Description
2021/03/05 2.0 Shifeng Li format the code
2020/11/03 1.0 Shifeng Li first upload

Definition in file driver_sht35.h.