commit | author | age
|
e30a4c
|
1 |
/********************************************************************************* |
GW |
2 |
* Copyright: (C) 2018 LingYun IoT System Studio |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* Filename: sht20.c |
|
6 |
* Description: This file is temperature and relative humidity sensor SHT20 code |
|
7 |
* |
|
8 |
* Version: 1.0.0(2018/10/14) |
|
9 |
* Author: Guo Wenxue <guowenxue@gmail.com> |
|
10 |
* ChangeLog: 1, Release initial version on "2018/10/14 12:13:26" |
|
11 |
* |
|
12 |
********************************************************************************/ |
|
13 |
#ifndef __SHT20_H |
|
14 |
#define __SHT20_H |
|
15 |
|
|
16 |
#include <stdio.h> |
|
17 |
#include <stdint.h> |
|
18 |
#include <time.h> |
|
19 |
|
|
20 |
#define SOFTRESET 0xFE |
|
21 |
#define TRIGGER_TEMPERATURE_NO_HOLD 0xF3 |
|
22 |
#define TRIGGER_HUMIDITY_NO_HOLD 0xF5 |
|
23 |
|
|
24 |
//#define I2C_API_IOCTL /* Use I2C userspace driver ioctl API */ |
|
25 |
#define I2C_API_RDWR /* Use I2C userspace driver read/write API */ |
|
26 |
|
|
27 |
int sht2x_init(void); |
|
28 |
int sht2x_get_serialnumber(uint8_t *serialnumber, int size); |
|
29 |
int sht2x_get_temp_humidity(float *temp, float *rh); |
|
30 |
void sht2x_term(void); |
|
31 |
|
|
32 |
#endif |
|
33 |
|