ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_shtcx.c File Reference
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include "ruuvi_driver_sensor.h"
#include "ruuvi_interface_shtcx.h"
#include "ruuvi_interface_environmental.h"
#include "ruuvi_interface_gpio.h"
#include "ruuvi_interface_i2c.h"
#include "ruuvi_interface_rtc.h"
#include "ruuvi_interface_yield.h"
#include <string.h>
#include "shtc1.h"

Go to the source code of this file.

Macros

#define LOW_POWER_SLEEP_MS_MIN   (1000U)
 
#define SHTCX_PROBE_RETRIES_MAX   (5U)
 
#define RETURN_SUCCESS_ON_VALID(param)
 Macro for checking "ignored" parameters NO_CHANGE, MIN, MAX, DEFAULT. More...
 
#define VERIFY_SENSOR_SLEEPS()
 Macro for checking that sensor is in sleep mode before configuration. More...
 
#define STATUS_OK   0
 SHTC driver ok. More...
 
#define STATUS_ERR_BAD_DATA   (-1)
 SHTC driver data invald. More...
 
#define STATUS_CRC_FAIL   (-2)
 SHTC driver CRC error. More...
 
#define STATUS_UNKNOWN_DEVICE   (-3)
 Invalid WHOAMI. More...
 
#define STATUS_WAKEUP_FAILED   (-4)
 Device didn't wake up. More...
 
#define STATUS_SLEEP_FAILED   (-5)
 Device didn't go to sleep. More...
 

Functions

rd_status_t ri_shtcx_init (rd_sensor_t *sensor, rd_bus_t bus, uint8_t handle)
 rd_sensor_init_fp More...
 
rd_status_t ri_shtcx_uninit (rd_sensor_t *sensor, rd_bus_t bus, uint8_t handle)
 rd_sensor_init_fp More...
 
rd_status_t ri_shtcx_samplerate_set (uint8_t *samplerate)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_samplerate_get (uint8_t *samplerate)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_resolution_set (uint8_t *resolution)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_resolution_get (uint8_t *resolution)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_scale_set (uint8_t *scale)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_scale_get (uint8_t *scale)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_dsp_set (uint8_t *dsp, uint8_t *parameter)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_dsp_get (uint8_t *dsp, uint8_t *parameter)
 
rd_status_t ri_shtcx_mode_set (uint8_t *mode)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_mode_get (uint8_t *mode)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_data_get (rd_sensor_data_t *const p_data)
 rd_sensor_data_fp More...
 
void sensirion_sleep_usec (uint32_t useconds)
 Implement sleep function for SHTC driver. More...
 

Detailed Description

Author
Otso Jousimaa otso@.nosp@m.ojou.nosp@m.sima..nosp@m.net
Date
2019-08-10

SHTC temperature and humidity sensor driver.

Definition in file ruuvi_interface_shtcx.c.