You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
4.0 KiB

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