Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
haptics.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Cirrus Logic, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
13#ifndef ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
15
28#include <zephyr/device.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
39typedef int (*haptics_stop_output_t)(const struct device *dev);
40
45typedef int (*haptics_start_output_t)(const struct device *dev);
46
54
63__syscall int haptics_start_output(const struct device *dev);
64
65static inline int z_impl_haptics_start_output(const struct device *dev)
66{
67 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
68
69 return api->start_output(dev);
70}
71
80__syscall int haptics_stop_output(const struct device *dev);
81
82static inline int z_impl_haptics_stop_output(const struct device *dev)
83{
84 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
85
86 return api->stop_output(dev);
87}
88
93#ifdef __cplusplus
94}
95#endif /* __cplusplus */
96
97#include <syscalls/haptics.h>
98
99#endif /* ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_ */
int haptics_stop_output(const struct device *dev)
Set the haptic device to stop 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:45
int(* haptics_stop_output_t)(const struct device *dev)
Set the haptic device to stop output.
Definition haptics.h:39
int haptics_start_output(const struct device *dev)
Set the haptic device to start output for a playback event.
Runtime device structure (in ROM) per driver instance.
Definition device.h:510
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:516
Haptic device API.
Definition haptics.h:50
haptics_start_output_t start_output
Definition haptics.h:51
haptics_stop_output_t stop_output
Definition haptics.h:52