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.

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