Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Analog axis API . More...
Data Structures | |
struct | analog_axis_calibration |
Analog axis calibration data structure. More... | |
Typedefs | |
typedef void(* | analog_axis_raw_data_t) (const struct device *dev, int channel, int16_t raw_val) |
Analog axis raw data callback. | |
Functions | |
void | analog_axis_set_raw_data_cb (const struct device *dev, analog_axis_raw_data_t cb) |
Set a raw data callback. | |
int | analog_axis_num_axes (const struct device *dev) |
Get the number of defined axes. | |
int | analog_axis_calibration_get (const struct device *dev, int channel, struct analog_axis_calibration *cal) |
Get the axis calibration data. | |
int | analog_axis_calibration_set (const struct device *dev, int channel, struct analog_axis_calibration *cal) |
Set the axis calibration data. | |
int | analog_axis_calibration_save (const struct device *dev) |
Save the calibration data. | |
Analog axis API .
#include <zephyr/input/input_analog_axis.h>
Analog axis raw data callback.
dev | Analog axis device. |
channel | Channel number. |
raw_val | Raw value for the channel. |
int analog_axis_calibration_get | ( | const struct device * | dev, |
int | channel, | ||
struct analog_axis_calibration * | cal ) |
#include <zephyr/input/input_analog_axis.h>
Get the axis calibration data.
dev | Analog axis device. |
channel | Channel number. |
cal | Pointer to an analog_axis_calibration structure that is going to get set with the current calibration data. |
0 | If successful. |
-EINVAL | If the specified channel is not valid. |
int analog_axis_calibration_save | ( | const struct device * | dev | ) |
#include <zephyr/input/input_analog_axis_settings.h>
Save the calibration data.
Save the calibration data permanently on the specifided device, requires the Settings subsystem to be configured and initialized.
dev | Analog axis device. |
0 | If successful. |
-errno | In case of any other error. |
int analog_axis_calibration_set | ( | const struct device * | dev, |
int | channel, | ||
struct analog_axis_calibration * | cal ) |
#include <zephyr/input/input_analog_axis.h>
Set the axis calibration data.
dev | Analog axis device. |
channel | Channel number. |
cal | Pointer to an analog_axis_calibration structure with the new calibration data |
0 | If successful. |
-EINVAL | If the specified channel is not valid. |
int analog_axis_num_axes | ( | const struct device * | dev | ) |
#include <zephyr/input/input_analog_axis.h>
Get the number of defined axes.
n | The number of defined axes for dev. |
void analog_axis_set_raw_data_cb | ( | const struct device * | dev, |
analog_axis_raw_data_t | cb ) |
#include <zephyr/input/input_analog_axis.h>
Set a raw data callback.
Set a callback to receive raw data for the specified analog axis device. This is meant to be use in the application to acquire the data to use for calibration. Set cb to NULL to disable the callback.
dev | Analog axis device. |
cb | An analog_axis_raw_data_t callback to use, NULL disable. |