Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
 4.2.99
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
21
22#include <zephyr/device.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
33typedef int (*haptics_stop_output_t)(const struct device *dev);
34
39typedef int (*haptics_start_output_t)(const struct device *dev);
40
48
57__syscall int haptics_start_output(const struct device *dev);
58
59static inline int z_impl_haptics_start_output(const struct device *dev)
60{
61 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
62
63 return api->start_output(dev);
64}
65
74__syscall int haptics_stop_output(const struct device *dev);
75
76static inline int z_impl_haptics_stop_output(const struct device *dev)
77{
78 const struct haptics_driver_api *api = (const struct haptics_driver_api *)dev->api;
79
80 return api->stop_output(dev);
81}
82
86
87#ifdef __cplusplus
88}
89#endif /* __cplusplus */
90
91#include <syscalls/haptics.h>
92
93#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:39
int(* haptics_stop_output_t)(const struct device *dev)
Set the haptic device to stop output.
Definition haptics.h:33
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:44
haptics_start_output_t start_output
Definition haptics.h:45
haptics_stop_output_t stop_output
Definition haptics.h:46