Skip to content

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

IVibration & getVibration()

Platform-injected singleton (same pattern as getClock())

Used in Motion and vibration.

Declared in crosspad/platform/IVibration.hpp:43.

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

MemberDescription
isAvailableWhether vibration hardware is present and initialized.
vibrateTrigger a haptic preset (async, queued to background task)
stopStop any active vibration.
startAudioToVibeEnter audio-to-vibration mode (motor follows audio input signal)
stopAudioToVibeExit audio-to-vibration mode.
applySettingsPush updated settings to the driver.

Methods

virtual bool isAvailable() const =0

Whether vibration hardware is present and initialized.

Used in Motion and vibration.

virtual void vibrate(VibrationPreset preset) = 0

Trigger a haptic preset (async, queued to background task)

Used in Motion and vibration.

virtual void stop() = 0

Stop any active vibration.

virtual void startAudioToVibe() = 0

Enter audio-to-vibration mode (motor follows audio input signal)

virtual void stopAudioToVibe() = 0

Exit audio-to-vibration mode.

virtual void applySettings(const VibrationSettings &settings) = 0

Push updated settings to the driver.

Declared in crosspad/platform/IVibration.hpp:19.