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.

159 lines
5.4 KiB

  1. /*
  2. Copyright 2019 Yiancar
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #pragma once
  15. #include "config_common.h"
  16. /* USB Device descriptor parameter */
  17. #define VENDOR_ID 0x8968
  18. #define PRODUCT_ID 0x4E4B
  19. #define DEVICE_VER 0x0001
  20. #define MANUFACTURER Yiancar-Designs
  21. #define PRODUCT NK65
  22. /* key matrix size */
  23. #define MATRIX_ROWS 5
  24. #define MATRIX_COLS 15
  25. #define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 }
  26. #define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3, A5 }
  27. // To enable debugger set A13 A14 -> A5 A7
  28. /* COL2ROW, ROW2COL*/
  29. #define DIODE_DIRECTION COL2ROW
  30. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  31. #define DEBOUNCE 5
  32. /* define if matrix has ghost (lacks anti-ghosting diodes) */
  33. //#define MATRIX_HAS_GHOST
  34. /* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
  35. * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
  36. */
  37. // #define GRAVE_ESC_CTRL_OVERRIDE
  38. /*
  39. * Force NKRO
  40. *
  41. * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
  42. * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
  43. * makefile for this to work.)
  44. *
  45. * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
  46. * until the next keyboard reset.
  47. *
  48. * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
  49. * fully operational during normal computer usage.
  50. *
  51. * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
  52. * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
  53. * bootmagic, NKRO mode will always be enabled until it is toggled again during a
  54. * power-up.
  55. *
  56. */
  57. //#define FORCE_NKRO
  58. /*
  59. * Magic Key Options
  60. *
  61. * Magic keys are hotkey commands that allow control over firmware functions of
  62. * the keyboard. They are best used in combination with the HID Listen program,
  63. * found here: https://www.pjrc.com/teensy/hid_listen.html
  64. *
  65. * The options below allow the magic key functionality to be changed. This is
  66. * useful if your keyboard/keypad is missing keys and you want magic key support.
  67. *
  68. */
  69. /* Bootmagic Lite key configuration */
  70. #define BOOTMAGIC_LITE_ROW 0
  71. #define BOOTMAGIC_LITE_COLUMN 0
  72. /* Backlight options */
  73. #define RGB_BACKLIGHT_ENABLED 1
  74. #define RGB_BACKLIGHT_NK65
  75. // they aren't really used if RGB_BACKLIGHT_HS60 defined
  76. #define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
  77. #define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
  78. #define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
  79. #define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
  80. #define RGB_BACKLIGHT_USE_ISO_ENTER 0
  81. #define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
  82. // disable backlight when USB suspended (PC sleep/hibernate/shutdown)
  83. #define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
  84. // disable backlight after timeout in minutes, 0 = no timeout
  85. #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
  86. // the default brightness
  87. #define RGB_BACKLIGHT_BRIGHTNESS 255
  88. // the default effect (RGB test)
  89. #define RGB_BACKLIGHT_EFFECT 6
  90. // the default effect speed (0-3)
  91. #define RGB_BACKLIGHT_EFFECT_SPEED 0
  92. // the default color1 and color2
  93. #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
  94. #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
  95. #define DRIVER_COUNT 2
  96. #define DRIVER_LED_TOTAL 128
  97. // These define which keys in the matrix are alphas/mods
  98. // Used for backlight effects so colors are different for
  99. // alphas vs. mods
  100. // Each value is for a row, bit 0 is column 0
  101. // Alpha=0 Mod=1
  102. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001
  103. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001
  104. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0110000000000001
  105. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001
  106. #define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111111000000111
  107. #define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
  108. #define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
  109. #define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
  110. #define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
  111. // Backlight config starts after VIA's EEPROM usage,
  112. // dynamic keymaps start after this.
  113. #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 32
  114. // VIA lighting is handled by the keyboard-level code
  115. #define VIA_CUSTOM_LIGHTING_ENABLE
  116. /* Custom EEPROM start addressing. This is to support
  117. * both 128kb and 256kb versions of F303.
  118. * Register 0x1FFFF7CC holds the size of the flash memory.
  119. */
  120. #ifndef FLASHSIZE_BASE
  121. # define FLASHSIZE_BASE ((uint32_t)0x1FFFF7CCU) /*!< FLASH Size register base address */
  122. #endif
  123. #define FEE_MCU_FLASH_SIZE_IGNORE_CHECK
  124. #define FEE_MCU_FLASH_SIZE \
  125. ({ \
  126. uint16_t (*flash_size) = (uint16_t*)FLASHSIZE_BASE; \
  127. *flash_size; \
  128. })