|
Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
|
DRV2605 Haptic Driver for ERM and LRA. More...
Files | |
| file | drv2605.h |
| Header file providing the API for the DRV2605 haptic driver. | |
Data Structures | |
| struct | drv2605_rom_data |
| ROM data configuration. More... | |
| struct | drv2605_rtp_data |
| Real-Time Playback (RTP) data configuration. More... | |
| union | drv2605_config_data |
| Configuration data union. More... | |
Enumerations | |
| enum | drv2605_library { DRV2605_LIBRARY_EMPTY = 0 , DRV2605_LIBRARY_TS2200_A , DRV2605_LIBRARY_TS2200_B , DRV2605_LIBRARY_TS2200_C , DRV2605_LIBRARY_TS2200_D , DRV2605_LIBRARY_TS2200_E , DRV2605_LIBRARY_LRA } |
| Effect libraries. More... | |
| enum | drv2605_mode { DRV2605_MODE_INTERNAL_TRIGGER = 0 , DRV2605_MODE_EXTERNAL_EDGE_TRIGGER , DRV2605_MODE_EXTERNAL_LEVEL_TRIGGER , DRV2605_MODE_PWM_ANALOG_INPUT , DRV2605_MODE_AUDIO_TO_VIBE , DRV2605_MODE_RTP , DRV2605_MODE_DIAGNOSTICS , DRV2605_MODE_AUTO_CAL } |
| Modes of operation. More... | |
| enum | drv2605_haptics_source { DRV2605_HAPTICS_SOURCE_ROM , DRV2605_HAPTICS_SOURCE_RTP , DRV2605_HAPTICS_SOURCE_AUDIO , DRV2605_HAPTICS_SOURCE_PWM , DRV2605_HAPTICS_SOURCE_ANALOG } |
| Types of haptic signal sources. More... | |
Functions | |
| int | drv2605_haptic_config (const struct device *dev, enum drv2605_haptics_source source, const union drv2605_config_data *config_data) |
| Configure the DRV2605 device for a particular signal source. | |
Helpers | |
| #define | DRV2605_WAVEFORM_SEQUENCER_MAX 8 |
| Maximum number of waveforms that can be stored in the sequencer. | |
| #define | DRV2605_WAVEFORM_SEQUENCER_WAIT_MS(ms) |
| Creates a wait/delay value for the waveform sequencer. | |
DRV2605 Haptic Driver for ERM and LRA.
| #define DRV2605_WAVEFORM_SEQUENCER_MAX 8 |
#include <zephyr/drivers/haptics/drv2605.h>
Maximum number of waveforms that can be stored in the sequencer.
| #define DRV2605_WAVEFORM_SEQUENCER_WAIT_MS | ( | ms | ) |
#include <zephyr/drivers/haptics/drv2605.h>
Creates a wait/delay value for the waveform sequencer.
This macro generates a byte value that, when placed in the drv2605_rom_data::seq_regs array, instructs the DRV2605 playback engine to idle for a specified duration.
| ms | The desired delay in milliseconds (rounded down to the nearest 10ms). Valid range is 10 to 1270. |
#include <zephyr/drivers/haptics/drv2605.h>
Types of haptic signal sources.
This enumeration defines the different types of haptic signal sources supported by the DRV2605.
| enum drv2605_library |
#include <zephyr/drivers/haptics/drv2605.h>
Effect libraries.
This enumeration defines the different effect libraries that can be used with the DRV2605 when using ROM source. TouchSense 2220 libraries are for open-loop ERM motors, DRV2605_LIBRARY_LRA is to be used for closed-loop LRA motors.
| enum drv2605_mode |
#include <zephyr/drivers/haptics/drv2605.h>
Modes of operation.
This enumeration defines the different modes of operation supported by the DRV2605.
See Table 5 of the DRV2605 datasheet for more information on the various operation modes.
| int drv2605_haptic_config | ( | const struct device * | dev, |
| enum drv2605_haptics_source | source, | ||
| const union drv2605_config_data * | config_data ) |
#include <zephyr/drivers/haptics/drv2605.h>
Configure the DRV2605 device for a particular signal source.
| dev | Pointer to the device structure for haptic device instance |
| source | The type of haptic signal source desired |
| config_data | Pointer to the configuration data union for the source |
| 0 | success |
| -ENOTSUP | signal source not supported |
| -errno | another negative error code on failure |