NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
Loading...
Searching...
No Matches

Sensor axis API . More...

+ Collaboration diagram for Sensor axis API:

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.
 

Detailed Description

Sensor axis API .

Macro Definition Documentation

◆ SENSOR_AXIS_SETTINGS_ROOT

#define SENSOR_AXIS_SETTINGS_ROOT   "sensor_axis"

#include <zephyr/drivers/input/sensor_axis.h>

Settings root path for sensor_axis.

Typedef Documentation

◆ sensor_axis_sensor_raw_cb_t

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.

Parameters
[in]devThe device that generated the event.
[in]valThe sensor value.
[in]user_dataUser data to pass to the callback.

Function Documentation

◆ sensor_axis_channel_center_set_curr()

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.

Note
It takes N times longer where N is the number of sensors of the channel.

◆ sensor_axis_channel_max_set_curr()

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.

Note
It takes N times longer where N is the number of sensors of the channel.

◆ sensor_axis_channel_min_set_curr()

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.

Note
It takes N times longer where N is the number of sensors of the channel.

◆ sensor_axis_channel_range_set_curr()

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.

Note
It takes N times longer where N is the number of sensors of the channel.

◆ sensor_axis_sensor_center_set_curr()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]timesThe number of times to sample the sensor.
[in]intervalThe interval between each sample.
Returns
0 If success, negative error number otherwise.

◆ sensor_axis_sensor_max_get()

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.

Parameters
[in]devThe sensor to get the setpoint.
[out]valThe sensor value to get.

◆ sensor_axis_sensor_max_set()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]valThe sensor value to set.

◆ sensor_axis_sensor_max_set_curr()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]timesThe number of times to sample the sensor.
[in]intervalThe interval between each sample.
Returns
0 If success, negative error number otherwise.

◆ sensor_axis_sensor_min_get()

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.

Parameters
[in]devThe sensor to get the setpoint.
[out]valThe sensor value to get.

◆ sensor_axis_sensor_min_set()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]valThe sensor value to set.

◆ sensor_axis_sensor_min_set_curr()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]timesThe number of times to sample the sensor.
[in]intervalThe interval between each sample.
Returns
0 If success, negative error number otherwise.

◆ sensor_axis_sensor_range_set_curr()

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.

Parameters
[in]devThe sensor to set the setpoint.
[in]timesThe number of times to sample the sensor.
[in]intervalThe interval between each sample.
[in]is_minIf true, use the current value as minimum, otherwise as maximum.
Returns
0 If success, negative error number otherwise.

◆ sensor_axis_sensor_set_raw_cb()

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.

Parameters
[in]devThe device to set the callback.
[in]cbThe callback function, or NULL to reset.
[in]user_dataUser data to pass to the callback.