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.

66 lines
2.0 KiB

  1. #pragma once
  2. #include "config_common.h"
  3. #define VENDOR_ID 0x1234
  4. #define PRODUCT_ID 0x5678
  5. #define DEVICE_VER 0x0001
  6. #define MANUFACTURER QMK
  7. #define PRODUCT 108Key-Trackpoint
  8. #define MATRIX_ROWS 8
  9. #define MATRIX_COLS 23
  10. #ifdef PS2_USE_USART
  11. #define PS2_CLOCK_PORT PORTD
  12. #define PS2_CLOCK_PIN PIND
  13. #define PS2_CLOCK_DDR DDRD
  14. #define PS2_CLOCK_BIT 5
  15. #define PS2_DATA_PORT PORTD
  16. #define PS2_DATA_PIN PIND
  17. #define PS2_DATA_DDR DDRD
  18. #define PS2_DATA_BIT 2
  19. /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
  20. /* set DDR of CLOCK as input to be slave */
  21. #define PS2_USART_INIT() do { \
  22. PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
  23. PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
  24. UCSR1C = ((1 << UMSEL10) | \
  25. (3 << UPM10) | \
  26. (0 << USBS1) | \
  27. (3 << UCSZ10) | \
  28. (0 << UCPOL1)); \
  29. UCSR1A = 0; \
  30. UBRR1H = 0; \
  31. UBRR1L = 0; \
  32. } while (0)
  33. #define PS2_USART_RX_INT_ON() do { \
  34. UCSR1B = ((1 << RXCIE1) | \
  35. (1 << RXEN1)); \
  36. } while (0)
  37. #define PS2_USART_RX_POLL_ON() do { \
  38. UCSR1B = (1 << RXEN1); \
  39. } while (0)
  40. #define PS2_USART_OFF() do { \
  41. UCSR1C = 0; \
  42. UCSR1B &= ~((1 << RXEN1) | \
  43. (1 << TXEN1)); \
  44. } while (0)
  45. #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
  46. #define PS2_USART_RX_DATA UDR1
  47. #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
  48. #define PS2_USART_RX_VECT USART1_RX_vect
  49. #endif
  50. #define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
  51. #define MATRIX_COL_PINS { C0, C1, C2, C3, C4, C5, C6, C7, D0, D1, F0, D3, D4, F1, D6, D7, E0, E1, E2, E3, E4, E5, E6 }
  52. #define UNUSED_PINS
  53. /* COL2ROW or ROW2COL */
  54. #define DIODE_DIRECTION COL2ROW
  55. #define DEBOUNCE 5
  56. #define LOCKING_SUPPORT_ENABLE
  57. #define LOCKING_RESYNC_ENABLE