summaryrefslogtreecommitdiffstats
path: root/drivers/haptic/DRV2605L.c
diff options
context:
space:
mode:
authorMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-09-19 09:42:33 -0700
committerDrashna Jaelre <drashna@live.com>2019-09-19 09:42:33 -0700
commit911b8915cc89c040db3c6075a1a547003b0ab37f (patch)
treefe7afcae351fd3a5e9bce4ea25ef406f6382f1d7 /drivers/haptic/DRV2605L.c
parent7a5a2591ebc797d9670366a45396afed48c5fc6f (diff)
DRV2605L Continuous Haptic Feedback Support (#6461)
* provide means to turn on RTP mode and set the amplitude * new keycode HPT_CONT to turn RTP off/on * introduce new keycodes HPT_CONI, and HPT_COND for Haptic Continuous Increase and Decrease * support for continuous mode amplitude increase and decrease * code cleanup * update docs to reference new keycodes and functionality * don't touch the keymaps * add function prototypes * add proper guards * cleanup guards * remove extra reserved
Diffstat (limited to 'drivers/haptic/DRV2605L.c')
-rw-r--r--drivers/haptic/DRV2605L.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c
index f74c965253..728554b01e 100644
--- a/drivers/haptic/DRV2605L.c
+++ b/drivers/haptic/DRV2605L.c
@@ -114,6 +114,17 @@ void DRV_init(void) {
DRV_write(DRV_GO, 0x01);
}
+void DRV_rtp_init(void) {
+ DRV_write(DRV_GO, 0x00);
+ DRV_write(DRV_RTP_INPUT, 20); //20 is the lowest value I've found where haptics can still be felt.
+ DRV_write(DRV_MODE, 0x05);
+ DRV_write(DRV_GO, 0x01);
+}
+
+void DRV_amplitude(uint8_t amplitude) {
+ DRV_write(DRV_RTP_INPUT, amplitude);
+}
+
void DRV_pulse(uint8_t sequence) {
DRV_write(DRV_GO, 0x00);
DRV_write(DRV_WAVEFORM_SEQ_1, sequence);