IVibration
#include "crosspad/platform/IVibration.hpp"Generated from crosspad/platform/IVibration.hpp in crosspad-core. Edit the header’s doxygen comments to change this page.
Recipes that use it: Motion and vibration
Functions
Section titled “Functions”getVibration
Section titled “getVibration”IVibration & getVibration()Platform-injected singleton (same pattern as getClock())
Used in Motion and vibration.
Declared in crosspad/platform/IVibration.hpp:43.
crosspad::IVibration
Section titled “crosspad::IVibration”Abstract vibration/haptics interface.
Implementations:
- Drv2605Driver (core): portable DRV2605/LRA driver using II2cDevice
- NullVibration (core): no-op stub for platforms without haptics
The interface does NOT manage initialization, I2C setup, or background tasks — those remain in the platform layer.
Used in Motion and vibration.
Members
| Member | Description |
|---|---|
isAvailable | Whether vibration hardware is present and initialized. |
vibrate | Trigger a haptic preset (async, queued to background task) |
stop | Stop any active vibration. |
startAudioToVibe | Enter audio-to-vibration mode (motor follows audio input signal) |
stopAudioToVibe | Exit audio-to-vibration mode. |
applySettings | Push updated settings to the driver. |
Methods
isAvailable
Section titled “isAvailable”virtual bool isAvailable() const =0Whether vibration hardware is present and initialized.
Used in Motion and vibration.
vibrate
Section titled “vibrate”virtual void vibrate(VibrationPreset preset) = 0Trigger a haptic preset (async, queued to background task)
Used in Motion and vibration.
virtual void stop() = 0Stop any active vibration.
startAudioToVibe
Section titled “startAudioToVibe”virtual void startAudioToVibe() = 0Enter audio-to-vibration mode (motor follows audio input signal)
stopAudioToVibe
Section titled “stopAudioToVibe”virtual void stopAudioToVibe() = 0Exit audio-to-vibration mode.
applySettings
Section titled “applySettings”virtual void applySettings(const VibrationSettings &settings) = 0Push updated settings to the driver.
Declared in crosspad/platform/IVibration.hpp:19.