config.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. Copyright 2012 Jun Wako <wakojun@gmail.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef CONFIG_H
  15. #define CONFIG_H
  16. #include "config_definitions.h"
  17. /* USB Device descriptor parameter */
  18. #define VENDOR_ID 0xFEED
  19. #define PRODUCT_ID 0x6060
  20. #define DEVICE_VER 0x0001
  21. #define MANUFACTURER Ortholinear Keyboards
  22. #define PRODUCT The Planck Keyboard
  23. #define DESCRIPTION A compact ortholinear keyboard
  24. /* key matrix size */
  25. #define MATRIX_ROWS 4
  26. #define MATRIX_COLS 12
  27. /* Planck PCB default pin-out */
  28. #define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
  29. #define ROWS (int []){ D0, D5, B5, B6 }
  30. /* COL2ROW or ROW2COL */
  31. #define DIODE_DIRECTION COL2ROW
  32. /* define if matrix has ghost */
  33. //#define MATRIX_HAS_GHOST
  34. /* number of backlight levels */
  35. #define BACKLIGHT_LEVELS 3
  36. /* Set 0 if debouncing isn't needed */
  37. #define DEBOUNCE 5
  38. /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
  39. #define LOCKING_SUPPORT_ENABLE
  40. /* Locking resynchronize hack */
  41. #define LOCKING_RESYNC_ENABLE
  42. /* key combination for command */
  43. #define IS_COMMAND() ( \
  44. keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
  45. )
  46. #ifdef BLUETOOTH_ENABLE
  47. #ifdef __AVR_ATmega32U4__
  48. #define SERIAL_UART_BAUD 9600
  49. #define SERIAL_UART_DATA UDR1
  50. #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1)
  51. #define SERIAL_UART_RXD_VECT USART1_RX_vect
  52. #define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1))
  53. #define SERIAL_UART_INIT() do { \
  54. UBRR1L = (uint8_t) SERIAL_UART_UBRR; /* baud rate */ \
  55. UBRR1H = (uint8_t) (SERIAL_UART_UBRR>>8); /* baud rate */ \
  56. UCSR1B = (1<<TXEN1); /* TX: enable */ \
  57. UCSR1C = (0<<UPM11) | (0<<UPM10) | /* parity: none(00), even(01), odd(11) */ \
  58. (0<<UCSZ12) | (1<<UCSZ11) | (1<<UCSZ10); /* data-8bit(011) */ \
  59. sei(); \
  60. } while(0)
  61. #else
  62. # error "USART configuration is needed."
  63. #endif
  64. // I'm fairly sure these aren't needed, but oh well - Jack
  65. /*
  66. * PS/2 Interrupt configuration
  67. */
  68. #ifdef PS2_USE_INT
  69. /* uses INT1 for clock line(ATMega32U4) */
  70. #define PS2_CLOCK_PORT PORTD
  71. #define PS2_CLOCK_PIN PIND
  72. #define PS2_CLOCK_DDR DDRD
  73. #define PS2_CLOCK_BIT 1
  74. #define PS2_DATA_PORT PORTD
  75. #define PS2_DATA_PIN PIND
  76. #define PS2_DATA_DDR DDRD
  77. #define PS2_DATA_BIT 0
  78. #define PS2_INT_INIT() do { \
  79. EICRA |= ((1<<ISC11) | \
  80. (0<<ISC10)); \
  81. } while (0)
  82. #define PS2_INT_ON() do { \
  83. EIMSK |= (1<<INT1); \
  84. } while (0)
  85. #define PS2_INT_OFF() do { \
  86. EIMSK &= ~(1<<INT1); \
  87. } while (0)
  88. #define PS2_INT_VECT INT1_vect
  89. #endif
  90. /*
  91. * PS/2 Busywait configuration
  92. */
  93. #ifdef PS2_USE_BUSYWAIT
  94. #define PS2_CLOCK_PORT PORTD
  95. #define PS2_CLOCK_PIN PIND
  96. #define PS2_CLOCK_DDR DDRD
  97. #define PS2_CLOCK_BIT 1
  98. #define PS2_DATA_PORT PORTD
  99. #define PS2_DATA_PIN PIND
  100. #define PS2_DATA_DDR DDRD
  101. #define PS2_DATA_BIT 0
  102. #endif
  103. #endif
  104. /*
  105. * Feature disable options
  106. * These options are also useful to firmware size reduction.
  107. */
  108. /* disable debug print */
  109. // #define NO_DEBUG
  110. /* disable print */
  111. // #define NO_PRINT
  112. /* disable action features */
  113. //#define NO_ACTION_LAYER
  114. //#define NO_ACTION_TAPPING
  115. //#define NO_ACTION_ONESHOT
  116. //#define NO_ACTION_MACRO
  117. //#define NO_ACTION_FUNCTION
  118. #endif