aboutsummaryrefslogtreecommitdiff
path: root/drivers/haptic/DRV2605L.h
diff options
context:
space:
mode:
authorishtob <ishtob@gmail.com>2019-02-16 21:39:30 -0500
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-16 18:39:30 -0800
commit2cee371bf125a6ec541dd7c5a809573facc7c456 (patch)
tree7bb6c074b759843d531eee67d65d91618bd79732 /drivers/haptic/DRV2605L.h
parenta7a647b7f6d707e9c952461beeca1f3637039d36 (diff)
downloadqmk_firmware-2cee371bf125a6ec541dd7c5a809573facc7c456.tar.gz
qmk_firmware-2cee371bf125a6ec541dd7c5a809573facc7c456.zip
Haptic feedback generalized - DRV2605 and solenoids (#4939)
* initial work to add eeprom to haptic feedback and decouple the feedback process from keyboards * Haptic feedback enhancements: on/off toggle working, feedback order working todo: -work on modes switching -get modes switching to save to eeprom * haptic enhancement - eeprom and modes added * Added set and get functions for haptic feedback * initial implementation of solenoids under haptic feedback * changed eeprom to 32 bits to reserve blocks for future features * start documentation of haptic feedback * change keycode per comment from reviewers * typo fixes * added eeprom for solenoid configs * added solenoid and docs * Add/fix default parameters configs, improve docs * more doc cleanup * add in solenoid buzz toggle, clean up doc * some fixes for error in compiling solenoid * fix a chibios specific i2c read function and added one for AVR controllers in DRV2605L.c * fixes for avr side issues * update keymap * fix keymap compile error * fix bugs found during solenoid testing * set pin that is not powered during bootloader * added warning about certain pins on the MCU may trip solenoid during DFU/bootloader
Diffstat (limited to 'drivers/haptic/DRV2605L.h')
-rw-r--r--drivers/haptic/DRV2605L.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h
index de9d294e9..836e9cbcd 100644
--- a/drivers/haptic/DRV2605L.h
+++ b/drivers/haptic/DRV2605L.h
@@ -31,13 +31,6 @@
31#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ 31#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
32#endif 32#endif
33 33
34#ifndef RATED_VOLTAGE
35#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
36#ifndef V_PEAK
37#define V_PEAK 2.8
38#endif
39#endif
40
41/* LRA specific settings */ 34/* LRA specific settings */
42#if FB_ERM_LRA == 1 35#if FB_ERM_LRA == 1
43#ifndef V_RMS 36#ifndef V_RMS
@@ -49,6 +42,16 @@
49#ifndef F_LRA 42#ifndef F_LRA
50#define F_LRA 205 43#define F_LRA 205
51#endif 44#endif
45#ifndef RATED_VOLTAGE
46#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
47#endif
48#endif
49
50#ifndef RATED_VOLTAGE
51#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
52#endif
53#ifndef V_PEAK
54#define V_PEAK 2.8
52#endif 55#endif
53 56
54/* Library Selection */ 57/* Library Selection */
@@ -60,6 +63,13 @@
60#endif 63#endif
61#endif 64#endif
62 65
66#ifndef DRV_GREETING
67#define DRV_GREETING alert_750ms
68#endif
69#ifndef DRV_MODE_DEFAULT
70#define DRV_MODE_DEFAULT strong_click1
71#endif
72
63/* Control 1 register settings */ 73/* Control 1 register settings */
64#ifndef DRIVE_TIME 74#ifndef DRIVE_TIME
65#define DRIVE_TIME 25 75#define DRIVE_TIME 25
@@ -162,7 +172,6 @@ void DRV_write(const uint8_t drv_register, const uint8_t settings);
162uint8_t DRV_read(const uint8_t regaddress); 172uint8_t DRV_read(const uint8_t regaddress);
163void DRV_pulse(const uint8_t sequence); 173void DRV_pulse(const uint8_t sequence);
164 174
165
166typedef enum DRV_EFFECT{ 175typedef enum DRV_EFFECT{
167 clear_sequence = 0, 176 clear_sequence = 0,
168 strong_click = 1, 177 strong_click = 1,
@@ -288,6 +297,7 @@ typedef enum DRV_EFFECT{
288 smooth_hum3_30 = 121, 297 smooth_hum3_30 = 121,
289 smooth_hum4_20 = 122, 298 smooth_hum4_20 = 122,
290 smooth_hum5_10 = 123, 299 smooth_hum5_10 = 123,
300 drv_effect_max = 124,
291} DRV_EFFECT; 301} DRV_EFFECT;
292 302
293/* Register bit array unions */ 303/* Register bit array unions */