|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Interfaces for haptic devices. More...
Topics | |
| Device-specific Haptics API extensions | |
| Haptics Driver Backend API | |
Files | |
| file | haptics.h |
| Main header file for haptics driver API. | |
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 a haptic device error occurs. | |
Enumerations | |
| enum | haptics_error_type { HAPTICS_ERROR_OVERCURRENT = BIT(0) , HAPTICS_ERROR_OVERTEMPERATURE = BIT(1) , HAPTICS_ERROR_UNDERVOLTAGE = BIT(2) , HAPTICS_ERROR_OVERVOLTAGE = BIT(3) , HAPTICS_ERROR_DC = BIT(4) } |
| Haptics error types. More... | |
Functions | |
| int | haptics_start_output (const struct device *dev) |
| Set the haptic device to start output for a playback event. | |
| int | haptics_stop_output (const struct device *dev) |
| Set the haptic device to stop output for a playback event. | |
| 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. | |
Interfaces for haptic devices.
| typedef void(* haptics_error_callback_t) (const struct device *dev, const uint32_t errors, void *const user_data) |
#include <zephyr/drivers/haptics.h>
Function type of callback invoked when a haptic device error occurs.
| dev | Pointer to the haptic device |
| errors | Device errors (bitmask of haptics_error_type values) |
| user_data | User data provided when the error callback was registered |
| enum haptics_error_type |
#include <zephyr/drivers/haptics.h>
Haptics error types.
|
inlinestatic |
#include <zephyr/drivers/haptics.h>
Register a callback function for haptics errors.
| dev | Pointer to the haptic device |
| cb | Callback function (of type haptics_error_callback_t) |
| user_data | User data to be provided back to the application via the callback |
| 0 | if successful |
| <0 | if failed |
| int haptics_start_output | ( | const struct device * | dev | ) |
#include <zephyr/drivers/haptics.h>
Set the haptic device to start output for a playback event.
| dev | Pointer to the device structure for haptic device instance |
| 0 | if successful |
| <0 | if failed |
| int haptics_stop_output | ( | const struct device * | dev | ) |
#include <zephyr/drivers/haptics.h>
Set the haptic device to stop output for a playback event.
| dev | Pointer to the device structure for haptic device instance |
| 0 | if successful |
| <0 | if failed |