ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_shtcx.h File Reference

Go to the source code of this file.

Macros

#define RI_SHTCX_WAKEUP_US   (240U)
 Time from wakeup cmd to rdy. More...
 

Functions

rd_status_t ri_shtcx_init (rd_sensor_t *environmental_sensor, rd_bus_t bus, uint8_t handle)
 rd_sensor_init_fp More...
 
rd_status_t ri_shtcx_uninit (rd_sensor_t *environmental_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 *)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_mode_get (uint8_t *)
 rd_sensor_setup_fp More...
 
rd_status_t ri_shtcx_data_get (rd_sensor_data_t *const p_data)
 rd_sensor_data_fp More...
 

Detailed Description

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

Interface for SHTCX basic usage. The underlying platform must provide functions for I2C access.

Testing the interface with ruuvi_driver_sensor_test.h

uint8_t handle = 0;
bus = RD_BUS_I2C;
handle = RUUVI_BOARD_RUUVI_BOARD_SHTCX_I2C_ADDRESS;
err_code = test_sensor_init(init, bus, handle);
err_code = test_sensor_setup(init, bus, handle);
err_code = test_sensor_modes(init, bus, handle);
uint32_t rd_status_t
bitfield for representing errors
#define RD_ERROR_CHECK(error, mask)
Shorthand macro for calling the rd_error_check with current file & line.
#define RD_SUCCESS
Internal Error.
#define RD_ERROR_SELFTEST
Self-test fail.
rd_status_t ri_shtcx_init(rd_sensor_t *sensor, rd_bus_t bus, uint8_t handle)
rd_sensor_init_fp
rd_status_t(* rd_sensor_init_fp)(rd_sensor_t *const p_sensor, const rd_bus_t bus, const uint8_t handle)
Initialize and uninitialize sensor. Init and uninit will setup sensor with function pointers....
rd_bus_t
Type of bus sensor uses.
@ RD_BUS_NONE
No bus, internal to IC.
@ RD_BUS_I2C
I2C bus.

Definition in file ruuvi_interface_shtcx.h.

Macro Definition Documentation

◆ RI_SHTCX_WAKEUP_US

#define RI_SHTCX_WAKEUP_US   (240U)

Time from wakeup cmd to rdy.

Definition at line 48 of file ruuvi_interface_shtcx.h.