diff options
author | Purdea Andrei <andrei@purdea.ro> | 2021-11-02 07:54:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 16:54:29 +1100 |
commit | 76fb54403ccd3ebaf1ca49c5172335e3593c5c5c (patch) | |
tree | 30b41c0b027baa5b9494f80ec0fd83c50a53fd5b /drivers/haptic/solenoid.h | |
parent | 85d94d0c4d97de3d1b7ce0476499f44e79c25944 (diff) | |
download | qmk_firmware-76fb54403ccd3ebaf1ca49c5172335e3593c5c5c.tar.gz qmk_firmware-76fb54403ccd3ebaf1ca49c5172335e3593c5c5c.zip |
haptic: Feature to disable it when usb port is not configured or suspended. (#12692)
This also add support for specifying a LED pin to indicate haptic status,
and also adds support for a haptic-enable pin, which is useful to turn off
the boost converter on the solenoid driver.
Diffstat (limited to 'drivers/haptic/solenoid.h')
-rw-r--r-- | drivers/haptic/solenoid.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/haptic/solenoid.h b/drivers/haptic/solenoid.h index f2a3bc4c3..653148154 100644 --- a/drivers/haptic/solenoid.h +++ b/drivers/haptic/solenoid.h | |||
@@ -49,6 +49,14 @@ | |||
49 | # error SOLENOID_PIN not defined | 49 | # error SOLENOID_PIN not defined |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #ifdef SOLENOID_PIN_ACTIVE_LOW | ||
53 | # define SOLENOID_PIN_WRITE_ACTIVE() writePinLow(SOLENOID_PIN) | ||
54 | # define SOLENOID_PIN_WRITE_INACTIVE() writePinHigh(SOLENOID_PIN) | ||
55 | #else | ||
56 | # define SOLENOID_PIN_WRITE_ACTIVE() writePinHigh(SOLENOID_PIN) | ||
57 | # define SOLENOID_PIN_WRITE_INACTIVE() writePinLow(SOLENOID_PIN) | ||
58 | #endif | ||
59 | |||
52 | void solenoid_buzz_on(void); | 60 | void solenoid_buzz_on(void); |
53 | void solenoid_buzz_off(void); | 61 | void solenoid_buzz_off(void); |
54 | void solenoid_set_buzz(int buzz); | 62 | void solenoid_set_buzz(int buzz); |