22 #ifndef _ADAFRUIT_DRV2605_H 23 #define _ADAFRUIT_DRV2605_H 31 #include <Adafruit_I2CDevice.h> 33 #define DRV2605_ADDR 0x5A 35 #define DRV2605_REG_STATUS 0x00 36 #define DRV2605_REG_MODE 0x01 37 #define DRV2605_MODE_INTTRIG 0x00 38 #define DRV2605_MODE_EXTTRIGEDGE 0x01 39 #define DRV2605_MODE_EXTTRIGLVL 0x02 40 #define DRV2605_MODE_PWMANALOG 0x03 41 #define DRV2605_MODE_AUDIOVIBE 0x04 42 #define DRV2605_MODE_REALTIME 0x05 43 #define DRV2605_MODE_DIAGNOS 0x06 44 #define DRV2605_MODE_AUTOCAL 0x07 46 #define DRV2605_REG_RTPIN 0x02 47 #define DRV2605_REG_LIBRARY 0x03 48 #define DRV2605_REG_WAVESEQ1 0x04 49 #define DRV2605_REG_WAVESEQ2 0x05 50 #define DRV2605_REG_WAVESEQ3 0x06 51 #define DRV2605_REG_WAVESEQ4 0x07 52 #define DRV2605_REG_WAVESEQ5 0x08 53 #define DRV2605_REG_WAVESEQ6 0x09 54 #define DRV2605_REG_WAVESEQ7 0x0A 55 #define DRV2605_REG_WAVESEQ8 0x0B 57 #define DRV2605_REG_GO 0x0C 58 #define DRV2605_REG_OVERDRIVE 0x0D 59 #define DRV2605_REG_SUSTAINPOS 0x0E 60 #define DRV2605_REG_SUSTAINNEG 0x0F 61 #define DRV2605_REG_BREAK 0x10 62 #define DRV2605_REG_AUDIOCTRL 0x11 63 #define DRV2605_REG_AUDIOLVL \ 65 #define DRV2605_REG_AUDIOMAX \ 67 #define DRV2605_REG_AUDIOOUTMIN \ 69 #define DRV2605_REG_AUDIOOUTMAX \ 71 #define DRV2605_REG_RATEDV 0x16 72 #define DRV2605_REG_CLAMPV 0x17 73 #define DRV2605_REG_AUTOCALCOMP \ 75 #define DRV2605_REG_AUTOCALEMP \ 77 #define DRV2605_REG_FEEDBACK 0x1A 78 #define DRV2605_REG_CONTROL1 0x1B 79 #define DRV2605_REG_CONTROL2 0x1C 80 #define DRV2605_REG_CONTROL3 0x1D 81 #define DRV2605_REG_CONTROL4 0x1E 82 #define DRV2605_REG_VBAT 0x21 83 #define DRV2605_REG_LRARESON 0x22 93 bool begin(TwoWire *theWire = &Wire);
110 Adafruit_I2CDevice *i2c_dev = NULL;
void selectLibrary(uint8_t lib)
Select the waveform library to use.
Definition: Adafruit_DRV2605.cpp:129
bool init()
Setup the HW.
Definition: Adafruit_DRV2605.cpp:73
void writeRegister8(uint8_t reg, uint8_t val)
Write an 8-bit register.
Definition: Adafruit_DRV2605.cpp:198
void setMode(uint8_t mode)
Set the device mode.
Definition: Adafruit_DRV2605.cpp:163
void setWaveform(uint8_t slot, uint8_t w)
Select the haptic waveform to use.
Definition: Adafruit_DRV2605.cpp:116
void useERM()
Use ERM (Eccentric Rotating Mass) mode.
Definition: Adafruit_DRV2605.cpp:208
void go(void)
Start playback of the waveforms (start moving!).
Definition: Adafruit_DRV2605.cpp:138
Adafruit_DRV2605(void)
Instantiates a new DRV2605 class. I2C, no address adjustments or pins.
Definition: Adafruit_DRV2605.cpp:47
uint8_t readRegister8(uint8_t reg)
Read an 8-bit register.
Definition: Adafruit_DRV2605.cpp:185
void useLRA()
Use LRA (Linear Resonance Actuator) mode.
Definition: Adafruit_DRV2605.cpp:218
bool begin(TwoWire *theWire=&Wire)
Setup HW using a specified Wire.
Definition: Adafruit_DRV2605.cpp:60
void stop(void)
Stop playback.
Definition: Adafruit_DRV2605.cpp:145
void setRealtimeValue(uint8_t rtp)
Set the realtime value when in RTP mode, used to directly drive the haptic motor. ...
Definition: Adafruit_DRV2605.cpp:174
The DRV2605 driver class.
Definition: Adafruit_DRV2605.h:90