config.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 0x0200
  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 6
  27. #define DIODE_DIRECTION COL2ROW
  28. // wiring of each half
  29. #define MATRIX_ROW_PINS { F4, F5, B1, B3 }
  30. #define MATRIX_COL_PINS { D3, D2, B4, F6, F7, B2 }
  31. //#define USE_I2C
  32. #define USE_SERIAL
  33. #define SOFT_SERIAL_PIN D1
  34. //#define EE_HANDS
  35. #define SPLIT_HAND_PIN E6
  36. /* Set 0 if debouncing isn't needed */
  37. #define DEBOUNCE 5
  38. #define QMK_ESC_OUTPUT D3
  39. #define QMK_ESC_INPUT B1
  40. #define PHYSICAL_LEDS_ENABLE
  41. #define IOS_DEVICE_ENABLE
  42. #ifdef BACKLIGHT_ENABLE
  43. #define BACKLIGHT_PIN C6
  44. #define BACKLIGHT_LEVELS 5
  45. // #define BACKLIGHT_BREATHING //not working with splits right now
  46. #define BREATHING_PERIOD 6
  47. #endif
  48. /* ws2812 RGB LED */
  49. #define RGB_DI_PIN D4
  50. #define RGBLIGHT_TIMER
  51. #define RGBLED_NUM 7 // Number of LEDs
  52. #define RGBLIGHT_ANIMATIONS //not working with splits right now
  53. #define RGBLIGHT_SLEEP
  54. #define RGBLIGHT_SPLIT
  55. #ifndef IOS_DEVICE_ENABLE
  56. #if RGBLED_NUM <= 6
  57. #define RGBLIGHT_LIMIT_VAL 255
  58. #else
  59. #define RGBLIGHT_LIMIT_VAL 130
  60. #endif
  61. #define RGBLIGHT_VAL_STEP 8
  62. #else
  63. #if RGBLED_NUM <= 6
  64. #define RGBLIGHT_LIMIT_VAL 90
  65. #else
  66. #define RGBLIGHT_LIMIT_VAL 45
  67. #endif
  68. #define RGBLIGHT_VAL_STEP 4
  69. #endif
  70. #define RGBLIGHT_HUE_STEP 10
  71. #define RGBLIGHT_SAT_STEP 17
  72. #if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
  73. #define USB_MAX_POWER_CONSUMPTION 400
  74. #else
  75. // iOS device need lessthan 100
  76. #define USB_MAX_POWER_CONSUMPTION 100
  77. #endif
  78. #define NUM_LOCK_LED_PIN D7
  79. #define CAPS_LOCK_LED_PIN B5
  80. #define SCROLL_LOCK_LED_PIN B6
  81. // #define NUM_NMOSFET //uncomment this if you using n-mosfet
  82. // #define CAPS_NMOSFET //uncomment this if you using n-mosfet
  83. // #define SCROLL_NMOSFET //uncomment this if you using n-mosfet
  84. // #define NUM_INVERT // uncomment this if you want to reverse logic of numlock
  85. // This will make it light up only when lock is off
  86. // (Doesn't work on mac. There is no num lock, so it will be always off and lit)
  87. #ifdef NUM_NMOSFET
  88. #define RESET_NUM_LOCK_LED() writePinLow(NUM_LOCK_LED_PIN)
  89. #ifdef NUM_INVERT
  90. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  91. #else
  92. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  93. #endif // NUM_INVERT
  94. #else
  95. #define RESET_NUM_LOCK_LED() writePinHigh(NUM_LOCK_LED_PIN)
  96. #ifdef NUM_INVERT
  97. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, led_state.num_lock)
  98. #else
  99. #define UPDATE_NUM_LOCK_LED() writePin(NUM_LOCK_LED_PIN, !led_state.num_lock)
  100. #endif // NUM_INVERT
  101. #endif // NUM_NMOSFET
  102. #ifdef CAPS_NMOSFET
  103. #define RESET_CAPS_LOCK_LED() writePinLow(CAPS_LOCK_LED_PIN)
  104. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, led_state.caps_lock)
  105. #else
  106. #define RESET_CAPS_LOCK_LED() writePinHigh(CAPS_LOCK_LED_PIN)
  107. #define UPDATE_CAPS_LOCK_LED() writePin(CAPS_LOCK_LED_PIN, !led_state.caps_lock)
  108. #endif // CAPS_NMOSFET
  109. #ifdef SCROLL_NMOSFET
  110. #define RESET_SCROLL_LOCK_LED() writePinLow(SCROLL_LOCK_LED_PIN)
  111. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, led_state.scroll_lock)
  112. #else
  113. #define RESET_SCROLL_LOCK_LED() writePinHigh(SCROLL_LOCK_LED_PIN)
  114. #define UPDATE_SCROLL_LOCK_LED() writePin(SCROLL_LOCK_LED_PIN, !led_state.scroll_lock)
  115. #endif // SCROLL_NMOSFET