config.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * config.h
  3. *
  4. * Copyright 2020 astro <yuleiz@gmail.com>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #pragma once
  20. /* key matrix size */
  21. #define MATRIX_ROWS 6
  22. #define MATRIX_COLS 16
  23. #define DEF_PIN(port, pin) (((port) << 8) | pin)
  24. #define GET_PORT(pp) (((pp) >> 8) & 0xFF)
  25. #define GET_PIN(pp) ((pp) & 0xFF)
  26. #define CUSTOM_MATRIX_ROW_PINS { \
  27. DEF_PIN(TCA6424_PORT2, 7), \
  28. DEF_PIN(TCA6424_PORT2, 6), \
  29. DEF_PIN(TCA6424_PORT2, 0), \
  30. DEF_PIN(TCA6424_PORT2, 2), \
  31. DEF_PIN(TCA6424_PORT2, 4), \
  32. DEF_PIN(TCA6424_PORT2, 5) }
  33. #define CUSTOM_MATRIX_COL_PINS { \
  34. DEF_PIN(TCA6424_PORT2, 1), \
  35. DEF_PIN(TCA6424_PORT1, 7), \
  36. DEF_PIN(TCA6424_PORT1, 6), \
  37. DEF_PIN(TCA6424_PORT1, 5), \
  38. DEF_PIN(TCA6424_PORT1, 4), \
  39. DEF_PIN(TCA6424_PORT1, 3), \
  40. DEF_PIN(TCA6424_PORT1, 2), \
  41. DEF_PIN(TCA6424_PORT1, 1), \
  42. DEF_PIN(TCA6424_PORT1, 0), \
  43. DEF_PIN(TCA6424_PORT0, 7), \
  44. DEF_PIN(TCA6424_PORT0, 6), \
  45. DEF_PIN(TCA6424_PORT0, 5), \
  46. DEF_PIN(TCA6424_PORT0, 4), \
  47. DEF_PIN(TCA6424_PORT0, 3), \
  48. DEF_PIN(TCA6424_PORT0, 2), \
  49. DEF_PIN(TCA6424_PORT0, 1) }
  50. #define ROW1_MASK 0x80
  51. #define ROW2_MASK 0x40
  52. #define ROW3_MASK 0x01
  53. #define ROW4_MASK 0x04
  54. #define ROW5_MASK 0x10
  55. #define ROW6_MASK 0x20
  56. #define ROW_PORT TCA6424_PORT2
  57. #define COL1_MASK 0x02
  58. #define COL2_MASK 0x80
  59. #define COL3_MASK 0x40
  60. #define COL4_MASK 0x20
  61. #define COL5_MASK 0x10
  62. #define COL6_MASK 0x08
  63. #define COL7_MASK 0x04
  64. #define COL8_MASK 0x02
  65. #define COL9_MASK 0x01
  66. #define COL10_MASK 0x80
  67. #define COL11_MASK 0x40
  68. #define COL12_MASK 0x20
  69. #define COL13_MASK 0x10
  70. #define COL14_MASK 0x08
  71. #define COL15_MASK 0x04
  72. #define COL16_MASK 0x02
  73. #define UNUSED_PINS
  74. #define DIODE_DIRECTION COL2ROW
  75. #define DEBOUNCE 5
  76. // i2c setting
  77. #define USE_I2CV1
  78. #define I2C1_SCL 8
  79. #define I2C1_SDA 9
  80. #define I2C1_CLOCK_SPEED 400000
  81. #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
  82. // rgb light setting
  83. #define RGBLED_NUM 9
  84. #define RGB_DI_PIN B4
  85. #define RGBLIGHT_ANIMATIONS
  86. #define AW9523B_RGB_NUM 4
  87. #define EARLY_INIT_PERFORM_BOOTLOADER_JUMP FALSE