]> git.gir.st - tmk_keyboard.git/blob - README.md
Fix README.md and ibm4704.txt
[tmk_keyboard.git] / README.md
1 TMK Keyboard Firmware Collection
2 ================================
3 This is a keyboard firmware with some useful features for Atmel AVR controller.
4
5 Source code is available here: <http://github.com/tmk/tmk_keyboard>
6
7
8 Features
9 --------
10 These features can be used in your keyboard.
11
12 * Multi-layer Keymap - Multiple keyboard layouts with layer switching
13 * Mouse key - Mouse control with keyboard
14 * System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
15 * Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
16 * USB NKRO - 120 keys(+ 8 modifiers) simultaneously
17 * PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
18 * Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
19 * User Function - Customizable function of key with writing code
20 * Macro - Very primitive at this time
21 * Keyboard Tricks - Oneshot modifier and modifier with tapping feature
22 * Debug Console - Messages for debug and interaction with firmware
23 * Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
24 * Locking CapsLock - Mechanical switch support for CapsLock
25 * Breathing Sleep LED - Sleep indicator with charm during USB suspend
26 * Backlight - Control backlight levels
27
28
29 Projects
30 --------
31 You can find some keyboard specific projects under `converter` and `keyboard` directory.
32
33 ### converter
34 * [ps2_usb](converter/ps2_usb/) - [PS/2 keyboard to USB][GH_ps2]
35 * [adb_usb](converter/adb_usb/) - [ADB keyboard to USB][GH_adb]
36 * [m0110_usb](converter/m0110_usb) - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
37 * [terminal_usb](converter/terminal_usb/) - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
38 * [news_usb](converter/news_usb/) - [Sony NEWS keyboard to USB][GH_news]
39 * [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
40 * [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
41 * [pc98_usb](converter/pc98_usb/) - [PC98] to USB
42 * [usb_usb](converter/usb_usb/) - USB to USB(experimental)
43 * [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB
44 * [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704]
45
46 ### keyboard
47 * [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board**
48 * [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
49 * [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
50 * [hid_liber](keyboard/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
51 * [phantom](keyboard/phantom/) - [Phantom] keyboard (by Tranquilite)
52 * [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
53 * [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
54 * [KMAC](keyboard/kmac/) - Korean custom keyboard
55
56 [GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
57 [GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
58 [GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
59 [GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
60 [GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
61 [GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
62 [GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
63 [GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
64 [GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
65 [GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
66 [GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
67 [HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
68 [Phantom]: http://geekhack.org/index.php?topic=26742
69 [GH60]: http://geekhack.org/index.php?topic=34959
70 [GH60_proto]: http://geekhack.org/index.php?topic=37570.0
71 [PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
72 [Sun]: http://en.wikipedia.org/wiki/Sun-3
73 [IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
74
75
76
77 License
78 -------
79 **GPLv2** or later. Some protocol files are under **Modified BSD License**.
80 LUFA, PJRC and V-USB stack have their own license respectively.
81
82
83
84 Build Firmware and Program Controller
85 -------------------------------------
86 See [doc/build.md](doc/build.md).
87
88
89
90 Change your keymap
91 ------------------
92 See [doc/keymap.md](doc/keymap.md).
93
94
95
96 Magic Commands
97 --------------
98 To see help press `Magic` + `H`.
99
100 `Magic` key bind may be `LShift` + `RShift` in many project, but `Power` key on ADB converter. `Magic` keybind can be vary on each project, check `config.h` in project directory.
101
102 Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
103
104 ----- Command Help -----
105 c: enter console mode
106 d: toggle debug enable
107 x: toggle matrix debug
108 k: toggle keyboard debug
109 m: toggle mouse debug
110 v: print device version & info
111 t: print timer count
112 s: print status
113 e: print eeprom config
114 n: toggle NKRO
115 0/F10: switch to Layer0
116 1/F1: switch to Layer1
117 2/F2: switch to Layer2
118 3/F3: switch to Layer3
119 4/F4: switch to Layer4
120 PScr: power down/remote wake-up
121 Caps: Lock Keyboard(Child Proof)
122 Paus: jump to bootloader
123
124 **TBD**
125
126 ### Boot Magic Configuration - Virtual DIP Switch
127 Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable.
128 Note that you must use keys of **Layer 0** as Magic keys. These settings are stored in EEPROM so that retain your configure over power cycles.
129
130 To avoid configuring accidentally additive salt key `KC_SPACE` also needs to be pressed along with the following configuration keys. The salt key is configurable in `config.h`. See [common/bootmagic.h](common/bootmagic.h).
131
132 #### General
133 - Skip reading EEPROM to start with default configuration(`ESC`)
134 - Clear configuration stored in EEPROM to reset configuration(`Backspace`)
135
136 #### Bootloader
137 - Kick up Bootloader(`B`)
138
139 #### Debug
140 - Debug enable(`D`)
141 - Debug matrix enable(`D`+`X`)
142 - Debug keyboard enable(`D`+`K`)
143 - Debug mouse enable(`D`+`M`)
144
145 #### Keymap
146 - Swap Control and CapsLock(`Left Control`)
147 - Change CapsLock to Control(`Caps Lock`)
148 - Swap LeftAlt and Gui(`Left Alt`)
149 - Swap RightAlt and Gui(`Right Alt`)
150 - Disable Gui(`Left Gui`)
151 - Swap Grave and Escape(`Grave`)
152 - Swap BackSlash and BackSpace(`Back Slash`)
153
154 #### Default Layer
155 - Set Default Layer to 0(`0`)
156 - Set Default Layer to 1(`1`)
157 - Set Default Layer to 2(`2`)
158 - Set Default Layer to 3(`3`)
159 - Set Default Layer to 4(`4`)
160 - Set Default Layer to 5(`5`)
161 - Set Default Layer to 6(`6`)
162 - Set Default Layer to 7(`7`)
163
164 #### Caution
165 Unintentional use of this feature will cause user confusion.
166
167 TODO: Magic key combination to avoid unintentional press during plug in
168
169 **TBD**
170
171
172 Mechanical Locking support
173 --------------------------
174 This feature makes it possible for you to use mechanical switch for `CapsLock`, `NumLock` or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LNUM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Resync option tries to keep lock switch state consistent with keyboard LED state.
175
176 #define LOCKING_SUPPORT_ENABLE
177 #define LOCKING_RESYNC_ENABLE
178
179
180 Start Your Own Project
181 -----------------------
182 **TBD**
183 ### Config.h Options
184 #### 1. USB vendor/product ID and device description
185 #define VENDOR_ID 0xFEED
186 #define PRODUCT_ID 0xBEEF
187 #define MANUFACTURER t.m.k.
188 #define PRODUCT Macway mod
189 #define DESCRIPTION t.m.k. keyboard firmware for Macway mod
190
191 #### 2. Keyboard matrix configuration
192 #define MATRIX_ROWS 8
193 #define MATRIX_COLS 8
194 #define MATRIX_HAS_GHOST
195
196
197
198 Architecture
199 ------------
200 Architecture Diagram
201 +---------------+---------------+-------------+
202 | Host | Keyboard | Matrix, LED |
203 ___________ |-----------+-+ +-------------+ | +-----------|
204 / /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
205 /__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
206 |.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
207 || || |----------->| PJRC |v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
208 || Host || | Console | iWRAP(BT)|e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
209 ||________||/.<-----------| UART |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
210 `_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
211 |_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
212 +---------------------------------------------+ Keyboard
213
214
215
216 Debugging
217 --------
218 Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
219
220 You can use xprintf() to display debug info on `hid_listen`, see `common/xprintf.h`.
221
222
223
224 Files and Directories
225 -------------------
226 ### Top
227 * common/ - common codes
228 * protocol/ - keyboard protocol support
229 * keyboard/ - keyboard projects
230 * converter/ - protocol converter projects
231 * doc/ - documents
232 * common.mk - Makefile for common
233 * protocol.mk - Makefile for protocol
234 * rules.mk - Makefile for build rules
235
236 ### Common
237 * host.h
238 * host_driver.h
239 * keyboard.h
240 * command.h
241 * keymap.h
242 * action.h
243 * keycode.h
244 * matrix.h
245 * led.h
246 * mousekey.h
247 * report.h
248 * debug.h
249 * print.h
250 * bootloader.h
251 * sendchar.h
252 * timer.h
253 * util.h
254
255 ### Keyboard Protocols
256 * lufa/ - LUFA USB stack
257 * pjrc/ - PJRC USB stack
258 * vusb/ - Objective Development V-USB
259 * iwrap/ - Bluetooth HID for Bluegiga iWRAP
260 * ps2.c - PS/2 protocol
261 * adb.c - Apple Desktop Bus protocol
262 * m0110.c - Macintosh 128K/512K/Plus keyboard protocol
263 * news.c - Sony NEWS keyboard protocol
264 * x68k.c - Sharp X68000 keyboard protocol
265 * serial_soft.c - Asynchronous Serial protocol implemented by software
266
267
268
269 Coding Style
270 -------------
271 - Doesn't use Tab to indent, use 4-spaces instead.
272
273
274
275 Other Keyboard Firmware Projects
276 ------------------
277 See [doc/other_projects.md](doc/other_projects.md).
Imprint / Impressum