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