Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions doc/hardware/peripherals/haptics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _haptics_api:

Haptics
#######

Overview
********

The haptics API allows for the control of haptic driver devices for the
purposes of performing haptic feedback events.

During a haptic feedback event the haptic device drives a signal to an
actuator. The source of the haptic event signal varies depending on the
capabilities of the haptic device.

Some examples of haptic signal sources are analog signals, preprogrammed
(ROM) wavetables, synthesized (RAM) wavetables, and digital audio streams.

Additionally, haptic driver devices often offer controls for adjusting and
tuning the drive signal to meet the electrical requirements of their respective
actuators.

API Reference
*************

.. doxygengroup:: haptics_interface
1 change: 1 addition & 0 deletions doc/hardware/peripherals/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Peripherals
fuel_gauge.rst
gnss.rst
gpio.rst
haptics.rst
hwinfo.rst
i2c_eeprom_target.rst
i3c.rst
Expand Down
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ add_subdirectory_ifdef(CONFIG_FPGA fpga)
add_subdirectory_ifdef(CONFIG_FUEL_GAUGE fuel_gauge)
add_subdirectory_ifdef(CONFIG_GNSS gnss)
add_subdirectory_ifdef(CONFIG_GPIO gpio)
add_subdirectory_ifdef(CONFIG_HAPTICS haptics)
add_subdirectory_ifdef(CONFIG_HWINFO hwinfo)
add_subdirectory_ifdef(CONFIG_HWSPINLOCK hwspinlock)
add_subdirectory_ifdef(CONFIG_I2C i2c)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ source "drivers/fpga/Kconfig"
source "drivers/fuel_gauge/Kconfig"
source "drivers/gnss/Kconfig"
source "drivers/gpio/Kconfig"
source "drivers/haptics/Kconfig"
source "drivers/hwinfo/Kconfig"
source "drivers/hwspinlock/Kconfig"
source "drivers/i2c/Kconfig"
Expand Down
7 changes: 7 additions & 0 deletions drivers/haptics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_library()
zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/haptics.h)

zephyr_library_sources_ifdef(CONFIG_HAPTICS_DRV2605 drv2605.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE haptics_handlers.c)
24 changes: 24 additions & 0 deletions drivers/haptics/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2024 Cirrus Logic, Inc.
#
# SPDX-License-Identifier: Apache-2.0

menuconfig HAPTICS
bool "Haptic feedback drivers"
help
Enable haptics driver configuration.

if HAPTICS

module = HAPTICS
module-str = haptics
source "subsys/logging/Kconfig.template.log_config"

config HAPTICS_INIT_PRIORITY
int "Haptic driver init priority"
default 90
help
Haptic driver initialization priority.

source "drivers/haptics/Kconfig.drv2605"

endif # HAPTICS
11 changes: 11 additions & 0 deletions drivers/haptics/Kconfig.drv2605
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2024 Cirrus Logic, Inc.
# SPDX-License-Identifier: Apache-2.0

config HAPTICS_DRV2605
bool "DRV2605 Haptics Driver"
default y
depends on DT_HAS_TI_DRV2605_ENABLED
select I2C
help
Enable I2C-based driver for the Texas Instruments DRV2605 Haptics
Driver.
Loading