Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Sensing Sensor API. More...
Modules | |
Sensor Callbacks | |
Data Structures | |
struct | sensing_sensor_register_info |
Sensor registration information. More... | |
Macros | |
#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. | |
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_SENSORS_DT_DEFINE | ( | node, | |
reg_ptr, | |||
cb_list_ptr, | |||
init_fn, | |||
pm_device, | |||
data_ptr, | |||
cfg_ptr, | |||
level, | |||
prio, | |||
api_ptr, | |||
... | |||
) |
#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 sensing 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 <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(). |
int sensing_sensor_get_reporters | ( | const struct device * | dev, |
int | type, | ||
sensing_sensor_handle_t * | reporter_handles, | ||
int | max_handles | ||
) |
#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 <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 <zephyr/sensing/sensing_sensor.h>
Get this sensor's state.
dev | The sensor instance device structure. |
state | Returned sensor state value |