13#ifndef ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
69 void *
const user_data);
77 void *
const user_data);
98static inline int z_impl_haptics_start_output(
const struct device *dev)
102 return api->start_output(dev);
115static inline int z_impl_haptics_stop_output(
const struct device *dev)
119 return api->stop_output(dev);
134 void *
const user_data)
153#include <syscalls/haptics.h>
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.
Definition haptics.h:75
int haptics_stop_output(const struct device *dev)
Set the haptic device to stop output for a playback event.
int haptics_start_output(const struct device *dev)
Set the haptic device to start output for a playback event.
int(* haptics_start_output_t)(const struct device *dev)
Set the haptic device to start output for a playback event.
Definition haptics.h:58
haptics_error_type
Haptics error types.
Definition haptics.h:37
void(* haptics_error_callback_t)(const struct device *dev, const uint32_t errors, void *const user_data)
Callback function for error interrupt.
Definition haptics.h:68
int(* haptics_stop_output_t)(const struct device *dev)
Set the haptic device to stop output.
Definition haptics.h:52
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.
Definition haptics.h:132
@ HAPTICS_ERROR_OVERVOLTAGE
Power source overvoltage error.
Definition haptics.h:41
@ HAPTICS_ERROR_PRIV_START
Definition haptics.h:45
@ HAPTICS_ERROR_DC
Output direct-current error.
Definition haptics.h:42
@ HAPTICS_ERROR_OVERCURRENT
Output overcurrent error.
Definition haptics.h:38
@ HAPTICS_ERROR_UNDERVOLTAGE
Power source undervoltage error.
Definition haptics.h:40
@ HAPTICS_ERROR_OVERTEMPERATURE
Device overtemperature error.
Definition haptics.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define NULL
Definition iar_missing_defs.h:20
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:519
Haptic device API.
Definition haptics.h:82
haptics_register_error_callback_t register_error_callback
Definition haptics.h:85
haptics_start_output_t start_output
Definition haptics.h:83
haptics_stop_output_t stop_output
Definition haptics.h:84