zephyr/drivers/sensor/sensor_shell.h
Yuval Peress 94dc05b3f2 sensors: Add streaming APIs
Introduce a streaming API that uses the same data path as the async API.

This includes features to the decoder:
* Checking if triggers are present

Adding streaming features built ontop of existing triggers:
* Adding 3 operations to be done on a trigger
  * include - include the data with the trigger information
  * nop - do nothing
  * drop - drop the data (flush)
* Add a new sensor_stream() API to mirror sensor_read() but add an
optional handler to be able to cancel the stream.

Signed-off-by: Yuval Peress <peress@google.com>
topic#sensor_stream
2023-11-10 12:16:46 -06:00

27 lines
666 B
C

/*
* Copyright (c) 2023 Google LLC
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_SENSOR_SENSOR_SHELL_H
#define ZEPHYR_DRIVERS_SENSOR_SENSOR_SHELL_H
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/rtio/rtio.h>
#include <zephyr/shell/shell.h>
struct sensor_shell_processing_context {
const struct device *dev;
const struct shell *sh;
};
extern struct rtio sensor_read_rtio;
int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[]);
void sensor_shell_processing_callback(int result, uint8_t *buf, uint32_t buf_len, void *userdata);
#endif /* ZEPHYR_DRIVERS_SENSOR_SENSOR_SHELL_H */