1 #ifndef RUUVI_TASK_SENSOR_H
2 #define RUUVI_TASK_SENSOR_H
97 sensor_list,
const size_t count,
const char *
const name);
uint32_t rd_status_t
bitfield for representing errors
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.
Ruuvi error codes and error check function.
Ruuvi sensor interface Lifecycle: Beta
uint16_t ri_gpio_id_t
port<<8 + pin
ri_gpio_state_t
States of GPIO pins.
Interface for I2C operations.
rt_sensor_ctx_t * rt_sensor_find_backend(rt_sensor_ctx_t *const sensor_list, const size_t count, const char *const name)
Search for requested sensor backend in given list of sensors.
rd_status_t rt_sensor_store(rt_sensor_ctx_t *const sensor)
Store the sensor state to NVM.
rd_status_t rt_sensor_configure(rt_sensor_ctx_t *const sensor)
Configure a sensor with given settings.
rd_status_t rt_sensor_load(rt_sensor_ctx_t *const sensor)
Load the sensor state from NVM.
rd_status_t rt_sensor_initialize(rt_sensor_ctx_t *const sensor)
Initialize sensor CTX.
rt_sensor_ctx_t * rt_sensor_find_provider(rt_sensor_ctx_t *const sensor_list, const size_t count, rd_sensor_data_fields_t values)
Search for a sensor which can provide requested values.
All sensors must implement configuration functions which accept this struct.
Interface to sensor. Some sensors can implement additional functions. The additional functions are de...
ri_gpio_state_t pwr_on
Power-on state of ctrl pin.
rd_sensor_t sensor
Control structure for sensor.
uint8_t handle
Handle of sensor.
ri_i2c_frequency_t i2c_max_speed
Maximum I2C speed supported.
ri_gpio_id_t pwr_pin
Power control pin.
ri_gpio_id_t level_pin
Level interrupt.
uint16_t nvm_file
NVM file of configuration.
ri_gpio_id_t fifo_pin
FIFO full interrupt.
uint16_t nvm_record
NVM record of configuration.
rd_sensor_configuration_t configuration
Sensor configuration.
rd_sensor_init_fp init
Initialization function.
rd_bus_t bus
Bus of sensor.
Union to access sensor data.