Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
/ esp-si7021 Public archive

An ESP-IDF component for the Silicon Labs Si7021-A20 I2C Humidity and Temperature Sensor

License

Notifications You must be signed in to change notification settings

jessebraham/esp-si7021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP-Si7021

An ESP-IDF component for the Silicon Labs Si7021-A20 Relative Humidity and Temperature Sensor with I2C Interface.

Links

Features

The following features have been implemented:

  • Measure Relative Humidity
  • Measure Temperature
  • Read and Write Registers
  • Read the Electronic Serial Number
  • Read the Firmware Revision
  • Perform a software reset of the sensor

Requirements

This component requires the ESP-IDF IoT Development Environment as well as the C99 Standard Library, and has no other external dependencies.

Example

TODO: provide an example

API

Data Structures

struct si7021_reading
{
    float humidity;
    float temperature;
};

Functions

esp_err_t readHumidity(const i2c_port_t i2c_num, float *humidity);
esp_err_t readTemperature(const i2c_port_t i2c_num, float *temperature);
esp_err_t readTemperatureAfterHumidity(const i2c_port_t i2c_num,
                                       float *temperature);
esp_err_t readSensors(const i2c_port_t i2c_num,
                      struct si7021_reading *sensor_data);
esp_err_t readSerialNumber(const i2c_port_t i2c_num, uint8_t *serial);
esp_err_t readFirmwareRevision(const i2c_port_t i2c_num, uint8_t *revision);
esp_err_t readRegister(const i2c_port_t i2c_num, const uint8_t command,
                       uint8_t *settings);
esp_err_t writeRegister(const i2c_port_t i2c_num, const uint8_t command,
                        const uint8_t settings);
esp_err_t softwareReset(const i2c_port_t i2c_num);

To Do

  • implement all features documented in the datasheet
    • acknowledge the fact that checksums are, in fact, a thing
    • implement an easier method of manipulating the user and heater control registers
      • user register - measurement resolution
      • user register - vdd status
      • user register - heater status
      • heater control register - heater current
  • properly comment header and source files
  • provide example application
  • write documentation

About

An ESP-IDF component for the Silicon Labs Si7021-A20 I2C Humidity and Temperature Sensor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published