KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sht21.h File Reference

This driver is to read the SHT21 I2C temperature and humidity sensor. More...

#include "drv/wb/i2c.h"

Go to the source code of this file.

Functions

bool sht21StartTempMeas (I2C_Device *dev, uint8_t addr)
 Starts the temperature measurement in the SHT21 module at I2C address 'addr'.
 
bool sht21ReadTemp (I2C_Device *dev, uint8_t addr, int *answer)
 Reads the temperatures from SHT21 at I2C address 'addr'; puts the result in answer.
 
bool sht21Temp (I2C_Device *dev, uint8_t addr, int *answer)
 Starts and reads the temperatures from SHT21 at I2C address 'addr' (hold master mode); puts the result in answer.
 
bool sht21StartHumidMeas (I2C_Device *dev, uint8_t addr)
 Starts the relative humidity measurement in the SHT21 module at I2C address 'addr'.
 
bool sht21ReadHumid (I2C_Device *dev, uint8_t addr, int *answer)
 Reads the relative humidity from SHT21 at I2C address 'addr'; puts the result in answer.
 
bool sht21Humi (I2C_Device *dev, uint8_t addr, int *answer)
 Starts and reads the relative humidity from SHT21 at I2C address 'addr' (hold master mode); puts the result in answer.
 

Detailed Description

This driver is to read the SHT21 I2C temperature and humidity sensor.

Usage:

int temperature;
if(sht21ReadTemp(I2C1, SHT21_I2C_ADDR, &temperature)){
printf("\n\nTemperature: %d.%d C", (temperature/10), (temperature%10));
}
}
if(errHas()){
errPrint(true);
}

Definition in file sht21.h.