config.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. Copyright 2015 Jun Wako <wakojun@gmail.com>
  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. /* USB Device descriptor parameter */
  16. #define VENDOR_ID 0x1c11
  17. #define PRODUCT_ID 0xb04d
  18. #define DEVICE_VER 0x0001
  19. #define MANUFACTURER Input Club
  20. #define PRODUCT Infinity_Ergodox/QMK
  21. #define MOUSEKEY_INTERVAL 20
  22. #define MOUSEKEY_DELAY 0
  23. #define MOUSEKEY_TIME_TO_MAX 60
  24. #define MOUSEKEY_MAX_SPEED 7
  25. #define MOUSEKEY_WHEEL_DELAY 0
  26. #define TAPPING_TOGGLE 1
  27. /* define if matrix has ghost */
  28. //#define MATRIX_HAS_GHOST
  29. #define TAPPING_TERM 200
  30. #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
  31. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  32. #define LOCKING_SUPPORT_ENABLE
  33. /* Locking resynchronize hack */
  34. #define LOCKING_RESYNC_ENABLE
  35. /* key combination for command */
  36. #define IS_COMMAND() ( \
  37. get_mods() == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
  38. get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
  39. )
  40. /* key matrix size */
  41. #define MATRIX_ROWS 18
  42. #define MATRIX_COLS 5
  43. // For some reason, the rows are colums in the schematic, and vice versa
  44. #define MATRIX_ROW_PINS { B2, B3, B18, B19, C0, C9, C10, C11, D0 }
  45. #define MATRIX_COL_PINS { D1, D4, D5, D6, D7 }
  46. #define UNUSED_PINS
  47. /* COL2ROW, ROW2COL */
  48. #define DIODE_DIRECTION ROW2COL
  49. /* Serial config (for communication between halves) */
  50. #define SERIAL_USART_DRIVER SD1 // Only true for the master half
  51. #define SERIAL_USART_CONFIG { (SERIAL_USART_SPEED), } // Only field is speed
  52. #define SERIAL_USART_FULL_DUPLEX
  53. /* number of backlight levels */
  54. #define BACKLIGHT_LEVELS 3
  55. #define LED_BRIGHTNESS_LO 100
  56. #define LED_BRIGHTNESS_HI 255
  57. /* LED matrix driver */
  58. #define LED_DRIVER_ADDR_1 0x74
  59. #define LED_DRIVER_COUNT 1
  60. #define DRIVER_LED_TOTAL 76
  61. #define LED_MATRIX_SPLIT { 38, 38 }
  62. #define LED_DISABLE_WHEN_USB_SUSPENDED
  63. /* i2c (for LED matrix) */
  64. #define I2C1_CLOCK_SPEED 400000
  65. #define I2C1_SCL_PAL_MODE PAL_MODE_ALTERNATIVE_2
  66. #define I2C1_SDA_PAL_MODE PAL_MODE_ALTERNATIVE_2
  67. #define I2C1_BANK GPIOB
  68. #define I2C1_SCL 0
  69. #define I2C1_SDA 1
  70. #ifdef ST7565_ENABLE
  71. /* LCD driver */
  72. # define ST7565_A0_PIN C7
  73. # define ST7565_RST_PIN C8
  74. # define ST7565_SS_PIN C4
  75. # define ST7565_SPI_CLK_DIVISOR 2
  76. # define ST7565_CONTRAST 22
  77. # define ST7565_DISPLAY_WIDTH 128
  78. # define ST7565_DISPLAY_HEIGHT 32
  79. /* SPI (for LCD) */
  80. # define SPI_DRIVER SPID1
  81. # define SPI_SCK_PIN C5
  82. # define SPI_SCK_PAL_MODE PAL_MODE_ALTERNATIVE_2
  83. # define SPI_MOSI_PIN C6
  84. # define SPI_MOSI_PAL_MODE PAL_MODE_ALTERNATIVE_2
  85. # define SPI_MISO_PIN A4 // Just an unused pin, the "normal" MISO pin (C7) is used for other things
  86. # define SPI_MISO_PAL_MODE PAL_MODE_ALTERNATIVE_7 // Default for A4
  87. #endif
  88. /* define if matrix has ghost */
  89. //#define MATRIX_HAS_GHOST
  90. /* Set 0 if debouncing isn't needed */
  91. #define DEBOUNCE 5
  92. #define VISUALIZER_USER_DATA_SIZE 16
  93. /*
  94. * Feature disable options
  95. * These options are also useful to firmware size reduction.
  96. */
  97. /* disable debug print */
  98. //#define NO_DEBUG
  99. /* disable print */
  100. //#define NO_PRINT
  101. /* disable action features */
  102. //#define NO_ACTION_LAYER
  103. //#define NO_ACTION_TAPPING
  104. //#define NO_ACTION_ONESHOT
  105. //#define NO_ACTION_MACRO
  106. //#define NO_ACTION_FUNCTION