LibDriver SHT4X
Loading...
Searching...
No Matches
driver_sht4x.h File Reference

driver sht4x header file More...

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

Go to the source code of this file.

Data Structures

struct  sht4x_handle_s
 sht4x handle structure definition More...
struct  sht4x_info_s
 sht4x information structure definition More...

Macros

#define DRIVER_SHT4X_LINK_INIT(HANDLE, STRUCTURE)
 initialize sht4x_handle_t structure
#define DRIVER_SHT4X_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_SHT4X_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_SHT4X_LINK_IIC_READ_COMMAND(HANDLE, FUC)
 link iic_read_cmd function
#define DRIVER_SHT4X_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
 link iic_write_cmd function
#define DRIVER_SHT4X_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SHT4X_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct sht4x_handle_s sht4x_handle_t
 sht4x handle structure definition
typedef struct sht4x_info_s sht4x_info_t
 sht4x information structure definition

Enumerations

enum  sht4x_address_t { SHT4X_ADDRESS_0 = (0x44 << 1) , SHT4X_ADDRESS_1 = (0x45 << 1) , SHT4X_ADDRESS_2 = (0x46 << 1) }
 sht4x address enumeration definition More...
enum  sht4x_mode_t {
  SHT4X_MODE_HIGH_PRECISION_WITH_NO_HEATER = 0xFD , SHT4X_MODE_MEDIUM_PRECISION_WITH_NO_HEATER = 0xF6 , SHT4X_MODE_LOWEST_PRECISION_WITH_NO_HEATER = 0xE0 , SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_200MW_1S = 0x39 ,
  SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_200MW_0P1S = 0x32 , SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_110MW_1S = 0x2F , SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_110MW_0P1S = 0x24 , SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_20MW_1S = 0x1E ,
  SHT4X_MODE_HIGH_PRECISION_WITH_HEATER_20MW_0P1S = 0x15
}
 sht4x mode enumeration definition More...

Functions

uint8_t sht4x_info (sht4x_info_t *info)
 get chip's information
uint8_t sht4x_set_addr (sht4x_handle_t *handle, sht4x_address_t addr)
 set the iic address
uint8_t sht4x_get_addr (sht4x_handle_t *handle, sht4x_address_t *addr)
 get the iic address
uint8_t sht4x_init (sht4x_handle_t *handle)
 initialize the chip
uint8_t sht4x_deinit (sht4x_handle_t *handle)
 close the chip
uint8_t sht4x_read (sht4x_handle_t *handle, sht4x_mode_t mode, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read temperature and humidity
uint8_t sht4x_soft_reset (sht4x_handle_t *handle)
 soft reset the chip
uint8_t sht4x_get_serial_number (sht4x_handle_t *handle, uint8_t num[4])
 get serial number
uint8_t sht4x_write_read (sht4x_handle_t *handle, uint8_t cmd, uint16_t delay_ms, uint8_t *data, uint16_t len)
 write and read bytes

Detailed Description

driver sht4x 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
1.0.0
Author
Shifeng Li
Date
2023-06-25

history

Date Version Author Description
2023/06/25 1.0 Shifeng Li first upload

Definition in file driver_sht4x.h.