diff options
| author | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-09-19 09:42:33 -0700 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-09-19 09:42:33 -0700 |
| commit | 911b8915cc89c040db3c6075a1a547003b0ab37f (patch) | |
| tree | fe7afcae351fd3a5e9bce4ea25ef406f6382f1d7 /drivers/haptic/haptic.h | |
| parent | 7a5a2591ebc797d9670366a45396afed48c5fc6f (diff) | |
| download | qmk_firmware-911b8915cc89c040db3c6075a1a547003b0ab37f.tar.gz qmk_firmware-911b8915cc89c040db3c6075a1a547003b0ab37f.zip | |
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/haptic.h')
| -rw-r--r-- | drivers/haptic/haptic.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h index 8135d0d43..2f6eb31fc 100644 --- a/drivers/haptic/haptic.h +++ b/drivers/haptic/haptic.h | |||
| @@ -34,12 +34,14 @@ | |||
| 34 | typedef union { | 34 | typedef union { |
| 35 | uint32_t raw; | 35 | uint32_t raw; |
| 36 | struct { | 36 | struct { |
| 37 | bool enable : 1; | 37 | bool enable :1; |
| 38 | uint8_t feedback : 2; | 38 | uint8_t feedback :2; |
| 39 | uint8_t mode : 7; | 39 | uint8_t mode :7; |
| 40 | bool buzz : 1; | 40 | bool buzz :1; |
| 41 | uint8_t dwell : 7; | 41 | uint8_t dwell :7; |
| 42 | uint16_t reserved : 16; | 42 | bool cont :1; |
| 43 | uint8_t amplitude :8; | ||
| 44 | uint16_t reserved :7; | ||
| 43 | }; | 45 | }; |
| 44 | } haptic_config_t; | 46 | } haptic_config_t; |
| 45 | 47 | ||
| @@ -71,6 +73,9 @@ uint8_t haptic_get_mode(void); | |||
| 71 | uint8_t haptic_get_feedback(void); | 73 | uint8_t haptic_get_feedback(void); |
| 72 | void haptic_dwell_increase(void); | 74 | void haptic_dwell_increase(void); |
| 73 | void haptic_dwell_decrease(void); | 75 | void haptic_dwell_decrease(void); |
| 76 | void haptic_toggle_continuous(void); | ||
| 77 | void haptic_cont_increase(void); | ||
| 78 | void haptic_cont_decrease(void); | ||
| 74 | 79 | ||
| 75 | void haptic_play(void); | 80 | void haptic_play(void); |
| 76 | void haptic_shutdown(void); | 81 | void haptic_shutdown(void); |
