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.

117 lines
3.6 KiB

  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. #include "config_common.h"
  4. /* USB Device descriptor parameter */
  5. #define VENDOR_ID 0xFEED
  6. #define PRODUCT_ID 0x6060
  7. #define DEVICE_VER 0x0001
  8. #define MANUFACTURER inachie
  9. #define PRODUCT paladin64
  10. #define DESCRIPTION Paladin64 ALPS 64 keyboard with trackpoint and underglow
  11. /* key matrix size */
  12. #define MATRIX_ROWS 8
  13. #define MATRIX_COLS 8
  14. #ifdef PS2_USE_USART
  15. #define PS2_CLOCK_PORT PORTD
  16. #define PS2_CLOCK_PIN PIND
  17. #define PS2_CLOCK_DDR DDRD
  18. #define PS2_CLOCK_BIT 5
  19. #define PS2_DATA_PORT PORTD
  20. #define PS2_DATA_PIN PIND
  21. #define PS2_DATA_DDR DDRD
  22. #define PS2_DATA_BIT 2
  23. /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling
  24. * edge */
  25. /* set DDR of CLOCK as input to be slave */
  26. #define PS2_USART_INIT() do { \
  27. PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
  28. PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
  29. UCSR1C = ((1 << UMSEL10) | \
  30. (3 << UPM10) | \
  31. (0 << USBS1) | \
  32. (3 << UCSZ10) | \
  33. (0 << UCPOL1)); \
  34. UCSR1A = 0; \
  35. UBRR1H = 0; \
  36. UBRR1L = 0; \
  37. } while (0)
  38. #define PS2_USART_RX_INT_ON() do { \
  39. UCSR1B = ((1 << RXCIE1) | \
  40. (1 << RXEN1)); \
  41. } while (0)
  42. #define PS2_USART_RX_POLL_ON() do { \
  43. UCSR1B = (1 << RXEN1); \
  44. } while (0)
  45. #define PS2_USART_OFF() do { \
  46. UCSR1C = 0; \
  47. UCSR1B &= ~((1 << RXEN1) | \
  48. (1 << TXEN1)); \
  49. } while (0)
  50. #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
  51. #define PS2_USART_RX_DATA UDR1
  52. #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
  53. #define PS2_USART_RX_VECT USART1_RX_vect
  54. #endif
  55. #ifdef PS2_USE_INT
  56. #define PS2_CLOCK_PORT PORTD
  57. #define PS2_CLOCK_PIN PIND
  58. #define PS2_CLOCK_DDR DDRD
  59. #define PS2_CLOCK_BIT 2
  60. #define PS2_DATA_PORT PORTD
  61. #define PS2_DATA_PIN PIND
  62. #define PS2_DATA_DDR DDRD
  63. #define PS2_DATA_BIT 5
  64. #define PS2_INT_INIT() do { \
  65. EICRA |= ((1<<ISC21) | \
  66. (0<<ISC20)); \
  67. } while (0)
  68. #define PS2_INT_ON() do { \
  69. EIMSK |= (1<<INT2); \
  70. } while (0)
  71. #define PS2_INT_OFF() do { \
  72. EIMSK &= ~(1<<INT2); \
  73. } while (0)
  74. #define PS2_INT_VECT INT2_vect
  75. #endif
  76. /* key matrix pins */
  77. #define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, D6, B0, D3 }
  78. #define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, D1 }
  79. #define UNUSED_PINS
  80. /* COL2ROW or ROW2COL */
  81. #define DIODE_DIRECTION COL2ROW
  82. /* number of backlight levels */
  83. #ifdef BACKLIGHT_PIN
  84. #define BACKLIGHT_LEVELS 3
  85. #endif
  86. /* Set 0 if debouncing isn't needed */
  87. #define DEBOUNCE 5
  88. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  89. #define LOCKING_SUPPORT_ENABLE
  90. /* Locking resynchronize hack */
  91. #define LOCKING_RESYNC_ENABLE
  92. #define RGB_DI_PIN D0
  93. #ifdef RGB_DI_PIN
  94. #define RGBLIGHT_ANIMATIONS
  95. #define RGBLED_NUM 14
  96. #define RGBLIGHT_HUE_STEP 10
  97. #define RGBLIGHT_SAT_STEP 17
  98. #define RGBLIGHT_VAL_STEP 12
  99. #endif
  100. #endif