]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/hadron/ver3/config.h
Adding default settings for ERM motors for Hadron v3 haptic feedback (#4761)
[qmk_firmware.git] / keyboards / hadron / ver3 / config.h
1 /*
2  * Copyright 2018 Jack Humbert <jack.humb@gmail.com>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef REV3_CONFIG_H
19 #define REV3_CONFIG_H
20
21 /* USB Device descriptor parameter */
22 #define DEVICE_VER 0x0003
23
24 #undef MATRIX_ROWS
25 #undef MATRIX_COLS
26 /* key matrix size */
27 #define MATRIX_ROWS 5
28 #define MATRIX_COLS 15
29
30
31 //Audio
32 #undef AUDIO_VOICES
33 #undef C6_AUDIO
34
35 #ifdef AUDIO_ENABLE
36     #define STARTUP_SONG SONG(PLANCK_SOUND)
37     // #define STARTUP_SONG SONG(NO_SOUND)
38
39     #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
40                                   SONG(COLEMAK_SOUND), \
41                                   SONG(DVORAK_SOUND) \
42                                 }
43 #define AUDIO_CLICKY
44   /* to enable clicky on startup */
45   //#define AUDIO_CLICKY_ON
46 #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
47 #endif
48
49 //configure qwiic micro_oled driver for the 128x32 oled
50 #ifdef QWIIC_MICRO_OLED_ENABLE
51
52 #undef I2C_ADDRESS_SA0_1
53 #define I2C_ADDRESS_SA0_1 0b0111100
54 #define LCDWIDTH      128
55 #define LCDHEIGHT     32
56 #define micro_oled_rotate_180
57
58 #endif
59 /*
60  * Keyboard Matrix Assignments
61  *
62  * Change this to how you wired your keyboard
63  * COLS: AVR pins used for columns, left to right
64  * ROWS: AVR pins used for rows, top to bottom
65  * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
66  *                  ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
67  *
68 */
69
70 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
71 #define DEBOUNCE 6
72
73 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
74 //#define LOCKING_SUPPORT_ENABLE
75 /* Locking resynchronize hack */
76 //#define LOCKING_RESYNC_ENABLE
77
78 /*
79  * Force NKRO
80  *
81  * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
82  * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
83  * makefile for this to work.)
84  *
85  * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
86  * until the next keyboard reset.
87  *
88  * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
89  * fully operational during normal computer usage.
90  *
91  * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
92  * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
93  * bootmagic, NKRO mode will always be enabled until it is toggled again during a
94  * power-up.
95  *
96  */
97 //#define FORCE_NKRO
98
99 /* key combination for magic key command */
100 #define IS_COMMAND() ( \
101         keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
102 )
103
104 /*
105  * Feature disable options
106  *  These options are also useful to firmware size reduction.
107  */
108
109 /* disable debug print */
110 //#define NO_DEBUG
111
112 /* disable print */
113 //#define NO_PRINT
114
115 /* disable action features */
116 //#define NO_ACTION_LAYER
117 //#define NO_ACTION_TAPPING
118 //#define NO_ACTION_ONESHOT
119 //#define NO_ACTION_MACRO
120 //#define NO_ACTION_FUNCTION
121 /*
122  * MIDI options
123  */
124
125 /* Prevent use of disabled MIDI features in the keymap */
126 //#define MIDI_ENABLE_STRICT 1
127
128 /* enable basic MIDI features:
129    - MIDI notes can be sent when in Music mode is on
130 */
131
132 #define MIDI_BASIC
133
134 /* enable advanced MIDI features:
135    - MIDI notes can be added to the keymap
136    - Octave shift and transpose
137    - Virtual sustain, portamento, and modulation wheel
138    - etc.
139 */
140 //#define MIDI_ADVANCED
141
142 /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
143 //#define MIDI_TONE_KEYCODE_OCTAVES 2
144
145 /* Haptic Driver initialization settings
146  * Feedback Control Settings */
147 #define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
148 #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
149 #define FB_LOOPGAIN 1 /* For  Low:0, Medium:1, High:2, Very High:3 */
150
151 /* default 3V ERM vibration motor voltage and library*/
152 #if FB_ERM_LRA == 0 
153 #define RATED_VOLTAGE 3
154 #define V_RMS 2.3
155 #define V_PEAK 3.30
156 /* Library Selection */
157 #define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
158
159 /* default 2V LRA voltage and library */
160 #elif FB_ERM_LRA == 1
161 #define RATED_VOLTAGE 2
162 #define V_RMS 2.0
163 #define V_PEAK 2.85
164 #define F_LRA 200
165 /* Library Selection */
166 #define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
167
168 #endif
169
170
171 /* Control 1 register settings */
172 #define DRIVE_TIME 25
173 #define AC_COUPLE 0
174 #define STARTUP_BOOST 1
175
176 /* Control 2 Settings */
177 #define BIDIR_INPUT 1
178 #define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
179 #define SAMPLE_TIME 3
180 #define BLANKING_TIME 1
181 #define IDISS_TIME 1
182
183 /* Control 3 settings */
184 #define NG_THRESH 2
185 #define ERM_OPEN_LOOP 1
186 #define SUPPLY_COMP_DIS 0
187 #define DATA_FORMAT_RTO 0
188 #define LRA_DRIVE_MODE 0
189 #define N_PWM_ANALOG 0
190 #define LRA_OPEN_LOOP 0
191 /* Control 4 settings */
192 #define ZC_DET_TIME 0
193 #define AUTO_CAL_TIME 3
194
195 //#define RGBLIGHT_ANIMATIONS
196
197 //#define RGBLED_NUM 10
198 //#define RGB_DI_PIN B5
199 //#define DRIVER_LED_TOTAL RGBLED_NUM
200
201 //#define RGB_MATRIX_KEYPRESSES
202 #endif