config.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
  36. # define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
  37. # undef RGB_MATRIX_LED_PROCESS_LIMIT
  38. # undef RGB_MATRIX_LED_FLUSH_LIMIT
  39. # ifdef KEYBOARD_planck_rev6
  40. # define RGB_MATRIX_LED_COUNT RGBLED_NUM
  41. # endif
  42. #endif
  43. #if defined(KEYBOARD_lets_split_rev2)
  44. # undef USE_I2C
  45. # define EE_HANDS
  46. #endif
  47. #if !defined(KEYBOARD_planck_light)
  48. # ifdef RGBLIGHT_ENABLE
  49. # define NO_MUSIC_MODE
  50. # endif // RGBLIGHT_ENABLE
  51. #else
  52. # undef QMK_ESC_OUTPUT
  53. # define QMK_ESC_OUTPUT E6 // usually COL
  54. # undef QMK_ESC_INPUT
  55. # define QMK_ESC_INPUT B0 // usually ROW
  56. # undef QMK_LED
  57. # define QMK_LED D6
  58. # undef QMK_SPEAKER
  59. # define QMK_SPEAKER B5
  60. # define SOLENOID_PIN A1
  61. #endif // KEYBOARD_planck_light
  62. #if defined(KEYBOARD_planck)
  63. # undef PRODUCT
  64. # if defined(KEYBOARD_planck_light)
  65. # define PRODUCT "Drashna Hacked RGB Beacon(Planck Light)"
  66. # elif defined(KEYBOARD_planck_rev6)
  67. # define PRODUCT "Drashna Hacked Planck Rev6"
  68. # elif defined(KEYBOARD_planck_ez)
  69. # define PRODUCT "Drashna Hacked Planck EZ"
  70. # define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
  71. # endif
  72. #endif
  73. #undef NO_USB_STARTUP_CHECK
  74. #define EEPROM_I2C_RM24C512C
  75. #define ENCODER_DIRECTION_FLIP
  76. /*
  77. * MIDI options
  78. */
  79. /* enable basic MIDI features:
  80. - MIDI notes can be sent when in Music mode is on
  81. */
  82. // #define MIDI_BASIC
  83. /* enable advanced MIDI features:
  84. - MIDI notes can be added to the keymap
  85. - Octave shift and transpose
  86. - Virtual sustain, portamento, and modulation wheel
  87. - etc.
  88. */
  89. //#define MIDI_ADVANCED
  90. /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
  91. //#define MIDI_TONE_KEYCODE_OCTAVES 2
  92. #define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
  93. #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
  94. #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
  95. /* default 3V ERM vibration motor voltage and library*/
  96. #if FB_ERM_LRA == 0
  97. # define RATED_VOLTAGE 3
  98. # define V_RMS 2.3
  99. # define V_PEAK 3.30
  100. /* Library Selection */
  101. # define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
  102. /* default 2V LRA voltage and library */
  103. #elif FB_ERM_LRA == 1
  104. # define RATED_VOLTAGE 2
  105. # define V_RMS 2.0
  106. # define V_PEAK 2.85
  107. # define F_LRA 200
  108. /* Library Selection */
  109. # define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
  110. #endif
  111. /* Control 1 register settings */
  112. #define DRIVE_TIME 25
  113. #define AC_COUPLE 0
  114. #define STARTUP_BOOST 1
  115. /* Control 2 Settings */
  116. #define BIDIR_INPUT 1
  117. #define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
  118. #define SAMPLE_TIME 3
  119. #define BLANKING_TIME 1
  120. #define IDISS_TIME 1
  121. /* Control 3 settings */
  122. #define NG_THRESH 2
  123. #define ERM_OPEN_LOOP 1
  124. #define SUPPLY_COMP_DIS 0
  125. #define DATA_FORMAT_RTO 0
  126. #define LRA_DRIVE_MODE 0
  127. #define N_PWM_ANALOG 0
  128. #define LRA_OPEN_LOOP 0
  129. /* Control 4 settings */
  130. #define ZC_DET_TIME 0
  131. #define AUTO_CAL_TIME 3