SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
HapticDefs.hpp
Go to the documentation of this file.
1
30#pragma once
31
32#include <stdint.h>
33
37enum class HapticActuatorType : uint8_t {
38 ERM = 0,
39 LRA = 1,
40};
41
56
62using HapticEffectId = uint16_t;
63
67enum class HapticStatus : uint8_t {
68 IDLE = 0,
69 PLAYING = 1,
70 PAUSED = 2,
71 CALIBRATING = 3,
72 ERROR = 4,
73 STANDBY = 5,
74};
75
102
109enum class HapticPreset : uint8_t {
110 CLICK,
114 BUZZ,
116 TAP,
117 HEAVY_TAP,
118 PULSE,
119 RAMP_UP,
120 RAMP_DOWN,
121 WAVE,
122 RAINBOW,
123};
124
HapticStatus
Vibration playback status.
@ PLAYING
Currently playing.
@ PAUSED
Playback paused.
@ IDLE
Not playing.
@ CALIBRATING
Calibrating.
@ ERROR
Error state.
HapticPreset
Preset haptic effect types for common use cases.
@ HEAVY_TAP
Heavy tap.
@ WAVE
Wave-like pattern.
@ CLICK
Short click/tick.
@ DOUBLE_CLICK
Double click.
@ PULSE
Pulsed vibration.
@ RAMP_UP
Gradually increasing intensity.
@ RAMP_DOWN
Gradually decreasing intensity.
@ TRIPLE_CLICK
Triple click.
@ BUZZ
Medium buzz.
@ STRONG_BUZZ
Strong buzz.
@ LONG_VIBRATION
Continuous vibration.
@ RAINBOW
Multi-frequency effect.
@ TAP
Light tap.
HapticActuatorType
Actuator type.
@ LRA
Linear Resonant Actuator.
@ ERM
Eccentric Rotating Mass motor.
HapticMode
Generic haptic operating mode.
@ INTERNAL_TRIGGER
Play by selecting waveforms/effects and calling run()
@ EXT_TRIGGER_LEVEL
External trigger on level (pin state)
@ AUTO_CALIBRATE
Auto-calibration mode.
@ DIAGNOSTICS
Diagnostics mode.
@ PWM_ANALOG
PWM or analog input drive.
@ AUDIO_TO_VIBE
Audio input to vibration.
@ STANDBY
Standby mode.
@ EXT_TRIGGER_EDGE
External trigger on edge (pin interrupt)
@ REAL_TIME_PLAYBACK
RTP mode (direct drive value)
uint16_t HapticEffectId
Haptic effect ID type.
Device capability flags.
uint8_t maxSequenceLength
Maximum waveform sequence length.
uint8_t hasF0Calibration
Supports F0 (resonant frequency) calibration.
uint16_t maxDurationMs
Maximum vibration duration in ms (0 = unlimited)
uint8_t hasAutoCalibration
Supports auto-calibration.
constexpr HapticCapabilities()
uint8_t hasVbatCompensation
Supports automatic voltage compensation.
uint8_t hasRTP
Supports Real-Time Playback mode.
uint8_t hasBreakEffect
Supports brake/break effects.
uint8_t hasOverdrive
Supports overdrive effects.
uint8_t maxEffectCount
Maximum number of effect IDs supported.
uint8_t hasContinuousMode
Supports continuous vibration mode.
uint8_t hasSequence
Supports waveform sequencing.