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