|
Zephyr Project API 3.6.0
A Scalable Open Source RTOS
|
Sensing Sensor API. More...
Modules | |
| Sensor Callbacks | |
Data Structures | |
| struct | sensing_sensor_register_info |
| Sensor registration information. More... | |
| struct | sensing_connection |
| Connection between a source and sink of sensor data. More... | |
| struct | sensing_sensor |
| Internal sensor instance data structure. More... | |
| struct | sensing_submit_config |
Macros | |
| #define | SENSING_SENSOR_INFO_NAME(node, idx) _CONCAT(_CONCAT(__sensing_sensor_info_, idx), DEVICE_DT_NAME_GET(node)) |
| #define | SENSING_SENSOR_INFO_DEFINE(node, idx) |
| #define | SENSING_CONNECTIONS_NAME(node) _CONCAT(__sensing_connections_, DEVICE_DT_NAME_GET(node)) |
| #define | SENSING_SENSOR_SOURCE_NAME(idx, node) |
| #define | SENSING_SENSOR_SOURCE_EXTERN(idx, node) extern struct sensing_sensor SENSING_SENSOR_SOURCE_NAME(idx, node); \ |
| #define | SENSING_CONNECTION_INITIALIZER(source_name, cb_list_ptr) |
| #define | SENSING_CONNECTION_DEFINE(idx, node, cb_list_ptr) |
| #define | SENSING_CONNECTIONS_DEFINE(node, num, cb_list_ptr) |
| #define | SENSING_SUBMIT_CFG_NAME(node, idx) _CONCAT(_CONCAT(__sensing_submit_cfg_, idx), DEVICE_DT_NAME_GET(node)) |
| #define | SENSING_SENSOR_IODEV_NAME(node, idx) _CONCAT(_CONCAT(__sensing_iodev_, idx), DEVICE_DT_NAME_GET(node)) |
| #define | SENSING_SENSOR_IODEV_DEFINE(node, idx) |
| #define | SENSING_SENSOR_NAME(node, idx) _CONCAT(_CONCAT(__sensing_sensor_, idx), DEVICE_DT_NAME_GET(node)) |
| #define | SENSING_SENSOR_DEFINE(node, prop, idx, reg_ptr, cb_list_ptr) |
| #define | SENSING_SENSORS_DEFINE(node, reg_ptr, cb_list_ptr) |
| #define | SENSING_SENSORS_DT_DEFINE(node, reg_ptr, cb_list_ptr, init_fn, pm_device, data_ptr, cfg_ptr, level, prio, api_ptr, ...) |
| Like SENSOR_DEVICE_DT_DEFINE() with sensing specifics. | |
| #define | SENSING_SENSORS_DT_INST_DEFINE(inst, ...) SENSING_SENSORS_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__) |
| Like SENSING_SENSORS_DT_DEFINE() for an instance of a DT_DRV_COMPAT compatible. | |
Enumerations | |
| enum | { EVENT_CONFIG_READY } |
| enum | { SENSOR_LATER_CFG_BIT } |
Functions | |
| int | sensing_sensor_get_reporters (const struct device *dev, int type, sensing_sensor_handle_t *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. | |
Sensing Sensor API.
| #define SENSING_CONNECTION_DEFINE | ( | idx, | |
| node, | |||
| cb_list_ptr | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_CONNECTION_INITIALIZER | ( | source_name, | |
| cb_list_ptr | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_CONNECTIONS_DEFINE | ( | node, | |
| num, | |||
| cb_list_ptr | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_CONNECTIONS_NAME | ( | node | ) | _CONCAT(__sensing_connections_, DEVICE_DT_NAME_GET(node)) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_DEFINE | ( | node, | |
| prop, | |||
| idx, | |||
| reg_ptr, | |||
| cb_list_ptr | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_INFO_DEFINE | ( | node, | |
| idx | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_INFO_NAME | ( | node, | |
| idx | |||
| ) | _CONCAT(_CONCAT(__sensing_sensor_info_, idx), DEVICE_DT_NAME_GET(node)) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_IODEV_DEFINE | ( | node, | |
| idx | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_IODEV_NAME | ( | node, | |
| idx | |||
| ) | _CONCAT(_CONCAT(__sensing_iodev_, idx), DEVICE_DT_NAME_GET(node)) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_NAME | ( | node, | |
| idx | |||
| ) | _CONCAT(_CONCAT(__sensing_sensor_, idx), DEVICE_DT_NAME_GET(node)) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_SOURCE_EXTERN | ( | idx, | |
| node | |||
| ) | extern struct sensing_sensor SENSING_SENSOR_SOURCE_NAME(idx, node); \ |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSOR_SOURCE_NAME | ( | idx, | |
| node | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSORS_DEFINE | ( | node, | |
| reg_ptr, | |||
| cb_list_ptr | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
| #define SENSING_SENSORS_DT_DEFINE | ( | node, | |
| reg_ptr, | |||
| cb_list_ptr, | |||
| init_fn, | |||
| pm_device, | |||
| data_ptr, | |||
| cfg_ptr, | |||
| level, | |||
| prio, | |||
| api_ptr, | |||
| ... | |||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
Like SENSOR_DEVICE_DT_DEFINE() with sensing specifics.
Defines a sensor which implements the sensor API. May define an element in the sensing sensor iterable section used to enumerate all sensing sensors.
| node | The devicetree node identifier. |
| reg_ptr | Pointer to the device's sensing_sensor_register_info. |
| cb_list_ptr | Pointer to devices callback list. |
| init_fn | Name of the init function of the driver. |
| pm_device | PM device resources reference (NULL if device does not use PM). |
| data_ptr | Pointer to the device's private data. |
| cfg_ptr | The address to the structure containing the configuration information for this instance of the driver. |
| level | The initialization level. See SYS_INIT() for details. |
| prio | Priority within the selected initialization level. See SYS_INIT() for details. |
| api_ptr | Provides an initial pointer to the API function struct used by the driver. Can be NULL. |
| #define SENSING_SENSORS_DT_INST_DEFINE | ( | inst, | |
| ... | |||
| ) | SENSING_SENSORS_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__) |
#include <include/zephyr/sensing/sensing_sensor.h>
Like SENSING_SENSORS_DT_DEFINE() for an instance of a DT_DRV_COMPAT compatible.
| inst | instance number. This is replaced by DT_DRV_COMPAT(inst) in the call to SENSING_SENSORS_DT_DEFINE(). |
| ... | other parameters as expected by SENSING_SENSORS_DT_DEFINE(). |
| #define SENSING_SUBMIT_CFG_NAME | ( | node, | |
| idx | |||
| ) | _CONCAT(_CONCAT(__sensing_submit_cfg_, idx), DEVICE_DT_NAME_GET(node)) |
#include <include/zephyr/sensing/sensing_sensor.h>
| anonymous enum |
#include <include/zephyr/sensing/sensing_sensor.h>
| Enumerator | |
|---|---|
| EVENT_CONFIG_READY | |
| anonymous enum |
#include <include/zephyr/sensing/sensing_sensor.h>
| Enumerator | |
|---|---|
| SENSOR_LATER_CFG_BIT | |
| int sensing_sensor_get_reporters | ( | const struct device * | dev, |
| int | type, | ||
| sensing_sensor_handle_t * | reporter_handles, | ||
| int | max_handles | ||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
Get reporter handles of a given sensor instance by sensor type.
| dev | The sensor instance device structure. |
| type | The given type, SENSING_SENSOR_TYPE_ALL to get reporters with all types. |
| max_handles | The max count of the reporter_handles array input. Can get real count number via sensing_sensor_get_reporters_count |
| reporter_handles | Input handles array for receiving found reporter sensor instances |
| int sensing_sensor_get_reporters_count | ( | const struct device * | dev, |
| int | type | ||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
Get reporters count of a given sensor instance by sensor type.
| dev | The sensor instance device structure. |
| type | The sensor type for checking, SENSING_SENSOR_TYPE_ALL |
type, 0 returned if no reporters by type. | int sensing_sensor_get_state | ( | const struct device * | dev, |
| enum sensing_sensor_state * | state | ||
| ) |
#include <include/zephyr/sensing/sensing_sensor.h>
Get this sensor's state.
| dev | The sensor instance device structure. |
| state | Returned sensor state value |