Based on the above exploration,
integrating the Audio-to-Haptic mode alongside the DRV2605L’s other modes requires
considering a few factors:
- Initial Device
Configuration: On startup, the DRV2605L can be auto-calibrated (if using
a new LRA or if conditions have changed significantly) and then put into
Audio-to-Haptic mode (Mode 0x04). Meanwhile, the host needs to be ready to
switch modes through I²C when needed. This is also useful to configure the
DRV2605L’s control registers (such as the noise gate and filters) appropriately
for the expected audio. In this design, default values worked well, but those
registers allow customization of how the audio is filtered and scaled.
- Switching to Manual Mode:
When a specific haptic effect is desired (for example, a weapon recoil or an
explosion the game explicitly knows about), the system can override the
audio-driven vibrations by switching the DRV2605L to a manual mode. For
instance, to play a ROM library effect, the device can be put in Waveform
Sequencer mode (Mode 0x00) and the desired effect index loaded into the waveform
sequencer registers. Alternatively, for a custom effect, Real-Time Playback mode
(Mode 0x05) can be used and the host can stream the waveform by writing to the
RTP register.
- Returning to Audio Mode:
After the event haptic is done (the effect completes or the custom command
finishes), switch the mode back to 0x04 (Audio-to-Haptic) so that ongoing game
audio resumes control. If audio was continuously playing in the background, the
vibrations can kick back in automatically. Testing confirmed that this approach
works well. The DRV2605L can robustly switch between modes and the tactile
effect to the user is that there is always something driving the haptic motor –
either the game’s audio or the game’s explicit haptic commands. Using the
library effects is convenient because these are tuned waveforms for common
events (like clicks, double clicks, ramping buzzes, and so on). One can, for
example, use audio-to-vibe for general atmosphere, but when the player fires a
weapon or there is an explosion that the game explicitly triggers, a stronger
library effect can be used (while perhaps momentarily muting the audio input to
the DRV2605L if needed, though this was often not even necessary to mute –
switching modes automatically ignores the audio).
An important recommendation is to
coordinate the audio and haptic events if possible. If a game event comes with a
sound (like an explosion sound effect) and a library effect is also triggered for
this, consider muting or lowering the audio feed into the DRV2605L at that moment to
avoid double-driving the LRA. In practice, since the approach above actually
switches modes, the audio input is not used when the library effect is playing, so
no conflict arises. However, if one were using multiple DRV2605L drivers (for
example, one for continuous audio haptics and another for event effects), make sure
the audio-driven driver is not vibrating at the same time as the explicit effect
driver to prevent overlapping vibrations. In the single-driver approach described,
this situation is avoided.
To further streamline development,
TI’s PC GUI (USB-based console) was used to experiment with mode switching and to
tune parameters before coding them. This is strongly recommended: using the EVM or a
similar tool for initial development can accelerate understanding and provide a more
engaging development process. For example, the GUI can quickly toggle modes and
adjust settings without recompiling firmware, making this easier to fine-tune the
behavior.
This tool provides register map and
buttons to configure the DRV2605L’s settings as shown in Figure 6-1.