|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Interfaces for haptic devices. More...
Topics | |
| Device-specific Haptics API extensions | |
Files | |
| file | haptics.h |
| Main header file for haptics driver API. | |
Data Structures | |
| struct | haptics_driver_api |
| Haptic device API. More... | |
Typedefs | |
| typedef int(* | haptics_stop_output_t) (const struct device *dev) |
| Set the haptic device to stop output. | |
| typedef int(* | haptics_start_output_t) (const struct device *dev) |
| Set the haptic device to start output for a playback event. | |
| typedef void(* | haptics_error_callback_t) (const struct device *dev, const uint32_t errors, void *const user_data) |
| Callback function for error interrupt. | |
| 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. | |
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_PRIV_START = BIT(5) } |
| 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>
Callback function for error interrupt.
| 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 |
| typedef int(* haptics_register_error_callback_t) (const struct device *dev, haptics_error_callback_t cb, void *const user_data) |
#include <zephyr/drivers/haptics.h>
Register a callback function for haptics errors.
| typedef int(* haptics_start_output_t) (const struct device *dev) |
#include <zephyr/drivers/haptics.h>
Set the haptic device to start output for a playback event.
| typedef int(* haptics_stop_output_t) (const struct device *dev) |
#include <zephyr/drivers/haptics.h>
Set the haptic device to stop output.
| 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 |