The DRV2605 driver class.
More...
#include <Adafruit_DRV2605.h>
|
| Adafruit_DRV2605 (void) |
| Instantiates a new DRV2605 class. I2C, no address adjustments or pins.
|
|
bool | begin (TwoWire *theWire=&Wire) |
| Setup HW using a specified Wire. More...
|
|
bool | init () |
| Setup the HW. More...
|
|
void | writeRegister8 (uint8_t reg, uint8_t val) |
| Write an 8-bit register. More...
|
|
uint8_t | readRegister8 (uint8_t reg) |
| Read an 8-bit register. More...
|
|
void | setWaveform (uint8_t slot, uint8_t w) |
| Select the haptic waveform to use. More...
|
|
void | selectLibrary (uint8_t lib) |
| Select the waveform library to use. More...
|
|
void | go (void) |
| Start playback of the waveforms (start moving!).
|
|
void | stop (void) |
| Stop playback.
|
|
void | setMode (uint8_t mode) |
| Set the device mode. More...
|
|
void | setRealtimeValue (uint8_t rtp) |
| Set the realtime value when in RTP mode, used to directly drive the haptic motor. More...
|
|
void | useERM () |
| Use ERM (Eccentric Rotating Mass) mode.
|
|
void | useLRA () |
| Use LRA (Linear Resonance Actuator) mode.
|
|
The DRV2605 driver class.
◆ begin()
bool Adafruit_DRV2605::begin |
( |
TwoWire * |
theWire = &Wire | ) |
|
Setup HW using a specified Wire.
- Parameters
-
theWire | Pointer to a TwoWire object, defaults to &Wire |
- Returns
- Return value from init()
◆ init()
bool Adafruit_DRV2605::init |
( |
| ) |
|
Setup the HW.
- Returns
- Always true
◆ writeRegister8()
void Adafruit_DRV2605::writeRegister8 |
( |
uint8_t |
reg, |
|
|
uint8_t |
val |
|
) |
| |
Write an 8-bit register.
- Parameters
-
reg | The register to write. |
val | The value to write. |
◆ readRegister8()
uint8_t Adafruit_DRV2605::readRegister8 |
( |
uint8_t |
reg | ) |
|
Read an 8-bit register.
- Parameters
-
- Returns
- 8-bit value of the register.
◆ setWaveform()
void Adafruit_DRV2605::setWaveform |
( |
uint8_t |
slot, |
|
|
uint8_t |
w |
|
) |
| |
Select the haptic waveform to use.
- Parameters
-
slot | The waveform slot to set, from 0 to 7 |
w | The waveform sequence value, refers to an index in the ROM library. |
Playback starts at slot 0 and continues through to slot 7, stopping if it encounters a value of 0. A list of available waveforms can be found in section 11.2 of the datasheet: http://www.adafruit.com/datasheets/DRV2605.pdf
◆ selectLibrary()
void Adafruit_DRV2605::selectLibrary |
( |
uint8_t |
lib | ) |
|
◆ setMode()
void Adafruit_DRV2605::setMode |
( |
uint8_t |
mode | ) |
|
Set the device mode.
- Parameters
-
0: Internal trigger, call go() to start playback
1: External trigger, rising edge on IN pin starts playback
2: External trigger, playback follows the state of IN pin
3: PWM/analog input
4: Audio
5: Real-time playback
6: Diagnostics
7: Auto calibration
◆ setRealtimeValue()
void Adafruit_DRV2605::setRealtimeValue |
( |
uint8_t |
rtp | ) |
|
Set the realtime value when in RTP mode, used to directly drive the haptic motor.
- Parameters
-
The documentation for this class was generated from the following files: