config.h 2.1 KB

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