logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

config.h (5699B)


  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. #pragma once
  15. /* key matrix size */
  16. #define MATRIX_COLS 6
  17. #define MATRIX_ROWS 9
  18. /* default pin-out */
  19. #define MATRIX_COL_PINS \
  20. { F4, F1, F0, D6, D0, D1 }
  21. #define MATRIX_ROW_PINS \
  22. { F5, F6, F7, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN }
  23. #define TRACKPOINT_PINS \
  24. { B7, B6, D7 }
  25. /*
  26. * Keyboard Matrix Assignments
  27. *
  28. * Change this to how you wired your keyboard
  29. * COLS: AVR pins used for columns, left to right
  30. * ROWS: AVR pins used for rows, top to bottom
  31. * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
  32. * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
  33. *
  34. */
  35. #define DIODE_DIRECTION COL2ROW
  36. /* key combination for command */
  37. #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)))
  38. /*
  39. * Feature disable options
  40. * These options are also useful to firmware size reduction.
  41. */
  42. /* disable debug print */
  43. // #define NO_DEBUG
  44. /* disable print */
  45. // #define NO_PRINT
  46. /* disable action features */
  47. //#define NO_ACTION_LAYER
  48. //#define NO_ACTION_TAPPING
  49. //#define NO_ACTION_ONESHOT
  50. #define PS2_MOUSE_INIT_DELAY 2000
  51. #define BATTERY_PIN B5
  52. #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
  53. enum led_sequence {
  54. LED_IND_LINUX,
  55. LED_IND_APPLE,
  56. LED_IND_WINDOWS,
  57. LED_IND_QWERTY,
  58. LED_IND_ALT,
  59. LED_IND_AUDIO,
  60. LED_IND_BLUETOOTH,
  61. LED_IND_USB,
  62. LED_IND_BATTERY,
  63. LED_IND_CAPSLOCK,
  64. LED_IND_GUI,
  65. LED_IND_FUN,
  66. LED_IND_NUM,
  67. LED_IND_PUNC,
  68. LED_IND_EMOJI,
  69. LED_IND_GREEK,
  70. LED_BKSP,
  71. LED_ENT,
  72. LED_RSFT,
  73. LED_RCTL,
  74. LED_RALT,
  75. LED_SLSH,
  76. LED_SCLN,
  77. LED_P,
  78. LED_O,
  79. LED_L,
  80. LED_DOT,
  81. LED_RGUI,
  82. LED_GREEK,
  83. LED_COMM,
  84. LED_K,
  85. LED_I,
  86. LED_U,
  87. LED_J,
  88. LED_M,
  89. LED_FUN,
  90. LED_RSPC,
  91. LED_N,
  92. LED_HH,
  93. LED_Y,
  94. LED_TRACKPOINT3,
  95. LED_TRACKPOINT2,
  96. LED_TRACKPOINT1,
  97. LED_T,
  98. LED_G,
  99. LED_B,
  100. LED_LSPC,
  101. LED_NUM,
  102. LED_V,
  103. LED_F,
  104. LED_R,
  105. LED_E,
  106. LED_D,
  107. LED_C,
  108. LED_EMPTY,
  109. LED_LGUI,
  110. LED_X,
  111. LED_S,
  112. LED_W,
  113. LED_Q,
  114. LED_A,
  115. LED_Z,
  116. LED_LALT,
  117. LED_LCTL,
  118. LED_LSFT,
  119. LED_ESC,
  120. LED_TAB,
  121. LED_TOTAL
  122. };
  123. # define RGBSPS_NUM LED_TOTAL
  124. # define WS2812_LED_COUNT RGBSPS_NUM
  125. #endif
  126. /* PS/2 mouse */
  127. #ifdef PS2_DRIVER_BUSYWAIT
  128. # define PS2_CLOCK_PIN D3
  129. # define PS2_DATA_PIN D2
  130. #endif
  131. /* PS/2 mouse interrupt version */
  132. #ifdef PS2_DRIVER_INTERRUPT
  133. /* uses INT1 for clock line(ATMega32U4) */
  134. # define PS2_CLOCK_PIN D3
  135. # define PS2_DATA_PIN D2
  136. # define PS2_INT_INIT() \
  137. do { \
  138. EICRA |= ((1 << ISC31) | (0 << ISC30)); \
  139. } while (0)
  140. # define PS2_INT_ON() \
  141. do { \
  142. EIMSK |= (1 << INT3); \
  143. } while (0)
  144. # define PS2_INT_OFF() \
  145. do { \
  146. EIMSK &= ~(1 << INT3); \
  147. } while (0)
  148. # define PS2_INT_VECT INT3_vect
  149. #endif
  150. /* PS/2 mouse USART version */
  151. #ifdef PS2_DRIVER_USART
  152. /* XCK for clock line and RXD for data line */
  153. #define PS2_CLOCK_PIN D5
  154. #define PS2_DATA_PIN D2
  155. /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
  156. /* set DDR of CLOCK as input to be slave */
  157. # define PS2_USART_INIT() \
  158. do { \
  159. PS2_CLOCK_DDR &= ~(1 << PS2_CLOCK_BIT); \
  160. PS2_DATA_DDR &= ~(1 << PS2_DATA_BIT); \
  161. UCSR1C = ((1 << UMSEL10) | (3 << UPM10) | (0 << USBS1) | (3 << UCSZ10) | (0 << UCPOL1)); \
  162. UCSR1A = 0; \
  163. UBRR1H = 0; \
  164. UBRR1L = 0; \
  165. } while (0)
  166. # define PS2_USART_RX_INT_ON() \
  167. do { \
  168. UCSR1B = ((1 << RXCIE1) | (1 << RXEN1)); \
  169. } while (0)
  170. # define PS2_USART_RX_POLL_ON() \
  171. do { \
  172. UCSR1B = (1 << RXEN1); \
  173. } while (0)
  174. # define PS2_USART_OFF() \
  175. do { \
  176. UCSR1C = 0; \
  177. UCSR1B &= ~((1 << RXEN1) | (1 << TXEN1)); \
  178. } while (0)
  179. # define PS2_USART_RX_READY (UCSR1A & (1 << RXC1))
  180. # define PS2_USART_RX_DATA UDR1
  181. # define PS2_USART_ERROR (UCSR1A & ((1 << FE1) | (1 << DOR1) | (1 << UPE1)))
  182. # define PS2_USART_RX_VECT USART1_RX_vect
  183. #endif