Zephyr API Documentation 4.0.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
7#ifndef ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
8#define ZEPHYR_INCLUDE_DRIVERS_HAPTICS_H_
9
17#include <zephyr/device.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
28typedef int (*haptics_stop_output_t)(const struct device *dev);
29
34typedef int (*haptics_start_output_t)(const struct device *dev);
35
43
52__syscall int haptics_start_output(const struct device *dev);
53
54static inline int z_impl_haptics_start_output(const struct device *dev)
55{
56 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
57
58 return api->start_output(dev);
59}
60
69__syscall int haptics_stop_output(const struct device *dev);
70
71static inline int z_impl_haptics_stop_output(const struct device *dev)
72{
73 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
74
75 return api->stop_output(dev);
76}
77
82#ifdef __cplusplus
83}
84#endif /* __cplusplus */
85
86#include <syscalls/haptics.h>
87
88#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(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:34
int(* haptics_stop_output_t)(const struct device *dev)
Set the haptic device to stop output.
Definition haptics.h:28
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417
Haptic device API.
Definition haptics.h:39
haptics_start_output_t start_output
Definition haptics.h:40
haptics_stop_output_t stop_output
Definition haptics.h:41