config.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /*
  2. Copyright 2019 SwanMatch
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include "config_common.h"
  16. /* USB Device descriptor parameter */
  17. #define VENDOR_ID 0x16C0
  18. #define PRODUCT_ID 0x27DB
  19. #define DEVICE_VER 0x0001
  20. #define MANUFACTURER SwanMatch
  21. #define PRODUCT SilverBullet44
  22. #define DESCRIPTION Metalical Keyboard
  23. /* key matrix size */
  24. #define MATRIX_ROWS 8
  25. #define MATRIX_COLS 6
  26. /*
  27. * Keyboard Matrix Assignments
  28. *
  29. * Change this to how you wired your keyboard
  30. * COLS: AVR pins used for columns, left to right
  31. * ROWS: AVR pins used for rows, top to bottom
  32. * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
  33. * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
  34. *
  35. */
  36. #define MATRIX_ROW_PINS { D4, C6, D7, E6 }
  37. #define MATRIX_COL_PINS { B3, B1, F7, F6, F5, F4 }
  38. #define UNUSED_PINS
  39. /* COL2ROW, ROW2COL*/
  40. #define DIODE_DIRECTION COL2ROW
  41. /*
  42. * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
  43. */
  44. #define SOFT_SERIAL_PIN D2 // or D1, D2, D3, E6
  45. #define MASTER_RIGHT
  46. // #define BACKLIGHT_PIN B7
  47. // #define BACKLIGHT_BREATHING
  48. // #define BACKLIGHT_LEVELS 3
  49. #define RGB_DI_PIN D3
  50. #ifdef RGB_DI_PIN
  51. //#define RGBLIGHT_SPLIT
  52. #define RGBLED_SPLIT {26, 26}
  53. #define RGBLED_NUM 52
  54. #ifdef RGB_MATRIX_ENABLE
  55. #define DRIVER_LED_TOTAL 52
  56. #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
  57. #define RGB_MATRIX_HUE_STEP 8
  58. #define RGB_MATRIX_SAT_STEP 8
  59. #define RGB_MATRIX_VAL_STEP 8
  60. #define RGB_MATRIX_SPD_STEP 8
  61. #define RGB_MATRIX_FRAMEBUFFER_EFFECTS
  62. #define RGB_MATRIX_KEYPRESSES // reacts to keypresses
  63. #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_TYPING_HEATMAP
  64. #else
  65. #define RGBLIGHT_LED_MAP { 0,1,2,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,3,4,5,6, \
  66. 26,27,28,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,29,30,31,32 }
  67. #define RGBLIGHT_HUE_STEP 8
  68. #define RGBLIGHT_SAT_STEP 8
  69. #define RGBLIGHT_VAL_STEP 8
  70. #define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level */
  71. //#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
  72. /*== all animations enable ==*/
  73. // #define RGBLIGHT_ANIMATIONS
  74. /*== or choose animations ==*/
  75. #define RGBLIGHT_EFFECT_BREATHING
  76. #define RGBLIGHT_EFFECT_RAINBOW_MOOD
  77. #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
  78. #define RGBLIGHT_EFFECT_SNAKE
  79. // #define RGBLIGHT_EFFECT_KNIGHT
  80. // #define RGBLIGHT_EFFECT_CHRISTMAS
  81. // #define RGBLIGHT_EFFECT_STATIC_GRADIENT
  82. // #define RGBLIGHT_EFFECT_RGB_TEST
  83. // #define RGBLIGHT_EFFECT_ALTERNATING
  84. /*== customize breathing effect ==*/
  85. /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
  86. #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
  87. /*==== use exp() and sin() ====*/
  88. #define RGBLIGHT_EFFECT_BREATHE_CENTER 2 // 1 to 2.7
  89. #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
  90. /*== customize snake effect ==*/
  91. #define RGBLIGHT_EFFECT_SNAKE_LENGTH RGBLED_NUM
  92. /*== customize knight effect ==*/
  93. #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 6
  94. #endif
  95. #endif
  96. /* Audio */
  97. #ifdef AUDIO_ENABLE
  98. #define B6_AUDIO
  99. #define STARTUP_SONG SONG(STARTUP_SOUND)
  100. #define AUDIO_CLICKY
  101. #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f
  102. #endif
  103. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  104. #define DEBOUNCE 10
  105. //#define RETRO_TAPPING
  106. #ifdef MOUSEKEY_ENABLE
  107. #define MOUSEKEY_INTERVAL 20
  108. #define MOUSEKEY_MAX_SPEED 5
  109. #define MOUSEKEY_TIME_TO_MAX 60
  110. #endif
  111. /* define if matrix has ghost (lacks anti-ghosting diodes) */
  112. //#define MATRIX_HAS_GHOST
  113. /* number of backlight levels */
  114. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  115. //#define LOCKING_SUPPORT_ENABLE
  116. /* Locking resynchronize hack */
  117. //#define LOCKING_RESYNC_ENABLE
  118. /* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
  119. * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
  120. */
  121. // #define GRAVE_ESC_CTRL_OVERRIDE
  122. /*
  123. * Force NKRO
  124. *
  125. * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
  126. * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
  127. * makefile for this to work.)
  128. *
  129. * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
  130. * until the next keyboard reset.
  131. *
  132. * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
  133. * fully operational during normal computer usage.
  134. *
  135. * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
  136. * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
  137. * bootmagic, NKRO mode will always be enabled until it is toggled again during a
  138. * power-up.
  139. *
  140. */
  141. //#define FORCE_NKRO
  142. /*
  143. * Magic Key Options
  144. *
  145. * Magic keys are hotkey commands that allow control over firmware functions of
  146. * the keyboard. They are best used in combination with the HID Listen program,
  147. * found here: https://www.pjrc.com/teensy/hid_listen.html
  148. *
  149. * The options below allow the magic key functionality to be changed. This is
  150. * useful if your keyboard/keypad is missing keys and you want magic key support.
  151. *
  152. */
  153. /* key combination for magic key command */
  154. /* defined by default; to change, uncomment and set to the combination you want */
  155. // #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
  156. /* control how magic key switches layers */
  157. //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
  158. //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
  159. //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
  160. /* override magic key keymap */
  161. //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
  162. //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
  163. //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
  164. //#define MAGIC_KEY_HELP H
  165. //#define MAGIC_KEY_HELP_ALT SLASH
  166. //#define MAGIC_KEY_DEBUG D
  167. //#define MAGIC_KEY_DEBUG_MATRIX X
  168. //#define MAGIC_KEY_DEBUG_KBD K
  169. //#define MAGIC_KEY_DEBUG_MOUSE M
  170. //#define MAGIC_KEY_VERSION V
  171. //#define MAGIC_KEY_STATUS S
  172. //#define MAGIC_KEY_CONSOLE C
  173. //#define MAGIC_KEY_LAYER0 0
  174. //#define MAGIC_KEY_LAYER0_ALT GRAVE
  175. //#define MAGIC_KEY_LAYER1 1
  176. //#define MAGIC_KEY_LAYER2 2
  177. //#define MAGIC_KEY_LAYER3 3
  178. //#define MAGIC_KEY_LAYER4 4
  179. //#define MAGIC_KEY_LAYER5 5
  180. //#define MAGIC_KEY_LAYER6 6
  181. //#define MAGIC_KEY_LAYER7 7
  182. //#define MAGIC_KEY_LAYER8 8
  183. //#define MAGIC_KEY_LAYER9 9
  184. //#define MAGIC_KEY_BOOTLOADER B
  185. //#define MAGIC_KEY_BOOTLOADER_ALT ESC
  186. //#define MAGIC_KEY_LOCK CAPS
  187. //#define MAGIC_KEY_EEPROM E
  188. //#define MAGIC_KEY_EEPROM_CLEAR BSPACE
  189. //#define MAGIC_KEY_NKRO N
  190. //#define MAGIC_KEY_SLEEP_LED Z
  191. /*
  192. * Feature disable options
  193. * These options are also useful to firmware size reduction.
  194. */
  195. /* disable debug print */
  196. //#define NO_DEBUG
  197. /* disable print */
  198. //#define NO_PRINT
  199. /* disable action features */
  200. //#define NO_ACTION_LAYER
  201. //#define NO_ACTION_TAPPING
  202. //#define NO_ACTION_ONESHOT
  203. /* disable these deprecated features by default */
  204. #define NO_ACTION_MACRO
  205. #define NO_ACTION_FUNCTION
  206. /*
  207. * MIDI options
  208. */
  209. /* Prevent use of disabled MIDI features in the keymap */
  210. //#define MIDI_ENABLE_STRICT 1
  211. /* enable basic MIDI features:
  212. - MIDI notes can be sent when in Music mode is on
  213. */
  214. //#define MIDI_BASIC
  215. /* enable advanced MIDI features:
  216. - MIDI notes can be added to the keymap
  217. - Octave shift and transpose
  218. - Virtual sustain, portamento, and modulation wheel
  219. - etc.
  220. */
  221. //#define MIDI_ADVANCED
  222. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
  223. //#define MIDI_TONE_KEYCODE_OCTAVES 1
  224. /*
  225. * HD44780 LCD Display Configuration
  226. */
  227. /*
  228. #define LCD_LINES 2 //< number of visible lines of the display
  229. #define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
  230. #define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
  231. #if LCD_IO_MODE
  232. #define LCD_PORT PORTB //< port for the LCD lines
  233. #define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
  234. #define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
  235. #define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
  236. #define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
  237. #define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
  238. #define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
  239. #define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
  240. #define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
  241. #define LCD_RS_PORT LCD_PORT //< port for RS line
  242. #define LCD_RS_PIN 3 //< pin for RS line
  243. #define LCD_RW_PORT LCD_PORT //< port for RW line
  244. #define LCD_RW_PIN 2 //< pin for RW line
  245. #define LCD_E_PORT LCD_PORT //< port for Enable line
  246. #define LCD_E_PIN 1 //< pin for Enable line
  247. #endif
  248. */
  249. /* Bootmagic Lite key configuration */
  250. // #define BOOTMAGIC_LITE_ROW 0
  251. // #define BOOTMAGIC_LITE_COLUMN 0