Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sensing.h File Reference

Main header file for the Sensing subsystem API. More...

Go to the source code of this file.

Data Structures

struct  sensing_sensor_version
 Sensor Version. More...
struct  sensing_sensor_info
 Read-only description of a sensor instance. More...
struct  sensing_callback_list
 Callback registration for a sensor instance. More...
struct  sensing_sensor_config
 Sensing subsystem sensor configure, including interval, sensitivity, latency. More...

Macros

#define SENSING_SENSOR_VERSION(_major, _minor, _hotfix, _build)
 Build a packed sensing_sensor_version value.
#define SENSING_SENSITIVITY_INDEX_ALL   -1
 Sentinel index meaning "apply to all data fields".
Sensor reporting flags
#define SENSING_SENSOR_FLAG_REPORT_ON_EVENT   BIT(0)
 Sensor flag indicating if this sensor is reporting data on event.
#define SENSING_SENSOR_FLAG_REPORT_ON_CHANGE   BIT(1)
 Sensor flag indicating if this sensor is reporting data on change.

Typedefs

typedef void * sensing_sensor_handle_t
 Opaque handle to an opened sensor instance.
typedef void(* sensing_data_event_t) (sensing_sensor_handle_t handle, const void *buf, void *context)
 Data event callback signature.

Enumerations

enum  sensing_sensor_state { SENSING_SENSOR_STATE_READY = 0 , SENSING_SENSOR_STATE_OFFLINE = 1 }
 Sensor state. More...
enum  sensing_sensor_attribute { SENSING_SENSOR_ATTRIBUTE_INTERVAL = 0 , SENSING_SENSOR_ATTRIBUTE_SENSITIVITY = 1 , SENSING_SENSOR_ATTRIBUTE_LATENCY = 2 , SENSING_SENSOR_ATTRIBUTE_MAX }
 Sensor configuration attribute. More...

Functions

int sensing_get_sensors (int *num_sensors, const struct sensing_sensor_info **info)
 Get all supported sensor instances' information.
int sensing_open_sensor (const struct sensing_sensor_info *info, struct sensing_callback_list *cb_list, sensing_sensor_handle_t *handle)
 Open sensor instance by sensing sensor info.
int sensing_open_sensor_by_dt (const struct device *dev, struct sensing_callback_list *cb_list, sensing_sensor_handle_t *handle)
 Open sensor instance by device.
int sensing_close_sensor (sensing_sensor_handle_t *handle)
 Close sensor instance.
int sensing_set_config (sensing_sensor_handle_t handle, struct sensing_sensor_config *configs, int count)
 Set current config items to Sensing subsystem.
int sensing_get_config (sensing_sensor_handle_t handle, struct sensing_sensor_config *configs, int count)
 Get current config items from Sensing subsystem.
const struct sensing_sensor_infosensing_get_sensor_info (sensing_sensor_handle_t handle)
 Get sensor information from sensor instance handle.

Detailed Description

Main header file for the Sensing subsystem API.