config.h 3.9 KB

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