Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sensing_sensor.h File Reference
#include <zephyr/sensing/sensing.h>
#include <zephyr/device.h>
#include <stdbool.h>
#include <zephyr/drivers/sensor.h>

Go to the source code of this file.

Data Structures

struct  sensing_sensor_register_info
 Sensor registration information. More...
 
struct  sensing_sensor_ctx
 Sensor context data structure. More...
 
struct  sensing_sensor_api
 Sensor callback api. More...
 

Macros

#define SENSING_SENSOR_DT_DEFINE(node_id, reg_ptr, ctx_ptr, api_ptr)
 Macro for define a sensor instance from device tree node id.
 

Typedefs

typedef int(* sensing_sensor_init_t) (const struct device *dev, const struct sensing_sensor_info *info, const sensing_sensor_handle_t *reporter_handles, int reporters_count)
 Sensor initialize.
 
typedef int(* sensing_sensor_deinit_t) (const struct device *dev)
 Sensor's de-initialize.
 
typedef int(* sensing_sensor_reset_t) (const struct device *dev)
 Sensor reset.
 
typedef int(* sensing_sensor_read_sample_t) (const struct device *dev, void *buf, int size)
 Sensor read sample.
 
typedef int(* sensing_sensor_process_t) (const struct device *dev, int reporter, void *buf, int size)
 Sensor process data.
 
typedef int(* sensing_sensor_self_calibration_t) (const struct device *dev)
 Trigger a sensor to do self calibration.
 
typedef int(* sensing_sensor_sensitivity_test_t) (const struct device *dev, int index, uint32_t sensitivity, void *last_sample_buf, int last_sample_size, void *current_sample_buf, int current_sample_size)
 Sensitivity arbitration.
 
typedef int(* sensing_sensor_set_interval_t) (const struct device *dev, uint32_t value)
 Set current report interval.
 
typedef int(* sensing_sensor_get_interval_t) (const struct device *dev, uint32_t *value)
 Get current report interval.
 
typedef int(* sensing_sensor_set_sensitivity_t) (const struct device *dev, int index, uint32_t value)
 Set data change sensitivity.
 
typedef int(* sensing_sensor_get_sensitivity_t) (const struct device *dev, int index, uint32_t *value)
 Get current data change sensitivity.
 
typedef int(* sensing_sensor_set_range_t) (const struct device *dev, int index, uint32_t value)
 Set data range.
 
typedef int(* sensing_sensor_get_range_t) (const struct device *dev, int index, uint32_t *value)
 Get current data range.
 
typedef int(* sensing_sensor_set_fifo_t) (const struct device *dev, uint32_t samples)
 Set current sensor's hardware fifo size.
 
typedef int(* sensing_sensor_get_fifo_t) (const struct device *dev, uint32_t *samples)
 Get current sensor's hardware fifo size.
 
typedef int(* sensing_sensor_set_offset_t) (const struct device *dev, int index, int32_t value)
 Set current sensor data offset.
 
typedef int(* sensing_sensor_get_offset_t) (const struct device *dev, int index, int32_t *value)
 Get current sensor data offset.
 

Functions

static int sensing_sensor_dev_init (const struct device *dev)
 
static void * sensing_sensor_get_ctx_data (const struct device *dev)
 Get registered context data pointer for a sensor instance.
 
int sensing_sensor_post_data (const struct device *dev, void *buf, int size)
 Post sensor data, sensor subsystem runtime will deliver to it's clients.
 
int sensing_sensor_get_reporters (const struct device *dev, int type, const int *reporter_handles, int max_handles)
 Get reporter handles of a given sensor instance by sensor type.
 
int sensing_sensor_get_reporters_count (const struct device *dev, int type)
 Get reporters count of a given sensor instance by sensor type.
 
int sensing_sensor_get_state (const struct device *dev, enum sensing_sensor_state *state)
 Get this sensor's state.
 
int sensing_sensor_notify_data_ready (const struct device *dev)
 Trigger the data ready event to sensing.
 
int sensing_sensor_set_data_ready (const struct device *dev, bool data_ready)
 Set the data ready mode of the sensor.