/*********************************************************************************
|
* Copyright: (C) 2018 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: sht20.c
|
* Description: This file is temperature and relative humidity sensor SHT20 code
|
*
|
* Version: 1.0.0(2018/10/14)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "2018/10/14 12:13:26"
|
*
|
********************************************************************************/
|
#ifndef __SHT20_H
|
#define __SHT20_H
|
|
#include <stdio.h>
|
#include <stdint.h>
|
#include <time.h>
|
|
#define SOFTRESET 0xFE
|
#define TRIGGER_TEMPERATURE_NO_HOLD 0xF3
|
#define TRIGGER_HUMIDITY_NO_HOLD 0xF5
|
|
//#define I2C_API_IOCTL /* Use I2C userspace driver ioctl API */
|
#define I2C_API_RDWR /* Use I2C userspace driver read/write API */
|
|
int sht2x_init(void);
|
int sht2x_get_serialnumber(uint8_t *serialnumber, int size);
|
int sht2x_get_temp_humidity(float *temp, float *rh);
|
void sht2x_term(void);
|
|
#endif
|