config.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * config.h
  3. *
  4. */
  5. #pragma once
  6. #define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE
  7. /* USB Device descriptor parameter */
  8. #define VENDOR_ID 0x4D58 // MX
  9. #define PRODUCT_ID 0x20AD // 8XV2.0 Additional
  10. #define DEVICE_VER 0x0001
  11. #define MANUFACTURER MATRIX
  12. #define PRODUCT 8XV2.0 Additional
  13. /* key matrix size */
  14. #define MATRIX_ROWS 6
  15. #define MATRIX_COLS 16
  16. #define DEF_PIN(port, pin) (((port) << 8) | pin)
  17. #define GET_PORT(pp) (((pp) >> 8) & 0xFF)
  18. #define GET_PIN(pp) ((pp) & 0xFF)
  19. #define ROW1_MASK 0x80
  20. #define ROW2_MASK 0x40
  21. #define ROW3_MASK 0x01
  22. #define ROW4_MASK 0x04
  23. #define ROW5_MASK 0x10
  24. #define ROW6_MASK 0x20
  25. #define ROW_PORT TCA6424_PORT2
  26. #define COL1_MASK 0x02
  27. #define COL2_MASK 0x80
  28. #define COL3_MASK 0x40
  29. #define COL4_MASK 0x20
  30. #define COL5_MASK 0x10
  31. #define COL6_MASK 0x08
  32. #define COL7_MASK 0x04
  33. #define COL8_MASK 0x02
  34. #define COL9_MASK 0x01
  35. #define COL10_MASK 0x80
  36. #define COL11_MASK 0x40
  37. #define COL12_MASK 0x20
  38. #define COL13_MASK 0x10
  39. #define COL14_MASK 0x08
  40. #define COL15_MASK 0x04
  41. #define COL16_MASK 0x02
  42. // Note: MATRIX_ROW_PINS only works with standard pin names.
  43. #define MATRIX_M20_ROW_PINS { \
  44. DEF_PIN(TCA6424_PORT2, 7), \
  45. DEF_PIN(TCA6424_PORT2, 6), \
  46. DEF_PIN(TCA6424_PORT2, 0), \
  47. DEF_PIN(TCA6424_PORT2, 2), \
  48. DEF_PIN(TCA6424_PORT2, 4), \
  49. DEF_PIN(TCA6424_PORT2, 5) }
  50. // Note: MATRIX_COL_PINS only works with standard pin names.
  51. #define MATRIX_M20_COL_PINS { \
  52. DEF_PIN(TCA6424_PORT2, 1), \
  53. DEF_PIN(TCA6424_PORT1, 7), \
  54. DEF_PIN(TCA6424_PORT1, 6), \
  55. DEF_PIN(TCA6424_PORT1, 5), \
  56. DEF_PIN(TCA6424_PORT1, 4), \
  57. DEF_PIN(TCA6424_PORT1, 3), \
  58. DEF_PIN(TCA6424_PORT1, 2), \
  59. DEF_PIN(TCA6424_PORT1, 1), \
  60. DEF_PIN(TCA6424_PORT1, 0), \
  61. DEF_PIN(TCA6424_PORT0, 7), \
  62. DEF_PIN(TCA6424_PORT0, 6), \
  63. DEF_PIN(TCA6424_PORT0, 5), \
  64. DEF_PIN(TCA6424_PORT0, 4), \
  65. DEF_PIN(TCA6424_PORT0, 3), \
  66. DEF_PIN(TCA6424_PORT0, 2), \
  67. DEF_PIN(TCA6424_PORT0, 1) }
  68. #define UNUSED_PINS
  69. #define DIODE_DIRECTION COL2ROW
  70. #define DEBOUNCE 5
  71. // i2c setting
  72. #define I2C1_SCL 8
  73. #define I2C1_SDA 9
  74. #define I2C1_CLOCK_SPEED 400000
  75. #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
  76. // rgb light setting
  77. #define RGB_DI_PIN B4 // reserved pin for future usage
  78. #define RGBLED_NUM 20
  79. #define RGBLIGHT_ANIMATIONS
  80. #define DRIVER_ADDR_1 0b1110100
  81. #define DRIVER_COUNT 1
  82. #define DRIVER_LED_TOTAL RGBLED_NUM