si7013.c File Reference

Driver for the Si7013 Temperature / Humidity sensor. More...

#include <stddef.h>
#include "si7013.h"
#include "em_device.h"
#include <stdbool.h>
#include "i2cspm.h"
Include dependency graph for si7013.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static int32_t Si7013_Measure (I2C_TypeDef *i2c, uint8_t addr, uint32_t *data, uint8_t command)
 Reads data from the Si7013 sensor.
static int32_t Si7013_StartNoHoldMeasure (I2C_TypeDef *i2c, uint8_t addr, uint8_t command)
 Starts a no hold measurement in the Si7013 sensor.
int32_t Si7013_GetFirmwareRevision (I2C_TypeDef *i2c, uint8_t addr, uint8_t *fwRev)
 Reads Firmware Revision from a Si7013 sensor.
int32_t Si7013_StartNoHoldMeasureRHAndTemp (I2C_TypeDef *i2c, uint8_t addr)
 Starts no hold measurement of relative humidity and temperature from a Si7013 sensor.
static int32_t Si7013_ReadNoHoldData (I2C_TypeDef *i2c, uint8_t addr, uint32_t *data)
 Reads data from the Si7013 sensor.
int32_t Si7013_ReadNoHoldRHAndTemp (I2C_TypeDef *i2c, uint8_t addr, uint32_t *rhData, int32_t *tData)
 Reads relative humidity and temperature from a Si7013 sensor.
int32_t Si7013_MeasureRHAndTemp (I2C_TypeDef *i2c, uint8_t addr, uint32_t *rhData, int32_t *tData)
 Reads relative humidity and temperature from a Si7013 sensor.
static int32_t Si7013_WriteUserReg2 (I2C_TypeDef *i2c, uint8_t addr, int8_t data)
int32_t Si7013_MeasureV (I2C_TypeDef *i2c, uint8_t addr, int32_t *vData)
 Reads relative humidity and temperature from a Si7013 sensor.
bool Si7013_Detect (I2C_TypeDef *i2c, uint8_t addr, uint8_t *deviceId)
 Checks if a Si7013 is present on the I2C bus or not.

Detailed Description

Driver for the Si7013 Temperature / Humidity sensor.

Version:
4.0.0

License

(C) Copyright 2014 Silicon Labs, http://www.silabs.com

This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file si7013.c.


Function Documentation

static int32_t Si7013_Measure ( I2C_TypeDef *  i2c,
uint8_t  addr,
uint32_t *  data,
uint8_t  command 
) [static]

Reads data from the Si7013 sensor.

Parameters:
[in] i2c The I2C peripheral to use (not used).
[in] addr The I2C address of the sensor.
[out] data The data read from the sensor.
[in] command The command to send to device. See the #define's for details.
Returns:
Returns number of bytes read on success. Otherwise returns error codes based on the I2CDRV.

Definition at line 68 of file si7013.c.

References I2CSPM_Transfer().

Referenced by Si7013_MeasureRHAndTemp(), Si7013_MeasureV(), and Si7013_ReadNoHoldRHAndTemp().

Here is the call graph for this function:

Here is the caller graph for this function:

static int32_t Si7013_ReadNoHoldData ( I2C_TypeDef *  i2c,
uint8_t  addr,
uint32_t *  data 
) [static]

Reads data from the Si7013 sensor.

Parameters:
[in] i2c The I2C peripheral to use (not used).
[in] addr The I2C address of the sensor.
[out] data The data read from the sensor.
Returns:
Returns number of bytes read on success. Otherwise returns error codes based on the I2CDRV.

Definition at line 213 of file si7013.c.

References I2CSPM_Transfer().

Referenced by Si7013_ReadNoHoldRHAndTemp().

Here is the call graph for this function:

Here is the caller graph for this function:

static int32_t Si7013_StartNoHoldMeasure ( I2C_TypeDef *  i2c,
uint8_t  addr,
uint8_t  command 
) [static]

Starts a no hold measurement in the Si7013 sensor.

Parameters:
[in] i2c The I2C peripheral to use (not used).
[in] addr The I2C address of the sensor.
[in] command The command to send to device. See the #define's for details.
Returns:
Returns number of bytes read on success. Otherwise returns error codes based on the I2CDRV.

Definition at line 112 of file si7013.c.

References I2CSPM_Transfer().

Referenced by Si7013_StartNoHoldMeasureRHAndTemp().

Here is the call graph for this function:

Here is the caller graph for this function: