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.

75 lines
2.4 KiB

  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. #include "config_common.h"
  4. #define VENDOR_ID 0x1234
  5. #define PRODUCT_ID 0x5678
  6. #define DEVICE_VER 0x0001
  7. #define MANUFACTURER QMK
  8. #define PRODUCT TRACKPOINT-DEMO
  9. #define DESCRIPTION Simple demonstration for IBM Trackpoint integration
  10. #define MATRIX_ROWS 1
  11. #define MATRIX_COLS 3
  12. #ifdef PS2_USE_USART
  13. #define PS2_CLOCK_PORT PORTD
  14. #define PS2_CLOCK_PIN PIND
  15. #define PS2_CLOCK_DDR DDRD
  16. #define PS2_CLOCK_BIT 5
  17. #define PS2_DATA_PORT PORTD
  18. #define PS2_DATA_PIN PIND
  19. #define PS2_DATA_DDR DDRD
  20. #define PS2_DATA_BIT 2
  21. /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
  22. /* set DDR of CLOCK as input to be slave */
  23. #define PS2_USART_INIT() do { \
  24. PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
  25. PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
  26. UCSR1C = ((1 << UMSEL10) | \
  27. (3 << UPM10) | \
  28. (0 << USBS1) | \
  29. (3 << UCSZ10) | \
  30. (0 << UCPOL1)); \
  31. UCSR1A = 0; \
  32. UBRR1H = 0; \
  33. UBRR1L = 0; \
  34. } while (0)
  35. #define PS2_USART_RX_INT_ON() do { \
  36. UCSR1B = ((1 << RXCIE1) | \
  37. (1 << RXEN1)); \
  38. } while (0)
  39. #define PS2_USART_RX_POLL_ON() do { \
  40. UCSR1B = (1 << RXEN1); \
  41. } while (0)
  42. #define PS2_USART_OFF() do { \
  43. UCSR1C = 0; \
  44. UCSR1B &= ~((1 << RXEN1) | \
  45. (1 << TXEN1)); \
  46. } while (0)
  47. #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
  48. #define PS2_USART_RX_DATA UDR1
  49. #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
  50. #define PS2_USART_RX_VECT USART1_RX_vect
  51. #endif
  52. #define MATRIX_COL_PINS { F1, F4, F5 }
  53. #define MATRIX_ROW_PINS { F0 }
  54. #define UNUSED_PINS
  55. /* COL2ROW or ROW2COL */
  56. #define DIODE_DIRECTION COL2ROW
  57. #define DEBOUNCING_DELAY 5
  58. #define LOCKING_SUPPORT_ENABLE
  59. #define LOCKING_RESYNC_ENABLE
  60. /* key combination for command */
  61. #define IS_COMMAND() ( \
  62. keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
  63. )
  64. #endif