Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DRV2605 Class Reference
Library for the TI DRV2605. More...
#include <DRV2605.h>
Public Member Functions | |
| DRV2605 (I2C &i2c, ActuatorType at=ERM, BrakeFactor bf=x4, LoopGain lg=MEDIUM, uint8_t rv=0x3F, uint8_t ocv=0x89, AutoCalTime act=ms500_700, uint8_t dt=0x13, SampleTime st=us200, uint8_t bt=2, uint8_t it=2) | |
| Create a DRV2605 object. | |
| void | i2cWriteByte (char reg, char value) |
| Write value to register. | |
| uint8_t | i2cReadByte (char reg) |
| Read value from register. | |
| void | mode (uint8_t mode) |
| Set the device into specified mode. | |
| uint8_t | diagnostics () |
| Runs diagnostics. | |
| void | dataFormatRTP (bool isSigned) |
| Select the input data interpretation for RTP. | |
| void | setLibrary (uint8_t lib) |
| Set ROM Library. | |
| void | setWaveform (int effect) |
| Set single waveform from ROM Library. | |
| void | setWaveformSequence (int effect1=0, int effect2=0, int effect3=0, int effect4=0, int effect5=0, int effect6=0, int effect7=0, int effect8=0) |
| Set waveform Sequence. | |
| void | play () |
| Plays the currently loaded waveform or waveform sequence. | |
| void | stop () |
| Stops the currently loaded waveform or waveform sequence. | |
| void | playRtp (uint8_t rtp) |
| Real time play back. | |
| float | batteryVoltage (void) |
| Battery voltage monitor. | |
Detailed Description
Library for the TI DRV2605.
Definition at line 74 of file DRV2605.h.
Constructor & Destructor Documentation
| DRV2605 | ( | I2C & | i2c, |
| ActuatorType | at = ERM, |
||
| BrakeFactor | bf = x4, |
||
| LoopGain | lg = MEDIUM, |
||
| uint8_t | rv = 0x3F, |
||
| uint8_t | ocv = 0x89, |
||
| AutoCalTime | act = ms500_700, |
||
| uint8_t | dt = 0x13, |
||
| SampleTime | st = us200, |
||
| uint8_t | bt = 2, |
||
| uint8_t | it = 2 |
||
| ) |
Create a DRV2605 object.
- Parameters:
-
&i2c pointer of I2C object at actuator type bf brake factor lg loop gain rv rated voltage ocv overdirve clamp voltage act auto caliblration time dt drive time st sample time bt braking time it current dissipation time
Definition at line 3 of file DRV2605.cpp.
Member Function Documentation
| float batteryVoltage | ( | void | ) |
| void dataFormatRTP | ( | bool | isSigned ) |
Select the input data interpretation for RTP.
- Parameters:
-
isSigned true: singed(-127~127), false: unsigned (0~255)
Definition at line 75 of file DRV2605.cpp.
| uint8_t diagnostics | ( | ) |
| uint8_t i2cReadByte | ( | char | reg ) |
Read value from register.
- Parameters:
-
reg Register to read
- Returns:
- Value
Definition at line 52 of file DRV2605.cpp.
| void i2cWriteByte | ( | char | reg, |
| char | value | ||
| ) |
Write value to register.
- Parameters:
-
reg Register to write value Value to write to the register
Definition at line 46 of file DRV2605.cpp.
| void mode | ( | uint8_t | mode ) |
Set the device into specified mode.
- Parameters:
-
mode Mode to set
Definition at line 61 of file DRV2605.cpp.
| void play | ( | ) |
Plays the currently loaded waveform or waveform sequence.
Definition at line 110 of file DRV2605.cpp.
| void playRtp | ( | uint8_t | rtp ) |
Real time play back.
- Parameters:
-
rtp intensity of the vibration (0 - 255)
Definition at line 120 of file DRV2605.cpp.
| void setLibrary | ( | uint8_t | lib ) |
Set ROM Library.
Note: This should be called before setWaveform function
- Parameters:
-
lib Set library (see library's macro)
Definition at line 84 of file DRV2605.cpp.
| void setWaveform | ( | int | effect ) |
Set single waveform from ROM Library.
Note: This should be called after setLibrary function
- Parameters:
-
effect The Waveform Effect Library Index value to play (1 to 123)
Definition at line 89 of file DRV2605.cpp.
| void setWaveformSequence | ( | int | effect1 = 0, |
| int | effect2 = 0, |
||
| int | effect3 = 0, |
||
| int | effect4 = 0, |
||
| int | effect5 = 0, |
||
| int | effect6 = 0, |
||
| int | effect7 = 0, |
||
| int | effect8 = 0 |
||
| ) |
Set waveform Sequence.
Note: This should be called after setLibrary function
- Parameters:
-
effect1... effect8 The Waveform Effect Library Index value to play (1 to 123): 0 = Stop Condition; 1- 123 = Waveform Index
Definition at line 95 of file DRV2605.cpp.
| void stop | ( | ) |
Stops the currently loaded waveform or waveform sequence.
Definition at line 115 of file DRV2605.cpp.
Generated on Tue Jul 19 2022 15:54:23 by
1.7.2