config.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
  18. # if defined(KEYBOARD_planck_light)
  19. # define RGB_DI_PIN A0
  20. # define RGBLED_NUM 13 // Number of LEDs
  21. # endif
  22. # define RGBLIGHT_HUE_STEP 12
  23. # define RGBLIGHT_SAT_STEP 12
  24. # define RGBLIGHT_VAL_STEP 12
  25. # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
  26. # define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
  27. # ifdef RGB_MATRIX_ENABLE
  28. # define RGBLIGHT_DISABLE_KEYCODES
  29. # endif
  30. #endif // RGBLIGHT_ENABLE
  31. #ifdef RGB_MATRIX_ENABLE
  32. # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
  33. // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
  34. # define RGB_MATRIX_FRAMEBUFFER_EFFECTS
  35. // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
  36. // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
  37. # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
  38. # undef RGB_MATRIX_LED_PROCESS_LIMIT
  39. # undef RGB_MATRIX_LED_FLUSH_LIMIT
  40. # ifdef KEYBOARD_planck_rev6
  41. # define DRIVER_LED_TOTAL RGBLED_NUM
  42. # endif
  43. #endif
  44. #if defined(KEYBOARD_lets_split_rev2)
  45. # define USE_SERIAL
  46. # undef USE_I2C
  47. # define EE_HANDS
  48. #endif
  49. #if !defined(KEYBOARD_planck_light)
  50. # ifdef RGBLIGHT_ENABLE
  51. # define NO_MUSIC_MODE
  52. # endif // RGBLIGHT_ENABLE
  53. #else
  54. # undef QMK_ESC_OUTPUT
  55. # define QMK_ESC_OUTPUT E6 // usually COL
  56. # undef QMK_ESC_INPUT
  57. # define QMK_ESC_INPUT B0 // usually ROW
  58. # undef QMK_LED
  59. # define QMK_LED D6
  60. # undef QMK_SPEAKER
  61. # define QMK_SPEAKER B5
  62. # define SOLENOID_PIN A1
  63. #endif // KEYBOARD_planck_light
  64. #if defined(KEYBOARD_planck)
  65. # undef PRODUCT
  66. # if defined(KEYBOARD_planck_light)
  67. # define PRODUCT Drashna Hacked RGB Beacon(Planck Light)
  68. # elif defined(KEYBOARD_planck_rev6)
  69. # define PRODUCT Drashna Hacked Planck Rev6
  70. # elif defined(KEYBOARD_planck_ez)
  71. # define PRODUCT Drashna Hacked Planck EZ
  72. # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
  73. # endif
  74. #endif
  75. #undef NO_USB_STARTUP_CHECK
  76. #define EEPROM_I2C_RM24C512C
  77. #define ENCODER_DIRECTION_FLIP
  78. /*
  79. * MIDI options
  80. */
  81. /* enable basic MIDI features:
  82. - MIDI notes can be sent when in Music mode is on
  83. */
  84. // #define MIDI_BASIC
  85. /* enable advanced MIDI features:
  86. - MIDI notes can be added to the keymap
  87. - Octave shift and transpose
  88. - Virtual sustain, portamento, and modulation wheel
  89. - etc.
  90. */
  91. //#define MIDI_ADVANCED
  92. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
  93. //#define MIDI_TONE_KEYCODE_OCTAVES 2
  94. #define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
  95. #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
  96. #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
  97. /* default 3V ERM vibration motor voltage and library*/
  98. #if FB_ERM_LRA == 0
  99. # define RATED_VOLTAGE 3
  100. # define V_RMS 2.3
  101. # define V_PEAK 3.30
  102. /* Library Selection */
  103. # define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
  104. /* default 2V LRA voltage and library */
  105. #elif FB_ERM_LRA == 1
  106. # define RATED_VOLTAGE 2
  107. # define V_RMS 2.0
  108. # define V_PEAK 2.85
  109. # define F_LRA 200
  110. /* Library Selection */
  111. # define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
  112. #endif
  113. /* Control 1 register settings */
  114. #define DRIVE_TIME 25
  115. #define AC_COUPLE 0
  116. #define STARTUP_BOOST 1
  117. /* Control 2 Settings */
  118. #define BIDIR_INPUT 1
  119. #define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
  120. #define SAMPLE_TIME 3
  121. #define BLANKING_TIME 1
  122. #define IDISS_TIME 1
  123. /* Control 3 settings */
  124. #define NG_THRESH 2
  125. #define ERM_OPEN_LOOP 1
  126. #define SUPPLY_COMP_DIS 0
  127. #define DATA_FORMAT_RTO 0
  128. #define LRA_DRIVE_MODE 0
  129. #define N_PWM_ANALOG 0
  130. #define LRA_OPEN_LOOP 0
  131. /* Control 4 settings */
  132. #define ZC_DET_TIME 0
  133. #define AUTO_CAL_TIME 3