Keyboard firmwares for Atmel AVR and Cortex-M
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. PS/2 to USB keyboard converter
  2. ==============================
  3. This firmware converts PS/2 keyboard protocol to USB.
  4. Demostration build
  5. ------------------
  6. In this demo build, you can try several layouts,
  7. mouse keys and USB NKRO.
  8. Special keys:
  9. Magic+0: Qwerty with mouse keys(default)
  10. Magic+1: Qwerty
  11. Magic+2: Colemak
  12. Magic+3: Dvorak
  13. Magic+4: Workman
  14. Magic+N: toggles NKRO/6KRO(6KRO by default)
  15. Magic+Esc: sends Power Event
  16. where Magic=(LShift+RShift) or (LControl+RShift)
  17. Keybinds:
  18. Fn0+(hjkl): Mouse key move(vi cursor)
  19. Fn0+(yuio): Mouse wheel(left,down,up,right)
  20. Fn0+space: Mouse button1
  21. Fn0+(mnb): Mouse buttons(1,2,3)
  22. Fn0+(zxc): Media control(Volup, Voldown, Mute)
  23. Fn1+(hjkl): Cursor move(vi cursor)
  24. Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
  25. Fn2+(esdf): Mouse key move(invert T cursor)
  26. Fn2+(qwrt): Mouse wheel(left,down,up,right)
  27. Fn2+space: Mouse button1
  28. Fn2+(,./): Media control(Volup, Voldown, Mute)
  29. where Fn0=;, Fn1=/, Fn2=a
  30. Features
  31. --------
  32. Mouse keys
  33. You can emulates mouse move and button click using keyboard.
  34. System/Media control
  35. You can sends Power event, Volume down/up and Mute.
  36. USB NKRO(actually 120KRO+8Modifiers)
  37. You can tolggles NKRO/6KRO.(Not tested on Mac.)
  38. Keymap customization
  39. You can customize keymaps easily by editing source code.
  40. Build for Teensy
  41. ----------------
  42. 0. Connect PS/2 keyboard to Teensy by 4 lines(Vcc, GND, Data, Clock).
  43. 1. Define following macros for PS/2 connection in config_pjrc.h:
  44. PS2_DATA_PORT
  45. PS2_DATA_PIN
  46. PS2_DATA_DDR
  47. PS2_DATA_BIT
  48. PS2_CLOCK_PORT
  49. PS2_CLOCK_PIN
  50. PS2_CLOCK_DDR
  51. PS2_CLOCK_BIT
  52. 2. Edit Makefile for build options and MCU setting.
  53. 2. make
  54. 3. program Teensy.
  55. http://www.pjrc.com/teensy/loader.html
  56. Build for V-USB
  57. ---------------
  58. 0. Build V-USB controller board and connect PS/2 keyboard.
  59. 1. Define macros in config_vusb.h if needed.
  60. 2. Edit Makefile.vusb for build options and MCU setting.
  61. 3. make -f Makefile.vusb
  62. 4. program your V-USB controller.
  63. V-USB Circuit
  64. -------------
  65. +---+ +---------------+
  66. USB GND | | ATmega168 |
  67. === C3 | |
  68. 5V <-------+--------+---|Vcc,AVCC | PS/2
  69. R1 | | ====
  70. D- <----+--+-----R2-----|INT1 RXD|------->DATA
  71. D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
  72. Z1 Z2 | | ->5V
  73. GND<----+---+--+--+-----|GND | ->GND
  74. | | | |
  75. | C2-+--|XTAL1 |
  76. | X1 | |
  77. +--C3-+--|XTAL2 |
  78. +---------------+
  79. R1: 1.5K Ohm
  80. R2,R3: 68 Ohm
  81. Z1,Z2: Zenner 3.6V
  82. C1,C2: 22pF
  83. C3: 0.1uF
  84. X1: Crystal 20MHz(16MHz/12MHz)
  85. Keymap
  86. ------
  87. You can change a keymap by editing code of keymap.c like following.
  88. How to define the keymap is probably obvious. You can find key
  89. symbols in usb_keycodes.h.
  90. If you want to define more than one keymap, see hhkb/keymap.c and
  91. macway/keymap.c as examples. To define keymap(layer) switching may
  92. needs a bit of your effort at this time.
  93. /* Default Layer: plain keymap
  94. * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------.
  95. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak|
  96. * `---' `---------------' `---------------' `---------------' `-----------' `-----------'
  97. * ,-----------------------------------------------------------. ,-----------. ,---------------.
  98. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -|
  99. * |-----------------------------------------------------------| |-----------| |---------------|
  100. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| |
  101. * |-----------------------------------------------------------| `-----------' |-----------| +|
  102. * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
  103. * |-----------------------------------------------------------| ,---. |---------------|
  104. * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
  105. * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
  106. * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| |
  107. * `-----------------------------------------------------------' `-----------' `---------------'
  108. */
  109. KEYMAP(
  110. ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, F13, F14,
  111. GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
  112. TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
  113. CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
  114. LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
  115. LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
  116. ),
  117. Multimedia keys
  118. ---------------
  119. Following lists PS/2 special keys supported by Windows.
  120. http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
  121. Key PS/2(Set2) HID
  122. ---------------------------------------------------
  123. System Power E0 37 01 0081
  124. System Sleep E0 3F 01 0082
  125. System Wake E0 5E 01 0083
  126. System Mute E0 23 0C 00E2
  127. Volume Up E0 32 0C 00E9
  128. Volume Down E0 21 0C 00EA
  129. Scan Next Track E0 4D 0C 00B5
  130. Scan Previous Track E0 15 0C 00B6
  131. Stop E0 3B 0C 00B7
  132. Play/Pause E0 34 0C 00CD
  133. Media Select E0 50 0C 0183
  134. Mail E0 48 0C 018A
  135. Calculator E0 2B 0C 0192
  136. My Computer E0 40 0C 0194
  137. WWW Search E0 10 0C 0221
  138. WWW Home E0 3A 0C 0223
  139. WWW Back E0 38 0C 0224
  140. WWW Forward E0 30 0C 0225
  141. WWW Stop E0 28 0C 0226
  142. WWW Refresh E0 20 0C 0227
  143. WWW Favorites E0 18 0C 022A
  144. EOF