Analog axis API .
More...
Analog axis API .
◆ analog_axis_raw_data_t
typedef void(* analog_axis_raw_data_t) (const struct device *dev, int channel, int16_t raw_val) |
#include <zephyr/input/input_analog_axis.h>
Analog axis raw data callback.
- Parameters
-
dev | Analog axis device. |
channel | Channel number. |
raw_val | Raw value for the channel. |
◆ analog_axis_calibration_get()
#include <zephyr/input/input_analog_axis.h>
Get the axis calibration data.
- Parameters
-
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. |
- Return values
-
0 | If successful. |
-EINVAL | If the specified channel is not valid. |
◆ analog_axis_calibration_save()
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.
- Parameters
-
- Return values
-
0 | If successful. |
-errno | In case of any other error. |
◆ analog_axis_calibration_set()
#include <zephyr/input/input_analog_axis.h>
Set the axis calibration data.
- Parameters
-
dev | Analog axis device. |
channel | Channel number. |
cal | Pointer to an analog_axis_calibration structure with the new calibration data |
- Return values
-
0 | If successful. |
-EINVAL | If the specified channel is not valid. |
◆ analog_axis_num_axes()
int analog_axis_num_axes |
( |
const struct device * | dev | ) |
|
◆ analog_axis_set_raw_data_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.
- Parameters
-
dev | Analog axis device. |
cb | An analog_axis_raw_data_t callback to use, NULL disable. |