From da2d2f947d5c30aebea17f414fb22ad50fe5410b Mon Sep 17 00:00:00 2001
From: Ryan
Date: Sun, 16 Jul 2023 23:42:56 +1000
Subject: quantum: remove direct `quantum.h` includes (#21507)
---
quantum/split_common/split_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'quantum/split_common/split_util.c')
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index a431383454..87838c3195 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -18,8 +18,8 @@
#include "keyboard.h"
#include "timer.h"
#include "transport.h"
-#include "quantum.h"
#include "wait.h"
+#include "debug.h"
#include "usb_util.h"
#ifdef EE_HANDS
--
cgit v1.2.3
From b090354143612d2c0f5c8629510542de5bd4e29e Mon Sep 17 00:00:00 2001
From: Ryan
Date: Fri, 21 Jul 2023 09:17:39 +1000
Subject: haptic: naming cleanups (#21551)
---
builddefs/common_features.mk | 23 +-
docs/feature_haptic_feedback.md | 19 +-
drivers/haptic/DRV2605L.c | 122 ------
drivers/haptic/DRV2605L.h | 406 --------------------
drivers/haptic/drv2605l.c | 126 +++++++
drivers/haptic/drv2605l.h | 407 +++++++++++++++++++++
keyboards/adpenrose/mine/keymaps/solenoid/rules.mk | 2 +-
.../adpenrose/shisaku/keymaps/solenoid/rules.mk | 2 +-
keyboards/ai03/lunar_ii/rules.mk | 2 +-
keyboards/boston_meetup/2019/config.h | 4 +-
keyboards/boston_meetup/2019/rules.mk | 2 +-
keyboards/buzzard/keymaps/crehmann/config.h | 4 +-
.../keymaps/crehmann/features/haptic_utils.c | 12 +-
keyboards/buzzard/keymaps/crehmann/rules.mk | 2 +-
keyboards/buzzard/keymaps/default/config.h | 4 +-
keyboards/buzzard/keymaps/default/rules.mk | 2 +-
keyboards/buzzard/rev1/rev1.c | 12 +-
keyboards/hadron/ver3/config.h | 4 +-
keyboards/hadron/ver3/keymaps/ishtob/config.h | 1 -
keyboards/hadron/ver3/keymaps/ishtob/keymap.c | 9 -
keyboards/hadron/ver3/rules.mk | 2 +-
keyboards/handwired/onekey/keymaps/haptic/rules.mk | 2 +-
.../swiftrax/bumblebee/keymaps/default/rules.mk | 1 -
.../swiftrax/bumblebee/keymaps/via/rules.mk | 1 -
.../5x6_right/keymaps/drashna/config.h | 4 +-
.../5x6_right/keymaps/drashna/rules.mk | 2 +-
keyboards/hardwareabstraction/handwire/rules.mk | 2 +-
keyboards/hillside/46/0_1/config.h | 4 +-
keyboards/hillside/46/0_1/rules.mk | 2 +-
keyboards/hillside/48/0_1/config.h | 4 +-
keyboards/hillside/48/0_1/rules.mk | 2 +-
keyboards/hillside/52/0_1/config.h | 4 +-
keyboards/hillside/52/0_1/rules.mk | 2 +-
.../ibm/model_m_4th_gen/overnumpad_1xb/rules.mk | 2 +-
keyboards/mechwild/clunker/rules.mk | 2 +-
keyboards/pearlboards/atlas/rules.mk | 2 +-
keyboards/pearlboards/pearl/rules.mk | 2 +-
keyboards/pearlboards/zeus/rules.mk | 2 +-
keyboards/splitkb/zima/config.h | 4 +-
keyboards/splitkb/zima/rules.mk | 2 +-
.../overnumpad_1xb/rules.mk | 2 +-
.../overnumpad_1xb/rules.mk | 2 +-
keyboards/unicomp/pc122/overnumpad_1xb/rules.mk | 2 +-
.../spacesaver_m_post_2013/overnumpad_1xb/rules.mk | 2 +-
.../spacesaver_m_pre_2013/overnumpad_1xb/rules.mk | 2 +-
keyboards/vertex/angle65/rules.mk | 2 +-
keyboards/xw60/rules.mk | 2 +-
layouts/community/ortho_4x12/drashna/config.h | 4 +-
quantum/haptic.c | 81 ++--
quantum/haptic.h | 9 +-
quantum/process_keycode/process_space_cadet.c | 3 +
quantum/split_common/split_util.c | 1 +
users/ishtob/ishtob.h | 2 +-
53 files changed, 667 insertions(+), 660 deletions(-)
delete mode 100644 drivers/haptic/DRV2605L.c
delete mode 100644 drivers/haptic/DRV2605L.h
create mode 100644 drivers/haptic/drv2605l.c
create mode 100644 drivers/haptic/drv2605l.h
delete mode 100644 keyboards/hadron/ver3/keymaps/ishtob/config.h
(limited to 'quantum/split_common/split_util.c')
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 5687201d61..2de2bdd56b 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -721,18 +721,23 @@ ifeq ($(strip $(FNV_ENABLE)), yes)
SRC += qmk_fnv_type_validation.c hash_32a.c hash_64a.c
endif
+VALID_HAPTIC_DRIVER_TYPES := drv2605l solenoid
ifeq ($(strip $(HAPTIC_ENABLE)),yes)
- COMMON_VPATH += $(DRIVER_PATH)/haptic
+ ifeq ($(filter $(HAPTIC_DRIVER),$(VALID_HAPTIC_DRIVER_TYPES)),)
+ $(call CATASTROPHIC_ERROR,Invalid HAPTIC_DRIVER,HAPTIC_DRIVER="$(HAPTIC_DRIVER)" is not a valid Haptic driver)
+ else
+ COMMON_VPATH += $(DRIVER_PATH)/haptic
- ifneq ($(filter DRV2605L, $(HAPTIC_DRIVER)), )
- SRC += DRV2605L.c
- QUANTUM_LIB_SRC += i2c_master.c
- OPT_DEFS += -DDRV2605L
- endif
+ ifeq ($(strip $(HAPTIC_DRIVER)), drv2605l)
+ SRC += drv2605l.c
+ QUANTUM_LIB_SRC += i2c_master.c
+ OPT_DEFS += -DHAPTIC_DRV2605L
+ endif
- ifneq ($(filter SOLENOID, $(HAPTIC_DRIVER)), )
- SRC += solenoid.c
- OPT_DEFS += -DSOLENOID_ENABLE
+ ifeq ($(strip $(HAPTIC_DRIVER)), solenoid)
+ SRC += solenoid.c
+ OPT_DEFS += -DHAPTIC_SOLENOID
+ endif
endif
endif
diff --git a/docs/feature_haptic_feedback.md b/docs/feature_haptic_feedback.md
index b456bad736..02a231138d 100644
--- a/docs/feature_haptic_feedback.md
+++ b/docs/feature_haptic_feedback.md
@@ -4,11 +4,12 @@
The following options are currently available for haptic feedback in `rules.mk`:
-```
+```make
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER += DRV2605L
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = drv2605l
+# or
+HAPTIC_DRIVER = solenoid
```
The following `config.h` settings are available for all types of haptic feedback:
@@ -92,7 +93,7 @@ This driver supports 2 different feedback motors. Set the following in your `con
Eccentric Rotating Mass vibration motors (ERM) is motor with a off-set weight attached so when drive signal is attached, the off-set weight spins and causes a sinusoidal wave that translate into vibrations.
-```
+```c
#define FB_ERM_LRA 0
#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
@@ -105,7 +106,7 @@ Eccentric Rotating Mass vibration motors (ERM) is motor with a off-set weight at
Linear resonant actuators (LRA, also know as a linear vibrator) works different from a ERM. A LRA has a weight and magnet suspended by springs and a voice coil. When the drive signal is applied, the weight would be vibrate on a single axis (side to side or up and down). Since the weight is attached to a spring, there is a resonance effect at a specific frequency. This frequency is where the LRA will operate the most efficiently. Refer to the motor's datasheet for the recommanded range for this frequency.
-```
+```c
#define FB_ERM_LRA 1
#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
@@ -170,13 +171,13 @@ List of waveform sequences from the datasheet:
| 42 | lg_dblclick_med_80 | 84 | transition_rampup_med_smooth1 | | |
### Optional DRV2605L defines
-```
-#define DRV_GREETING *sequence name or number*
+```c
+#define DRV2605L_GREETING *sequence name or number*
```
If haptic feedback is enabled, the keyboard will vibrate to a specific sequence during startup. That can be selected using the following define:
-```
-#define DRV_MODE_DEFAULT *sequence name or number*
+```c
+#define DRV2605L_DEFAULT_MODE *sequence name or number*
```
This will set what sequence `HF_RST` will set as the active mode. If not defined, mode will be set to 1 when `HF_RST` is pressed.
diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c
deleted file mode 100644
index 5a1d2ca0af..0000000000
--- a/drivers/haptic/DRV2605L.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Copyright 2018 ishtob
- * Driver for DRV2605L written for QMK
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-#include "DRV2605L.h"
-#include "print.h"
-#include
-#include
-#include
-
-uint8_t DRV2605L_transfer_buffer[2];
-uint8_t DRV2605L_read_register;
-
-void DRV_write(uint8_t drv_register, uint8_t settings) {
- DRV2605L_transfer_buffer[0] = drv_register;
- DRV2605L_transfer_buffer[1] = settings;
- i2c_transmit(DRV2605L_BASE_ADDRESS << 1, DRV2605L_transfer_buffer, 2, 100);
-}
-
-uint8_t DRV_read(uint8_t regaddress) {
- i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, &DRV2605L_read_register, 1, 100);
-
- return DRV2605L_read_register;
-}
-
-void DRV_init(void) {
- i2c_init();
- /* 0x07 sets DRV2605 into calibration mode */
- DRV_write(DRV_MODE, 0x07);
-
- // DRV_write(DRV_FEEDBACK_CTRL,0xB6);
-
-#if FB_ERM_LRA == 0
- /* ERM settings */
- DRV_write(DRV_RATED_VOLT, (RATED_VOLTAGE / 21.33) * 1000);
-# if ERM_OPEN_LOOP == 0
- DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (((V_PEAK * (DRIVE_TIME + BLANKING_TIME + IDISS_TIME)) / 0.02133) / (DRIVE_TIME - 0.0003)));
-# elif ERM_OPEN_LOOP == 1
- DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK / 0.02196));
-# endif
-#elif FB_ERM_LRA == 1
- DRV_write(DRV_RATED_VOLT, ((V_RMS * sqrt(1 - ((4 * ((150 + (SAMPLE_TIME * 50)) * 0.000001)) + 0.0003) * F_LRA) / 0.02071)));
-# if LRA_OPEN_LOOP == 0
- DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, ((V_PEAK / sqrt(1 - (F_LRA * 0.0008)) / 0.02133)));
-# elif LRA_OPEN_LOOP == 1
- DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK / 0.02196));
-# endif
-#endif
-
- DRVREG_FBR FB_SET;
- FB_SET.Bits.ERM_LRA = FB_ERM_LRA;
- FB_SET.Bits.BRAKE_FACTOR = FB_BRAKEFACTOR;
- FB_SET.Bits.LOOP_GAIN = FB_LOOPGAIN;
- FB_SET.Bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/
- DRV_write(DRV_FEEDBACK_CTRL, (uint8_t)FB_SET.Byte);
- DRVREG_CTRL1 C1_SET;
- C1_SET.Bits.C1_DRIVE_TIME = DRIVE_TIME;
- C1_SET.Bits.C1_AC_COUPLE = AC_COUPLE;
- C1_SET.Bits.C1_STARTUP_BOOST = STARTUP_BOOST;
- DRV_write(DRV_CTRL_1, (uint8_t)C1_SET.Byte);
- DRVREG_CTRL2 C2_SET;
- C2_SET.Bits.C2_BIDIR_INPUT = BIDIR_INPUT;
- C2_SET.Bits.C2_BRAKE_STAB = BRAKE_STAB;
- C2_SET.Bits.C2_SAMPLE_TIME = SAMPLE_TIME;
- C2_SET.Bits.C2_BLANKING_TIME = BLANKING_TIME;
- C2_SET.Bits.C2_IDISS_TIME = IDISS_TIME;
- DRV_write(DRV_CTRL_2, (uint8_t)C2_SET.Byte);
- DRVREG_CTRL3 C3_SET;
- C3_SET.Bits.C3_LRA_OPEN_LOOP = LRA_OPEN_LOOP;
- C3_SET.Bits.C3_N_PWM_ANALOG = N_PWM_ANALOG;
- C3_SET.Bits.C3_LRA_DRIVE_MODE = LRA_DRIVE_MODE;
- C3_SET.Bits.C3_DATA_FORMAT_RTO = DATA_FORMAT_RTO;
- C3_SET.Bits.C3_SUPPLY_COMP_DIS = SUPPLY_COMP_DIS;
- C3_SET.Bits.C3_ERM_OPEN_LOOP = ERM_OPEN_LOOP;
- C3_SET.Bits.C3_NG_THRESH = NG_THRESH;
- DRV_write(DRV_CTRL_3, (uint8_t)C3_SET.Byte);
- DRVREG_CTRL4 C4_SET;
- C4_SET.Bits.C4_ZC_DET_TIME = ZC_DET_TIME;
- C4_SET.Bits.C4_AUTO_CAL_TIME = AUTO_CAL_TIME;
- DRV_write(DRV_CTRL_4, (uint8_t)C4_SET.Byte);
- DRV_write(DRV_LIB_SELECTION, LIB_SELECTION);
-
- DRV_write(DRV_GO, 0x01);
-
- /* 0x00 sets DRV2605 out of standby and to use internal trigger
- * 0x01 sets DRV2605 out of standby and to use external trigger */
- DRV_write(DRV_MODE, 0x00);
-
- // Play greeting sequence
- DRV_write(DRV_GO, 0x00);
- DRV_write(DRV_WAVEFORM_SEQ_1, DRV_GREETING);
- 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);
- DRV_write(DRV_GO, 0x01);
-}
diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h
deleted file mode 100644
index 8b8eae38b8..0000000000
--- a/drivers/haptic/DRV2605L.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/* Copyright 2018 ishtob
- * Driver for DRV2605L written for QMK
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#pragma once
-#include "i2c_master.h"
-
-/* Initialization settings
-
- * Feedback Control Settings */
-#ifndef FB_ERM_LRA
-# define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
-#endif
-#ifndef FB_BRAKEFACTOR
-# define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
-#endif
-#ifndef FB_LOOPGAIN
-# define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
-#endif
-
-/* LRA specific settings */
-#if FB_ERM_LRA == 1
-# ifndef V_RMS
-# define V_RMS 2.0
-# endif
-# ifndef V_PEAK
-# define V_PEAK 2.1
-# endif
-# ifndef F_LRA
-# define F_LRA 205
-# endif
-# ifndef RATED_VOLTAGE
-# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
-# endif
-#endif
-
-#ifndef RATED_VOLTAGE
-# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
-#endif
-#ifndef V_PEAK
-# define V_PEAK 2.8
-#endif
-
-/* Library Selection */
-#ifndef LIB_SELECTION
-# if FB_ERM_LRA == 1
-# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
-# else
-# define LIB_SELECTION 1
-# endif
-#endif
-
-#ifndef DRV_GREETING
-# define DRV_GREETING alert_750ms
-#endif
-#ifndef DRV_MODE_DEFAULT
-# define DRV_MODE_DEFAULT strong_click1
-#endif
-
-/* Control 1 register settings */
-#ifndef DRIVE_TIME
-# define DRIVE_TIME 25
-#endif
-#ifndef AC_COUPLE
-# define AC_COUPLE 0
-#endif
-#ifndef STARTUP_BOOST
-# define STARTUP_BOOST 1
-#endif
-
-/* Control 2 Settings */
-#ifndef BIDIR_INPUT
-# define BIDIR_INPUT 1
-#endif
-#ifndef BRAKE_STAB
-# define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
-#endif
-#ifndef SAMPLE_TIME
-# define SAMPLE_TIME 3
-#endif
-#ifndef BLANKING_TIME
-# define BLANKING_TIME 1
-#endif
-#ifndef IDISS_TIME
-# define IDISS_TIME 1
-#endif
-
-/* Control 3 settings */
-#ifndef NG_THRESH
-# define NG_THRESH 2
-#endif
-#ifndef ERM_OPEN_LOOP
-# define ERM_OPEN_LOOP 1
-#endif
-#ifndef SUPPLY_COMP_DIS
-# define SUPPLY_COMP_DIS 0
-#endif
-#ifndef DATA_FORMAT_RTO
-# define DATA_FORMAT_RTO 0
-#endif
-#ifndef LRA_DRIVE_MODE
-# define LRA_DRIVE_MODE 0
-#endif
-#ifndef N_PWM_ANALOG
-# define N_PWM_ANALOG 0
-#endif
-#ifndef LRA_OPEN_LOOP
-# define LRA_OPEN_LOOP 0
-#endif
-
-/* Control 4 settings */
-#ifndef ZC_DET_TIME
-# define ZC_DET_TIME 0
-#endif
-#ifndef AUTO_CAL_TIME
-# define AUTO_CAL_TIME 3
-#endif
-
-/* register defines -------------------------------------------------------- */
-#define DRV2605L_BASE_ADDRESS 0x5A /* DRV2605L Base address */
-#define DRV_STATUS 0x00
-#define DRV_MODE 0x01
-#define DRV_RTP_INPUT 0x02
-#define DRV_LIB_SELECTION 0x03
-#define DRV_WAVEFORM_SEQ_1 0x04
-#define DRV_WAVEFORM_SEQ_2 0x05
-#define DRV_WAVEFORM_SEQ_3 0x06
-#define DRV_WAVEFORM_SEQ_4 0x07
-#define DRV_WAVEFORM_SEQ_5 0x08
-#define DRV_WAVEFORM_SEQ_6 0x09
-#define DRV_WAVEFORM_SEQ_7 0x0A
-#define DRV_WAVEFORM_SEQ_8 0x0B
-#define DRV_GO 0x0C
-#define DRV_OVERDRIVE_TIME_OFFSET 0x0D
-#define DRV_SUSTAIN_TIME_OFFSET_P 0x0E
-#define DRV_SUSTAIN_TIME_OFFSET_N 0x0F
-#define DRV_BRAKE_TIME_OFFSET 0x10
-#define DRV_AUDIO_2_VIBE_CTRL 0x11
-#define DRV_AUDIO_2_VIBE_MIN_IN 0x12
-#define DRV_AUDIO_2_VIBE_MAX_IN 0x13
-#define DRV_AUDIO_2_VIBE_MIN_OUTDRV 0x14
-#define DRV_AUDIO_2_VIBE_MAX_OUTDRV 0x15
-#define DRV_RATED_VOLT 0x16
-#define DRV_OVERDRIVE_CLAMP_VOLT 0x17
-#define DRV_AUTO_CALIB_COMP_RESULT 0x18
-#define DRV_AUTO_CALIB_BEMF_RESULT 0x19
-#define DRV_FEEDBACK_CTRL 0x1A
-#define DRV_CTRL_1 0x1B
-#define DRV_CTRL_2 0x1C
-#define DRV_CTRL_3 0x1D
-#define DRV_CTRL_4 0x1E
-#define DRV_CTRL_5 0x1F
-#define DRV_OPEN_LOOP_PERIOD 0x20
-#define DRV_VBAT_VOLT_MONITOR 0x21
-#define DRV_LRA_RESONANCE_PERIOD 0x22
-
-void DRV_init(void);
-void DRV_write(const uint8_t drv_register, const uint8_t settings);
-uint8_t DRV_read(const uint8_t regaddress);
-void DRV_rtp_init(void);
-void DRV_amplitude(const uint8_t amplitude);
-void DRV_pulse(const uint8_t sequence);
-
-typedef enum DRV_EFFECT {
- clear_sequence = 0,
- strong_click = 1,
- strong_click_60 = 2,
- strong_click_30 = 3,
- sharp_click = 4,
- sharp_click_60 = 5,
- sharp_click_30 = 6,
- soft_bump = 7,
- soft_bump_60 = 8,
- soft_bump_30 = 9,
- dbl_click = 10,
- dbl_click_60 = 11,
- trp_click = 12,
- soft_fuzz = 13,
- strong_buzz = 14,
- alert_750ms = 15,
- alert_1000ms = 16,
- strong_click1 = 17,
- strong_click2_80 = 18,
- strong_click3_60 = 19,
- strong_click4_30 = 20,
- medium_click1 = 21,
- medium_click2_80 = 22,
- medium_click3_60 = 23,
- sharp_tick1 = 24,
- sharp_tick2_80 = 25,
- sharp_tick3_60 = 26,
- sh_dblclick_str = 27,
- sh_dblclick_str_80 = 28,
- sh_dblclick_str_60 = 29,
- sh_dblclick_str_30 = 30,
- sh_dblclick_med = 31,
- sh_dblclick_med_80 = 32,
- sh_dblclick_med_60 = 33,
- sh_dblsharp_tick = 34,
- sh_dblsharp_tick_80 = 35,
- sh_dblsharp_tick_60 = 36,
- lg_dblclick_str = 37,
- lg_dblclick_str_80 = 38,
- lg_dblclick_str_60 = 39,
- lg_dblclick_str_30 = 40,
- lg_dblclick_med = 41,
- lg_dblclick_med_80 = 42,
- lg_dblclick_med_60 = 43,
- lg_dblsharp_tick = 44,
- lg_dblsharp_tick_80 = 45,
- lg_dblsharp_tick_60 = 46,
- buzz = 47,
- buzz_80 = 48,
- buzz_60 = 49,
- buzz_40 = 50,
- buzz_20 = 51,
- pulsing_strong = 52,
- pulsing_strong_80 = 53,
- pulsing_medium = 54,
- pulsing_medium_80 = 55,
- pulsing_sharp = 56,
- pulsing_sharp_80 = 57,
- transition_click = 58,
- transition_click_80 = 59,
- transition_click_60 = 60,
- transition_click_40 = 61,
- transition_click_20 = 62,
- transition_click_10 = 63,
- transition_hum = 64,
- transition_hum_80 = 65,
- transition_hum_60 = 66,
- transition_hum_40 = 67,
- transition_hum_20 = 68,
- transition_hum_10 = 69,
- transition_rampdown_long_smooth1 = 70,
- transition_rampdown_long_smooth2 = 71,
- transition_rampdown_med_smooth1 = 72,
- transition_rampdown_med_smooth2 = 73,
- transition_rampdown_short_smooth1 = 74,
- transition_rampdown_short_smooth2 = 75,
- transition_rampdown_long_sharp1 = 76,
- transition_rampdown_long_sharp2 = 77,
- transition_rampdown_med_sharp1 = 78,
- transition_rampdown_med_sharp2 = 79,
- transition_rampdown_short_sharp1 = 80,
- transition_rampdown_short_sharp2 = 81,
- transition_rampup_long_smooth1 = 82,
- transition_rampup_long_smooth2 = 83,
- transition_rampup_med_smooth1 = 84,
- transition_rampup_med_smooth2 = 85,
- transition_rampup_short_smooth1 = 86,
- transition_rampup_short_smooth2 = 87,
- transition_rampup_long_sharp1 = 88,
- transition_rampup_long_sharp2 = 89,
- transition_rampup_med_sharp1 = 90,
- transition_rampup_med_sharp2 = 91,
- transition_rampup_short_sharp1 = 92,
- transition_rampup_short_sharp2 = 93,
- transition_rampdown_long_smooth1_50 = 94,
- transition_rampdown_long_smooth2_50 = 95,
- transition_rampdown_med_smooth1_50 = 96,
- transition_rampdown_med_smooth2_50 = 97,
- transition_rampdown_short_smooth1_50 = 98,
- transition_rampdown_short_smooth2_50 = 99,
- transition_rampdown_long_sharp1_50 = 100,
- transition_rampdown_long_sharp2_50 = 101,
- transition_rampdown_med_sharp1_50 = 102,
- transition_rampdown_med_sharp2_50 = 103,
- transition_rampdown_short_sharp1_50 = 104,
- transition_rampdown_short_sharp2_50 = 105,
- transition_rampup_long_smooth1_50 = 106,
- transition_rampup_long_smooth2_50 = 107,
- transition_rampup_med_smooth1_50 = 108,
- transition_rampup_med_smooth2_50 = 109,
- transition_rampup_short_smooth1_50 = 110,
- transition_rampup_short_smooth2_50 = 111,
- transition_rampup_long_sharp1_50 = 112,
- transition_rampup_long_sharp2_50 = 113,
- transition_rampup_med_sharp1_50 = 114,
- transition_rampup_med_sharp2_50 = 115,
- transition_rampup_short_sharp1_50 = 116,
- transition_rampup_short_sharp2_50 = 117,
- long_buzz_for_programmatic_stopping = 118,
- smooth_hum1_50 = 119,
- smooth_hum2_40 = 120,
- smooth_hum3_30 = 121,
- smooth_hum4_20 = 122,
- smooth_hum5_10 = 123,
- drv_effect_max = 124,
-} DRV_EFFECT;
-
-/* Register bit array unions */
-
-typedef union DRVREG_STATUS { /* register 0x00 */
- uint8_t Byte;
- struct {
- uint8_t OC_DETECT : 1; /* set to 1 when overcurrent event is detected */
- uint8_t OVER_TEMP : 1; /* set to 1 when device exceeds temp threshold */
- uint8_t FB_STS : 1; /* set to 1 when feedback controller has timed out */
- /* auto-calibration routine and diagnostic result
- * result | auto-calibation | diagnostic |
- * 0 | passed | actuator func normal |
- * 1 | failed | actuator func fault* |
- * * actuator is not present or is shorted, timing out, or giving out–of-range back-EMF */
- uint8_t DIAG_RESULT : 1;
- uint8_t : 1;
- uint8_t DEVICE_ID : 3; /* Device IDs 3: DRV2605 4: DRV2604 5: DRV2604L 6: DRV2605L */
- } Bits;
-} DRVREG_STATUS;
-
-typedef union DRVREG_MODE { /* register 0x01 */
- uint8_t Byte;
- struct {
- uint8_t MODE : 3; /* Mode setting */
- uint8_t : 3;
- uint8_t STANDBY : 1; /* 0:standby 1:ready */
- } Bits;
-} DRVREG_MODE;
-
-typedef union DRVREG_WAIT {
- uint8_t Byte;
- struct {
- uint8_t WAIT_MODE : 1; /* Set to 1 to interpret as wait for next 7 bits x10ms */
- uint8_t WAIT_TIME : 7;
- } Bits;
-} DRVREG_WAIT;
-
-typedef union DRVREG_FBR { /* register 0x1A */
- uint8_t Byte;
- struct {
- uint8_t BEMF_GAIN : 2;
- uint8_t LOOP_GAIN : 2;
- uint8_t BRAKE_FACTOR : 3;
- uint8_t ERM_LRA : 1;
- } Bits;
-} DRVREG_FBR;
-
-typedef union DRVREG_CTRL1 { /* register 0x1B */
- uint8_t Byte;
- struct {
- uint8_t C1_DRIVE_TIME : 5;
- uint8_t C1_AC_COUPLE : 1;
- uint8_t : 1;
- uint8_t C1_STARTUP_BOOST : 1;
- } Bits;
-} DRVREG_CTRL1;
-
-typedef union DRVREG_CTRL2 { /* register 0x1C */
- uint8_t Byte;
- struct {
- uint8_t C2_IDISS_TIME : 2;
- uint8_t C2_BLANKING_TIME : 2;
- uint8_t C2_SAMPLE_TIME : 2;
- uint8_t C2_BRAKE_STAB : 1;
- uint8_t C2_BIDIR_INPUT : 1;
- } Bits;
-} DRVREG_CTRL2;
-
-typedef union DRVREG_CTRL3 { /* register 0x1D */
- uint8_t Byte;
- struct {
- uint8_t C3_LRA_OPEN_LOOP : 1;
- uint8_t C3_N_PWM_ANALOG : 1;
- uint8_t C3_LRA_DRIVE_MODE : 1;
- uint8_t C3_DATA_FORMAT_RTO : 1;
- uint8_t C3_SUPPLY_COMP_DIS : 1;
- uint8_t C3_ERM_OPEN_LOOP : 1;
- uint8_t C3_NG_THRESH : 2;
- } Bits;
-} DRVREG_CTRL3;
-
-typedef union DRVREG_CTRL4 { /* register 0x1E */
- uint8_t Byte;
- struct {
- uint8_t C4_OTP_PROGRAM : 1;
- uint8_t : 1;
- uint8_t C4_OTP_STATUS : 1;
- uint8_t : 1;
- uint8_t C4_AUTO_CAL_TIME : 2;
- uint8_t C4_ZC_DET_TIME : 2;
- } Bits;
-} DRVREG_CTRL4;
-
-typedef union DRVREG_CTRL5 { /* register 0x1F */
- uint8_t Byte;
- struct {
- uint8_t C5_IDISS_TIME : 2;
- uint8_t C5_BLANKING_TIME : 2;
- uint8_t C5_PLAYBACK_INTERVAL : 1;
- uint8_t C5_LRA_AUTO_OPEN_LOOP : 1;
- uint8_t C5_AUTO_OL_CNT : 2;
- } Bits;
-} DRVREG_CTRL5;
diff --git a/drivers/haptic/drv2605l.c b/drivers/haptic/drv2605l.c
new file mode 100644
index 0000000000..7613dc59d1
--- /dev/null
+++ b/drivers/haptic/drv2605l.c
@@ -0,0 +1,126 @@
+/* Copyright 2018 ishtob
+ * Driver for DRV2605L written for QMK
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include "drv2605l.h"
+#include "i2c_master.h"
+#include
+
+uint8_t drv2605l_write_buffer[2];
+uint8_t drv2605l_read_buffer;
+
+void drv2605l_write(uint8_t reg_addr, uint8_t data) {
+ drv2605l_write_buffer[0] = reg_addr;
+ drv2605l_write_buffer[1] = data;
+ i2c_transmit(DRV2605L_I2C_ADDRESS << 1, drv2605l_write_buffer, 2, 100);
+}
+
+uint8_t drv2605l_read(uint8_t reg_addr) {
+ i2c_readReg(DRV2605L_I2C_ADDRESS << 1, reg_addr, &drv2605l_read_buffer, 1, 100);
+
+ return drv2605l_read_buffer;
+}
+
+void drv2605l_init(void) {
+ i2c_init();
+ /* 0x07 sets DRV2605 into calibration mode */
+ drv2605l_write(DRV2605L_REG_MODE, 0x07);
+
+ // drv2605l_write(DRV2605L_REG_FEEDBACK_CTRL,0xB6);
+
+#if FB_ERM_LRA == 0
+ /* ERM settings */
+ drv2605l_write(DRV2605L_REG_RATED_VOLTAGE, (RATED_VOLTAGE / 21.33) * 1000);
+# if ERM_OPEN_LOOP == 0
+ drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (((V_PEAK * (DRIVE_TIME + BLANKING_TIME + IDISS_TIME)) / 0.02133) / (DRIVE_TIME - 0.0003)));
+# elif ERM_OPEN_LOOP == 1
+ drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (V_PEAK / 0.02196));
+# endif
+#elif FB_ERM_LRA == 1
+ drv2605l_write(DRV2605L_REG_RATED_VOLTAGE, ((V_RMS * sqrt(1 - ((4 * ((150 + (SAMPLE_TIME * 50)) * 0.000001)) + 0.0003) * F_LRA) / 0.02071)));
+# if LRA_OPEN_LOOP == 0
+ drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, ((V_PEAK / sqrt(1 - (F_LRA * 0.0008)) / 0.02133)));
+# elif LRA_OPEN_LOOP == 1
+ drv2605l_write(DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE, (V_PEAK / 0.02196));
+# endif
+#endif
+
+ DRVREG_FBR FB_SET;
+ FB_SET.Bits.ERM_LRA = FB_ERM_LRA;
+ FB_SET.Bits.BRAKE_FACTOR = FB_BRAKEFACTOR;
+ FB_SET.Bits.LOOP_GAIN = FB_LOOPGAIN;
+ FB_SET.Bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/
+ drv2605l_write(DRV2605L_REG_FEEDBACK_CTRL, (uint8_t)FB_SET.Byte);
+
+ DRVREG_CTRL1 C1_SET;
+ C1_SET.Bits.C1_DRIVE_TIME = DRIVE_TIME;
+ C1_SET.Bits.C1_AC_COUPLE = AC_COUPLE;
+ C1_SET.Bits.C1_STARTUP_BOOST = STARTUP_BOOST;
+ drv2605l_write(DRV2605L_REG_CTRL1, (uint8_t)C1_SET.Byte);
+
+ DRVREG_CTRL2 C2_SET;
+ C2_SET.Bits.C2_BIDIR_INPUT = BIDIR_INPUT;
+ C2_SET.Bits.C2_BRAKE_STAB = BRAKE_STAB;
+ C2_SET.Bits.C2_SAMPLE_TIME = SAMPLE_TIME;
+ C2_SET.Bits.C2_BLANKING_TIME = BLANKING_TIME;
+ C2_SET.Bits.C2_IDISS_TIME = IDISS_TIME;
+ drv2605l_write(DRV2605L_REG_CTRL2, (uint8_t)C2_SET.Byte);
+
+ DRVREG_CTRL3 C3_SET;
+ C3_SET.Bits.C3_LRA_OPEN_LOOP = LRA_OPEN_LOOP;
+ C3_SET.Bits.C3_N_PWM_ANALOG = N_PWM_ANALOG;
+ C3_SET.Bits.C3_LRA_DRIVE_MODE = LRA_DRIVE_MODE;
+ C3_SET.Bits.C3_DATA_FORMAT_RTO = DATA_FORMAT_RTO;
+ C3_SET.Bits.C3_SUPPLY_COMP_DIS = SUPPLY_COMP_DIS;
+ C3_SET.Bits.C3_ERM_OPEN_LOOP = ERM_OPEN_LOOP;
+ C3_SET.Bits.C3_NG_THRESH = NG_THRESH;
+ drv2605l_write(DRV2605L_REG_CTRL3, (uint8_t)C3_SET.Byte);
+
+ DRVREG_CTRL4 C4_SET;
+ C4_SET.Bits.C4_ZC_DET_TIME = ZC_DET_TIME;
+ C4_SET.Bits.C4_AUTO_CAL_TIME = AUTO_CAL_TIME;
+ drv2605l_write(DRV2605L_REG_CTRL4, (uint8_t)C4_SET.Byte);
+
+ drv2605l_write(DRV2605L_REG_LIBRARY_SELECTION, DRV2605L_LIBRARY);
+
+ drv2605l_write(DRV2605L_REG_GO, 0x01);
+
+ /* 0x00 sets DRV2605 out of standby and to use internal trigger
+ * 0x01 sets DRV2605 out of standby and to use external trigger */
+ drv2605l_write(DRV2605L_REG_MODE, 0x00);
+
+ // Play greeting sequence
+ drv2605l_write(DRV2605L_REG_GO, 0x00);
+ drv2605l_write(DRV2605L_REG_WAVEFORM_SEQUENCER_1, DRV2605L_GREETING);
+ drv2605l_write(DRV2605L_REG_GO, 0x01);
+}
+
+void drv2605l_rtp_init(void) {
+ drv2605l_write(DRV2605L_REG_GO, 0x00);
+ drv2605l_write(DRV2605L_REG_RTP_INPUT, 20); // 20 is the lowest value I've found where haptics can still be felt.
+ drv2605l_write(DRV2605L_REG_MODE, 0x05);
+ drv2605l_write(DRV2605L_REG_GO, 0x01);
+}
+
+void drv2605l_amplitude(uint8_t amplitude) {
+ drv2605l_write(DRV2605L_REG_RTP_INPUT, amplitude);
+}
+
+void drv2605l_pulse(uint8_t sequence) {
+ drv2605l_write(DRV2605L_REG_GO, 0x00);
+ drv2605l_write(DRV2605L_REG_WAVEFORM_SEQUENCER_1, sequence);
+ drv2605l_write(DRV2605L_REG_GO, 0x01);
+}
diff --git a/drivers/haptic/drv2605l.h b/drivers/haptic/drv2605l.h
new file mode 100644
index 0000000000..796611edb6
--- /dev/null
+++ b/drivers/haptic/drv2605l.h
@@ -0,0 +1,407 @@
+/* Copyright 2018 ishtob
+ * Driver for DRV2605L written for QMK
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
+
+#include
+
+/* Initialization settings
+
+ * Feedback Control Settings */
+#ifndef FB_ERM_LRA
+# define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
+#endif
+#ifndef FB_BRAKEFACTOR
+# define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
+#endif
+#ifndef FB_LOOPGAIN
+# define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
+#endif
+
+/* LRA specific settings */
+#if FB_ERM_LRA == 1
+# ifndef V_RMS
+# define V_RMS 2.0
+# endif
+# ifndef V_PEAK
+# define V_PEAK 2.1
+# endif
+# ifndef F_LRA
+# define F_LRA 205
+# endif
+# ifndef RATED_VOLTAGE
+# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
+# endif
+#endif
+
+#ifndef RATED_VOLTAGE
+# define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */
+#endif
+#ifndef V_PEAK
+# define V_PEAK 2.8
+#endif
+
+/* Library Selection */
+#ifndef DRV2605L_LIBRARY
+# if FB_ERM_LRA == 1
+# define DRV2605L_LIBRARY 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+# else
+# define DRV2605L_LIBRARY 1
+# endif
+#endif
+
+#ifndef DRV2605L_GREETING
+# define DRV2605L_GREETING alert_750ms
+#endif
+#ifndef DRV2605L_DEFAULT_MODE
+# define DRV2605L_DEFAULT_MODE strong_click1
+#endif
+
+/* Control 1 register settings */
+#ifndef DRIVE_TIME
+# define DRIVE_TIME 25
+#endif
+#ifndef AC_COUPLE
+# define AC_COUPLE 0
+#endif
+#ifndef STARTUP_BOOST
+# define STARTUP_BOOST 1
+#endif
+
+/* Control 2 Settings */
+#ifndef BIDIR_INPUT
+# define BIDIR_INPUT 1
+#endif
+#ifndef BRAKE_STAB
+# define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
+#endif
+#ifndef SAMPLE_TIME
+# define SAMPLE_TIME 3
+#endif
+#ifndef BLANKING_TIME
+# define BLANKING_TIME 1
+#endif
+#ifndef IDISS_TIME
+# define IDISS_TIME 1
+#endif
+
+/* Control 3 settings */
+#ifndef NG_THRESH
+# define NG_THRESH 2
+#endif
+#ifndef ERM_OPEN_LOOP
+# define ERM_OPEN_LOOP 1
+#endif
+#ifndef SUPPLY_COMP_DIS
+# define SUPPLY_COMP_DIS 0
+#endif
+#ifndef DATA_FORMAT_RTO
+# define DATA_FORMAT_RTO 0
+#endif
+#ifndef LRA_DRIVE_MODE
+# define LRA_DRIVE_MODE 0
+#endif
+#ifndef N_PWM_ANALOG
+# define N_PWM_ANALOG 0
+#endif
+#ifndef LRA_OPEN_LOOP
+# define LRA_OPEN_LOOP 0
+#endif
+
+/* Control 4 settings */
+#ifndef ZC_DET_TIME
+# define ZC_DET_TIME 0
+#endif
+#ifndef AUTO_CAL_TIME
+# define AUTO_CAL_TIME 3
+#endif
+
+#define DRV2605L_I2C_ADDRESS 0x5A
+
+#define DRV2605L_REG_STATUS 0x00
+#define DRV2605L_REG_MODE 0x01
+#define DRV2605L_REG_RTP_INPUT 0x02
+#define DRV2605L_REG_LIBRARY_SELECTION 0x03
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_1 0x04
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_2 0x05
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_3 0x06
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_4 0x07
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_5 0x08
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_6 0x09
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_7 0x0A
+#define DRV2605L_REG_WAVEFORM_SEQUENCER_8 0x0B
+#define DRV2605L_REG_GO 0x0C
+#define DRV2605L_REG_OVERDRIVE_TIME_OFFSET 0x0D
+#define DRV2605L_REG_SUSTAIN_TIME_OFFSET_P 0x0E
+#define DRV2605L_REG_SUSTAIN_TIME_OFFSET_N 0x0F
+#define DRV2605L_REG_BRAKE_TIME_OFFSET 0x10
+#define DRV2605L_REG_AUDIO_TO_VIBE_CTRL 0x11
+#define DRV2605L_REG_AUDIO_TO_VIBE_MIN_INPUT 0x12
+#define DRV2605L_REG_AUDIO_TO_VIBE_MAX_INPUT 0x13
+#define DRV2605L_REG_AUDIO_TO_VIBE_MIN_OUTPUT_DRIVE 0x14
+#define DRV2605L_REG_AUDIO_TO_VIBE_MAX_OUTPUT_DRIVE 0x15
+#define DRV2605L_REG_RATED_VOLTAGE 0x16
+#define DRV2605L_REG_OVERDRIVE_CLAMP_VOLTAGE 0x17
+#define DRV2605L_REG_AUTO_CALIBRATION_COMPENSATION_RESULT 0x18
+#define DRV2605L_REG_AUTO_CALIBRATION_BACK_EMF_RESULT 0x19
+#define DRV2605L_REG_FEEDBACK_CTRL 0x1A
+#define DRV2605L_REG_CTRL1 0x1B
+#define DRV2605L_REG_CTRL2 0x1C
+#define DRV2605L_REG_CTRL3 0x1D
+#define DRV2605L_REG_CTRL4 0x1E
+#define DRV2605L_REG_CTRL5 0x1F
+#define DRV2605L_REG_LRA_OPEN_LOOP_PERIOD 0x20
+#define DRV2605L_REG_VBAT_VOLTAGE_MONITOR 0x21
+#define DRV2605L_REG_LRA_RESONANCE_PERIOD 0x22
+
+void drv2605l_init(void);
+void drv2605l_write(const uint8_t reg_addr, const uint8_t data);
+uint8_t drv2605l_read(const uint8_t reg_addr);
+void drv2605l_rtp_init(void);
+void drv2605l_amplitude(const uint8_t amplitude);
+void drv2605l_pulse(const uint8_t sequence);
+
+typedef enum DRV_EFFECT {
+ clear_sequence,
+ strong_click,
+ strong_click_60,
+ strong_click_30,
+ sharp_click,
+ sharp_click_60,
+ sharp_click_30,
+ soft_bump,
+ soft_bump_60,
+ soft_bump_30,
+ dbl_click,
+ dbl_click_60,
+ trp_click,
+ soft_fuzz,
+ strong_buzz,
+ alert_750ms,
+ alert_1000ms,
+ strong_click1,
+ strong_click2_80,
+ strong_click3_60,
+ strong_click4_30,
+ medium_click1,
+ medium_click2_80,
+ medium_click3_60,
+ sharp_tick1,
+ sharp_tick2_80,
+ sharp_tick3_60,
+ sh_dblclick_str,
+ sh_dblclick_str_80,
+ sh_dblclick_str_60,
+ sh_dblclick_str_30,
+ sh_dblclick_med,
+ sh_dblclick_med_80,
+ sh_dblclick_med_60,
+ sh_dblsharp_tick,
+ sh_dblsharp_tick_80,
+ sh_dblsharp_tick_60,
+ lg_dblclick_str,
+ lg_dblclick_str_80,
+ lg_dblclick_str_60,
+ lg_dblclick_str_30,
+ lg_dblclick_med,
+ lg_dblclick_med_80,
+ lg_dblclick_med_60,
+ lg_dblsharp_tick,
+ lg_dblsharp_tick_80,
+ lg_dblsharp_tick_60,
+ buzz,
+ buzz_80,
+ buzz_60,
+ buzz_40,
+ buzz_20,
+ pulsing_strong,
+ pulsing_strong_80,
+ pulsing_medium,
+ pulsing_medium_80,
+ pulsing_sharp,
+ pulsing_sharp_80,
+ transition_click,
+ transition_click_80,
+ transition_click_60,
+ transition_click_40,
+ transition_click_20,
+ transition_click_10,
+ transition_hum,
+ transition_hum_80,
+ transition_hum_60,
+ transition_hum_40,
+ transition_hum_20,
+ transition_hum_10,
+ transition_rampdown_long_smooth1,
+ transition_rampdown_long_smooth2,
+ transition_rampdown_med_smooth1,
+ transition_rampdown_med_smooth2,
+ transition_rampdown_short_smooth1,
+ transition_rampdown_short_smooth2,
+ transition_rampdown_long_sharp1,
+ transition_rampdown_long_sharp2,
+ transition_rampdown_med_sharp1,
+ transition_rampdown_med_sharp2,
+ transition_rampdown_short_sharp1,
+ transition_rampdown_short_sharp2,
+ transition_rampup_long_smooth1,
+ transition_rampup_long_smooth2,
+ transition_rampup_med_smooth1,
+ transition_rampup_med_smooth2,
+ transition_rampup_short_smooth1,
+ transition_rampup_short_smooth2,
+ transition_rampup_long_sharp1,
+ transition_rampup_long_sharp2,
+ transition_rampup_med_sharp1,
+ transition_rampup_med_sharp2,
+ transition_rampup_short_sharp1,
+ transition_rampup_short_sharp2,
+ transition_rampdown_long_smooth1_50,
+ transition_rampdown_long_smooth2_50,
+ transition_rampdown_med_smooth1_50,
+ transition_rampdown_med_smooth2_50,
+ transition_rampdown_short_smooth1_50,
+ transition_rampdown_short_smooth2_50,
+ transition_rampdown_long_sharp1_50,
+ transition_rampdown_long_sharp2_50,
+ transition_rampdown_med_sharp1_50,
+ transition_rampdown_med_sharp2_50,
+ transition_rampdown_short_sharp1_50,
+ transition_rampdown_short_sharp2_50,
+ transition_rampup_long_smooth1_50,
+ transition_rampup_long_smooth2_50,
+ transition_rampup_med_smooth1_50,
+ transition_rampup_med_smooth2_50,
+ transition_rampup_short_smooth1_50,
+ transition_rampup_short_smooth2_50,
+ transition_rampup_long_sharp1_50,
+ transition_rampup_long_sharp2_50,
+ transition_rampup_med_sharp1_50,
+ transition_rampup_med_sharp2_50,
+ transition_rampup_short_sharp1_50,
+ transition_rampup_short_sharp2_50,
+ long_buzz_for_programmatic_stopping,
+ smooth_hum1_50,
+ smooth_hum2_40,
+ smooth_hum3_30,
+ smooth_hum4_20,
+ smooth_hum5_10,
+ drv_effect_max
+} DRV_EFFECT;
+
+/* Register bit array unions */
+
+typedef union DRVREG_STATUS { /* register 0x00 */
+ uint8_t Byte;
+ struct {
+ uint8_t OC_DETECT : 1; /* set to 1 when overcurrent event is detected */
+ uint8_t OVER_TEMP : 1; /* set to 1 when device exceeds temp threshold */
+ uint8_t FB_STS : 1; /* set to 1 when feedback controller has timed out */
+ /* auto-calibration routine and diagnostic result
+ * result | auto-calibation | diagnostic |
+ * 0 | passed | actuator func normal |
+ * 1 | failed | actuator func fault* |
+ * * actuator is not present or is shorted, timing out, or giving out–of-range back-EMF */
+ uint8_t DIAG_RESULT : 1;
+ uint8_t : 1;
+ uint8_t DEVICE_ID : 3; /* Device IDs 3: DRV2605 4: DRV2604 5: DRV2604L 6: DRV2605L */
+ } Bits;
+} DRVREG_STATUS;
+
+typedef union DRVREG_MODE { /* register 0x01 */
+ uint8_t Byte;
+ struct {
+ uint8_t MODE : 3; /* Mode setting */
+ uint8_t : 3;
+ uint8_t STANDBY : 1; /* 0:standby 1:ready */
+ } Bits;
+} DRVREG_MODE;
+
+typedef union DRVREG_WAIT {
+ uint8_t Byte;
+ struct {
+ uint8_t WAIT_MODE : 1; /* Set to 1 to interpret as wait for next 7 bits x10ms */
+ uint8_t WAIT_TIME : 7;
+ } Bits;
+} DRVREG_WAIT;
+
+typedef union DRVREG_FBR { /* register 0x1A */
+ uint8_t Byte;
+ struct {
+ uint8_t BEMF_GAIN : 2;
+ uint8_t LOOP_GAIN : 2;
+ uint8_t BRAKE_FACTOR : 3;
+ uint8_t ERM_LRA : 1;
+ } Bits;
+} DRVREG_FBR;
+
+typedef union DRVREG_CTRL1 { /* register 0x1B */
+ uint8_t Byte;
+ struct {
+ uint8_t C1_DRIVE_TIME : 5;
+ uint8_t C1_AC_COUPLE : 1;
+ uint8_t : 1;
+ uint8_t C1_STARTUP_BOOST : 1;
+ } Bits;
+} DRVREG_CTRL1;
+
+typedef union DRVREG_CTRL2 { /* register 0x1C */
+ uint8_t Byte;
+ struct {
+ uint8_t C2_IDISS_TIME : 2;
+ uint8_t C2_BLANKING_TIME : 2;
+ uint8_t C2_SAMPLE_TIME : 2;
+ uint8_t C2_BRAKE_STAB : 1;
+ uint8_t C2_BIDIR_INPUT : 1;
+ } Bits;
+} DRVREG_CTRL2;
+
+typedef union DRVREG_CTRL3 { /* register 0x1D */
+ uint8_t Byte;
+ struct {
+ uint8_t C3_LRA_OPEN_LOOP : 1;
+ uint8_t C3_N_PWM_ANALOG : 1;
+ uint8_t C3_LRA_DRIVE_MODE : 1;
+ uint8_t C3_DATA_FORMAT_RTO : 1;
+ uint8_t C3_SUPPLY_COMP_DIS : 1;
+ uint8_t C3_ERM_OPEN_LOOP : 1;
+ uint8_t C3_NG_THRESH : 2;
+ } Bits;
+} DRVREG_CTRL3;
+
+typedef union DRVREG_CTRL4 { /* register 0x1E */
+ uint8_t Byte;
+ struct {
+ uint8_t C4_OTP_PROGRAM : 1;
+ uint8_t : 1;
+ uint8_t C4_OTP_STATUS : 1;
+ uint8_t : 1;
+ uint8_t C4_AUTO_CAL_TIME : 2;
+ uint8_t C4_ZC_DET_TIME : 2;
+ } Bits;
+} DRVREG_CTRL4;
+
+typedef union DRVREG_CTRL5 { /* register 0x1F */
+ uint8_t Byte;
+ struct {
+ uint8_t C5_IDISS_TIME : 2;
+ uint8_t C5_BLANKING_TIME : 2;
+ uint8_t C5_PLAYBACK_INTERVAL : 1;
+ uint8_t C5_LRA_AUTO_OPEN_LOOP : 1;
+ uint8_t C5_AUTO_OL_CNT : 2;
+ } Bits;
+} DRVREG_CTRL5;
diff --git a/keyboards/adpenrose/mine/keymaps/solenoid/rules.mk b/keyboards/adpenrose/mine/keymaps/solenoid/rules.mk
index 2a1e874d82..345c10cdd4 100644
--- a/keyboards/adpenrose/mine/keymaps/solenoid/rules.mk
+++ b/keyboards/adpenrose/mine/keymaps/solenoid/rules.mk
@@ -1,4 +1,4 @@
VIA_ENABLE = yes
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = solenoid
ENCODER_MAP_ENABLE = yes # Encoder mapping functionality
\ No newline at end of file
diff --git a/keyboards/adpenrose/shisaku/keymaps/solenoid/rules.mk b/keyboards/adpenrose/shisaku/keymaps/solenoid/rules.mk
index e13f2bd035..6bec144827 100644
--- a/keyboards/adpenrose/shisaku/keymaps/solenoid/rules.mk
+++ b/keyboards/adpenrose/shisaku/keymaps/solenoid/rules.mk
@@ -1,4 +1,4 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER += SOLENOID
\ No newline at end of file
+HAPTIC_DRIVER = solenoid
\ No newline at end of file
diff --git a/keyboards/ai03/lunar_ii/rules.mk b/keyboards/ai03/lunar_ii/rules.mk
index 1448dc35c3..7ad594e1f9 100644
--- a/keyboards/ai03/lunar_ii/rules.mk
+++ b/keyboards/ai03/lunar_ii/rules.mk
@@ -12,4 +12,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
HAPTIC_ENABLE = yes # Enable solenoid support
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h
index 4ed063f738..d8888eb92f 100644
--- a/keyboards/boston_meetup/2019/config.h
+++ b/keyboards/boston_meetup/2019/config.h
@@ -48,7 +48,7 @@
#define V_RMS 2.3
#define V_PEAK 3.30
/* Library Selection */
-#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+#define DRV2605L_LIBRARY 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
/* default 2V LRA voltage and library */
#elif FB_ERM_LRA == 1
@@ -57,7 +57,7 @@
#define V_PEAK 2.85
#define F_LRA 200
/* Library Selection */
-#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+#define DRV2605L_LIBRARY 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
#endif
diff --git a/keyboards/boston_meetup/2019/rules.mk b/keyboards/boston_meetup/2019/rules.mk
index b2f1131ffd..777d555b2d 100644
--- a/keyboards/boston_meetup/2019/rules.mk
+++ b/keyboards/boston_meetup/2019/rules.mk
@@ -12,6 +12,6 @@ AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = no
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
diff --git a/keyboards/buzzard/keymaps/crehmann/config.h b/keyboards/buzzard/keymaps/crehmann/config.h
index 181396ad26..ee3192e3fd 100644
--- a/keyboards/buzzard/keymaps/crehmann/config.h
+++ b/keyboards/buzzard/keymaps/crehmann/config.h
@@ -25,8 +25,8 @@
#define NO_HAPTIC_PUNCTUATION
#define NO_HAPTIC_NAV
#define NO_HAPTIC_NUMERIC
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT sharp_tick1
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE sharp_tick1
#endif
#ifdef PS2_MOUSE_ENABLE
diff --git a/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c b/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
index 37fa2902c5..8f5aa0e662 100644
--- a/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
+++ b/keyboards/buzzard/keymaps/crehmann/features/haptic_utils.c
@@ -4,7 +4,7 @@
#include "haptic_utils.h"
#ifdef HAPTIC_ENABLE
-#include "drivers/haptic/DRV2605L.h"
+#include "drivers/haptic/drv2605l.h"
#endif
#ifdef HAPTIC_ENABLE
@@ -23,19 +23,19 @@ void process_layer_pulse(layer_state_t state) {
#ifdef HAPTIC_ENABLE
switch (get_highest_layer(state)) {
case 1:
- DRV_pulse(soft_bump);
+ drv2605l_pulse(soft_bump);
break;
case 2:
- DRV_pulse(sh_dblsharp_tick);
+ drv2605l_pulse(sh_dblsharp_tick);
break;
case 3:
- DRV_pulse(lg_dblclick_str);
+ drv2605l_pulse(lg_dblclick_str);
break;
case 4:
- DRV_pulse(soft_bump);
+ drv2605l_pulse(soft_bump);
break;
case 5:
- DRV_pulse(pulsing_sharp);
+ drv2605l_pulse(pulsing_sharp);
break;
}
#endif
diff --git a/keyboards/buzzard/keymaps/crehmann/rules.mk b/keyboards/buzzard/keymaps/crehmann/rules.mk
index 484e7d84a6..98a83af549 100644
--- a/keyboards/buzzard/keymaps/crehmann/rules.mk
+++ b/keyboards/buzzard/keymaps/crehmann/rules.mk
@@ -3,7 +3,7 @@ SRC += features/haptic_utils.c
OLED_ENABLE = yes
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
PS2_MOUSE_ENABLE = yes
MOUSEKEY_ENABLE = yes
diff --git a/keyboards/buzzard/keymaps/default/config.h b/keyboards/buzzard/keymaps/default/config.h
index 2a42e17d0c..d5bf3e4dc6 100644
--- a/keyboards/buzzard/keymaps/default/config.h
+++ b/keyboards/buzzard/keymaps/default/config.h
@@ -25,8 +25,8 @@
#define NO_HAPTIC_PUNCTUATION
#define NO_HAPTIC_NAV
#define NO_HAPTIC_NUMERIC
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT sharp_tick1
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE sharp_tick1
#endif
diff --git a/keyboards/buzzard/keymaps/default/rules.mk b/keyboards/buzzard/keymaps/default/rules.mk
index e8124aebb9..46728f3803 100644
--- a/keyboards/buzzard/keymaps/default/rules.mk
+++ b/keyboards/buzzard/keymaps/default/rules.mk
@@ -1,7 +1,7 @@
OLED_ENABLE = yes # uncomment if you are using an OLED display
#HAPTIC_ENABLE = yes # uncomment only on the master side if you are using a Pimoroni haptic buzz
-#HAPTIC_DRIVER = DRV2605L # uncomment only on the master side if you are using a Pimoroni haptic buzz
+#HAPTIC_DRIVER = drv2605l # uncomment only on the master side if you are using a Pimoroni haptic buzz
#PS2_MOUSE_ENABLE = yes # uncomment only on the master side if you are usin a TrackPoint
MOUSEKEY_ENABLE = yes
\ No newline at end of file
diff --git a/keyboards/buzzard/rev1/rev1.c b/keyboards/buzzard/rev1/rev1.c
index c6cdc66187..c26e4d5831 100644
--- a/keyboards/buzzard/rev1/rev1.c
+++ b/keyboards/buzzard/rev1/rev1.c
@@ -3,7 +3,7 @@
#include "quantum.h"
#ifdef HAPTIC_ENABLE
-#include "drivers/haptic/DRV2605L.h"
+#include "drivers/haptic/drv2605l.h"
#endif
#ifdef SWAP_HANDS_ENABLE
@@ -100,27 +100,27 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case 1:
#ifdef HAPTIC_ENABLE
- DRV_pulse(soft_bump);
+ drv2605l_pulse(soft_bump);
#endif
break;
case 2:
#ifdef HAPTIC_ENABLE
- DRV_pulse(sh_dblsharp_tick);
+ drv2605l_pulse(sh_dblsharp_tick);
#endif
break;
case 3:
#ifdef HAPTIC_ENABLE
- DRV_pulse(lg_dblclick_str);
+ drv2605l_pulse(lg_dblclick_str);
#endif
break;
case 4:
#ifdef HAPTIC_ENABLE
- DRV_pulse(soft_bump);
+ drv2605l_pulse(soft_bump);
#endif
break;
case 5:
#ifdef HAPTIC_ENABLE
- DRV_pulse(pulsing_sharp);
+ drv2605l_pulse(pulsing_sharp);
#endif
break;
}
diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h
index be315e668a..675bd218f0 100644
--- a/keyboards/hadron/ver3/config.h
+++ b/keyboards/hadron/ver3/config.h
@@ -70,7 +70,7 @@
#define V_RMS 2.3
#define V_PEAK 3.30
/* Library Selection */
-#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+#define DRV2605L_LIBRARY 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
/* default 2V LRA voltage and library */
#elif FB_ERM_LRA == 1
@@ -79,7 +79,7 @@
#define V_PEAK 2.85
#define F_LRA 200
/* Library Selection */
-#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+#define DRV2605L_LIBRARY 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
#endif
diff --git a/keyboards/hadron/ver3/keymaps/ishtob/config.h b/keyboards/hadron/ver3/keymaps/ishtob/config.h
deleted file mode 100644
index 6f70f09bee..0000000000
--- a/keyboards/hadron/ver3/keymaps/ishtob/config.h
+++ /dev/null
@@ -1 +0,0 @@
-#pragma once
diff --git a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c
index e99ff55caf..a3b522fa04 100644
--- a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c
+++ b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c
@@ -239,12 +239,3 @@ bool music_mask_user(uint16_t keycode) {
return true;
}
}
-
-
-void matrix_init_keymap(void) {
-}
-
-
-void matrix_scan_keymap(void) {
-}
-
diff --git a/keyboards/hadron/ver3/rules.mk b/keyboards/hadron/ver3/rules.mk
index 5739e57d19..887fbcbfeb 100644
--- a/keyboards/hadron/ver3/rules.mk
+++ b/keyboards/hadron/ver3/rules.mk
@@ -12,7 +12,7 @@ AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no # once arm_rgb is implemented
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
ENCODER_ENABLER = yes
diff --git a/keyboards/handwired/onekey/keymaps/haptic/rules.mk b/keyboards/handwired/onekey/keymaps/haptic/rules.mk
index 802f7e5dde..05201736e6 100644
--- a/keyboards/handwired/onekey/keymaps/haptic/rules.mk
+++ b/keyboards/handwired/onekey/keymaps/haptic/rules.mk
@@ -1,2 +1,2 @@
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/handwired/swiftrax/bumblebee/keymaps/default/rules.mk b/keyboards/handwired/swiftrax/bumblebee/keymaps/default/rules.mk
index 9c6098640a..ef72559a0c 100644
--- a/keyboards/handwired/swiftrax/bumblebee/keymaps/default/rules.mk
+++ b/keyboards/handwired/swiftrax/bumblebee/keymaps/default/rules.mk
@@ -1,2 +1 @@
AUDIO_ENABLE = yes
-HAPTIC_ENABLE += SOLENOID
\ No newline at end of file
diff --git a/keyboards/handwired/swiftrax/bumblebee/keymaps/via/rules.mk b/keyboards/handwired/swiftrax/bumblebee/keymaps/via/rules.mk
index 8c797e4309..1e79dbce26 100644
--- a/keyboards/handwired/swiftrax/bumblebee/keymaps/via/rules.mk
+++ b/keyboards/handwired/swiftrax/bumblebee/keymaps/via/rules.mk
@@ -1,5 +1,4 @@
VIA_ENABLE = yes
-#HAPTIC_ENABLE += SOLENOID
AUDIO_ENABLE = yes
#either solenoid or audio not both can be enabled
LTO_ENABLE = yes
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h
index a449a126d6..913c613c98 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/config.h
@@ -32,5 +32,5 @@
#define FB_ERM_LRA 0
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT buzz
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE buzz
diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk
index 9f5341e973..1cf7a3fccf 100644
--- a/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk
+++ b/keyboards/handwired/tractyl_manuform/5x6_right/keymaps/drashna/rules.mk
@@ -35,7 +35,7 @@ ifeq ($(strip $(KEYBOARD)), handwired/tractyl_manuform/5x6_right/f411)
LTO_SUPPORTED = no
OVERLOAD_FEATURES = yes
HAPTIC_ENABLE = yes
- HAPTIC_DRIVER = DRV2605L
+ HAPTIC_DRIVER = drv2605l
endif
ifeq ($(strip $(OVERLOAD_FEATURES)), yes)
diff --git a/keyboards/hardwareabstraction/handwire/rules.mk b/keyboards/hardwareabstraction/handwire/rules.mk
index d782fba2a8..ede296e1e8 100644
--- a/keyboards/hardwareabstraction/handwire/rules.mk
+++ b/keyboards/hardwareabstraction/handwire/rules.mk
@@ -1,6 +1,6 @@
LTO_ENABLE = yes
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = solenoid
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
diff --git a/keyboards/hillside/46/0_1/config.h b/keyboards/hillside/46/0_1/config.h
index 55395dd407..dc8654b4bb 100644
--- a/keyboards/hillside/46/0_1/config.h
+++ b/keyboards/hillside/46/0_1/config.h
@@ -21,5 +21,5 @@
/* Haptic waveforms */
// Two mild waveforms
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT sharp_tick3_60
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE sharp_tick3_60
diff --git a/keyboards/hillside/46/0_1/rules.mk b/keyboards/hillside/46/0_1/rules.mk
index 2501147ea8..3c12e55b58 100644
--- a/keyboards/hillside/46/0_1/rules.mk
+++ b/keyboards/hillside/46/0_1/rules.mk
@@ -5,4 +5,4 @@ LTO_ENABLE = yes # Use link time optimization for smaller firmware
# enable it and set its driver here or in your keymap folder
# The Pimoroni board's driver is DRV2605L
# HAPTIC_ENABLE = yes # Enable haptic driver
-# HAPTIC_DRIVER = DRV2605L
+# HAPTIC_DRIVER = drv2605l
diff --git a/keyboards/hillside/48/0_1/config.h b/keyboards/hillside/48/0_1/config.h
index dc642c1193..3b432cf17b 100644
--- a/keyboards/hillside/48/0_1/config.h
+++ b/keyboards/hillside/48/0_1/config.h
@@ -16,5 +16,5 @@
/* Haptic waveforms */
// Two mild waveforms
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT sharp_tick3_60
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE sharp_tick3_60
diff --git a/keyboards/hillside/48/0_1/rules.mk b/keyboards/hillside/48/0_1/rules.mk
index 2501147ea8..3c12e55b58 100644
--- a/keyboards/hillside/48/0_1/rules.mk
+++ b/keyboards/hillside/48/0_1/rules.mk
@@ -5,4 +5,4 @@ LTO_ENABLE = yes # Use link time optimization for smaller firmware
# enable it and set its driver here or in your keymap folder
# The Pimoroni board's driver is DRV2605L
# HAPTIC_ENABLE = yes # Enable haptic driver
-# HAPTIC_DRIVER = DRV2605L
+# HAPTIC_DRIVER = drv2605l
diff --git a/keyboards/hillside/52/0_1/config.h b/keyboards/hillside/52/0_1/config.h
index 55395dd407..dc8654b4bb 100644
--- a/keyboards/hillside/52/0_1/config.h
+++ b/keyboards/hillside/52/0_1/config.h
@@ -21,5 +21,5 @@
/* Haptic waveforms */
// Two mild waveforms
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT sharp_tick3_60
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE sharp_tick3_60
diff --git a/keyboards/hillside/52/0_1/rules.mk b/keyboards/hillside/52/0_1/rules.mk
index 2501147ea8..3c12e55b58 100644
--- a/keyboards/hillside/52/0_1/rules.mk
+++ b/keyboards/hillside/52/0_1/rules.mk
@@ -5,4 +5,4 @@ LTO_ENABLE = yes # Use link time optimization for smaller firmware
# enable it and set its driver here or in your keymap folder
# The Pimoroni board's driver is DRV2605L
# HAPTIC_ENABLE = yes # Enable haptic driver
-# HAPTIC_DRIVER = DRV2605L
+# HAPTIC_DRIVER = drv2605l
diff --git a/keyboards/ibm/model_m_4th_gen/overnumpad_1xb/rules.mk b/keyboards/ibm/model_m_4th_gen/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/ibm/model_m_4th_gen/overnumpad_1xb/rules.mk
+++ b/keyboards/ibm/model_m_4th_gen/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/mechwild/clunker/rules.mk b/keyboards/mechwild/clunker/rules.mk
index 3e6a4da7db..a521203b32 100644
--- a/keyboards/mechwild/clunker/rules.mk
+++ b/keyboards/mechwild/clunker/rules.mk
@@ -1 +1 @@
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/pearlboards/atlas/rules.mk b/keyboards/pearlboards/atlas/rules.mk
index 15d4f79cde..1dd174f436 100644
--- a/keyboards/pearlboards/atlas/rules.mk
+++ b/keyboards/pearlboards/atlas/rules.mk
@@ -12,6 +12,6 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = yes # Audio output
ENCODER_ENABLE = yes
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
LTO_ENABLE = yes
diff --git a/keyboards/pearlboards/pearl/rules.mk b/keyboards/pearlboards/pearl/rules.mk
index 707e9c9312..83d6c3a33f 100644
--- a/keyboards/pearlboards/pearl/rules.mk
+++ b/keyboards/pearlboards/pearl/rules.mk
@@ -11,6 +11,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = yes # Audio output
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
LTO_ENABLE = yes
diff --git a/keyboards/pearlboards/zeus/rules.mk b/keyboards/pearlboards/zeus/rules.mk
index eeb36fee4e..5cb2d9b649 100644
--- a/keyboards/pearlboards/zeus/rules.mk
+++ b/keyboards/pearlboards/zeus/rules.mk
@@ -12,6 +12,6 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = yes # Audio output
ENCODER_ENABLE = yes # Rotary encoder
HAPTIC_ENABLE = yes # Rumble feefback
-HAPTIC_DRIVER = DRV2605L # Rumble motor
+HAPTIC_DRIVER = drv2605l # Rumble motor
LTO_ENABLE = yes # Link time optimization
diff --git a/keyboards/splitkb/zima/config.h b/keyboards/splitkb/zima/config.h
index 21fc2a2609..b031fca8dd 100644
--- a/keyboards/splitkb/zima/config.h
+++ b/keyboards/splitkb/zima/config.h
@@ -35,5 +35,5 @@ along with this program. If not, see .
#define RATED_VOLTAGE 3
#define V_PEAK 5
-#define DRV_GREETING alert_750ms
-#define DRV_MODE_DEFAULT buzz
+#define DRV2605L_GREETING alert_750ms
+#define DRV2605L_DEFAULT_MODE buzz
diff --git a/keyboards/splitkb/zima/rules.mk b/keyboards/splitkb/zima/rules.mk
index fb9a585656..f491893a43 100644
--- a/keyboards/splitkb/zima/rules.mk
+++ b/keyboards/splitkb/zima/rules.mk
@@ -15,6 +15,6 @@ ENCODER_ENABLE = yes # ENables the use of one or more encoders
OLED_ENABLE = yes
OLED_DRIVER = SSD1306 # Enables the use of OLED displays
HAPTIC_ENABLE = yes # Supported but not included by defaut
-HAPTIC_DRIVER = DRV2605L
+HAPTIC_DRIVER = drv2605l
LTO_ENABLE = yes
diff --git a/keyboards/unicomp/classic_ultracl_post_2013/overnumpad_1xb/rules.mk b/keyboards/unicomp/classic_ultracl_post_2013/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/unicomp/classic_ultracl_post_2013/overnumpad_1xb/rules.mk
+++ b/keyboards/unicomp/classic_ultracl_post_2013/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/unicomp/classic_ultracl_pre_2013/overnumpad_1xb/rules.mk b/keyboards/unicomp/classic_ultracl_pre_2013/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/unicomp/classic_ultracl_pre_2013/overnumpad_1xb/rules.mk
+++ b/keyboards/unicomp/classic_ultracl_pre_2013/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/unicomp/pc122/overnumpad_1xb/rules.mk b/keyboards/unicomp/pc122/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/unicomp/pc122/overnumpad_1xb/rules.mk
+++ b/keyboards/unicomp/pc122/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/rules.mk b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/rules.mk
+++ b/keyboards/unicomp/spacesaver_m_post_2013/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/rules.mk b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/rules.mk
index 225317b367..9131708828 100644
--- a/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/rules.mk
+++ b/keyboards/unicomp/spacesaver_m_pre_2013/overnumpad_1xb/rules.mk
@@ -14,4 +14,4 @@ AUDIO_ENABLE = no # Audio output
KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/vertex/angle65/rules.mk b/keyboards/vertex/angle65/rules.mk
index 2849e086e8..330f6ff76b 100644
--- a/keyboards/vertex/angle65/rules.mk
+++ b/keyboards/vertex/angle65/rules.mk
@@ -12,4 +12,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER += SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/keyboards/xw60/rules.mk b/keyboards/xw60/rules.mk
index 460d3ced43..710fb4ca88 100644
--- a/keyboards/xw60/rules.mk
+++ b/keyboards/xw60/rules.mk
@@ -11,4 +11,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
HAPTIC_ENABLE = yes
-HAPTIC_DRIVER = SOLENOID
+HAPTIC_DRIVER = solenoid
diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h
index 8443ff054f..071f7cb55b 100644
--- a/layouts/community/ortho_4x12/drashna/config.h
+++ b/layouts/community/ortho_4x12/drashna/config.h
@@ -115,7 +115,7 @@
# define V_RMS 2.3
# define V_PEAK 3.30
/* Library Selection */
-# define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+# define DRV2605L_LIBRARY 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
/* default 2V LRA voltage and library */
#elif FB_ERM_LRA == 1
@@ -124,7 +124,7 @@
# define V_PEAK 2.85
# define F_LRA 200
/* Library Selection */
-# define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
+# define DRV2605L_LIBRARY 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
#endif
diff --git a/quantum/haptic.c b/quantum/haptic.c
index c151547fca..13b2258eb8 100644
--- a/quantum/haptic.c
+++ b/quantum/haptic.c
@@ -14,17 +14,20 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+
#include "haptic.h"
#include "eeconfig.h"
#include "debug.h"
#include "usb_device_state.h"
#include "gpio.h"
-#ifdef DRV2605L
-# include "DRV2605L.h"
+
+#ifdef HAPTIC_DRV2605L
+# include "drv2605l.h"
#endif
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
# include "solenoid.h"
#endif
+
#if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE)
extern uint8_t split_haptic_play;
#endif
@@ -59,11 +62,11 @@ void haptic_init(void) {
eeconfig_init();
}
haptic_config.raw = eeconfig_read_haptic();
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
solenoid_set_dwell(haptic_config.dwell);
#endif
if ((haptic_config.raw == 0)
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
|| (haptic_config.dwell == 0)
#endif
) {
@@ -77,12 +80,12 @@ void haptic_init(void) {
// This is to execute any side effects of the configuration.
set_haptic_config_enable(haptic_config.enable);
}
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
solenoid_setup();
dprintf("Solenoid driver initialized\n");
#endif
-#ifdef DRV2605L
- DRV_init();
+#ifdef HAPTIC_DRV2605L
+ drv2605l_init();
dprintf("DRV2605 driver initialized\n");
#endif
eeconfig_debug_haptic();
@@ -95,7 +98,7 @@ void haptic_init(void) {
}
void haptic_task(void) {
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
solenoid_check();
#endif
}
@@ -108,13 +111,13 @@ void eeconfig_debug_haptic(void) {
void haptic_enable(void) {
set_haptic_config_enable(true);
- xprintf("haptic_config.enable = %u\n", haptic_config.enable);
+ dprintf("haptic_config.enable = %u\n", haptic_config.enable);
eeconfig_update_haptic(haptic_config.raw);
}
void haptic_disable(void) {
set_haptic_config_enable(false);
- xprintf("haptic_config.enable = %u\n", haptic_config.enable);
+ dprintf("haptic_config.enable = %u\n", haptic_config.enable);
eeconfig_update_haptic(haptic_config.raw);
}
@@ -130,7 +133,7 @@ void haptic_toggle(void) {
void haptic_feedback_toggle(void) {
haptic_config.feedback++;
if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX) haptic_config.feedback = KEY_PRESS;
- xprintf("haptic_config.feedback = %u\n", !haptic_config.feedback);
+ dprintf("haptic_config.feedback = %u\n", !haptic_config.feedback);
eeconfig_update_haptic(haptic_config.raw);
}
@@ -142,7 +145,7 @@ void haptic_buzz_toggle(void) {
void haptic_mode_increase(void) {
uint8_t mode = haptic_config.mode + 1;
-#ifdef DRV2605L
+#ifdef HAPTIC_DRV2605L
if (haptic_config.mode >= drv_effect_max) {
mode = 1;
}
@@ -152,7 +155,7 @@ void haptic_mode_increase(void) {
void haptic_mode_decrease(void) {
uint8_t mode = haptic_config.mode - 1;
-#ifdef DRV2605L
+#ifdef HAPTIC_DRV2605L
if (haptic_config.mode < 1) {
mode = (drv_effect_max - 1);
}
@@ -161,7 +164,7 @@ void haptic_mode_decrease(void) {
}
void haptic_dwell_increase(void) {
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
int16_t next_dwell = ((int16_t)haptic_config.dwell) + SOLENOID_DWELL_STEP_SIZE;
if (haptic_config.dwell >= SOLENOID_MAX_DWELL) {
// if it's already at max, we wrap back to min
@@ -178,7 +181,7 @@ void haptic_dwell_increase(void) {
}
void haptic_dwell_decrease(void) {
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
int16_t next_dwell = ((int16_t)haptic_config.dwell) - SOLENOID_DWELL_STEP_SIZE;
if (haptic_config.dwell <= SOLENOID_MIN_DWELL) {
// if it's already at min, we wrap to max
@@ -196,13 +199,13 @@ void haptic_dwell_decrease(void) {
void haptic_reset(void) {
set_haptic_config_enable(true);
- uint8_t feedback = HAPTIC_FEEDBACK_DEFAULT;
+ uint8_t feedback = HAPTIC_DEFAULT_FEEDBACK;
haptic_config.feedback = feedback;
-#ifdef DRV2605L
- uint8_t mode = HAPTIC_MODE_DEFAULT;
+#ifdef HAPTIC_DRV2605L
+ uint8_t mode = HAPTIC_DEFAULT_MODE;
haptic_config.mode = mode;
#endif
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
uint8_t dwell = SOLENOID_DEFAULT_DWELL;
haptic_config.dwell = dwell;
haptic_config.buzz = SOLENOID_DEFAULT_BUZZ;
@@ -213,41 +216,41 @@ void haptic_reset(void) {
haptic_config.buzz = 0;
#endif
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
- xprintf("haptic_config.mode = %u\n", haptic_config.mode);
+ dprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
+ dprintf("haptic_config.mode = %u\n", haptic_config.mode);
}
void haptic_set_feedback(uint8_t feedback) {
haptic_config.feedback = feedback;
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
+ dprintf("haptic_config.feedback = %u\n", haptic_config.feedback);
}
void haptic_set_mode(uint8_t mode) {
haptic_config.mode = mode;
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.mode = %u\n", haptic_config.mode);
+ dprintf("haptic_config.mode = %u\n", haptic_config.mode);
}
void haptic_set_amplitude(uint8_t amp) {
haptic_config.amplitude = amp;
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude);
-#ifdef DRV2605L
- DRV_amplitude(amp);
+ dprintf("haptic_config.amplitude = %u\n", haptic_config.amplitude);
+#ifdef HAPTIC_DRV2605L
+ drv2605l_amplitude(amp);
#endif
}
void haptic_set_buzz(uint8_t buzz) {
haptic_config.buzz = buzz;
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.buzz = %u\n", haptic_config.buzz);
+ dprintf("haptic_config.buzz = %u\n", haptic_config.buzz);
}
void haptic_set_dwell(uint8_t dwell) {
haptic_config.dwell = dwell;
eeconfig_update_haptic(haptic_config.raw);
- xprintf("haptic_config.dwell = %u\n", haptic_config.dwell);
+ dprintf("haptic_config.dwell = %u\n", haptic_config.dwell);
}
uint8_t haptic_get_enable(void) {
@@ -277,19 +280,19 @@ uint8_t haptic_get_dwell(void) {
void haptic_enable_continuous(void) {
haptic_config.cont = 1;
- xprintf("haptic_config.cont = %u\n", haptic_config.cont);
+ dprintf("haptic_config.cont = %u\n", haptic_config.cont);
eeconfig_update_haptic(haptic_config.raw);
-#ifdef DRV2605L
- DRV_rtp_init();
+#ifdef HAPTIC_DRV2605L
+ drv2605l_rtp_init();
#endif
}
void haptic_disable_continuous(void) {
haptic_config.cont = 0;
- xprintf("haptic_config.cont = %u\n", haptic_config.cont);
+ dprintf("haptic_config.cont = %u\n", haptic_config.cont);
eeconfig_update_haptic(haptic_config.raw);
-#ifdef DRV2605L
- DRV_write(DRV_MODE, 0x00);
+#ifdef HAPTIC_DRV2605L
+ drv2605l_write(DRV2605L_REG_MODE, 0x00);
#endif
}
@@ -318,15 +321,15 @@ void haptic_cont_decrease(void) {
}
void haptic_play(void) {
-#ifdef DRV2605L
+#ifdef HAPTIC_DRV2605L
uint8_t play_eff = 0;
play_eff = haptic_config.mode;
- DRV_pulse(play_eff);
+ drv2605l_pulse(play_eff);
# if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE)
split_haptic_play = haptic_config.mode;
# endif
#endif
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
solenoid_fire_handler();
# if defined(SPLIT_KEYBOARD) && defined(SPLIT_HAPTIC_ENABLE)
split_haptic_play = 1;
@@ -335,7 +338,7 @@ void haptic_play(void) {
}
void haptic_shutdown(void) {
-#ifdef SOLENOID_ENABLE
+#ifdef HAPTIC_SOLENOID
solenoid_shutdown();
#endif
}
diff --git a/quantum/haptic.h b/quantum/haptic.h
index 71d95cc61b..5bd1a71916 100644
--- a/quantum/haptic.h
+++ b/quantum/haptic.h
@@ -16,14 +16,15 @@
*/
#pragma once
+
#include
#include
-#ifndef HAPTIC_FEEDBACK_DEFAULT
-# define HAPTIC_FEEDBACK_DEFAULT 0
+#ifndef HAPTIC_DEFAULT_FEEDBACK
+# define HAPTIC_DEFAULT_FEEDBACK 0
#endif
-#ifndef HAPTIC_MODE_DEFAULT
-# define HAPTIC_MODE_DEFAULT DRV_MODE_DEFAULT
+#ifndef HAPTIC_DEFAULT_MODE
+# define HAPTIC_DEFAULT_MODE DRV2605L_DEFAULT_MODE
#endif
/* EEPROM config settings */
diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c
index 4d9f01077e..f948ad6238 100644
--- a/quantum/process_keycode/process_space_cadet.c
+++ b/quantum/process_keycode/process_space_cadet.c
@@ -13,10 +13,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+
#include "process_space_cadet.h"
#include "keycodes.h"
#include "timer.h"
+#include "action.h"
#include "action_tapping.h"
+#include "action_util.h"
// ********** OBSOLETE DEFINES, STOP USING! (pls?) **********
// Shift / paren setup
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index 87838c3195..fca95e0847 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -21,6 +21,7 @@
#include "wait.h"
#include "debug.h"
#include "usb_util.h"
+#include "bootloader.h"
#ifdef EE_HANDS
# include "eeconfig.h"
diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h
index fd9e19c809..fcc2e2b847 100644
--- a/users/ishtob/ishtob.h
+++ b/users/ishtob/ishtob.h
@@ -36,7 +36,7 @@ enum userspace_keycodes {
#define _FNLAYER 6
#define _NUMLAY 7
#define _MOUSECURSOR 8
-#define _ADJUST 16
+#define _ADJUST 9
--
cgit v1.2.3
From 625671d1cf44ddbade756cd058149cd3971b317c Mon Sep 17 00:00:00 2001
From: Drashna Jaelre
Date: Thu, 20 Jul 2023 18:40:05 -0700
Subject: [Bug] Fix compilation error when Split Watchdog enabled (#21543)
---
quantum/split_common/split_util.c | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'quantum/split_common/split_util.c')
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index fca95e0847..1db02df3b2 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -31,6 +31,10 @@
# include "rgblight.h"
#endif
+#if defined(SPLIT_WATCHDOG_ENABLE)
+# include "bootloader.h"
+#endif
+
#ifndef SPLIT_USB_TIMEOUT
# define SPLIT_USB_TIMEOUT 2000
#endif
--
cgit v1.2.3
From d136d490538d38085d938bd2e15d9c73236ff1a5 Mon Sep 17 00:00:00 2001
From: Ryan
Date: Sat, 22 Jul 2023 06:43:14 +1000
Subject: Revert "[Bug] Fix compilation error when Split Watchdog enabled"
(#21572)
---
quantum/split_common/split_util.c | 4 ----
1 file changed, 4 deletions(-)
(limited to 'quantum/split_common/split_util.c')
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index 1db02df3b2..fca95e0847 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -31,10 +31,6 @@
# include "rgblight.h"
#endif
-#if defined(SPLIT_WATCHDOG_ENABLE)
-# include "bootloader.h"
-#endif
-
#ifndef SPLIT_USB_TIMEOUT
# define SPLIT_USB_TIMEOUT 2000
#endif
--
cgit v1.2.3
From 6018b56c5595b97e45837d1ee9c96d9c3d795c43 Mon Sep 17 00:00:00 2001
From: Ryan
Date: Tue, 1 Aug 2023 00:43:10 +1000
Subject: Remove old OLED API code (#21651)
---
keyboards/10bleoledhub/config.h | 2 -
keyboards/crkbd/keymaps/crkqwes/config.h | 2 -
keyboards/crkbd/keymaps/hvp/keymap.c | 4 -
keyboards/crkbd/keymaps/markstos/config.h | 3 -
keyboards/helix/rev2/keymaps/default/keymap.c | 8 --
.../helix/rev2/keymaps/default/oled_display.c | 147 --------------------
.../helix/rev2/keymaps/five_rows_jis/keymap.c | 120 +---------------
keyboards/helix/rev2/keymaps/froggy/keymap.c | 126 -----------------
keyboards/helix/rev2/keymaps/froggy_106/keymap.c | 152 ---------------------
keyboards/helix/rev2/keymaps/yshrsmz/keymap.c | 134 ------------------
keyboards/latincompass/latinpad/config.h | 2 -
keyboards/lily58/keymaps/chuan/config.h | 2 -
keyboards/lily58/keymaps/chuan/keymap.c | 7 -
keyboards/lily58/keymaps/datadavd/config.h | 2 -
keyboards/lily58/keymaps/domnantas/config.h | 2 -
keyboards/lily58/keymaps/hvp/config.h | 2 -
keyboards/lily58/keymaps/hvp/keymap.c | 57 --------
keyboards/lily58/keymaps/jhelvy/config.h | 2 -
keyboards/lily58/keymaps/jhelvy/keymap.c | 69 ----------
keyboards/lily58/keymaps/mikefightsbears/keymap.c | 3 -
keyboards/lily58/keymaps/yshrsmz/keymap.c | 3 -
keyboards/lily58/keymaps/yuchi/keymap.c | 3 -
keyboards/rgbkb/sol/keymaps/xyverz/config.h | 26 ----
keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c | 112 ---------------
keyboards/spacetime/rev2/rev2.c | 24 ----
layouts/community/split_3x6_3/drashna/config.h | 1 -
quantum/split_common/split_util.c | 3 -
quantum/split_common/split_util.h | 1 -
28 files changed, 2 insertions(+), 1017 deletions(-)
delete mode 100644 keyboards/rgbkb/sol/keymaps/xyverz/config.h
delete mode 100644 keyboards/spacetime/rev2/rev2.c
(limited to 'quantum/split_common/split_util.c')
diff --git a/keyboards/10bleoledhub/config.h b/keyboards/10bleoledhub/config.h
index d5ec736436..87716c6273 100644
--- a/keyboards/10bleoledhub/config.h
+++ b/keyboards/10bleoledhub/config.h
@@ -16,8 +16,6 @@ along with this program. If not, see .*/
#pragma once
-#define SSD1306OLED
-
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
diff --git a/keyboards/crkbd/keymaps/crkqwes/config.h b/keyboards/crkbd/keymaps/crkqwes/config.h
index 5be6a0449b..b2209c7e6d 100644
--- a/keyboards/crkbd/keymaps/crkqwes/config.h
+++ b/keyboards/crkbd/keymaps/crkqwes/config.h
@@ -28,9 +28,7 @@ along with this program. If not, see .
// #define MASTER_RIGHT
// #define EE_HANDS
-// #define SSD1306OLED
#undef USE_I2C
-#undef SSD1306OLED
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 200
diff --git a/keyboards/crkbd/keymaps/hvp/keymap.c b/keyboards/crkbd/keymaps/hvp/keymap.c
index 7e1953e34d..fc57fc1bb0 100644
--- a/keyboards/crkbd/keymaps/hvp/keymap.c
+++ b/keyboards/crkbd/keymaps/hvp/keymap.c
@@ -1,9 +1,5 @@
#include QMK_KEYBOARD_H
#include "hvp.c"
-#ifdef SSD1306OLED
-# include "ssd1306.h"
-# include
-#endif
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
diff --git a/keyboards/crkbd/keymaps/markstos/config.h b/keyboards/crkbd/keymaps/markstos/config.h
index 24101724de..0a3d7a360c 100644
--- a/keyboards/crkbd/keymaps/markstos/config.h
+++ b/keyboards/crkbd/keymaps/markstos/config.h
@@ -16,9 +16,6 @@ This is the C configuration file for the keymap
#define MASTER_RIGHT
// #define EE_HANDS
-//#define SSD1306OLED
-
-
// By default, when holding a dual-function key shortly after tapping it, the
// tapped key will begin repeating. This is handy for fast typists when typing
// words with double letters, such as "happy". If you turn this setting ON, it
diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c
index 25b0c3dff8..b777d35d45 100644
--- a/keyboards/helix/rev2/keymaps/default/keymap.c
+++ b/keyboards/helix/rev2/keymaps/default/keymap.c
@@ -340,10 +340,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
-
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
@@ -351,10 +347,6 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_get_mode();
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
}
diff --git a/keyboards/helix/rev2/keymaps/default/oled_display.c b/keyboards/helix/rev2/keymaps/default/oled_display.c
index 384356bd14..4eb815ce48 100644
--- a/keyboards/helix/rev2/keymaps/default/oled_display.c
+++ b/keyboards/helix/rev2/keymaps/default/oled_display.c
@@ -136,150 +136,3 @@ bool oled_task_user(void) {
return false;
}
#endif // end of OLED_ENABLE
-
-//SSD1306 OLED update loop
-/*
- The following code is left as a sample to help you transition from SSD1306OLED to OLED_ENABLE.
-
- * `matrix_write(matrix, data)` is replaced by `oled_write(data, false)`.
- * `matrix_write_P(matrix, data)` is replaced by `oled_write_P(data, false)`.
- * It is no longer necessary to call `iota_gfx_task()`.
- * `matrix_update()` are no longer needed.
- * `iota_gfx_task_user()` is no longer needed. Instead, `bool oled_task_user(void)` is provided.
-
- 以下のコードは、SSD1306OLED から OLED_ENABLE に移行する助けになるようにサンプルとして残してあります。
-
- * `matrix_write(matrix, data)` は、`oled_write(data, false)` に書き換えます。
- * `matrix_write_P(matrix, data)` は、`oled_write_P(data, false)` に書き換えます。
- * `iota_gfx_task()` を呼び出す必要はなくなります。
- * `matrix_update()` は不要になります。
- * `iota_gfx_task_user()` は不要になります。代りに `bool oled_task_user(void)` を用意します。
- */
-
-#ifdef SSD1306OLED
-#include "ssd1306.h"
-#define oled_write(data,flag) matrix_write(matrix, data)
-#define oled_write_P(data,flag) matrix_write_P(matrix, data)
-
-void matrix_scan_user(void) {
- iota_gfx_task(); // this is what updates the display continuously
-}
-
-void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-static void render_logo(struct CharacterMatrix *matrix) {
-
- static const char helix_logo[] PROGMEM ={
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
- 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
- 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
- 0};
- oled_write_P(helix_logo, false);
-}
-
-static void render_rgbled_status(bool full, struct CharacterMatrix *matrix) {
-# ifdef RGBLIGHT_ENABLE
- char buf[30];
- if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
- if (full) {
- snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
- rgblight_get_mode(),
- rgblight_get_hue()/RGBLIGHT_HUE_STEP,
- rgblight_get_sat()/RGBLIGHT_SAT_STEP,
- rgblight_get_val()/RGBLIGHT_VAL_STEP);
- } else {
- snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
- }
- oled_write(buf, false);
- }
-# endif
-}
-
-static void render_layer_status(struct CharacterMatrix *matrix) {
- // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
- char buf[10];
- oled_write_P(PSTR("Layer: "), false);
- switch (layer_state) {
- case L_BASE:
- oled_write_P(PSTR("Default"), false);
- break;
- case L_RAISE:
- oled_write_P(PSTR("Raise"), false);
- break;
- case L_LOWER:
- oled_write_P(PSTR("Lower"), false);
- break;
- case L_ADJUST:
- case L_ADJUST_TRI:
- oled_write_P(PSTR("Adjust"), false);
- break;
- default:
- oled_write_P(PSTR("Undef-"), false);
- snprintf(buf,sizeof(buf), "%ld", layer_state);
- oled_write(buf, false);
- }
- oled_write_P(PSTR("\n"), false);
-}
-
-void render_status(struct CharacterMatrix *matrix) {
- // Render to mode icon
- static const char os_logo[][2][3] PROGMEM = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
- if (is_mac_mode()) {
- oled_write_P(os_logo[0][0], false);
- oled_write_P(PSTR("\n"), false);
- oled_write_P(os_logo[0][1], false);
- } else {
- oled_write_P(os_logo[1][0], false);
- oled_write_P(PSTR("\n"), false);
- oled_write_P(os_logo[1][1], false);
- }
-
- oled_write_P(PSTR(" "), false);
- render_layer_status(matrix);
-
- // Host Keyboard LED Status
- led_t led_state = host_keyboard_led_state();
- oled_write_P(led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "), false);
- oled_write_P(led_state.caps_lock ? PSTR("CAPS") : PSTR(" "), false);
- oled_write_P(led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "), false);
- oled_write_P(PSTR("\n"), false);
- render_rgbled_status(true, matrix);
-}
-
-# if OLED_UPDATE_INTERVAL > 0
-uint16_t oled_update_timeout;
-# endif
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
-# if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
-# endif
-
-# if OLED_UPDATE_INTERVAL > 0
- if (timer_elapsed(oled_update_timeout) < OLED_UPDATE_INTERVAL) {
- return;
- }
- oled_update_timeout = timer_read();
-# endif
- matrix_clear(&matrix);
- if (is_keyboard_master()) {
- render_status(&matrix);
- } else {
- render_logo(&matrix);
- render_rgbled_status(false, &matrix);
- render_layer_status(&matrix);
- }
- matrix_update(&display, &matrix);
-}
-
-#endif // end of SSD1306OLED
diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
index ff7b174f5b..75e50968bc 100644
--- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
+++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c
@@ -2,9 +2,6 @@
#include "keymap_japanese.h"
#include
#include
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
// * If you want to recognize that you pressed the Adjust key with the Lower / Raise key you can enable this comment out. However, the binary size may be over. *
// #define ADJUST_MACRO_ENABLE
@@ -192,7 +189,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
-#if defined(SSD1306OLED) || defined(OLED_ENABLE)
+#if defined(OLED_ENABLE)
char keylog[24] = {};
const char code_to_name[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
@@ -249,7 +246,7 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- #if defined(SSD1306OLED) || defined(OLED_ENABLE)
+ #if defined(OLED_ENABLE)
if (record->event.pressed) {
set_keylog(keycode, record);
}
@@ -310,121 +307,8 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_get_mode();
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-void matrix_scan_user(void) {
- iota_gfx_task(); // this is what updates the display continuously
-}
-
-static inline void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-//assign the right code to your layers for OLED display
-#define L_BASE _BASE
-#define L_LOWER (1<<_LOWER)
-#define L_RAISE (1<<_RAISE)
-#define L_ADJUST (1<<_ADJUST)
-#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER)
-#define L_LOW_E (1<<_LOW_E)
-#define L_RAI_E (1<<_RAI_E)
-#define L_ADJUST_TRIE (L_ADJUST|L_RAI_E|L_LOW_E)
-
-const char helix_logo[]={
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
- 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
- 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
- 0};
-
-static inline void render_logo(struct CharacterMatrix *matrix) {
-
- matrix_write(matrix, helix_logo);
-}
-
-const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
-
-static inline void render_status(struct CharacterMatrix *matrix) {
-
- char buf[20];
- // Render to mode icon
- if(keymap_config.swap_lalt_lgui==false){
- matrix_write(matrix, mac_win_logo[0][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write(matrix, mac_win_logo[0][1]);
- } else {
- matrix_write(matrix, mac_win_logo[1][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write(matrix, mac_win_logo[1][1]);
- }
-
- #ifdef RGBLIGHT_ENABLE
- snprintf(buf, sizeof(buf), " LED mode:%d", (short)RGB_current_mode);
- matrix_write(matrix, buf);
- #endif
-
- // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
- matrix_write_P(matrix, PSTR("\nLayer: "));
- switch (layer_state) {
- case L_BASE:
- matrix_write_P(matrix, default_layer_state == (1UL<<_BAS_E) ? PSTR("BaseEx") : PSTR("Base"));
- break;
- case L_RAISE:
- matrix_write_P(matrix, PSTR("Raise"));
- break;
- case L_RAI_E:
- matrix_write_P(matrix, PSTR("RaiseEx"));
- break;
- case L_LOWER:
- matrix_write_P(matrix, PSTR("Lower"));
- break;
- case L_LOW_E:
- matrix_write_P(matrix, PSTR("LowerEx"));
- break;
- case L_ADJUST:
- case L_ADJUST_TRI:
- case L_ADJUST_TRIE:
- matrix_write_P(matrix, PSTR("Adjust"));
- break;
- default:
- snprintf(buf, sizeof(buf), "%d", (short)layer_state);
- matrix_write(matrix, buf);
- }
-
- matrix_write(matrix, keylog);
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
- #if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
- #endif
-
- matrix_clear(&matrix);
- if (is_keyboard_master()) {
- render_status(&matrix);
- } else {
- render_logo(&matrix);
- }
-
- matrix_update(&display, &matrix);
}
-#endif // end of SSD1306OLED
-
//OLED update loop
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c
index c29c5832de..dc047d3118 100644
--- a/keyboards/helix/rev2/keymaps/froggy/keymap.c
+++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c
@@ -4,10 +4,6 @@
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
-
#define LAYOUT_half( \
L00, L01, L02, L03, L04, L05, \
L10, L11, L12, L13, L14, L15, \
@@ -450,10 +446,6 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_get_mode();
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
}
@@ -555,10 +547,6 @@ uint8_t layer_state_old;
//runs every scan cycle (a lot)
void matrix_scan_user(void) {
- #ifdef SSD1306OLED
- iota_gfx_task(); // this is what updates the display continuously
- #endif
-
if(delay_key_stat && (timer_elapsed(key_timer) > DELAY_TIME)){
register_delay_code(_BASE);
if(!delay_key_pressed){
@@ -629,120 +617,6 @@ void matrix_scan_user(void) {
#endif
}
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-// Render to OLED
-void render_status(struct CharacterMatrix *matrix) {
-
- // froggy logo
- static char logo[4][1][17]=
- {
- {
- {0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0}
- },
- {
- {0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0}
- },
- {
- {0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0}
- },
- {
- {0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0}
- }
- };
-
- static char indctr[8][2][4]=
- {
- // white icon
- {
- {0x60,0x61,0x62,0},
- {0x63,0x64,0}
- },
- {
- {0x80,0x81,0x82,0},
- {0x83,0x84,0}
- },
- {
- {0xa0,0xa1,0xa2,0},
- {0xa3,0xa4,0}
- },
- {
- {0xc0,0xc1,0xc2,0},
- {0xc3,0xc4,0}
- },
- // Black icon
- {
- {0x75,0x76,0x77,0},
- {0x78,0x79,0}
- },
- {
- {0x95,0x96,0x97,0},
- {0x98,0x99,0}
- },
- {
- {0xb5,0xb6,0xb7,0},
- {0xb8,0xb9,0}
- },
- {
- {0xd5,0xd6,0xd7,0},
- {0xd8,0xd9,0}
- },
- };
-
- int rown = 0;
- int rowf = 0;
- int rowa = 0;
- int rows = 0;
-
- //Set Indicator icon
- led_t led_state = host_keyboard_led_state();
- if (led_state.num_lock) { rown = 4; } else { rown = 0; }
- if (led_state.caps_lock) { rowa = 4; } else { rowa = 0; }
- if (led_state.scroll_lock) { rows = 4; } else { rows = 0; }
- if (layer_state == L_FUNC) { rowf = 4; }
-
- matrix_write(matrix, indctr[rown] [0]);
- matrix_write(matrix, indctr[rowf] [1]);
- matrix_write(matrix, logo [0] [0]);
- matrix_write(matrix, indctr[rown+1][0]);
- matrix_write(matrix, indctr[rowf+1][1]);
- matrix_write(matrix, logo [1] [0]);
- matrix_write(matrix, indctr[rowa+2][0]);
- matrix_write(matrix, indctr[rows+2][1]);
- matrix_write(matrix, logo [2] [0]);
- matrix_write(matrix, indctr[rowa+3][0]);
- matrix_write(matrix, indctr[rows+3][1]);
- matrix_write(matrix, logo [3] [0]);
-
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
-#if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
-#endif
-
- matrix_clear(&matrix);
- if (is_keyboard_master()) {
- render_status(&matrix);
- }
- matrix_update(&display, &matrix);
-}
-
-#endif // end of SSD1306OLED
-
//OLED update loop
#ifdef OLED_ENABLE
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
index b9c6aa2324..d0a17cb4ae 100644
--- a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
+++ b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
@@ -1,9 +1,6 @@
#include QMK_KEYBOARD_H
#include "keymap_japanese.h"
#include
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
#define LAYOUT_half( \
L00, L01, L02, L03, L04, L05, \
@@ -563,15 +560,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
-
-//keyboard start-up code. Runs once when the firmware starts up.
-void matrix_init_user(void) {
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
// LED Effect
#ifdef RGBLIGHT_ENABLE
unsigned char rgb[7][5][3];
@@ -632,10 +620,6 @@ layer_state_t layer_state_old;
//runs every scan cycle (a lot)
void matrix_scan_user(void) {
- #ifdef SSD1306OLED
- iota_gfx_task(); // this is what updates the display continuously
- #endif
-
if(delay_key_stat && (timer_elapsed(key_timer) > DELAY_TIME)){
if (IS_MODE_106())
register_delay_code(_BASE_106);
@@ -693,142 +677,6 @@ void matrix_scan_user(void) {
#endif
}
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-// Render to OLED
-void render_status(struct CharacterMatrix *matrix) {
-
- // froggy logo
- static char logo[4][17]=
- {
- {0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0},
- {0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0},
- {0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0},
- {0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0},
- };
-
- static char modectl[4][2][4]=
- {
- {
- {0x65,0x66,0x67,0}, //WIN
- {0x85,0x86,0x87,0}, //WIN
- },
- {
- {0xa5,0xa6,0xa7,0}, //US(101)
- {0xc5,0xc6,0xc7,0}, //US(101)
- },
- {
- {0xbd,0xbe,0xbf,0}, //MAC
- {0xdd,0xde,0xdf,0}, //MAC
- },
- {
- {0xba,0xbb,0xbc,0}, //JP(106)
- {0xda,0xdb,0xdc,0}, //JP(106)
- },
- };
-
- static char indctr[8][2][4]=
- {
- // white icon
- {
- {0x60,0x61,0x62,0}, //NUM
- {0x63,0x64,0} //FUNC
- },
- {
- {0x80,0x81,0x82,0}, //NUM
- {0x83,0x84,0} //FUNC
- },
- {
- {0xa0,0xa1,0xa2,0}, //CAPS
- {0xa3,0xa4,0} //SCLK
- },
- {
- {0xc0,0xc1,0xc2,0}, //CAPS
- {0xc3,0xc4,0} //SCLK
- },
- // Black icon
- {
- {0x75,0x76,0x77,0}, //NUM
- {0x78,0x79,0} //FUNC
- },
- {
- {0x95,0x96,0x97,0}, //NUM
- {0x98,0x99,0} //FUNC
- },
- {
- {0xb5,0xb6,0xb7,0}, //CAPS
- {0xb8,0xb9,0} //SCLK
- },
- {
- {0xd5,0xd6,0xd7,0}, //CAPS
- {0xd8,0xd9,0} //SCLK
- },
- };
-
- int rown = 0;
- int rowf = 0;
- int rowa = 0;
- int rows = 0;
- int rowm = 0;
- int rowj = 1;
-
- //Set Indicator icon
- led_t led_state = host_keyboard_led_state();
- if (led_state.num_lock) { rown = 4; }
- if (led_state.caps_lock) { rowa = 4; }
- if (led_state.scroll_lock) { rows = 4; }
- if (IS_LAYER_ON(_FUNC)) { rowf = 4; }
-
- //Set Mode icon
- if (IS_MODE_MAC()) { rowm = 2; }
- if (IS_MODE_106()) { rowj = 3; }
-
- matrix_write(matrix, indctr[rown] [0]);
- matrix_write(matrix, indctr[rowf] [1]);
- matrix_write(matrix, modectl[rowm] [0]);
- matrix_write(matrix, logo[0]);
- matrix_write(matrix, indctr[rown+1][0]);
- matrix_write(matrix, indctr[rowf+1][1]);
- matrix_write(matrix, modectl[rowm] [1]);
- matrix_write(matrix, logo[1]);
- matrix_write(matrix, indctr[rowa+2][0]);
- matrix_write(matrix, indctr[rows+2][1]);
- matrix_write(matrix, modectl[rowj] [0]);
- matrix_write(matrix, logo[2]);
- matrix_write(matrix, indctr[rowa+3][0]);
- matrix_write(matrix, indctr[rows+3][1]);
- matrix_write(matrix, modectl[rowj] [1]);
- matrix_write(matrix, logo[3]);
-
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
-#if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
-#endif
-
- matrix_clear(&matrix);
- if (is_keyboard_master()) {
- render_status(&matrix);
- }
- matrix_update(&display, &matrix);
-}
-
-#endif // end of SSD1306OLED
-
//OLED update loop
#ifdef OLED_ENABLE
diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
index 1fc5dfba99..20fa181d77 100644
--- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
+++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c
@@ -1,9 +1,6 @@
#include QMK_KEYBOARD_H
#include
#include
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@@ -331,10 +328,6 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_get_mode();
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
}
@@ -363,133 +356,6 @@ void music_scale_user(void)
#endif
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-void matrix_scan_user(void) {
- iota_gfx_task(); // this is what updates the display continuously
-}
-
-void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-//assign the right code to your layers for OLED display
-#define L_BASE 0
-#define L_LOWER (1<<_LOWER)
-#define L_RAISE (1<<_RAISE)
-#define L_ADJUST (1<<_ADJUST)
-#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER)
-
-static void render_logo(struct CharacterMatrix *matrix) {
-
- static const char helix_logo[] PROGMEM ={
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
- 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
- 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
- 0};
- matrix_write_P(matrix, helix_logo);
- //matrix_write_P(&matrix, PSTR(" Split keyboard kit"));
-}
-
-static void render_rgbled_status(bool full, struct CharacterMatrix *matrix) {
-#ifdef RGBLIGHT_ENABLE
- char buf[30];
- if (RGBLIGHT_MODES > 1 && rgblight_is_enabled()) {
- if (full) {
- snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ",
- rgblight_get_mode(),
- rgblight_get_hue()/RGBLIGHT_HUE_STEP,
- rgblight_get_sat()/RGBLIGHT_SAT_STEP,
- rgblight_get_val()/RGBLIGHT_VAL_STEP);
- } else {
- snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode());
- }
- matrix_write(matrix, buf);
- }
-#endif
-}
-
-static void render_layer_status(struct CharacterMatrix *matrix) {
- // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
- char buf[10];
- matrix_write_P(matrix, PSTR("Layer: "));
- switch (layer_state) {
- case L_BASE:
- matrix_write_P(matrix, PSTR("Default"));
- break;
- case L_RAISE:
- matrix_write_P(matrix, PSTR("Raise"));
- break;
- case L_LOWER:
- matrix_write_P(matrix, PSTR("Lower"));
- break;
- case L_ADJUST:
- case L_ADJUST_TRI:
- matrix_write_P(matrix, PSTR("Adjust"));
- break;
- default:
- matrix_write_P(matrix, PSTR("Undef-"));
- snprintf(buf,sizeof(buf), "%ld", layer_state);
- matrix_write(matrix, buf);
- }
-}
-
-void render_status(struct CharacterMatrix *matrix) {
-
- // Render to mode icon
- static const char os_logo[][2][3] PROGMEM ={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
- if(keymap_config.swap_lalt_lgui==false){
- matrix_write_P(matrix, os_logo[0][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write_P(matrix, os_logo[0][1]);
- }else{
- matrix_write_P(matrix, os_logo[1][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write_P(matrix, os_logo[1][1]);
- }
-
- matrix_write_P(matrix, PSTR(" "));
- render_layer_status(matrix);
- matrix_write_P(matrix, PSTR("\n"));
-
- // Host Keyboard LED Status
- led_t led_state = host_keyboard_led_state();
- matrix_write_P(matrix, led_state.num_lock ? PSTR("NUMLOCK") : PSTR(" "));
- matrix_write_P(matrix, led_state.caps_lock ? PSTR("CAPS") : PSTR(" "));
- matrix_write_P(matrix, led_state.scroll_lock ? PSTR("SCLK") : PSTR(" "));
- matrix_write_P(matrix, PSTR("\n"));
- render_rgbled_status(true, matrix);
-}
-
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
-#if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
-#endif
-
- matrix_clear(&matrix);
- if (is_keyboard_master()) {
- render_status(&matrix);
- } else {
- render_logo(&matrix);
- render_rgbled_status(false, &matrix);
- render_layer_status(&matrix);
- }
- matrix_update(&display, &matrix);
-}
-
-#endif // end of SSD1306OLED
-
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
diff --git a/keyboards/latincompass/latinpad/config.h b/keyboards/latincompass/latinpad/config.h
index d68f3b9241..baba2a4a58 100644
--- a/keyboards/latincompass/latinpad/config.h
+++ b/keyboards/latincompass/latinpad/config.h
@@ -16,8 +16,6 @@ along with this program. If not, see .*/
#pragma once
-#define SSD1306OLED
-
#define RGB_MATRIX_LED_COUNT 18
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
diff --git a/keyboards/lily58/keymaps/chuan/config.h b/keyboards/lily58/keymaps/chuan/config.h
index d952ce457b..b3a47769bf 100644
--- a/keyboards/lily58/keymaps/chuan/config.h
+++ b/keyboards/lily58/keymaps/chuan/config.h
@@ -30,8 +30,6 @@ along with this program. If not, see .
// #define MASTER_RIGHT
// #define EE_HANDS
-// #define SSD1306OLED
-
#define QUICK_TAP_TERM 0
/* define tapping term */
diff --git a/keyboards/lily58/keymaps/chuan/keymap.c b/keyboards/lily58/keymaps/chuan/keymap.c
index fed5b6df67..58a19ebd5f 100644
--- a/keyboards/lily58/keymaps/chuan/keymap.c
+++ b/keyboards/lily58/keymaps/chuan/keymap.c
@@ -173,13 +173,6 @@ bool oled_task_user(void) {
#endif //OLED_ENABLE
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
-#ifdef SSD1306OLED
- // set_keylog(keycode, record);
-#endif
- // set_timelog();
- }
-
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
diff --git a/keyboards/lily58/keymaps/datadavd/config.h b/keyboards/lily58/keymaps/datadavd/config.h
index 19b372e569..c851d7ad0e 100644
--- a/keyboards/lily58/keymaps/datadavd/config.h
+++ b/keyboards/lily58/keymaps/datadavd/config.h
@@ -28,8 +28,6 @@ along with this program. If not, see .
// #define MASTER_RIGHT
// #define EE_HANDS
-// #define SSD1306OLED
-
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 50
diff --git a/keyboards/lily58/keymaps/domnantas/config.h b/keyboards/lily58/keymaps/domnantas/config.h
index 143a950ef2..830139cc03 100644
--- a/keyboards/lily58/keymaps/domnantas/config.h
+++ b/keyboards/lily58/keymaps/domnantas/config.h
@@ -28,7 +28,5 @@ along with this program. If not, see .
// #define MASTER_RIGHT
#define EE_HANDS
-// #define SSD1306OLED
-
#define QUICK_TAP_TERM 0
#define TAPPING_TERM 100
diff --git a/keyboards/lily58/keymaps/hvp/config.h b/keyboards/lily58/keymaps/hvp/config.h
index ec0960470a..35c0f25f2c 100644
--- a/keyboards/lily58/keymaps/hvp/config.h
+++ b/keyboards/lily58/keymaps/hvp/config.h
@@ -28,8 +28,6 @@ along with this program. If not, see .
// #define MASTER_RIGHT
// #define EE_HANDS
-#define SSD1306OLED
-
#define TAPPING_TERM 100
#undef TAPPING_TERM
#define TAPPING_TERM 150
diff --git a/keyboards/lily58/keymaps/hvp/keymap.c b/keyboards/lily58/keymaps/hvp/keymap.c
index 5ca0b73653..b94ea9397c 100644
--- a/keyboards/lily58/keymaps/hvp/keymap.c
+++ b/keyboards/lily58/keymaps/hvp/keymap.c
@@ -5,9 +5,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
@@ -84,63 +81,9 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_config.mode;
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-// When add source files to SRC in rules.mk, you can use functions.
-const char *read_layer_state(void);
-const char *read_logo(void);
-void set_keylog(uint16_t keycode, keyrecord_t *record);
-const char *read_keylog(void);
-const char *read_keylogs(void);
-
-void matrix_scan_user(void) {
- iota_gfx_task();
-}
-
-void matrix_render_user(struct CharacterMatrix *matrix) {
- if (is_master) {
- // If you want to change the display of OLED, you need to change here
- matrix_write_ln(matrix, read_layer_state());
- matrix_write_ln(matrix, read_keylog());
- matrix_write_ln(matrix, read_keylogs());
- //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
- //matrix_write_ln(matrix, read_host_led_state());
- //matrix_write_ln(matrix, read_timelog());
- } else {
- matrix_write(matrix, read_logo());
- }
}
-void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
- matrix_clear(&matrix);
- matrix_render_user(&matrix);
- matrix_update(&display, &matrix);
-}
-#endif//SSD1306OLED
-
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
-#ifdef SSD1306OLED
- set_keylog(keycode, record);
-#endif
- // set_timelog();
- }
-
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
diff --git a/keyboards/lily58/keymaps/jhelvy/config.h b/keyboards/lily58/keymaps/jhelvy/config.h
index dbd058a8b5..08ddcd4e32 100644
--- a/keyboards/lily58/keymaps/jhelvy/config.h
+++ b/keyboards/lily58/keymaps/jhelvy/config.h
@@ -28,8 +28,6 @@ along with this program. If not, see .
// #define MASTER_RIGHT
// #define EE_HANDS
-#define SSD1306OLED
-
#define QUICK_TAP_TERM 0
#undef TAPPING_TERM
#define TAPPING_TERM 200
diff --git a/keyboards/lily58/keymaps/jhelvy/keymap.c b/keyboards/lily58/keymaps/jhelvy/keymap.c
index 03e56b1bd1..ae44d372c6 100644
--- a/keyboards/lily58/keymaps/jhelvy/keymap.c
+++ b/keyboards/lily58/keymaps/jhelvy/keymap.c
@@ -4,10 +4,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
-
extern uint8_t is_master;
@@ -45,68 +41,3 @@ LGUI(KC_BSPC),MO(2),LGUI(KC_S),LGUI(KC_C),LGUI(KC_V),LGUI(KC_X),
KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO)
};
-
-void matrix_init_user(void) {
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-// When add source files to SRC in rules.mk, you can use functions.
-const char *read_layer_state(void);
-const char *read_logo(void);
-void set_keylog(uint16_t keycode, keyrecord_t *record);
-const char *read_keylog(void);
-const char *read_keylogs(void);
-
-// const char *read_mode_icon(bool swap);
-// const char *read_host_led_state(void);
-// void set_timelog(void);
-// const char *read_timelog(void);
-
-void matrix_scan_user(void) {
- iota_gfx_task();
-}
-
-void matrix_render_user(struct CharacterMatrix *matrix) {
- if (is_master) {
- // If you want to change the display of OLED, you need to change here
- matrix_write_ln(matrix, read_layer_state());
- matrix_write_ln(matrix, read_keylog());
- matrix_write_ln(matrix, read_keylogs());
- //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
- //matrix_write_ln(matrix, read_host_led_state());
- //matrix_write_ln(matrix, read_timelog());
- } else {
- matrix_write(matrix, read_logo());
- }
-}
-
-void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
- matrix_clear(&matrix);
- matrix_render_user(&matrix);
- matrix_update(&display, &matrix);
-}
-#endif//SSD1306OLED
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
-#ifdef SSD1306OLED
- set_keylog(keycode, record);
-#endif
- // set_timelog();
- }
- return true;
-}
diff --git a/keyboards/lily58/keymaps/mikefightsbears/keymap.c b/keyboards/lily58/keymaps/mikefightsbears/keymap.c
index 4bf723eb8d..ce9aa64e35 100644
--- a/keyboards/lily58/keymaps/mikefightsbears/keymap.c
+++ b/keyboards/lily58/keymaps/mikefightsbears/keymap.c
@@ -4,9 +4,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
diff --git a/keyboards/lily58/keymaps/yshrsmz/keymap.c b/keyboards/lily58/keymaps/yshrsmz/keymap.c
index 03269aa6a9..3ab9222b9d 100644
--- a/keyboards/lily58/keymaps/yshrsmz/keymap.c
+++ b/keyboards/lily58/keymaps/yshrsmz/keymap.c
@@ -4,9 +4,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
diff --git a/keyboards/lily58/keymaps/yuchi/keymap.c b/keyboards/lily58/keymaps/yuchi/keymap.c
index 1c87661113..c8c9eea5e9 100644
--- a/keyboards/lily58/keymaps/yuchi/keymap.c
+++ b/keyboards/lily58/keymaps/yuchi/keymap.c
@@ -4,9 +4,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "ssd1306.h"
-#endif
extern uint8_t is_master;
diff --git a/keyboards/rgbkb/sol/keymaps/xyverz/config.h b/keyboards/rgbkb/sol/keymaps/xyverz/config.h
deleted file mode 100644
index 334eee608c..0000000000
--- a/keyboards/rgbkb/sol/keymaps/xyverz/config.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-This is the c configuration file for the keymap
-
-Copyright 2012 Jun Wako
-Copyright 2015 Jack Humbert
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see .
-*/
-
-#pragma once
-
-
-// place overrides here
-
-/* #define SSD1306OLED */
diff --git a/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c
index 01cccab9e5..4aeaddc39f 100644
--- a/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c
+++ b/keyboards/rgbkb/zygomorph/keymaps/5x6pad/keymap.c
@@ -3,9 +3,6 @@
#include "lufa.h"
#include "split_util.h"
#endif
-#ifdef SSD1306OLED
- #include "common/ssd1306.h"
-#endif
extern keymap_config_t keymap_config;
@@ -171,113 +168,4 @@ void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
RGB_current_mode = rgblight_config.mode;
#endif
- //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
- #ifdef SSD1306OLED
- iota_gfx_init(!has_usb()); // turns on the display
- #endif
-}
-
-
-//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
-#ifdef SSD1306OLED
-
-// hook point for 'led_test' keymap
-// 'default' keymap's led_test_init() is empty function, do nothing
-// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35);
-__attribute__ ((weak))
-void led_test_init(void) {}
-
-void matrix_scan_user(void) {
- led_test_init();
- iota_gfx_task(); // this is what updates the display continuously
-}
-
-void matrix_update(struct CharacterMatrix *dest,
- const struct CharacterMatrix *source) {
- if (memcmp(dest->display, source->display, sizeof(dest->display))) {
- memcpy(dest->display, source->display, sizeof(dest->display));
- dest->dirty = true;
- }
-}
-
-//assign the right code to your layers for OLED display
-#define L_BASE 0
-#define L_FN (1<<_FN)
-#define L_ADJ (1<<_ADJ)
-
-static void render_logo(struct CharacterMatrix *matrix) {
-
- static char logo[]={
- 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
- 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
- 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
- 0};
- matrix_write(matrix, logo);
- //matrix_write_P(&matrix, PSTR(" Split keyboard kit"));
-}
-
-
-
-void render_status(struct CharacterMatrix *matrix) {
-
- // Render to mode icon
- static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
- if(keymap_config.swap_lalt_lgui==false){
- matrix_write(matrix, logo[0][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write(matrix, logo[0][1]);
- }else{
- matrix_write(matrix, logo[1][0]);
- matrix_write_P(matrix, PSTR("\n"));
- matrix_write(matrix, logo[1][1]);
- }
-
- // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
- char buf[40];
- snprintf(buf,sizeof(buf), "Undef-%ld", layer_state);
- matrix_write_P(matrix, PSTR("\nLayer: "));
- switch (layer_state) {
- case L_BASE:
- matrix_write_P(matrix, PSTR("Default"));
- break;
- case L_FN:
- matrix_write_P(matrix, PSTR("FN"));
- break;
- case L_ADJ:
- case L_ADJ_TRI:
- matrix_write_P(matrix, PSTR("ADJ"));
- break;
- default:
- matrix_write(matrix, buf);
- }
-
- // Host Keyboard LED Status
- char led[40];
- led_t led_state = host_keyboard_led_state();
- snprintf(led, sizeof(led), "\n%s %s %s",
- led_state.num_lock ? "NUMLOCK" : " ",
- led_state.caps_lock ? "CAPS" : " ",
- led_state.scroll_lock ? "SCLK" : " ");
- matrix_write(matrix, led);
-}
-
-
-void iota_gfx_task_user(void) {
- struct CharacterMatrix matrix;
-
-#if DEBUG_TO_SCREEN
- if (debug_enable) {
- return;
- }
-#endif
-
- matrix_clear(&matrix);
- if(is_master){
- render_status(&matrix);
- }else{
- render_logo(&matrix);
- }
- matrix_update(&display, &matrix);
}
-
-#endif
diff --git a/keyboards/spacetime/rev2/rev2.c b/keyboards/spacetime/rev2/rev2.c
deleted file mode 100644
index 3ecef1c1d8..0000000000
--- a/keyboards/spacetime/rev2/rev2.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2019 Kyle Terry
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-#include "rev2.h"
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
-#ifdef SSD1306OLED
- return process_record_gfx(keycode,record) && process_record_user(keycode, record);
-#else
- return process_record_user(keycode, record);
-#endif
-}
diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h
index 92065e8f31..cfed26931b 100644
--- a/layouts/community/split_3x6_3/drashna/config.h
+++ b/layouts/community/split_3x6_3/drashna/config.h
@@ -24,7 +24,6 @@
#define SPLIT_MODS_ENABLE
#undef USE_I2C
-#undef SSD1306OLED
// #define QUICK_TAP_TERM 0
// #define TAPPING_TERM 100
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index fca95e0847..5d044c4ea0 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -206,9 +206,6 @@ void split_pre_init(void) {
#endif
if (is_keyboard_master()) {
-#if defined(USE_I2C) && defined(SSD1306OLED)
- matrix_master_OLED_init();
-#endif
transport_master_init();
}
}
diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h
index ab42c85e9f..f83b05b6a6 100644
--- a/quantum/split_common/split_util.h
+++ b/quantum/split_common/split_util.h
@@ -7,7 +7,6 @@
extern volatile bool isLeftHand;
-void matrix_master_OLED_init(void);
void split_pre_init(void);
void split_post_init(void);
--
cgit v1.2.3