7#ifndef DATA_FORWARDER_SENSOR_H_
8#define DATA_FORWARDER_SENSOR_H_
21#include <zephyr/drivers/sensor.h>
22#include <zephyr/sys/util.h>
99#if IS_ENABLED(CONFIG_DATA_FWD_PROTO_INT32_VALUES)
100 return (
proto_value_t)CLAMP(sensor_value_to_micro(val), INT32_MIN, INT32_MAX);
102 return sensor_value_to_float(val);
float proto_value_t
Definition protocol_types.h:21
uint8_t data_fwd_sensor_type_id(void)
Get the application-defined sensor type identifier.
const char *const * data_fwd_sensor_channel_names(void)
Get short names for each data channel.
static proto_value_t data_fwd_sensor_value_to_proto_value(const struct sensor_value *val)
Convert a Zephyr sensor value to a protocol sample value.
Definition data_fwd_sensor.h:97
int data_fwd_sensor_fetch(proto_value_t *values, const size_t values_size, size_t *count)
Read one sample from the sensor into values.
int data_fwd_sensor_init(void)
Initialize the selected sensor driver.
uint8_t data_fwd_sensor_channel_count(void)
Get the number of data channels in each sample.
uint16_t data_fwd_sensor_frequency(void)
Get the nominal sampling frequency in Hz.