config.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 0x0000
  18. #define DEVICE_VER 0x0001
  19. #define MANUFACTURER Pierre
  20. #define PRODUCT Ferris the keeb
  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 14
  27. #define UNUSED_MCP 7
  28. // wiring
  29. #define MATRIX_ROW_PINS_MCU \
  30. { B3, B2, B1, F0 }
  31. #define MATRIX_COL_PINS_MCU \
  32. { D6, D7, B4, B5, B6 }
  33. #define UNUSED_PINS_MCU \
  34. { B0, B7, C6, C7, D2, D3, D4, D5, E6, F1, F4, F5, F6, F7 }
  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. /* COL2ROW, ROW2COL*/
  42. #define DIODE_DIRECTION COL2ROW
  43. /* define if matrix has ghost (lacks anti-ghosting diodes) */
  44. //#define MATRIX_HAS_GHOST
  45. /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
  46. #define DEBOUNCE 5