]> git.donarmstrong.com Git - qmk_firmware.git/blob - docs/config_options.md
b71dbb8ae9b238160b0bc81989f91ec413fe476b
[qmk_firmware.git] / docs / config_options.md
1 # The `config.h` file
2
3 This is a c header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere (namely keymaps). This file can exist at a couple different levels:
4
5 ## Keyboard
6
7 ```c
8 #ifndef CONFIG_H
9 #define CONFIG_H
10
11 #include "config_common.h"
12
13 // config options
14
15 #endif
16 ```
17
18 This file contains config options that should apply to the whole keyboard, and won't change in revisions, or most keymaps. The revision block here only applies to keyboards with revisions.
19
20 ## Revisions
21
22 ```c
23 #ifndef <revision>_CONFIG_H
24 #define <revision>_CONFIG_H
25
26 #include "config_common.h"
27
28 // config options
29
30 #endif
31 ```
32
33 For keyboards that have revisions, this file contains config options that should apply to only that revisions, and won't change in most keymaps.
34
35 ## Keymap
36
37 ```c
38 #ifndef CONFIG_USER_H
39 #define CONFIG_USER_H
40
41 #include "config_common.h"
42
43 // config options
44
45 #endif
46 ```
47
48 This file contains all of the options for that particular keymap. If you wish to override a previous declaration, you can use `#undef <variable>` to undefine it, where you can then redefine it without an error.
49
50 # Config Options
51
52 ```c
53 #define VENDOR_ID 0x1234 // defines your VID, and for most DIY projects, can be whatever you want
54 #define PRODUCT_ID 0x5678 // defines your PID, and for most DIY projects, can be whatever you want  
55 #define DEVICE_VER 0 // defines the device version (often used for revisions)
56
57 #define MANUFACTURER Me // generally who/whatever brand produced the board
58 #define PRODUCT Board // the name of the keyboard
59 #define DESCRIPTION a keyboard // a short description of what the keyboard is
60
61 #define MATRIX_ROWS 5 // the number of rows in your keyboard's matrix
62 #define MATRIX_COLS 15 // the number of columns in your keyboard's matrix
63
64 #define MATRIX_ROW_PINS { D0, D5, B5, B6 } // pins of the rows, from top to bottom
65 #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } // pins of the columns, from left to right
66 #define UNUSED_PINS { D1, D2, D3, B1, B2, B3 } // pins unused by the keyboard for reference 
67 #define MATRIX_HAS_GHOST // define is matrix has ghost (unlikely)
68 #define DIODE_DIRECTION COL2ROW // COL2ROW or ROW2COL - how your matrix is configured
69 // COL2ROW means the black mark on your diode is facing to the rows, and between the switch and the rows
70
71 #define AUDIO_VOICES // turns on the alternate audio voices (to cycle through)
72 #define C6_AUDIO // enables audio on pin C6
73 #define B5_AUDIO // enables audio on pin B5 (duophony is enable if both are enabled)
74
75 #define BACKLIGHT_PIN B7 // pin of the backlight - B5, B6, B7 use PWM, others use softPWM
76 #define BACKLIGHT_LEVELS 3 // number of levels your backlight will have (not including off)
77
78 #define DEBOUNCING_DELAY 5 // the delay when reading the value of the pin (5 is default)
79
80 #define LOCKING_SUPPORT_ENABLE // mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
81 #define LOCKING_RESYNC_ENABLE // tries to keep switch state consistent with keyboard LED state
82
83 #define IS_COMMAND() ( \ // key combination that allows the use of magic commands (useful for debugging)
84     keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
85 )
86
87 // the following options can save on file size at the expense of that feature
88 #define NO_DEBUG // disable debuging (saves on file size)
89 #define NO_PRINT // disable printing (saves of file size)
90 #define NO_ACTION_LAYER // no layers
91 #define NO_ACTION_TAPPING // no tapping for layers/mods
92 #define NO_ACTION_ONESHOT // no oneshot for layers/mods
93 #define NO_ACTION_MACRO // no macros
94 #define NO_ACTION_FUNCTION // no functions
95
96 #define FORCE_NKRO // NKRO by default requires to be turned on, this forces it to be on always
97
98 #define PREVENT_STUCK_MODIFIERS // when switching layers, this will release all mods
99
100 #define TAPPING_TERM 200 // how long before a tap becomes a hold
101 #define TAPPING_TOGGLE 2 // how many taps before triggering the toggle
102
103 #define PERMISSIVE_HOLD // makes tap and hold keys work better for fast typers who don't want tapping term set above 500
104
105 #define LEADER_TIMEOUT 300 // how long before the leader key times out
106
107 #define ONESHOT_TIMEOUT 300 // how long before oneshot times out
108 #define ONESHOT_TAP_TOGGLE 2 // how many taps before oneshot toggle is triggered
109
110 #define IGNORE_MOD_TAP_INTERRUPT // makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
111
112 // ws2812 options
113 #define RGB_DI_PIN D7 // pin the DI on the ws2812 is hooked-up to
114 #define RGBLIGHT_ANIMATIONS // run RGB animations
115 #define RGBLED_NUM 15 // number of LEDs
116 #define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue
117 #define RGBLIGHT_SAT_STEP 25 // units to step when in/decresing saturation
118 #define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness)
119
120 #define RGBW_BB_TWI // bit-bangs twi to EZ RGBW LEDs (only required for Ergodox EZ)
121
122 // mousekey options (self-describing)
123 #define MOUSEKEY_INTERVAL 20
124 #define MOUSEKEY_DELAY 0
125 #define MOUSEKEY_TIME_TO_MAX 60
126 #define MOUSEKEY_MAX_SPEED 7
127 #define MOUSEKEY_WHEEL_DELAY 0
128
129 ```