13#ifndef ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
46 HAPTICS_ERROR_PRIV_START =
BIT(5),
58 void *
const user_data);
83 void *
const user_data);
117static inline int z_impl_haptics_start_output(
const struct device *dev)
121 return api->start_output(dev);
134static inline int z_impl_haptics_stop_output(
const struct device *dev)
138 return api->stop_output(dev);
153 void *
const user_data)
172#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:81
int(* haptics_start_output_t)(const struct device *dev)
Set the haptic device to start output for a playback event.
Definition haptics.h:75
int(* haptics_stop_output_t)(const struct device *dev)
Set the haptic device to stop output.
Definition haptics.h:69
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.
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)
Function type of callback invoked when a haptic device error occurs.
Definition haptics.h:57
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:151
@ HAPTICS_ERROR_OVERVOLTAGE
Power source overvoltage error.
Definition haptics.h:41
@ 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
<span class="mlabel">Driver Operations</span> Haptics driver operations
Definition haptics.h:88
haptics_register_error_callback_t register_error_callback
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition haptics.h:100
haptics_start_output_t start_output
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition haptics.h:92
haptics_stop_output_t stop_output
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition haptics.h:96