![]() |
NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
|
Sensor axis API . More...
Macros | |
#define | SENSOR_AXIS_SETTINGS_ROOT "sensor_axis" |
Settings root path for sensor_axis. | |
Typedefs | |
typedef void(* | sensor_axis_sensor_raw_cb_t) (const struct device *dev, const struct sensor_value *val, void *user_data) |
Sensor axis sensor raw callback type. | |
Functions | |
void | sensor_axis_sensor_set_raw_cb (const struct device *dev, sensor_axis_sensor_raw_cb_t cb, void *user_data) |
Set callback function for raw sensor value, use NULL to reset. | |
void | sensor_axis_sensor_min_get (const struct device *dev, struct sensor_value *val) |
Get sensor setpoint that will report minimum value. | |
void | sensor_axis_sensor_max_get (const struct device *dev, struct sensor_value *val) |
Get sensor setpoint that will report maximum value. | |
void | sensor_axis_sensor_min_set (const struct device *dev, const struct sensor_value *val) |
Set sensor setpoint that will report minimum value. | |
void | sensor_axis_sensor_max_set (const struct device *dev, const struct sensor_value *val) |
Set sensor setpoint that will report maximum value. | |
int | sensor_axis_sensor_min_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Use current sensor value as setpoint that will report minimum value. | |
int | sensor_axis_sensor_max_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Use current sensor value as setpoint that will report maximum value. | |
int | sensor_axis_sensor_center_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Use current sensor value as setpoint that will report center value. Use with sensor_axis_sensor_range_set_curr for setting the center point and the range. | |
int | sensor_axis_sensor_range_set_curr (const struct device *dev, int times, k_timeout_t interval, bool is_min) |
Use current sensor value as setpoint that will be used as range. Use with sensor_axis_sensor_center_set_curr for setting the center point and the range. | |
int | sensor_axis_channel_min_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Similar to sensor_axis_sensor_min_set_curr but applies to all underlying sensors of a channel. | |
int | sensor_axis_channel_max_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Similar to sensor_axis_sensor_max_set_curr but applies to all underlying sensors of a channel. | |
int | sensor_axis_channel_center_set_curr (const struct device *dev, int times, k_timeout_t interval) |
Similar to sensor_axis_sensor_center_set_curr but applies to all underlying sensors of a channel. | |
int | sensor_axis_channel_range_set_curr (const struct device *dev, int times, k_timeout_t interval, bool is_min) |
Similar to sensor_axis_sensor_range_set_curr but applies to all underlying sensors of a channel. | |
Sensor axis API .
#define SENSOR_AXIS_SETTINGS_ROOT "sensor_axis" |
#include <zephyr/drivers/input/sensor_axis.h>
Settings root path for sensor_axis.
typedef void(* sensor_axis_sensor_raw_cb_t) (const struct device *dev, const struct sensor_value *val, void *user_data) |
#include <zephyr/drivers/input/sensor_axis.h>
Sensor axis sensor raw callback type.
[in] | dev | The device that generated the event. |
[in] | val | The sensor value. |
[in] | user_data | User data to pass to the callback. |
int sensor_axis_channel_center_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Similar to sensor_axis_sensor_center_set_curr but applies to all underlying sensors of a channel.
int sensor_axis_channel_max_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Similar to sensor_axis_sensor_max_set_curr but applies to all underlying sensors of a channel.
int sensor_axis_channel_min_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Similar to sensor_axis_sensor_min_set_curr but applies to all underlying sensors of a channel.
int sensor_axis_channel_range_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval, | ||
bool | is_min ) |
#include <zephyr/drivers/input/sensor_axis.h>
Similar to sensor_axis_sensor_range_set_curr but applies to all underlying sensors of a channel.
int sensor_axis_sensor_center_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Use current sensor value as setpoint that will report center value. Use with sensor_axis_sensor_range_set_curr for setting the center point and the range.
[in] | dev | The sensor to set the setpoint. |
[in] | times | The number of times to sample the sensor. |
[in] | interval | The interval between each sample. |
void sensor_axis_sensor_max_get | ( | const struct device * | dev, |
struct sensor_value * | val ) |
#include <zephyr/drivers/input/sensor_axis.h>
Get sensor setpoint that will report maximum value.
[in] | dev | The sensor to get the setpoint. |
[out] | val | The sensor value to get. |
void sensor_axis_sensor_max_set | ( | const struct device * | dev, |
const struct sensor_value * | val ) |
#include <zephyr/drivers/input/sensor_axis.h>
Set sensor setpoint that will report maximum value.
[in] | dev | The sensor to set the setpoint. |
[in] | val | The sensor value to set. |
int sensor_axis_sensor_max_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Use current sensor value as setpoint that will report maximum value.
[in] | dev | The sensor to set the setpoint. |
[in] | times | The number of times to sample the sensor. |
[in] | interval | The interval between each sample. |
void sensor_axis_sensor_min_get | ( | const struct device * | dev, |
struct sensor_value * | val ) |
#include <zephyr/drivers/input/sensor_axis.h>
Get sensor setpoint that will report minimum value.
[in] | dev | The sensor to get the setpoint. |
[out] | val | The sensor value to get. |
void sensor_axis_sensor_min_set | ( | const struct device * | dev, |
const struct sensor_value * | val ) |
#include <zephyr/drivers/input/sensor_axis.h>
Set sensor setpoint that will report minimum value.
[in] | dev | The sensor to set the setpoint. |
[in] | val | The sensor value to set. |
int sensor_axis_sensor_min_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval ) |
#include <zephyr/drivers/input/sensor_axis.h>
Use current sensor value as setpoint that will report minimum value.
[in] | dev | The sensor to set the setpoint. |
[in] | times | The number of times to sample the sensor. |
[in] | interval | The interval between each sample. |
int sensor_axis_sensor_range_set_curr | ( | const struct device * | dev, |
int | times, | ||
k_timeout_t | interval, | ||
bool | is_min ) |
#include <zephyr/drivers/input/sensor_axis.h>
Use current sensor value as setpoint that will be used as range. Use with sensor_axis_sensor_center_set_curr for setting the center point and the range.
[in] | dev | The sensor to set the setpoint. |
[in] | times | The number of times to sample the sensor. |
[in] | interval | The interval between each sample. |
[in] | is_min | If true, use the current value as minimum, otherwise as maximum. |
void sensor_axis_sensor_set_raw_cb | ( | const struct device * | dev, |
sensor_axis_sensor_raw_cb_t | cb, | ||
void * | user_data ) |
#include <zephyr/drivers/input/sensor_axis.h>
Set callback function for raw sensor value, use NULL
to reset.
[in] | dev | The device to set the callback. |
[in] | cb | The callback function, or NULL to reset. |
[in] | user_data | User data to pass to the callback. |