config.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. Copyright 2023 3araht
  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. /*
  16. * Keyboard Matrix Assignments
  17. *
  18. * Change this to how you wired your keyboard
  19. * COLS: AVR pins used for columns, left to right
  20. * ROWS: AVR pins used for rows, top to bottom
  21. * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
  22. * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
  23. *
  24. */
  25. #define MATRIX_ROW_PINS { B5, B4, E6, D7, C6, D4 }
  26. #define MATRIX_COL_PINS { B1, F7, F6, F5, F4, B3, B2, B6, D0, D1 }
  27. #define MATRIX_ROW_PINS_RIGHT { D1, D0, D4, C6, D7, E6 }
  28. #define MATRIX_COL_PINS_RIGHT { F4, F5, F6, F7, B1, B3, B2, C7, B7, F1 }
  29. /* COL2ROW, ROW2COL */
  30. #define DIODE_DIRECTION COL2ROW
  31. // Right side has to be the master since 1, LED data is output from right side, and 2, Audio pin is prepared on right side as a reserve.
  32. #define MASTER_RIGHT
  33. // for "Generic" Promicro to be detected correctly as lefthand side (slave)
  34. #define SPLIT_USB_DETECT
  35. /* ws2812 RGB LED */
  36. #define RGB_DI_PIN D3
  37. #ifdef RGBLIGHT_ENABLE
  38. # define RGBLED_NUM 123
  39. // Do not define "RGBLED_SPLIT" since somehow it doesn't work well yet.
  40. // Even thhough "#define RGBLED_SPLIT { 60, 63 }" was set, LEDs on the sub keyboad side didn't turn on.
  41. // Not sure but rgblight_sethsv_at() might not support RGBLED_SPLIT yet.
  42. // Instead, LED data is tranferred from right side to the left via TRRS cable.
  43. # define RGBLIGHT_LIMIT_VAL 80
  44. # define RGBLIGHT_LAYERS
  45. // By default, LEDs of the buttons which are pressed turn on.
  46. // # define RGBLIGHT_EFFECT_TWINKLE
  47. // # define RGBLIGHT_EFFECT_KNIGHT
  48. // RGBLIGHT LED MAP
  49. // Right 1st row (12 LEDs)
  50. // ENCODER
  51. // Right 2nd .. 5th row(13, 12, 13, 12 LEDs)
  52. // Left 1st .. 5th row (12 LEDs x 5 rows)
  53. # define RGBLIGHT_LED_MAP { \
  54. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, \
  55. 97, \
  56. 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, \
  57. 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, \
  58. 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, \
  59. 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, \
  60. \
  61. 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \
  62. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, \
  63. 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, \
  64. 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
  65. 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48 \
  66. }
  67. #endif
  68. #ifdef RGB_MATRIX_ENABLE
  69. /* ws2812 RGB MATRIX */
  70. # define RGB_MATRIX_LED_COUNT 123
  71. # define RGB_MATRIX_KEYPRESSES // reacts to keypresses
  72. // for all fingers used at once.
  73. # define LED_HITS_TO_REMEMBER 10
  74. # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 50
  75. // the above brighness setting has no effect on rgb_matrix_set_color().
  76. // Use darker colors instead.
  77. /* RGB darker COLORS */
  78. # define RGB_DARKWHITE 0x66, 0x66, 0x66
  79. # define RGB_DARKRED 0x66, 0x0, 0x0
  80. # define RGB_DARKCORAL 0x66, 0x31, 0x1E
  81. # define RGB_DARKORANGE 0x66, 0x33, 0x0
  82. # define RGB_DARKGOLDENROD 0x56, 0x42, 0xD
  83. # define RGB_DARKGOLD 0x66, 0x56, 0x0
  84. # define RGB_DARKYELLOW 0x66, 0x66, 0x0
  85. # define RGB_DARKCHARTREUSE 0x33, 0x66, 0x0
  86. # define RGB_DARKGREEN 0x0, 0x66, 0x0
  87. # define RGB_DARKSPRINGGREEN 0x0, 0x66, 0x33
  88. # define RGB_DARKTURQUOISE 0x1C, 0x2C, 0x2A
  89. # define RGB_DARKTEAL 0x0, 0x33, 0x33
  90. # define RGB_DARKCYAN 0x0, 0x66, 0x66
  91. # define RGB_DARKAZURE 0x3D, 0x62, 0x66
  92. # define RGB_DARKBLUE 0x0, 0x0, 0x66
  93. # define RGB_DARKPURPLE 0x30, 0x0, 0x66
  94. # define RGB_DARKMAGENTA 0x66, 0x0, 0x66
  95. # define RGB_DARKPINK 0x66, 0x33, 0x4C
  96. // https://docs.qmk.fm/#/feature_rgb_matrix
  97. // Enable suspend mode.
  98. // # define RGB_DISABLE_WHEN_USB_SUSPENDED true
  99. # define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
  100. // #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
  101. // #define ENABLE_RGB_MATRIX_BREATHING
  102. // #define ENABLE_RGB_MATRIX_BAND_SAT
  103. // #define ENABLE_RGB_MATRIX_BAND_VAL
  104. // #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
  105. // #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
  106. // #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
  107. // #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
  108. // #define ENABLE_RGB_MATRIX_CYCLE_ALL
  109. // #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
  110. // #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
  111. # define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
  112. // #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
  113. // #define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
  114. // #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
  115. // #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
  116. // #define ENABLE_RGB_MATRIX_DUAL_BEACON
  117. // # define ENABLE_RGB_MATRIX_RAINBOW_BEACON
  118. // #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
  119. // #define ENABLE_RGB_MATRIX_RAINDROPS
  120. // #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
  121. # define ENABLE_RGB_MATRIX_HUE_BREATHING
  122. // #define ENABLE_RGB_MATRIX_HUE_PENDULUM
  123. // #define ENABLE_RGB_MATRIX_HUE_WAVE
  124. // #define ENABLE_RGB_MATRIX_TYPING_HEATMAP
  125. // #define ENABLE_RGB_MATRIX_DIGITAL_RAIN
  126. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
  127. # define ENABLE_RGB_MATRIX_SOLID_REACTIVE
  128. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
  129. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
  130. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
  131. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
  132. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
  133. // #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
  134. // #define ENABLE_RGB_MATRIX_SPLASH
  135. # define ENABLE_RGB_MATRIX_MULTISPLASH
  136. // #define ENABLE_RGB_MATRIX_SOLID_SPLASH
  137. // #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
  138. #endif // RGB_MATRIX_ENABLE
  139. /*
  140. * Feature disable options
  141. * These options are also useful to firmware size reduction.
  142. */
  143. /* disable debug print */
  144. //#define NO_DEBUG
  145. /* disable print */
  146. //#define NO_PRINT
  147. /* disable action features */
  148. //#define NO_ACTION_LAYER
  149. //#define NO_ACTION_TAPPING
  150. //#define NO_ACTION_ONESHOT
  151. /* Audio */
  152. #ifdef AUDIO_ENABLE
  153. # define AUDIO_PIN B5 // use EX1 = PB5 = PIN9 as Audio output
  154. // #define DAC_SAMPLE_MAX 32768U
  155. # define DAC_SAMPLE_MAX 65535U
  156. // #define AUDIO_CLICKY
  157. # define NO_MUSIC_MODE
  158. // #define STARTUP_SONG SONG(FANTASIE_IMPROMPTU)
  159. // #define STARTUP_SONG SONG(NOCTURNE_OP_9_NO_1)
  160. // #define STARTUP_SONG SONG(USSR_ANTHEM)
  161. // #define STARTUP_SONG SONG(CAMPANELLA)
  162. #endif
  163. /*
  164. * MIDI options
  165. */
  166. /* enable basic MIDI features:
  167. - MIDI notes can be sent when in Music mode is on
  168. */
  169. //#define MIDI_BASIC
  170. /* enable advanced MIDI features:
  171. - MIDI notes can be added to the keymap
  172. - Octave shift and transpose
  173. - Virtual sustain, portamento, and modulation wheel
  174. - etc.
  175. */
  176. #ifdef MIDI_ENABLE
  177. # define MIDI_ADVANCED
  178. // Initial velocity value (avoid using 127 since it is used as a special number in some sound sources.)
  179. # define MIDI_INITIAL_VELOCITY 117
  180. #endif // MIDI_ENABLE
  181. #define TAP_CODE_DELAY 10
  182. /* 2021/01/22 added to shrink firmware size */
  183. // NO_ACTION_TAPPING -1964 bytes, however, this disables Layer mods...
  184. // #define NO_ACTION_TAPPING
  185. // NO_ACTION_ONESHOT -388 bytes
  186. #define NO_ACTION_ONESHOT
  187. /*
  188. * Encoder options
  189. */
  190. #ifdef ENCODER_ENABLE
  191. # define ENCODER_RESOLUTIONS_RIGHT { 4 }
  192. #endif // ENCODER_ENABLE