config.h 3.5 KB

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