|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Main header file for haptics driver API. More...
#include <zephyr/audio/codec.h>#include <zephyr/device.h>#include <zephyr/drivers/sensor.h>#include <zephyr/sys/__assert.h>#include <zephyr/syscalls/haptics.h>Go to the source code of this file.
Data Structures | |
| union | haptics_config |
| Haptics source configuration. More... | |
| struct | haptics_driver_api |
| @driver_ops{Haptics} More... | |
Typedefs | |
| typedef void(* | haptics_error_callback_t) (const struct device *dev, const uint32_t errors, void *const user_data) |
| Function type of callback invoked when an error occurs. | |
| typedef int(* | haptics_calibrate_t) (const struct device *dev, const uint32_t routine) |
| @def_driverbackendgroup{Haptics,haptics_interface} | |
| typedef int(* | haptics_monitor_get_t) (const struct device *dev, const enum haptics_monitor monitor, const enum haptics_monitor_type type, struct sensor_value *const val) |
| Retrieve an integrated sensor reading from the haptic driver. | |
| typedef int(* | haptics_monitor_set_t) (const struct device *dev, const enum haptics_monitor monitor, const bool enable) |
| Enable or disable integrated sensing for the haptic driver. | |
| typedef int(* | haptics_register_error_callback_t) (const struct device *dev, haptics_error_callback_t cb, void *const user_data) |
| Register a callback function for haptics errors. | |
| typedef int(* | haptics_select_source_t) (const struct device *dev, const enum haptics_source src, const union haptics_config *const cfg) |
| Specify a playback source for haptics_start_output(). | |
| typedef int(* | haptics_set_level_t) (const struct device *dev, const enum haptics_source src, const union haptics_config *const cfg, const uint32_t level) |
| Set level controls for haptic effects. | |
| typedef int(* | haptics_set_trigger_t) (const struct device *dev, const uint32_t trigger, const uint32_t types, const enum haptics_source src, const union haptics_config *const cfg, const uint32_t level) |
| Assign a haptic effect to a specified GPIO event or condition. | |
| typedef int(* | haptics_start_output_t) (const struct device *dev) |
| Start playback for a haptic effect. | |
| typedef int(* | haptics_stop_output_t) (const struct device *dev) |
| Stop an ongoing haptic effect and cancel any queued effects, if applicable. | |
| typedef int(* | haptics_stream_samples_t) (const struct device *dev, const uint8_t *const samples, const size_t len) |
| Stream 8-bit samples over the control port for haptic effects. | |
| typedef int(* | haptics_trigger_t) (const struct device *dev, const uint32_t trigger, const enum haptics_trigger_type type) |
| Trigger a haptic effect. | |
Functions | |
| int | haptics_calibrate (const struct device *dev, const uint32_t routine) |
| Calibrate the haptic driver for an external actuator. | |
| int | haptics_monitor_get (const struct device *dev, const enum haptics_monitor monitor, const enum haptics_monitor_type type, struct sensor_value *const val) |
| Retrieve an integrated sensor reading from the haptic driver. | |
| int | haptics_monitor_set (const struct device *dev, const enum haptics_monitor monitor, const bool enable) |
| Enable or disable integrated sensing for the haptic driver. | |
| static int | haptics_register_error_callback (const struct device *dev, haptics_error_callback_t cb, void *const user_data) |
| Register a callback function for haptics errors. | |
| int | haptics_select_source (const struct device *dev, const enum haptics_source src, const union haptics_config *const cfg) |
| Specify a playback source and related configuration details. | |
| int | haptics_set_level (const struct device *dev, const enum haptics_source src, const union haptics_config *const cfg, const uint32_t level) |
| Set level controls for haptic effects. | |
| int | haptics_set_trigger (const struct device *dev, const uint32_t trigger, const uint32_t types, const enum haptics_source src, const union haptics_config *const cfg, const uint32_t level) |
| Assign a haptic effect to a specified GPIO event or condition. | |
| int | haptics_start_output (const struct device *dev) |
| Start playback for a haptic effect. | |
| int | haptics_stop_output (const struct device *dev) |
| Stop an ongoing haptic effect and cancel any queued effects, if applicable. | |
| int | haptics_stream_samples (const struct device *dev, const uint8_t *const samples, const size_t len) |
| Stream 8-bit samples over the control port for haptic effects. | |
| int | haptics_trigger (const struct device *dev, const uint32_t trigger, const enum haptics_trigger_type type) |
| Trigger a haptic effect. | |
Main header file for haptics driver API.