config.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. Copyright 2012 Jun Wako <wakojun@gmail.com>
  3. Copyright 2015 Jack Humbert
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 2 of the License, or
  7. (at your option) any later version.
  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. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #pragma once
  16. #include "config_common.h"
  17. /* USB Device descriptor parameter */
  18. #define VENDOR_ID 0xC0DE
  19. #define PRODUCT_ID 0x1337
  20. #define DEVICE_VER 0x0100
  21. #define MANUFACTURER KgOfHedgehogs
  22. #define PRODUCT Jian
  23. /* key matrix size */
  24. // Rows are doubled-up
  25. #define MATRIX_ROWS 8
  26. #define MATRIX_COLS 7
  27. #define DIODE_DIRECTION COL2ROW
  28. // wiring of each half
  29. #define MATRIX_ROW_PINS { D3, D2, E6, B4 }
  30. #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 }
  31. /* Use I2C or Serial, not both */
  32. // #define USE_SERIAL
  33. #define USE_I2C
  34. /* Select hand configuration */
  35. // #define MASTER_LEFT
  36. // #define MASTER_RIGHT
  37. #define EE_HANDS
  38. // different Jian configs
  39. #define DIPS_ENABLE
  40. #define PHYSICAL_LEDS_ENABLE
  41. #define NUM_LOCK_LED_PIN C6
  42. #define CAPS_LOCK_LED_PIN D7
  43. #define SCROLL_LOCK_LED_PIN B5
  44. // #define NUM_NMOSFET //uncomment this if you using n-mosfet
  45. // #define CAPS_NMOSFET //uncomment this if you using n-mosfet
  46. // #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
  47. // #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
  48. // This will make it light up only when lock is off
  49. // (Doesn't work on mac. There is no num lock, so it will be always off and lit)
  50. #ifdef NUM_NMOSFET
  51. #define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
  52. #ifdef NUM_INVERT
  53. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  54. #else
  55. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  56. #endif // NUM_INVERT
  57. #else
  58. #define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
  59. #ifdef NUM_INVERT
  60. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  61. #else
  62. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  63. #endif // NUM_INVERT
  64. #endif // NUM_NMOSFET
  65. #ifdef CAPS_NMOSFET
  66. #define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
  67. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
  68. #else
  69. #define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
  70. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
  71. #endif // CAPS_NMOSFET
  72. #ifdef SCROLL_NMOSFET
  73. #define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
  74. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
  75. #else
  76. #define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
  77. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
  78. #endif // SCROLL_NMOSFET
  79. /* Set 0 if debouncing isn't needed */
  80. #define DEBOUNCE 5
  81. #ifdef BACKLIGHT_ENABLE
  82. #define BACKLIGHT_PIN B6
  83. #define BACKLIGHT_LEVELS 5
  84. //#define BACKLIGHT_BREATHING //not working with splits right now
  85. #define BREATHING_PERIOD 6
  86. #endif
  87. /* ws2812 RGB LED */
  88. #define RGB_DI_PIN D4
  89. #define RGBLIGHT_TIMER
  90. #define RGBLED_NUM 7 // Number of LEDs
  91. #define RGBLIGHT_ANIMATIONS //not working with splits right now
  92. #define RGBLIGHT_SLEEP
  93. #define RGBLIGHT_SPLIT
  94. #ifndef IOS_DEVICE_ENABLE
  95. #if RGBLED_NUM <= 6
  96. #define RGBLIGHT_LIMIT_VAL 255
  97. #else
  98. #define RGBLIGHT_LIMIT_VAL 130
  99. #endif
  100. #define RGBLIGHT_VAL_STEP 8
  101. #else
  102. #if RGBLED_NUM <= 6
  103. #define RGBLIGHT_LIMIT_VAL 90
  104. #else
  105. #define RGBLIGHT_LIMIT_VAL 45
  106. #endif
  107. #define RGBLIGHT_VAL_STEP 4
  108. #endif
  109. #define RGBLIGHT_HUE_STEP 10
  110. #define RGBLIGHT_SAT_STEP 17
  111. #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
  112. #define USB_MAX_POWER_CONSUMPTION 400
  113. #else
  114. // iOS device need lessthan 100
  115. #define USB_MAX_POWER_CONSUMPTION 100
  116. #endif