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.

80 lines
2.3 KiB

  1. /*
  2. Copyright 2020 Pierre Chevalier <pierrechevalier83@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 0xC2AB
  17. #define PRODUCT_ID 0x0001
  18. #define DEVICE_VER 0x0002
  19. #define MANUFACTURER Cuddly Keyboards Ltd.
  20. #define PRODUCT Ferris 0.2
  21. /* key matrix size */
  22. #define MATRIX_ROWS 8
  23. #define MATRIX_COLS 10
  24. #define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2)
  25. #define MATRIX_COLS_PER_SIDE (MATRIX_COLS / 2)
  26. #define UNUSED_MCU 24
  27. #define UNUSED_MCP 7
  28. // wiring
  29. #define MATRIX_ROW_PINS_MCU \
  30. { B7, B6, B5, A2 }
  31. #define MATRIX_COL_PINS_MCU \
  32. { B8, B4, B3, A15, A14 }
  33. #define UNUSED_PINS_MCU \
  34. { A0, A1, A3, A4, A5, A6, A7, A8, A9, A10, A13, B0, B1, B2, B9, B12, B13, B14, B15, C13, C14, C15, F0, F1 }
  35. #define MATRIX_ROW_PINS_MCP \
  36. { B0, B1, B2, B3 }
  37. #define MATRIX_COL_PINS_MCP \
  38. { A0, A1, A2, A3, A4 }
  39. #define UNUSED_PINS_MCP \
  40. { B4, B5, B6, B7, A5, A6, A7 }
  41. #define MATRIX_ROW_PINS \
  42. { B7, B6, B5, A2, A0, A0, A0, A0 }
  43. #define MATRIX_COL_PINS \
  44. { B8, B4, B3, A15, A14, A1, A1, A1, A1, A1 }
  45. #define UNUSED_PINS \
  46. { A3, A4, A5, A6, A7, A8, A9, A10, A13, B0, B1, B2, B9, B12, B13, B14, B15, C13, C14, C15, F0, F1 }
  47. /* COL2ROW, ROW2COL*/
  48. #define DIODE_DIRECTION COL2ROW
  49. /* define if matrix has ghost (lacks anti-ghosting diodes) */
  50. //#define MATRIX_HAS_GHOST
  51. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  52. #define DEBOUNCE 5
  53. /* i2c settings */
  54. #define I2C_DRIVER I2CD2
  55. #define I2C1_SCL_BANK GPIOB
  56. #define I2C1_SCL 10
  57. #define I2C1_SDA_BANK GPIOB
  58. #define I2C1_SDA 11
  59. #define I2C1_TIMINGR_PRESC 2U
  60. #define I2C1_TIMINGR_SCLDEL 1U
  61. #define I2C1_TIMINGR_SDADEL 0U
  62. #define I2C1_TIMINGR_SCLH 9U
  63. #define I2C1_TIMINGR_SCLL 26U
  64. #define I2C1_SCL_PAL_MODE 1
  65. #define I2C1_SDA_PAL_MODE 1