Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Sensor Driver Backend API

Data Structures

struct  sensor_driver_api
  Driver Operations Sensor driver operations More...

Typedefs

typedef int(* sensor_attr_set_t) (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, const struct sensor_value *val)
 Callback API to set a sensor attribute.
typedef int(* sensor_attr_get_t) (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val)
 Callback API to get a sensor attribute.
typedef int(* sensor_trigger_set_t) (const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler)
 Callback API to set a sensor trigger and handler.
typedef int(* sensor_sample_fetch_t) (const struct device *dev, enum sensor_channel chan)
 Callback API to fetch a sensor sample into the driver buffer.
typedef int(* sensor_channel_get_t) (const struct device *dev, enum sensor_channel chan, struct sensor_value *val)
 Callback API to read a sensor channel from the driver buffer.
typedef int(* sensor_get_decoder_t) (const struct device *dev, const struct sensor_decoder_api **api)
 Callback API to get the sensor decoder implementation.
typedef void(* sensor_submit_t) (const struct device *sensor, struct rtio_iodev_sqe *sqe)
 Callback API to service an RTIO submission for a sensor device.

Detailed Description

This group contains the API type definitions, callback signatures, and other helpers required to implement a Sensor driver.

Typedef Documentation

◆ sensor_attr_get_t

typedef int(* sensor_attr_get_t) (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val)

#include <zephyr/drivers/sensor.h>

Callback API to get a sensor attribute.

See sensor_attr_get() for argument description

◆ sensor_attr_set_t

typedef int(* sensor_attr_set_t) (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, const struct sensor_value *val)

#include <zephyr/drivers/sensor.h>

Callback API to set a sensor attribute.

See sensor_attr_set() for argument description

◆ sensor_channel_get_t

typedef int(* sensor_channel_get_t) (const struct device *dev, enum sensor_channel chan, struct sensor_value *val)

#include <zephyr/drivers/sensor.h>

Callback API to read a sensor channel from the driver buffer.

See sensor_channel_get() for argument description

◆ sensor_get_decoder_t

typedef int(* sensor_get_decoder_t) (const struct device *dev, const struct sensor_decoder_api **api)

#include <zephyr/drivers/sensor.h>

Callback API to get the sensor decoder implementation.

See sensor_get_decoder() for argument description

◆ sensor_sample_fetch_t

typedef int(* sensor_sample_fetch_t) (const struct device *dev, enum sensor_channel chan)

#include <zephyr/drivers/sensor.h>

Callback API to fetch a sensor sample into the driver buffer.

See sensor_sample_fetch_chan() for argument description

◆ sensor_submit_t

typedef void(* sensor_submit_t) (const struct device *sensor, struct rtio_iodev_sqe *sqe)

#include <zephyr/drivers/sensor.h>

Callback API to service an RTIO submission for a sensor device.

Invoked when the asynchronous sensor path dispatches work to the driver.

Parameters
sensorThe sensor device
sqeThe RTIO submission queue entry

◆ sensor_trigger_set_t

typedef int(* sensor_trigger_set_t) (const struct device *dev, const struct sensor_trigger *trig, sensor_trigger_handler_t handler)

#include <zephyr/drivers/sensor.h>

Callback API to set a sensor trigger and handler.

See sensor_trigger_set() for argument description