-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSensirion_SHT31.h
35 lines (29 loc) · 1.32 KB
/
Sensirion_SHT31.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* File: Sensirion_SHT31.h
* Author: dieterv
* v0.2
* Created on February 3, 2020, 3:09 PM
*
* Library for Sensirion SHT31 Temp/Relative humidity sensor
* Usage:
* - Set I2C address in Sensirion_SHT31.c file (const uint8_t SHT31_Address = 0x45)
* ! Default address with address pin tied to ground is 0x44
* - Run SHT31_InitReset
* - Run SHT31_SingleShot with pointers to where results should be stored and required repeatability
* - Internal heater can be turned on/off with SHT31_HeaterOnOff: 1 to switch on, 0 to switch off
*/
#ifndef XC_SHT31
#define XC_SHT31
#include <xc.h> // include processor files - each processor file is guarded.
//#include "I2C1.h"
//--------------------Variables--------------------
extern char AsciiResult[5];
//-------------------Macros-------------------
//--------------------Functions--------------------
int8_t SHT31_InitReset (void); // high level
int8_t SHT31_SingleShot(int16_t * pTempResult, uint8_t * pRHResult, uint8_t Repeatability); // high level
int8_t SHT31_HeaterOnOff(uint8_t OnOff); // high level
int8_t SHT31_GetData(uint8_t MeasurementData[], uint8_t Repeatability);
int8_t SHT31_CheckCRC(uint8_t DataToCheck[]);
int8_t SHT31_ConvertData(uint8_t MeasurementData[], int16_t * pTempResult, uint8_t * pRHResult);
#endif