Remove obsolete documentation

example_keyboards
skullY 7 years ago
parent c12f19107f
commit f1c581fdd4

@ -1,103 +0,0 @@
# This guide has now been included in the main readme - please reference that one instead.
## Build Environment Setup
### Windows (Vista and later)
1. If you have ever installed WinAVR, uninstall it.
2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
5. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
7. Future build commands should be run from the standard Windows command prompt, which you can find by searching for "command prompt" from the start menu or start screen. Ignore the "MHV AVR Shell".
### Mac
If you're using [homebrew,](http://brew.sh/) you can use the following commands:
brew tap osx-cross/avr
brew install avr-libc
brew install dfu-programmer
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line.
You can also try these instructions:
1. Install Xcode from the App Store.
2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
3. Install [DFU-Programmer][dfu-prog].
### Linux
Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager.
Debian/Ubuntu example:
sudo apt-get update
sudo apt-get install gcc-avr avr-libc dfu-programmer
### Vagrant
If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](vagrant_guide.md).
## Verify Your Installation
1. If you haven't already, obtain this repository ([https://github.com/qmk/qmk_firmware](https://github.com/qmk/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application.
2. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead.
3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `readme.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboards/`. For example, if you're building for a Planck, run `cd keyboards/planck`.
4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. More information about the `make` command can be found below.
## Customizing, Building, and Deploying Your Firmware
### The Make command
The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards/<keyboard>/`), or your keymap folder (`/keyboards/<keyboard>/keymaps/<keymap>/`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)).
By default, this will generate a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests.
* The "root" (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc.
* The "keyboard" folder is any keyboard project's folder, like `/keyboards/planck`.
* The "keymap" folder is any keymap's folder, like `/keyboards/planck/keymaps/default`.
Below is a list of the useful `make` commands in QMK:
* `make` - cleans automatically and builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder
* `make keyboard=<keyboard>` - specifies the keyboard (only to be used in root)
* `make keymap=<keymap>` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder)
* `make quick` - skips the clean step (cannot be used immediately after modifying config.h or Makefiles)
* `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press `KC_RESET`). This does not work for Teensy-based keyboards like the ErgoDox EZ.
* `keyboard=` and `keymap=` are compatible with this
* `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root)
* `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root)
* `make all-keymaps [keyboard=<keyboard>]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `<keyboard>`
* `make all-keyboards-quick`, `make all-keyboards-default-quick` and `make all-keymaps-quick [keyboard=<keyboard>]` - like the normal "make-all-*" commands, but they skip the clean steps
Other, less useful functionality:
* `make COLOR=false` - turns off color output
* `make SILENT=true` - turns off output besides errors/warnings
* `make VERBOSE=true` - outputs all of the avr-gcc stuff (not interesting)
### The Makefile
There are 3 different `make` and `Makefile` locations:
* root (`/`)
* keyboard (`/keyboards/<keyboard>/`)
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **It is required if you want to run `make` in the keymap folder.**
### The `config.h` file
There are 2 `config.h` locations:
* keyboard (`/keyboards/<keyboard>/`)
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
The keyboard `config.h` is included only if the keymap one doesn't exist. The format to use for your custom one [is here](/doc/keymap_config_h_example.h). If you want to override a setting from the parent `config.h` file, you need to do this:
```
#undef MY_SETTING
#define MY_SETTING 4
```
For a value of `4` for this imaginary setting. So we `undef` it first, then `define` it.
You can then override any settings, rather than having to copy and paste the whole thing.

@ -1,187 +0,0 @@
Build Firmware and Program Controller
=====================================
## This guide may be out-dated - use [build_guide.md](build_guide.md) instead
Download and Install
--------------------
### 1. Install Tools
1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC (and avr-libc) with your favorite package manager or run the avr_setup.sh script in the root of this repository.
2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].
3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.
If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].
### 2. Download source
You can find firmware source at github:
- <https://github.com/tmk/tmk_keyboard>
If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
- <https://github.com/tmk/tmk_keyboard/archive/master.zip>
Build firmware
--------------
### 1. Open terminal
Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
### 2. Change directory
Move to project directory in the firmware source.
cd tmk_keyboard/{'keyboard' or 'converter'}/<project>
### 3. Make
Build firmware using GNU `make` command. You'll see `<project>_<variant>.hex` file in that directory unless something unexpected occurs in build process.
make -f Makefile.<variant> clean
make -f Makefile.<variant>
Program Controller
------------------
Now you have **hex** file to program on current directory. This **hex** is only needed to program your controller, other files are used for development and you may leave and forget them.
### 1. Start bootloader
How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual.
### 2. Program with DFU bootloader
Stock AVR USB chip including ATmega32U4 has DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
To program AVR chip with DFU bootloader use `FLIP` or `dfu-programmer`.
If you have a proper program command in `Makefile` just type this.
`FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below.
To use command line tool run this command. Note that you need to set PATH variable properly.
$ make -f Makefile.<variant> flip
Or to program with `dfu-programmer` run:
$ make -f Makefile.<variant> dfu
#### FLIP GUI tutorial
1. On menu bar click Device -> Select, then. `ATmega32u4`.
2. On menu bar click Settings -> Communication -> USB, then click 'Open' button on 'USB Port Connection' dialog.
At this point you'll see grey-outed widgets on the app get colored and ready.
3. On menu bar click File -> Load HEX File, then select your firmware hex file on File Selector dialog.
4. On 'Operations Flow' panel click 'Run' button to load the firmware binary to the chip. Note that you should keep 'Erase', 'Blank Check', 'Program' and 'Verify' check boxes selected.
5. Re-plug USB cord or click 'Start Application' button to restart your controller.
Done.
See also these instructions if you need.
- <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP>
- <http://www.atmel.com/Images/doc7769.pdf>
### 3. Program with Teensy Loader
If you have PJRC Teensy see instruction of `Teensy Loader`.
- <http://www.pjrc.com/teensy/loader.html>
Or use this command if you have command line version of Teensy Loader installed.
$ make -f Makefile.<variant> teensy
### 4. Program with Other programmer
You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or USBasp. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile.
$ make -f Makefile.<variant> program
[cygwin]: https://www.cygwin.com/
[mingw]: http://www.mingw.org/
[mhv]: https://infernoembedded.com/products/avr-tools
[winavr]: http://winavr.sourceforge.net/
[crosspack]: http://www.obdev.at/products/crosspack/index.html
[flip]: http://www.atmel.com/tools/FLIP.aspx
[dfu-prog]: http://dfu-programmer.sourceforge.net/
[teensy-loader]:http://www.pjrc.com/teensy/loader.html
Makefile Options
----------------
### 1. MCU and Frequency.
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb1286 # Teensy++ 2.0
F_CPU = 16000000
Set your MCU and its clock in Hz.
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096
If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure.
### 2. Features
Optional. Note that ***comment out*** with `#` to disable them.
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
### 3. Programmer
Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`.
# avrdude with AVRISPmkII
PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex
# avrdude with USBaspLoader
PROGRAM_CMD = avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
# avrdude with arduino
PROGRAM_CMD = avrdude -p $(MCU) -c arduino -P COM1 -b 57600 -U flash:w:$(TARGET).hex
Config.h Options
----------------
### 1. Magic command key combination
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))
### 2. Mechanical Locking Support for CapsLock
/* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */
#define CAPSLOCK_LOCKING_ENABLE
/* Locking CapsLock re-synchronize hack */
#define CAPSLOCK_LOCKING_RESYNC_ENABLE
### 3. Disable Debug and Print
/* disable debug print */
#define NO_DEBUG
/* disable print */
#define NO_PRINT
### 4. Disable Action Features
#define NO_ACTION_LAYER
#define NO_ACTION_TAPPING
#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
***TBD***

@ -1,352 +0,0 @@
#Planck Advanced (but not too advanced) `cygwin` Users Guide
If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you.
This guide was written step by step as I went through the process on a `Windows 10` `x86_64` and a `Windows 7` `amd k10` based system. This should be generally applicable to to any `Windows` environment with `cygwin`.
#####Do not skip steps. Do not move past a step until the previous step finishes successfully.
Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html)
##Get the Required Packages
Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected:
- devel/git
- devel/gcc-core
- devel/gcc-g++
- devel/flex
- devel/bison
- devel/make
- devel/texinfo
- devel/gettext-devel
- devel/automake
- devel/autoconfig
- devel/libtool
- text/gettext
- libs/libgcc1
- interpreters/m4
- web/wget
- archive/unzip
The following sources will be required:
- [gmp](https://gmplib.org/) (6.1.0)
- [mpfr](http://www.mpfr.org/) (3.1.4)
- [mpc](http://www.multiprecision.org/) (1.0.3)
- [binutils](https://www.sourceware.org/binutils/) (2.26)
- [gcc](https://gcc.gnu.org/) (5.3.0)
- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0)
The `dfu-programmer` will be required to flash the new firmware
- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2)
The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive
```
$ mkdir ~/local
$ mkdir ~/local/avr
$ mkdir ~/src
$ cd ~/src
$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
$ wget http://www.mpfr.org/mpfr-3.1.4/mpfr-3.1.4.tar.bz2
$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2
$ tar -xjf gmp-6.1.0.tar.bz2
$ tar -xjf mpfr-3.1.4.tar.bz2
$ tar -zxf mpc-1.0.3.tar.gz
$ tar -zxf binutils-2.26.tar.gz
$ tar -zxf gcc-5.3.0.tar.gz
$ tar -xjf avr-libc-2.0.0.tar.bz2
```
##Setup the Build Environment
These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent.
```
$ PREFIX=$HOME/local/avr
$ export PREFIX
$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS
$ PATH=$PATH:$PREFIX/bin:$PREFIX/lib
$ export PATH
```
##The `gcc` Required Math Library Packages
The following packages are required to be complied and installed in order to compile `gcc`. They are not sufficiently available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous. Verfiy that for each package, `make check` returns all passing and no fails.
###Build and Install `gmp`
```
$ cd ~/src/gmp-6.1.0
$ ./configure --enable-static --disable-shared
$ make
$ make check
$ make install
```
###Build and Install `mpfr`
```
$ cd ~/src/mpfr-3.1.4
$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared
$ make
$ make check
$ make install
```
###Build and Install `mpc`
```
$ cd ~/src/mpc-1.0.3
$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared
$ make
$ make check
$ make install
```
##OPTIONAL Part
You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while).
###Build and Install `gcc` for Your Machine
```
$ cd ~/src/gcc-5.3.0
$ mkdir obj-local
$ cd obj-local
$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared
$ make
$ make install
```
##End OPTIONAL Part
###Build and Install `binutils` for Your Machine
```
$ cd ~/src/binutils-2.26
$ mkdir obj-local
$ cd obj-local
$ ../configure
$ make
$ make install
```
##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system
Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard.
###Build `binutils` for AVR
If you plan to build and install `avr-gdb` also, use the `gdb` install at the end of this guide as it also builds the `binutils`
```
$ cd ~/src/binutils-2.26
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX --target=avr --disable-nls
$ make
$ make install
```
###Build `gcc` for AVR
```
$ cd ~/src/gcc-5.3.0
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2
$ make
$ make install
```
###Build `avr-libc` for AVR
For building the `avr-libc`, we have to specify the host build system. In my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`.
```
$ cd ~/src/avr-libc-2.0.0
$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr
$ make
$ make install
```
##Building 'dfu-programmer' for flashing the firmware via USB and installing the drivers
We can either build our own, or use the precomplied binaries. The precompiled binaries don't play well with `cygwin` so it is better to build them ourselves. The procedure for the precompiled binaries is included at the end of this guide.
### Build and Install the `libusb`
The `dfu-programmer` requires `libusb` so that it can interact with the USB system. These repos must be bootstrapped in order to create an appropriate `./configure` and `Makefile` for your system.
```
$ cd ~/src
$ git clone https://github.com/libusb/libusb.git
$ cd libusb
$ ./bootstrap.sh
$ ./configure
$ make
$ make install
```
### Build and Install the `dfu-programmer`
```
$ cd ~/src
$ git clone https://github.com/dfu-programmer/dfu-programmer.git
$ cd dfu-programmer
$ ./bootstrap.sh
$ ./configure
$ make
$ make install
```
Verify the installation with:
```
$ which dfu-programmer
/usr/local/bin/dfu-programmer
$ dfu-programmer
dfu-programmer 0.7.2
https://github.com/dfu-programmer/dfu-programmer
Type 'dfu-programmer --help' for a list of commands
'dfu-programmer --targets' to list supported target devices
```
If you are not getting the above result, you will not be able to flash the firmware!
###Install the USB drivers
The drivers are included in the windows binary version of [`dfu-programmer` 0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip).
```
$ cd ~/src
$ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
$ unzip dfu-programmer-win-0.7.2.zip -d dfu-programmer-win-0.7.2
```
or
The official drivers are found in [Atmel's `FLIP` installer](http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe). Download and then install `FLIP`. Upon installation, the drivers will be found in `C:\Program Files (x86)\Atmel\Flip 3.4.7\usb`.
Then, from an **administrator-privileged** `Windows` terminal, run the following command (adjust the path for username, etc. as necessary) and accept the prompt that pops up:
```
C:\> pnputil -i -a C:\cygwin64\home\Kevin\src\dfu-programmer-win-0.7.2\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
or
C:\> pnputil -i -a "C:\Program Files (x86)\Atmel\Flip 3.4.7\usb\atmel_usb_dfu.inf"
```
This should be the result:
```
Microsoft PnP Utility
Processing inf : atmel_usb_dfu.inf
Successfully installed the driver on a device on the system.
Driver package added successfully.
Published name : oem104.inf
Total attempted: 1
Number successfully imported: 1
```
Alternatively, the `Windows` driver can be installed when prompted by `Windows` when the keyboard is attached. Do not let `Windows` search for a driver; specify the path to search for a driver and point it to the `atmel_usb_dfu.inf` file.
##Building and Flashing the Planck firmware!
If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it.
###Build Planck and Load the Firmware
```
$ cd ~/src
$ git clone https://github.com/qmk/qmk_firmware.git
$ cd qmk_firmware/keyboards/planck
$ make
```
Make sure there are no errors. You should end up with this or something similar:
```
Creating load file for Flash: planck.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex
Creating load file for EEPROM: planck.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0
Creating Extended Listing: planck.lss
avr-objdump -h -S -z planck.elf > planck.lss
Creating Symbol Table: planck.sym
avr-nm -n planck.elf > planck.sym
Size after:
text data bss dec hex filename
18602 82 155 18839 4997 planck.elf
-------- end --------
```
If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from `github`, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed.
But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then:
```
$ make dfu
```
.
.
.
profit!!!
##extra bits...
###Installing Precompiled `dfu-programmer` Binaries (not recommended for `cygwin`)
To install the `dfu-programmer` from the binaries, we must get if from [the `dfu-programmer` website](https://dfu-programmer.github.io/) ([0.7.2](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip)).
Copy this file into your `cygwin` home\src directory. (For me, it is `C:\cygwin64\home\Kevin\src`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `./dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. This is because the `dfu-programmer` binary is `mingw` based, not `cygwin` based, so the `dlls` do not cooperate. I achieved acceptable pathing by moving the files to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running (Adjusting your path for username, etc. as needed):
```
C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin
```
Then, rename `libusb0_x86.dll` to `libusb0.dll`.
You can tell that you were successful by trying to execute 'dfu-programmer' from the 'cygwin' prompt:
```
$ which dfu-programmer
/home/Kevin/local/avr/bin/dfu-programmer
$ dfu-programmer
dfu-programmer 0.7.2
https://github.com/dfu-programmer/dfu-programmer
Type 'dfu-programmer --help' for a list of commands
'dfu-programmer --targets' to list supported target devices
```
If you are not getting the above result, you will not be able to flash the firmware!
- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`.
- Make sure the `dll` is named correctly.
- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permission. If you did it anyway, do `chmod +x dfu-programmer.exe`.
- Still have problems? Try building it instead.
##Debugging Tools
These tools are for debugging your firmware, etc. before flashing. Theoretically, it can save your memory from wearing out. However, these tool do not work 100% for the Planck firmware.
### `gdb` for AVR
`gdb` has a simulator for AVR but it does not support all instructions (like WDT), so it immediately crashes when running the Planck firmware (because `lufa.c` disables the WDT in the first few lines of execution). But it can still be useful in debugging example code and test cases, if you know how to use it.
```
$ cd ~/src
$ git clone git://sourceware.org/git/binutils-gdb.git
$ cd binutils-gdb
$ mkdir obj-avr
$ cd obj-avr
$ ../configure --prefix=$PREFIX --target=avr --build=x86_64-unknown-cygwin --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --disable-nls --enable-static
$ make
$ make install
```
### `simulavr`
`simulavr` is an AVR simulator. It runs the complied AVR elfs. `simulavr` does not support the `atmega32u4` device... it does `atmega32` but that is not good enough for the firmware (no PORTE and other things), so you cannot run the Planck firmware. I use it to simulate ideas I have for features in separate test projects.
This one is a major pain in the butt because it has a lot of dependencies and it is buggy. I will do my best to explain it but... it was hard to figure out. A few things need to be changed in the 'Makefile' to make it work in `cygwin`.
```
$ cd ~/src
$ git clone https://github.com/Traumflug/simulavr.git
$ cd simulavr
$ ./bootstrap
$ ./configure --prefix=$PREFIX --enable-static --disable-tcl --disable-doxygen-doc
```
Edit `src/Makefile.am` now so that `-no-undefined` is included (I did this by removing the SYS_MINGW conditional surrounding `libsim_la_LDFLAGS += -no-undefined` and `libsimulavr_la_LDFLAGS += -no-undefined \ libsimulavr_la_LIBADD += $(TCL_LIB)`. Also, `$(EXEEXT)` is added after `kbdgentables` in two places.
```
$ make
$ make install
```
TODO:
- git repos for all sources
- command line magic for cygwin setup
- better options for `dfu-drivers`

@ -1,64 +0,0 @@
# WARNING: Until issue [#173](https://github.com/tmk/tmk_keyboard/issues/173) goes through, the [core][1] repository will not be up-to-date with the latest changes and fixes, but can still be used.
If you want to use TMK for your own keyboard project, you've got three options for embedding the [core][1].
The recommended option is [subtrees](#1-git-subtree).
After adding the embed you'll need to [modify the Makefile](#modifications-to-the-makefile) of your project to point to the core correctly.
## 1. git subtree
In order to set up the subtree in your project, first add the core repository as a remote:
```
git remote add -f core https://github.com/tmk/tmk_core
```
Then add the core as a subtree (directory) in your local repository:
```
git subtree add -P tmk_core core master --squash
```
And that's it!
When you want to update the subtree in your repository to match the master on [tmk_core][1], do this:
```
git subtree pull -P tmk_core core master --squash
```
## 2. git submodule
In order to set up the submodule in your project, first add a new submodule:
```
git submodule add https://github.com/tmk/tmk_core tmk_core
```
Then pull, sync and update the submodule:
```
git pull
git submodule sync --recursive
git submodule update --init --recursive
```
And that's it!
When you want to update the subtree in your repository to match the master on [tmk_core][1], follow the same steps as above.
If you want to clone a repository from GitHub that has submodule(s) in it, pass <kbd>--recursive</kbd> when cloning, like so:
`git clone --recursive https://github.com/<username>/<repository>`
## 3. Manually (without git)
*Note: This is not recommended in any way, but it's still possible.*
Download a zipped version of the [tmk_core][1] repository using this link:
<https://github.com/tmk/tmk_core/archive/master.zip>
Extract the zip in your project's directory, then rename the folder to <kbd>tmk_core</kbd>.
## Modifications to the *Makefile*
The one thing you have to make sure to change in the *Makefile* (compared to [tmk_keyboard](https://github.com/tmk/tmk_keyboard) drivers' *[Makefile](https://github.com/tmk/tmk_keyboard/blob/master/keyboard/gh60/Makefile#L45)*) is the "TMK_DIR" variable, which needs to point to the embed directory:
```Makefile
TMK_DIR = ./tmk_core
```
[1]: https://github.com/tmk/tmk_core

@ -1,7 +0,0 @@
## Update core branch procedure
git co master
git subtree split -P tmk_core -b <tmp_branch>
git co core
git merge <tmp_branch>
git co master
git subtree merge -P tmk_core --squash

@ -1,5 +0,0 @@
# Alternative Controller for HHKB
* [Geekhack.org thread](https://geekhack.org/index.php?topic=12047.0)
* [Connector unmate](https://geekhack.org/index.php?topic=12047.msg1543860#msg1543860)

@ -1,8 +0,0 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
#endif

@ -1,37 +0,0 @@
# Share your keymap idea here!
https://github.com/tmk/tmk_keyboard/issues/265
---
## Reverse-shifted for numbers
With pressing Shift and '1' key you get **1** while with just '1' key you get **!**.
- https://geekhack.org/index.php?topic=41989.msg1959718#msg1959718
## KBT Pure layout
Keymap code on Alps64
https://github.com/thisisshi/tmk_keyboard/blob/15fe63e8d181a8a95988dcc71929f0024df55caa/keyboard/alps64/keymap_pure.c
and guide.
https://github.com/thisisshi/tmk_keyboard/blob/77ac0805ade565fb23657e3644c920ada71edccf/keyboard/alps64/Guide.md
## Prevent stuck modifiers
Consider the following scenario:
1. Layer 0 has a key defined as Shift.
2. The same key is defined on layer 1 as the letter A.
3. User presses Shift.
4. User switches to layer 1 for whatever reason.
5. User releases Shift, or rather the letter A.
6. User switches back to layer 0.
Shift was actually never released and is still considered pressed.
If such situation bothers you add this to your `config.h`:
#define PREVENT_STUCK_MODIFIERS
This option uses 5 bytes of memory per every 8 keys on the keyboard
rounded up (5 bits per key). For example on Planck (48 keys) it uses
(48/8)\*5 = 30 bytes.

@ -1,21 +0,0 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -1,685 +0,0 @@
Keymap framework - how to define your keymap
============================================
***NOTE: This is updated for QMK but this is still work in progress. This may still be inconsistent with the source code.***
QMK is based on TMK. Understanding the essential changes made should help you understand variable names etc.
## TMK vs. QMK
| Firmware |TMK |QMK |
|---------------------------|-----------------------|-------------------------|
| Maintainer |hasu |Jack Humbert et al. |
| Build path customization | `TMK_DIR = ...` | `include .../Makefile` |
| `keymaps` data | 3D array of `uint8_t` holding **keycode** | 3D array of `uint16_t` holding **action code** |
| `fn_actions` data | 1D array of `uint16_t` holding **action code** | 1D array of `uint16_t` holding **action code** |
Since QMK is based on TMK and uses major portion of TMK code as is, understanding the essential changes made should help you understand the code.
## 0. Keymap and layers
In QMK, **`const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS]`** holds multiple **layers** of keymap information in **16 bit** data holding the **action code**. You can define **32 layers** at most.
For trivial key definitions, the higher 8 bits of the **action code** are all 0 and the lower 8 bits holds the USB HID usage code generated by the key as **keycode**.
Respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence.
Keymap: 32 Layers Layer: action code matrix
----------------- ---------------------
stack of layers array_of_action_code[row][column]
____________ precedence _______________________
/ / | high / ESC / F1 / F2 / F3 ....
31 /___________// | /-----/-----/-----/-----
30 /___________// | / TAB / Q / W / E ....
29 /___________/ | /-----/-----/-----/-----
: _:_:_:_:_:__ | : /LCtrl/ A / S / D ....
: / : : : : : / | : / : : : :
2 /___________// | 2 `--------------------------
1 /___________// | 1 `--------------------------
0 /___________/ V low 0 `--------------------------
Sometimes, the action code stored in keymap may be referred as keycode in some documents due to the TMK history.
### 0.1 Keymap layer status
Keymap layer has its state in two 32 bit parameters:
* **`default_layer_state`** indicates a base keymap layer(0-31) which is always valid and to be referred.
* **`layer_state`** () has current on/off status of the layer on its each bit.
Keymap has its state in two parameter **`default_layer`** indicates a base keymap layer(0-31) which is always valid and to be referred, **`keymap_stat`** is 16bit variable which has current on/off status of layers on its each bit.
Keymap layer '0' is usually `default_layer` and which is the only valid layer and other layers is initially off after boot up firmware, though, you can configured them in `config.h`.
To change `default_layer` will be useful when you switch key layout completely, say you want Colmak instead of Qwerty.
Initial state of Keymap Change base layout
----------------------- ------------------
31 31
30 30
29 29
: :
: : ____________
2 ____________ 2 / /
1 / / ,->1 /___________/
,->0 /___________/ | 0
| |
`--- default_layer = 0 `--- default_layer = 1
layer_state = 0x00000001 layer_state = 0x00000002
On the other hand, you shall change `layer_state` to overlay base layer with some layers for feature such as navigation keys, function key(F1-F12), media keys or special actions.
Overlay feature layer
--------------------- bit|status
____________ ---+------
31 / / 31 | 0
30 /___________// -----> 30 | 1
29 /___________/ -----> 29 | 1
: : | :
: ____________ : | :
2 / / 2 | 0
,->1 /___________/ -----> 1 | 1
| 0 0 | 0
| +
`--- default_layer = 1 |
layer_state = 0x60000002 <-'
### 0.2 Layer Precedence and Transparency
Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
See example below.
### 0.3 Keymap Example
Keymap in this QMK is **`static const uint16_t PROGMEM keymaps[]`** C array in fact and you can define layers in it with **`KEYMAP()`** C macro and keycodes. To use complex actions you need to define `Fn` keycode in **`fn_actions[]`** array. It holds the 16 bit quantum keycode (action code).
> Please note that keymap in the TMK, which QMK was forked from, is **`static const uint8_t PROGMEM keymaps[]`** C array which holds the 8 bit keycode (~USB HID usage code).
This is a keymap example for [HHKB](http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard) keyboard.
This example has three layers, 'QWERTY' as base layer, 'FN' and 'MOUSE'.
In this example,
`MO(layer)` is a **momentary layer switching** key.
You can find other keymap definitions in file `keymap.c` located on project directories.
```
/*
* dbroqua HHKB Layout
*/
#include "hhkb.h"
#define BASE 0
#define FN 1
#define MOUSE 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BASE Level: Default Layer
* ,-----------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
* |-----------------------------------------------------------------------------------------+
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
* |-----------------------------------------------------------------------------------------+
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
* |-----------------------------------------------------------------------------------------+
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | fn |
* +-----------------------------------------------------------------------------------------+
* | Gui | Alt | Space | AltGr |Mouse|
* `----------------------------------------------------------------´
*/
[BASE] = KEYMAP(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \
KC_LGUI, KC_LALT, /* */ KC_SPC, KC_RALT, MO(MOUSE)
),
/* FN Layer
* ,-----------------------------------------------------------------------------------------.
* | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F0 | F11 | F12 | Ins | Del|
* |-----------------------------------------------------------------------------------------+
* | Caps | | | | | | | |PrtSc| Slck| Paus| Up | | |
* |-----------------------------------------------------------------------------------------+
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left |Right| |
* |-----------------------------------------------------------------------------------------+
* | | Prev| Play| Next| | | + | - | End |PgDwn| Down| | |
* +-----------------------------------------------------------------------------------------+
* | | | | Stop | |
* `----------------------------------------------------------------´
*/
[FN] = KEYMAP(
KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \
KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_TRNS
),
/* MOUSE Layer
* ,-----------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------------------------------------+
* | | | WUp | | | | | | | | Btn1| Up | Btn2| |
* |-----------------------------------------------------------------------------------------+
* | | WLt | WDn | WRt | | | | | | | Left |Right| |
* |-----------------------------------------------------------------------------------------+
* | | | | | | | | | | Btn3| Down| | |
* +-----------------------------------------------------------------------------------------+
* | | | | | |
* `----------------------------------------------------------------´
*/
[MOUSE] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, \
KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_R, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_MS_D, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};
```
## 1. Keycode
See [`tmk_core/common/keycode.h`](../tmk_core/common/keycode.h) or keycode table below for the detail. Keycode is internal **8bit code** to indicate action performed on key in keymap. Keycodes are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) plus special codes in the `0xA5-DF` range.
Keycode has `KC_` prefixed symbol respectively. Most of keycodes like `KC_A` have simple action registers key to host on press and unregister on release, while some of other keycodes has some special actions like `Fn` keys, Media control keys, System control keys and Mousekeys.
keymaps[]
In `KEYMAP()` macro, TMK recommends you to keep prefix part `KC_` of keycode to keep keymap compact. For example, just use `A` instead you place `KC_A` in `KEYMAP()`. But this doesn't apply for QMK.
The `KEYMAP()` macro defines correspondence between the physical key location to the electrical key connection.
Some keycodes has 7-letter **short name** such as `KC_COMM` in addition to descriptive name `KC_COMMA`, you'll prefer short one in `KEYMAP()`.
### 1.0 Other key
- `KC_NO` for no action
- `KC_TRNS` for layer transparency (See above)
### 1.1 Normal key
- `KC_A` to `KC_Z`, `KC_1` to `KC_0` for alpha numeric key
- `KC_MINS`, `KC_EQL`, `KC_GRV`, `KC_RBRC`, `KC_LBRC`, `KC_COMM`, `KC_DOT`, `KC_BSLS`, `KC_SLSH`, `KC_SCLN`, `KC_QUOT`
- `KC_ESC`, `KC_TAB`, `KC_SPC`, `KC_BSPC`, `KC_ENT`, `KC_DEL`, `KC_INS`
- `KC_UP`, `KC_DOWN`, `KC_RGHT`, `KC_LEFT`, `KC_PGUP`, `KC_PGDN`, `KC_HOME`, `KC_END`
- `KC_CAPS`, `KC_NLCK`, `KC_SLCK`, `KC_PSCR`, `KC_PAUS`, `KC_APP`, `KC_F1` to `KC_F24`
- `KC_P1` to `KC_P0`, `KC_PDOT`, `KC_PCMM`, `KC_PSLS`, `KC_PAST`, `KC_PMNS`, `KC_PPLS`, `KC_PEQL`, `KC_PENT` for keypad.
### 1.2 Modifier
There are 8 modifiers which has discrimination between left and right.
- `KC_LCTL` and `KC_RCTL` for Control
- `KC_LSFT` and `KC_RSFT` for Shift
- `KC_LALT` and `KC_RALT` for Alt
- `KC_LGUI` and `KC_RGUI` for Windows key or Command key in Mac
### 1.3 Mousekey
- `KC_MS_U`, `KC_MS_D`, `KC_MS_L`, `KC_MS_R` for mouse cursor
- `KC_WH_U`, `KC_WH_D`, `KC_WH_L`, `KC_WH_R` for mouse wheel
- `KC_BTN1`, `KC_BTN2`, `KC_BTN3`, `KC_BTN4`, `KC_BTN5` for mouse buttons
### 1.4 System & Media key
- `KC_PWR`, `KC_SLEP`, `KC_WAKE` for Power, Sleep, Wake
- `KC_MUTE`, `KC_VOLU`, `KC_VOLD` for audio volume control
- `KC_MNXT`, `KC_MPRV`, `KC_MSTP`, `KC_MPLY`, `KC_MSEL` for media control
- `KC_MAIL`, `KC_CALC`, `KC_MYCM` for application launch
- `KC_WSCH`, `KC_WHOM`, `KC_WBAK`, `KC_WFWD`, `KC_WSTP`, `KC_WREF`, `KC_WFAV` for web browser operation
### 1.5 Fn key
You don't need to use this functionality under QMK since this is a backward compatibility functionality. Unlike TMK, you can write action code itself directly in **`static const uint16_t PROGMEM keymaps[]`** C array using `MO(layer)`, etc.
`KC_FNnn` are keycodes for `Fn` key which not given any actions at the beginning unlike most of keycodes has its own inborn action. To use these keycodes in `KEYMAP()` you need to assign action you want at first. Action of `Fn` key is defined in `fn_actions[]` and its index of the array is identical with number part of `KC_FNnn`. Thus `KC_FN0` keycode indicates the action defined in first element of the array. ***Only 32 `Fn` keys can be defined at most.***
### 1.6 Keycode Table
See keycode table in [`doc/keycode.txt`](./keycode.txt) for description of keycodes.
In regard to implementation side most of keycodes are identical with [HID usage][HID_usage](pdf) sent to host for real and some virtual keycodes are defined to support special actions.
[HID_usage]: http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
## 2. Action
See [`common/action_code.h`](../common/action_code.h). Action is a **16bit code** and defines function to perform on events of a key like press, release, holding and tapping.
Most of keys just register 8bit scancode to host, but to support other complex features needs 16bit extended action codes internally. However, using 16bit action codes in keymap results in double size in memory compared to using just keycodes. To avoid this waste 8bit keycodes are used in `KEYMAP()` instead of action codes.
***You can just use keycodes of `Normal key`, `Modifier`, `Mousekey` and `System & Media key` in keymap*** to indicate corresponding actions instead of using action codes. While ***to use other special actions you should use keycode of `Fn` key defined in `fn_actions[]`.***
### 2.1 Key Action
This is a simple action that registers scancodes(HID usage in fact) to host on press event of key and unregister on release.
#### Parameters
+ **mods**: { ` MOD_LCTL`, ` MOD_LSFT`, ` MOD_LALT`, ` MOD_LGUI`,
` MOD_RCTL`, ` MOD_RSFT`, ` MOD_RALT`, ` MOD_RGUI` }
+ **key**: keycode
#### 2.1.1 Normal key and Modifier
***This action usually won't be used expressly in keymap*** because you can just use keycodes in `KEYMAP()` instead.
You can define these actions on *'A'* key and *'left shift'* modifier with:
ACTION_KEY(KC_A)
ACTION_KEY(KC_LSFT)
#### 2.1.2 Modified key
This action is comprised of strokes of modifiers and a key. `Macro` action is needed if you want more complex key strokes.
Say you want to assign a key to `Shift + 1` to get character *'!'* or `Alt + Tab` to switch application windows.
ACTION_MODS_KEY(MOD_LSFT, KC_1)
ACTION_MODS_KEY(MOD_LALT, KC_TAB)
Or `Alt,Shift + Tab` can be defined. `ACTION_MODS_KEY(mods, key)` requires **4-bit modifier state** and a **keycode** as arguments. See `keycode.h` for `MOD_BIT()` macro.
ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB)
#### 2.1.3 Multiple Modifiers
Registers multiple modifiers with pressing a key. To specify multiple modifiers use `|`.
ACTION_MODS(MOD_ALT | MOD_LSFT)
#### 2.1.3 Modifier with Tap key([Dual role][dual_role])
Works as a modifier key while holding, but registers a key on tap(press and release quickly).
ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT)
### 2.2 Layer Action
These actions operate layers of keymap.
#### Parameters
You can specify a **target layer** of action and **when the action is executed**. Some actions take a **bit value** for bitwise operation.
+ **layer**: `0`-`31`
+ **on**: { `ON_PRESS` | `ON_RELEASE` | `ON_BOTH` }
+ **bits**: 4-bit value and 1-bit mask bit
#### 2.2.1 Default Layer
Default Layer is a layer which always is valid and referred to when actions is not defined on other overlay layers.
This sets Default Layer to given parameter `layer` and activate it.
ACTION_DEFAULT_LAYER_SET(layer)
#### 2.2.2 Momentary
Turns on `layer` momentarily while holding, in other words it activates when key is pressed and deactivate when released.
ACTION_LAYER_MOMENTARY(layer)
#### 2.2.3 Toggle Switch
Turns on `layer` with first type(press and release) and turns off with next.
ACTION_LAYER_TOGGLE(layer)
#### 2.2.4 Momentary Switch with tap key
Turns on `layer` momentary while holding, but registers key on tap(press and release quickly).
ACTION_LAYER_TAP_KEY(layer, key)
#### 2.2.5 Momentary Switch with tap toggle
Turns on `layer` momentary while holding and toggles it with serial taps.
ACTION_LAYER_TAP_TOGGLE(layer)
#### 2.2.6 Invert state of layer
Inverts current state of `layer`. If the layer is on it becomes off with this action.
ACTION_LAYER_INVERT(layer, on)
#### 2.2.7 Turn On layer
Turns on layer state.
ACTION_LAYER_ON(layer, on)
Turns on layer state on press and turns off on release.
ACTION_LAYER_ON_OFF(layer)
#### 2.2.8 Turn Off layer
Turns off layer state.
ACTION_LAYER_OFF(layer, on)
Turns off layer state on press and activates on release.
ACTION_LAYER_OFF_ON(layer)
#### 2.2.9 Set layer
Turn on layer only.
`layer_state = (1<<layer) [layer: 0-31]`
ACTION_LAYER_SET(layer, on)
Turns on layer only and clear all layer on release..
ACTION_LAYER_SET_CLEAR(layer)
#### 2.2.10 Bitwise operation
**part** indicates which part of 32bit layer state(0-7). **bits** is 5-bit value. **on** indicates when the action is executed.
ACTION_LAYER_BIT_AND(part, bits, on)
ACTION_LAYER_BIT_OR(part, bits, on)
ACTION_LAYER_BIT_XOR(part, bits, on)
ACTION_LAYER_BIT_SET(part, bits, on)
These actions works with parameters as following code.
uint8_t shift = part*4;
uint32_t mask = (bits&0x10) ? ~(0xf<<shift) : 0;
uint32_t layer_state = layer_state <bitop> ((bits<<shift)|mask);
Default Layer also has bitwise operations, they are executed when key is released.
ACTION_DEFAULT_LAYER_BIT_AND(part, bits)
ACTION_DEFAULT_LAYER_BIT_OR(part, bits)
ACTION_DEFAULT_LAYER_BIT_XOR(part, bits)
ACTION_DEFAULT_LAYER_BIT_SET(part, bits)
### 2.3 Macro action
***TBD***
`Macro` action indicates complex key strokes.
MACRO( D(LSHIFT), D(D), END )
MACRO( U(D), U(LSHIFT), END )
MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )
#### 2.3.1 Macro Commands
- **I()** change interval of stroke.
- **D()** press key
- **U()** release key
- **T()** type key(press and release)
- **W()** wait
- **END** end mark
#### 2.3.2 Examples
***TODO: sample implementation***
See `keyboards/hhkb/keymap.c` for sample.
### 2.4 Function action
***TBD***
There are two type of action, normal `Function` and tappable `Function`.
These actions call user defined function with `id`, `opt`, and key event information as arguments.
#### 2.4.1 Function
To define normal `Function` action in keymap use this.
ACTION_FUNCTION(id, opt)
#### 2.4.2 Function with tap
To define tappable `Function` action in keymap use this.
ACTION_FUNCTION_TAP(id, opt)
#### 2.4.3 Implement user function
`Function` actions can be defined freely with C by user in callback function:
void keymap_call_function(keyrecord_t *event, uint8_t id, uint8_t opt)
This C function is called every time key is operated, argument `id` selects action to be performed and `opt` can be used for option. Function `id` can be 0-255 and `opt` can be 0-15.
`keyrecord_t` is comprised of key event and tap count. `keyevent_t` indicates which and when key is pressed or released. From `tap_count` you can know tap state, 0 means no tap. These information will be used in user function to decide how action of key is performed.
typedef struct {
keyevent_t event;
uint8_t tap_count;
} keyrecord_t;
typedef struct {
key_t key;
bool pressed;
uint16_t time;
} keyevent_t;
typedef struct {
uint8_t col;
uint8_t row;
} key_t;
***TODO: sample implementation***
See `keyboards/hhkb/keymap.c` for sample.
### 2.5 Backlight Action
These actions control the backlight.
#### 2.5.1 Change backlight level
Increase backlight level.
ACTION_BACKLIGHT_INCREASE()
Decrease backlight level.
ACTION_BACKLIGHT_DECREASE()
Step through backlight levels.
ACTION_BACKLIGHT_STEP()
Turn a specific backlight level on or off.
ACTION_BACKLIGHT_LEVEL(1)
#### 2.5.2 Turn on / off backlight
Turn the backlight on and off without changing level.
ACTION_BACKLIGHT_TOGGLE()
### 2.6 Swap-Hands Action
The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command key is pressed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd`
### 2.6.1 Configuration
The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck:
```
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
{{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
{{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
{{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
};
```
Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return {7, 2} (third row, eighth column).
### 2.6.2 Advanced Swap Commands
- **`ACTION_SWAP_HANDS()`** Swaps hands when pressed, returns to normal when released (momentary).
- **`ACTION_SWAP_HANDS_TOGGLE()`** Toggles swap on and off with every keypress.
- **`ACTION_SWAP_HANDS_TAP_TOGGLE()`** Toggles with a tap; momentary when held.
- **`ACTION_SWAP_HANDS_TAP_KEY(key)`** Sends `key` with a tap; momentary swap when held.
- **`ACTION_SWAP_HANDS_ON_OFF()`** Alias for `ACTION_SWAP_HANDS()`
- **`ACTION_SWAP_HANDS_OFF_ON()`** Momentarily turns off swap.
- **`ACTION_SWAP_HANDS_ON()`** Turns on swapping and leaves it on.
- **`ACTION_SWAP_HANDS_OFF()`** Turn off swapping and leaves it off. Good for returning to a known state.
## 3. Layer switching Example
There are some ways to switch layer with 'Layer' actions.
### 3.1 Momentary switching
Momentary switching changes layer only while holding Fn key.
This action makes 'Layer 1' active(valid) on key press event and inactive on release event. Namely you can overlay a layer on lower layers or default layer temporarily with this action.
ACTION_LAYER_MOMENTARY(1)
Note that after switching on press the actions on destination layer(Layer 1) are performed.
***Thus you shall need to place an action to go back on destination layer***, or you will be stuck in destination layer without way to get back. Usually you need to place same action or 'KC_TRNS` on destination layer to get back.
### 3.2 Toggle switching
Toggle switching performed after releasing a key. With this action you can keep staying on the destination layer until you type the key again to return.
This performs toggle switching action of 'Layer 2'.
ACTION_LAYER_TOGGLE(2)
### 3.3 Momentary switching with Tap key
These actions switch a layer only while holding a key but register the key on tap. **Tap** means to press and release a key quickly.
ACTION_LAYER_TAP_KEY(2, KC_SCLN)
With this you can place a layer switching action on normal key like ';' without losing its original key register function. This action allows you to have layer switching action without necessity of a dedicated key. It means you can have it even on home row of keyboard.
### 3.4 Momentary switching with Tap Toggle
This switches layer only while holding a key but toggle layer with several taps. **Tap** means to press and release key quickly.
ACTION_LAYER_TAP_TOGGLE(1)
Number of taps can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by default.
### 3.5 Momentary switching with Modifiers
This registers modifier key(s) simultaneously with layer switching.
ACTION_LAYER_MODS(2, MOD_LSFT | MOD_LALT)
## 4. Tapping
Tapping is to press and release a key quickly. Tapping speed is determined with setting of `TAPPING_TERM`, which can be defined in `config.h`, 200ms by default.
### 4.1 Tap Key
This is a feature to assign normal key action and modifier including layer switching to just same one physical key. This is a kind of [Dual role key][dual_role]. It works as modifier when holding the key but registers normal key when tapping.
Modifier with tap key:
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV)
Layer switching with tap key:
ACTION_LAYER_TAP_KEY(2, KC_SCLN)
[dual_role]: http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
When user hold a key after tap, it repeat the tapped key rather to hold a modifier key.
If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`.
See https://github.com/qmk/qmk_firmware/issues/889 for the detail.
### 4.2 Tap Toggle
This is a feature to assign both toggle layer and momentary switch layer action to just same one physical key. It works as momentary layer switch when holding a key but toggle switch with several taps.
ACTION_LAYER_TAP_TOGGLE(1)
### 4.3 Oneshot Modifier
This runs onetime effects which modify only on just one following key. It works as normal modifier key when holding down while oneshot modifier when tapping. The behavior of oneshot modifiers is similar to the [sticky keys](https://en.wikipedia.org/wiki/StickyKeys) functionality found in most operating systems.
ACTION_MODS_ONESHOT(MOD_LSFT)
Oneshot layer key:
ACTION_LAYER_ONESHOT(MY_LAYER)
Say you want to type 'The', you have to push and hold Shift key before type 't' then release it before type 'h' and 'e', otherwise you'll get 'THe' or 'the' unintentionally. With Oneshot Modifier you can tap Shift then type 't', 'h' and 'e' normally, you don't need to holding Shift key properly here. This mean you can release Shift before 't' is pressed down.
Oneshot effect is cancel unless following key is pressed down within `ONESHOT_TIMEOUT` of `config.h`. No timeout when it is `0` or not defined.
Most implementations of sticky keys allow you to lock a modifier by double tapping the modifier. The layer then remains locked untill the modifier is tapped again. To enable this behaviour for oneshot modifiers set `ONESHOT_TAP_TOGGLE` to the number taps required. The feature is disabled if `ONESHOT_TAP_TOGGLE<2` or not defined.
### 4.4 Tap Toggle Mods
Similar to layer tap toggle, this works as a momentary modifier when holding, but toggles on with several taps. A single tap will 'unstick' the modifier again.
ACTION_MODS_TAP_TOGGLE(MOD_LSFT)
## 5. Legacy Keymap
In QMK, `tmk_core/common/keymap.c` is missing and its replacement `quantum/keymap_common.c` lacks Legacy Keymap support.
Legacy Keymap uses two arrays `fn_layer[]` and `fn_keycode[]` to define Fn key. The index of arrays corresponds with postfix number of `Fn` key. Array `fn_layer[]` indicates destination layer to switch and `fn_keycode[]` has keycodes to send when tapping `Fn` key.
In the following legacy keymap setting example, `Fn0`, `Fn1` and `Fn2` switch layer to 1, 2 and 2 respectively. `Fn2` registers `Space` key when tapping while `Fn0` and `Fn1` doesn't send any key.
static const uint8_t PROGMEM fn_layer[] = {
1, // Fn0
2, // Fn1
2, // Fn2
};
static const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0
KC_NO, // Fn1
KC_SPC, // Fn2
};
Under QMK, these can be realized using action code ACTION_LAYER_TAP_KEY(1, KC_NO), ACTION_LAYER_TAP_KEY(2, KC_NO), and ACTION_LAYER_TAP_KEY(2, KC_SPC) in the `keymaps` directly.
## 6. Terminology
***TBD***
### keymap
is comprised of multiple layers.
### layer
is matrix of keycodes.
### key
is physical button on keyboard or logical switch on software.
### keycode
is codes used on firmware.
### action
is a function assigned on a key.
### layer transparency
Using transparent keycode one layer can refer key definition on other lower layer.
### layer precedence
Top layer has higher precedence than lower layers.
### tapping
is to press and release a key quickly.
### Fn key
is key which executes a special action like layer switching, mouse key, macro or etc.
### dual role key
<http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys>

@ -1,29 +0,0 @@
== KLL vs TMK
1. **Shift** = Memontary
1. Latch = One shot
1. Lock = Toggle
## KLL terminology
### Fall-through
When a key is undefined on a particular layer, the key
definition on the previously stacked layer will be used. Eventually
the key definition will be set to using the default layer. If the None
keyword is used, then the fall-through will stop and no action will
take place.
###Latch
When referring to keyboards, a key function that is only enabled
until the release of the next keypress.
###Lock
When referring to keyboards, a key function that is enabled until
that key is pressed again (e.g. Caps Lock).
### NKRO
N-Key Rollover is the capability to press N number of keys at the
same time on a keyboard and have them all register on the OS simultaneously.
### Scan Code
Row x Column code or native protocol code used by the keyboard.
### Shift
When referring to keyboards, a key function that is enabled while
that key is held.
### USB Code
Keyboard Press/Release codes as defined by the USB HID
Spec.

@ -1,38 +0,0 @@
# Overview
As raised in #1038 and other issues, the licensing status of QMK is not clear. In an effort to remove ambiguity and to clarify the licensing status of the quantum code we are identifying the providence of our source code files and clarifying what license applies to each one.
# Signoff
This section documents the people who need to sign off on applying the GPL to one or more of their contributions. If your name appears below and you consent to applying the GPL to your contributions, please put today's date in the last field of your row. Please stick to the following date format: 2017 Jan 28
Username | Files | Sign Off Date |
---------|-------|---------------|
@0xdec | quantum/rgblight.c | 2017 Jan 29 |
@algernon | quantum/quantum.c<br>quantum/quantum.h<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h | 2017 Jan 29 |
@cdlm | quantum/template/template.c<br>quantum/template/template.h | 2017 Feb 03 |
@DidierLoiseau | quantum/keymap_extras/keymap_canadian_multilingual.h<br>quantum/keymap_extras/keymap_bepo.h |2017 Jan 29 |
@eltang | quantum/config_common.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/template/config.h | 2017 Feb 28 |
@ezuk | quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/quantum_keycodes.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/keymap_extras/keymap_colemak.h<br>quantum/keymap_extras/keymap_nordic.h | 2017 Jan 31 |
@fredizzimo | quantum/config_common.h<br>quantum/keycode_config.h<br>quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/keymap_common.c<br>quantum/matrix.c<br>quantum/quantum.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/api/api_sysex.c | 2017 Jan 29 |
@h-youhei | quantum/keymap_extras/keymap_jp.h | 2017 Jan 28 |
@heartsekai | quantum/keymap_extras/keymap_german_ch.h | 2017 Jan 29 |
@IBnobody | quantum/keycode_config.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/audio/audio.c<br>quantum/audio/audio.h<br>quantum/audio/audio_pwm.c<br>quantum/audio/audio_pwm.c<br>quantum/audio/voices.c<br>quantum/audio/voices.h<br>quantum/template/config.h<br>quantum/template/template.c | 2017 Jan 30 |
@jackhumbert | quantum/config_common.h<br>quantum/keycode_config.h<br>quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/light_ws2812.c<br>quantum/light_ws2812.h<br>quantum/matrix.c<br>quantum/quantum.c<br>quantum/quantum.h<br>quantum/quantum_keycodes.h<br>quantum/rgblight.c<br>quantum/rgblight.h<br>quantum/api/api_sysex.c<br>quantum/audio/audio.c<br>quantum/audio/audio.h<br>quantum/audio/audio_pwm.c<br>quantum/audio/audio_pwm.c<br>quantum/audio/voices.c<br>quantum/audio/voices.h<br>quantum/keymap_extras/keymap_colemak.h<br>quantum/keymap_extras/keymap_dvorak.h<br>quantum/keymap_extras/keymap_fr_ch.h<br>quantum/keymap_extras/keymap_french.h<br>quantum/keymap_extras/keymap_french_osx.h<br>quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_german_ch.h<br>quantum/keymap_extras/keymap_german_osx.h<br>quantum/keymap_extras/keymap_neo2.h<br>quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_plover.h<br>quantum/keymap_extras/keymap_spanish.h<br>quantum/keymap_extras/keymap_uk.h<br>quantum/process_keycode/process_midi.c<br>quantum/process_keycode/process_music.c<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h<br>quantum/template/config.h<br>quantum/template/template.c<br>quantum/template/template.h | 2017-01-29 |
@jakllsch | quantum/keymap_extras/keymap_dvorak.h<br>quantum/keymap_extras/keymap_fr_ch.h<br>quantum/keymap_extras/keymap_french.h<br>quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_german_ch.h<br>quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_spanish.h<br>quantum/keymap_extras/keymap_uk.h | 2017 Jan 29 |
kuel | quantum/keymap_extras/keymap_unicode_cyrillic.h<br>quantum/keymap_extras/keymap_russian.h | |
@lindhe | quantum/keymap_extras/keymap_nordic.h<br>quantum/keymap_extras/keymap_norwegian.h | 2017 Jan 30 |
@matzebond | quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_neo2.h | 2017 Jan 30 |
@plgruener | quantum/keymap_extras/keymap_german.h<br>quantum/keymap_extras/keymap_neo2.h | 2017 Jan 30 |
@priyadi | quantum/quantum.c<br>quantum/process_keycode/process_unicode.c<br>quantum/process_keycode/process_unicode.h | 2017 Jan 31 |
@pvinis | quantum/quantum.c<br>quantum/quantum.h<br>quantum/process_keycode/process_tap_dance.c<br>quantum/process_keycode/process_tap_dance.h | 2017 Jan 29 |
@Smilliam | quantum/quantum.c | 2017 Feb 25 |
@sperochon | quantum/keymap_extras/keymap_french_osx.h | 2017 Jan 30 |
stephan . bosebeck at holidayinsider.com | quantum/keymap_extras/keymap_german_osx.h | 2017 Feb 15 |
@TerryMathews | quantum/quantum.c | 2017 Jan 29 |
@Twey | quantum/keymap_extras/keymap_plover.h | |
@Vifon | quantum/dynamic_macro.h<br>quantum/quantum.c | 2017 Feb 09 |
@vincent-pochet | quantum/keymap_extras/keymap_fr_ch.h | 2017 Feb 09 |
@wez | quantum/dynamic_macro.h | 2017 Jan 29 |
@Wilba6582 | quantum/keymap.h<br>quantum/keymap_common.c<br>quantum/quantum_keycodes.h | 2017 Feb 15 |
@yangliu | quantum/light_ws2812.c<br>quantum/light_ws2812.h<br>quantum/rgblight.c<br>quantum/rgblight.h | 2017 Jan 30 |

File diff suppressed because it is too large Load Diff

@ -1,36 +0,0 @@
## supported projects
### PS/2 converter
Confirmed it works on NXP LPC11U35.
- http://developer.mbed.org/platforms/TG-LPC11U35-501/
### Infinity keyboard
It runs on Freescale MK20DX128.
## compile error: cstddef
Experienced this with arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2 on ubuntu 14.04.
And resolved with 4.9.3 installed from:
- https://launchpad.net/gcc-arm-embedded
- https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
```
$ make -f Makefile.mbed
mkdir -p build/.
arm-none-eabi-g++ -include config_mbed.h -mcpu=cortex-m0 -mthumb -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer -fshort-wchar -fno-builtin -MMD -MP -DNDEBUG -Os -DTARGET_LPC11U35_401 -DTARGET_M0 -DTARGET_NXP -DTARGET_LPC11UXX -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0 -DARM_MATH_CM0 -DMBED_BUILD_TIMESTAMP=1399108688.49 -D__MBED__=1 -std=gnu++98 -I. -I../../mbed-sdk/libraries/mbed/targets -I../../mbed-sdk/libraries/mbed/targets/cmsis -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM -I../../mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11UXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11U35_501 -I../../mbed-sdk/libraries/mbed/targets/hal -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_MCU_LPC11U35_501 -I../../mbed-sdk/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_MCU_LPC11U35_501/TARGET_LPC11U35_501 -I../../mbed-sdk/libraries/mbed -I../../mbed-sdk/libraries/mbed/hal -I../../mbed-sdk/libraries/mbed/api -I../../mbed-sdk/libraries/mbed/common -I../../mbed-sdk/libraries/USBDevice -I../../mbed-sdk/libraries/USBDevice/USBHID -I../../mbed-sdk/libraries/USBDevice/USBDevice -I../../mbed-sdk/libraries/USBDevice/USBAudio -I../../mbed-sdk/libraries/USBDevice/USBSerial -I../../mbed-sdk/libraries/USBDevice/USBMSD -I../../mbed-sdk/libraries/USBDevice/USBMIDI -I../../protocol/mbed -I../../common -I../../protocol -o build/./main.o main.cpp
In file included from ../../mbed-sdk/libraries/mbed/api/mbed.h:21:0,
from main.cpp:1:
../../mbed-sdk/libraries/mbed/api/platform.h:25:19: fatal error: cstddef: No such file or directory
#include <cstddef>
^
compilation terminated.
make: *** [build/./main.o] Error 1
[13:13] noname@desk:/mnt/old_root/home/noname/tmp/tmk_keyboard/converter/ps2_usb
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

@ -1,21 +0,0 @@
In rare circumstances, your keyboard/device can become unwritable, and `dfu-programmer` will give you an error like this:
Erasing flash... Success
Checking memory from 0x0 to 0x6FFF... Empty.
Checking memory from 0x0 to 0x607F... Empty.
0% 100% Programming 0x6080 bytes...
[ X ERROR
Memory write error, use debug for more info.
Currently the only way to solve this is to [reprogram the chip via ISP](https://www.reddit.com/r/olkb/comments/4rjzen/flashing_error_on_mac_os_x/d52rj8o/). This requires another device to be hooked up to a couple of exposed pins on the PCB. __[We now have a guide on ISP flashing](isp_flashing_guide.md)__ and [this is where things are on the Planck PCB](http://imgur.com/lvbxbHt).
An example command to flash the board once things are hooked up is:
avrdude -c usbtiny -p m32u4 -U flash:w:planck_default_rev4.hex
Research is still being done on why this happens, but here are some cases:
* [`make -f Makefile.rn42 dfu` and not the dfu-programmer commands worked for @tybenz](https://github.com/tmk/tmk_keyboard/issues/316) - also see [the hhkb keyboard on tmk](https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb)
* [Doing a force erase works here](https://geekhack.org/index.php?topic=12047.msg1520147#msg1520147)
* [`dfu-programmer atmega32u4 erase --force` works here as well](https://forum.fhem.de/index.php?topic=29777.0) [DE]
* [Unresolved, but some data dumps](https://github.com/dfu-programmer/dfu-programmer/issues/29)

@ -1,62 +0,0 @@
Other Keyboard Firmware Projects
================================
## PJRC USB Keyboard/Mouse Example[USB][PJRC][Teensy][AVR]
- <http://www.pjrc.com/teensy/usb_keyboard.html>
- <http://www.pjrc.com/teensy/usb_mouse.html>
## kbupgrade[USB][V-USB][AVR]
- <http://github.com/rhomann/kbupgrade>
- <http://geekhack.org/showwiki.php?title=Island:8406>
## c64key[USB][V-USB][AVR]
- <http://symlink.dk/projects/c64key/>
## rump[USB][V-USB][AVR]
- <http://mg8.org/rump/>
- <http://github.com/clee/rump>
## dulcimer[USB][V-USB][AVR]
- <http://www.schatenseite.de/dulcimer.html>
## humblehacker-keyboard[USB][LUFA][AVR][Ergo]
- <http://github.com/humblehacker>
- <http://www.humblehacker.com/keyboard/>
- <http://geekhack.org/showwiki.php?title=Island:6292>
## ps2avr[PS/2][AVR]
- <http://sourceforge.net/projects/ps2avr/>
## ErgoDox[Ergo][Split][USB][AVR]
- <http://geekhack.org/index.php?topic=22780.0>
- <https://github.com/benblazak/ergodox-firmware>
- <https://github.com/cub-uanic/tmk_keyboard>
## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
- <https://github.com/frobiac/adnw>
## bpiphany's AVR-Keyboard[PJRC][AVR][USB]
- <https://github.com/BathroomEpiphanies/AVR-Keyboard>
- <http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions>
- <http://deskthority.net/wiki/Phantom>
## USB-USB keyboard remapper[converter][USB-USB][AVR][Arduino]
- <http://forum.colemak.com/viewtopic.php?pid=10837>
- <https://github.com/darkytoothpaste/keymapper>
## USB-USB converter threads[converter][USB-USB]
- <http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html>
- <http://geekhack.org/index.php?topic=19458.0>
## kbdbabel.org[converter][vintage][protocol][8051]
Great resource of vintage keyboard protocol information and code
- <http://www.kbdbabel.org/>
## Haata's kiibohd Controller[converter][vintage][protocol][AVR][PJRC][Cortex]
A lots of vintage keyboard protocol supports
- <http://gitorious.org/kiibohd-controller>
## Kinesis ergonomic keyboard firmware replacement[V-USB][LUFA][Ergo]
- <https://github.com/chrisandreae/kinesis-firmware>

@ -1,151 +0,0 @@
# Planck Firmware Guide
## Setting up the environment
### Windows
1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/qmk/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
### Mac
If you're using homebrew, you can use the following commands:
brew tap osx-cross/avr
brew install avr-libc
brew install dfu-programmer
Otherwise, these instructions will work:
1. Install Xcode from the App Store.
2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
3. Install [DFU-Programmer][dfu-prog].
### Linux
1. Install AVR GCC with your favorite package manager.
2. Install [DFU-Programmer][dfu-prog].
Note that, since it will be directly accessing USB hardware, the
`dfu-programmer` program needs to be run as root.
## Verify Your Installation
1. Clone the following repository: https://github.com/qmk/qmk_firmware
2. Open a Terminal and `cd` into `qmk_firmware/keyboards/planck`
3. Run `make`. This should output a lot of information about the build process.
## Using the built-in functions
Here is a list of some of the functions available from the command line:
* `make clean`: clean the environment - may be required in-between builds
* `make`: compile the code
* `make KEYMAP=<keymap>`: compile with the extended keymap file `extended_keymaps/extended_keymap_<keymap>.c`
* `make dfu`: build and flash the layout to the PCB
* `make dfu-force`: build and force-flash the layout to the PCB (may be require for first flash)
Generally, the instructions to flash the PCB are as follows:
1. Make changes to the appropriate keymap file
2. Save the file
3. `make clean`
4. Press the reset button on the PCB/press the key with the `RESET` keycode
5. `make <arguments> dfu` - use the necessary `KEYMAP=<keymap>` and/or `COMMON=true` arguments here.
## Troubleshooting
If you see something like this
0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142
440 [main] sh 13384 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
after running 'make' on Windows than you are encountering a very popular issue with WinAVR on Windows 8.1 and 10.
You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip).
Restart your system and everything should work fine!
If you see this
dfu-programmer atmega32u4 erase
process_begin: CreateProcess(NULL, dfu-programmer atmega32u4 erase, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [dfu] Error 2
when trying to 'make dfu' on Windows you need to copy the dfu-programmer.exe to qmk_firmware/keyboards/planck.
## Quantum MK Firmware
### Keymap
Unlike the other keymaps, prefixing the keycodes with `KC_` is required. A full list of the keycodes is available [here](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/doc/keycode.txt). For the keycodes available only in the extended keymap, see this [header file](https://github.com/qmk/qmk_firmware/blob/master/quantum/keymap_common.h).
You can use modifiers with keycodes like this:
LCTL(KC_C)
Which will generate Ctrl+c. These are daisy-chainable, meaning you can do things like:
LCTL(LALT(KC_C))
That will generate Ctrl+Alt+c. The entire list of these functions is here:
* `LCTL()`: Left control
* `LSFT()` / `S()`: Left shift
* `LALT()`: Left alt/opt
* `LGUI()`: Left win/cmd
* `RCTL()`: Right control
* `RSFT()`: Right shift
* `RALT()`: Right alt/opt
* `RGUI()`: Right win/cmd
`S(KC_1)`-like entries are useful in writing keymaps for the Planck.
### Other keycodes
A number of other keycodes have been added that you may find useful:
* `CM_<key>`: the Colemak equivalent of a key (in place of `KC_<key>`), when using Colemak in software (`CM_O` generates `KC_SCLN`)
* `RESET`: jump to bootloader for flashing (same as press the reset button)
* `BL_STEP`: step through the backlight brightnesses
* `BL_<0-15>`: set backlight brightness to 0-15
* `BL_DEC`: lower the backlight brightness
* `BL_INC`: raise the backlight brightness
* `BL_TOGG`: toggle the backlight on/off
### Function layers
The extended keymap extends the number of function layers from 32 to the near-infinite value of 256. Rather than using `FN<num>` notation (still available, but limited to `FN0`-`FN31`), you can use the `FUNC(<num>)` notation. `F(<num>)` is a shortcut for this.
The function actions are unchanged, and you can see the full list of them [here](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_code.h). They are explained in detail [here](keymap.md#2-action).
### Macros
Macros have been setup in the `keymaps/keymap_default.c` file so that you can use `M(<num>)` to access a macro in the `action_get_macro` section on your keymap. The switch/case structure you see here is required, and is setup for `M(0)` - you'll need to copy and paste the code to look like this (e.g. to support `M(3)`):
switch(id) {
case 0:
return MACRODOWN(TYPE(KC_A), END);
break;
case 1:
return MACRODOWN(TYPE(KC_B), END);
break;
case 2:
return MACRODOWN(TYPE(KC_C), END);
break;
case 3:
return MACRODOWN(TYPE(KC_D), END);
break;
}
return MACRO_NONE;
`MACRODOWN()` is a shortcut for `(record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)` which tells the macro to execute when the key is pressed. Without this, the macro will be executed on both the down and up stroke.
[cygwin]: https://www.cygwin.com/
[mingw]: http://www.mingw.org/
[mhv]: https://infernoembedded.com/products/avr-tools
[winavr]: http://winavr.sourceforge.net/
[crosspack]: http://www.obdev.at/products/crosspack/index.html
[dfu-prog]: http://dfu-programmer.sourceforge.net/

@ -1,14 +0,0 @@
= Previously Asked Questions
:toc:
:toc-placement: preamble
toc::[]
= Question thread
http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html
= Questions
== Columns beyond 16(uint16_t) cannot be read
* https://github.com/tmk/tmk_keyboard/wiki/FAQ#cant-read-comlumn-of-matrix-beyond-16
* http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177-270.html#p247051
* http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279

@ -1 +0,0 @@
# Get Report Descriptor with lsusb

@ -1,17 +0,0 @@
.Makefile
[source,Makefile]
----
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
----

@ -1,34 +0,0 @@
## TMK based projects
Add your project here!
See https://github.com/tmk/tmk_keyboard/issues/173
### keyboards
**S60-X**: [DIY 60% keyboard](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) designed by [VinnyCordeiro](https://github.com/VinnyCordeiro) for Sentraq:
- https://github.com/VinnyCordeiro/tmk_keyboard
**Octagon V1**: Korean custom keyboard designed by Duck.
- https://github.com/xauser/tmk_keyboard/tree/xauser
**Compact L3**: Custom keyboard designed by LifeZone and LeeKu.
- https://github.com/xauser/tmk_keyboard/tree/xauser
**KMAC, 1,2 and Happy**: Custom keyboard designed by kbdmania.
- https://github.com/ageaenes/tmk_keyboard
**P60**: [DIY wired 60% keyboard](https://imgur.com/a/zwsDN) by [p3lim](https://github.com/p3lim).
- https://github.com/p3lim/keyboard_firmware
**Nerd, Kitten Paw, Lightsaber, Phantom, Lightpad, Ergodox** on [xauser](https://github.com/xauser)'s repository
- https://github.com/xauser/tmk_keyboard/tree/xauser
**ErgoDox** on [cub-unanic](https://github.com/cub-uanic)'s repository
- https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
**Atreus** by [technomancy](https://atreus.technomancy.us)
- https://github.com/technomancy/tmk_keyboard/tree/atreus/keyboard/atreus
**[mcdox](https://github.com/DavidMcEwan/mcdox)**
- https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
### converters

@ -1,69 +0,0 @@
## TMK own projects by hasu
Located in [tmk_keyboard](https://github.com/tmk/tmk_keyboard/tree/master/) repository.
### converter
* [ps2_usb] - [PS/2 keyboard to USB][GH_ps2]
* [adb_usb] - [ADB keyboard to USB][GH_adb]
* [m0110_usb] - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
* [terminal_usb] - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
* [news_usb] - [Sony NEWS keyboard to USB][GH_news]
* [x68k_usb] - [Sharp X68000 keyboard to USB][GH_x68k]
* [sun_usb] - [Sun] to USB(type4, 5 and 3?)
* [pc98_usb] - [PC98] to USB
* [usb_usb] - USB to USB(experimental)
* [ascii_usb] - ASCII(Serial console terminal) to USB
* [ibm4704_usb] - [IBM 4704 keyboard Converter][GH_ibm4704]
### keyboard
* [hhkb] - [Happy Hacking Keyboard pro][GH_hhkb]
* [gh60] - [GH60][GH60_diy] DIY 60% keyboard [prototype][GH60_proto]
* [hbkb] - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
* [hid_liber] - [HID liberation][HID_liber] controller (by alaricljs)
* [phantom] - [Phantom] keyboard (by Tranquilite)
* [IIgs_Standard] - Apple [IIGS] keyboard mod(by JeffreySung)
* [macway] - [Compact keyboard mod][GH_macway] [retired]
* [KMAC] - Korean custom keyboard
* [Lightsaber] - Korean custom keyboard
[ps2_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ps2_usb/
[adb_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb/
[m0110_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb
[terminal_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/terminal_usb/
[news_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/news_usb/
[x68k_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/x68k_usb/
[sun_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/sun_usb/
[pc98_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/pc98_usb/
[usb_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb/
[ascii_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ascii_usb/
[ibm4704_usb]: https://github.com/tmk/tmk_keyboard/tree/master/converter/ibm4704_usb
[hhkb]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hhkb/
[gh60]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/gh60/
[hbkb]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hbkb/
[hid_liber]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/hid_liber/
[phantom]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/phantom/
[IIgs_Standard]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/IIgs/
[macway]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/macway/
[KMAC]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/kmac/
[Lightsaber]: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/lightsaber/
[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
[Phantom]: http://geekhack.org/index.php?topic=26742
[GH60_diy]: http://geekhack.org/index.php?topic=34959
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
[Sun]: http://en.wikipedia.org/wiki/Sun-3
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
See other [[TMK Based Projects]]

@ -1,243 +0,0 @@
# TMK Documenation
Features
--------
These features can be used in your keyboard.
* Multi-layer Keymap - Multiple keyboard layouts with layer switching
* Mouse key - Mouse control with keyboard
* System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
* Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
* USB NKRO - 120 keys(+ 8 modifiers) simultaneously
* PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
* Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
* User Function - Customizable function of key with writing code
* Macro - Very primitive at this time
* Keyboard Tricks - Oneshot modifier and modifier with tapping feature
* Debug Console - Messages for debug and interaction with firmware
* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
* Locking CapsLock - Mechanical switch support for CapsLock
* Breathing Sleep LED - Sleep indicator with charm during USB suspend
* Backlight - Control backlight levels
Projects
--------
You can find some keyboard specific projects under `converter` and `keyboard` directory.
## Main projects
### OLKB products
* [planck](keyboards/planck/) - [Planck] Ortholinear 40% keyboard
* [preonic](keyboards/preonic/) - [Preonic] Ortholinear 50% keyboard
* [atomic](keyboards/atomic/) - [Atomic] Ortholinear 60% keyboard
### Ergodox EZ
* [ergodox_ez](keyboards/ergodox/ez) - [Ergodox_EZ] Assembled split keyboard
## Other projects
### converter
* [ps2_usb](converter/ps2_usb/) - [PS/2 keyboard to USB][GH_ps2]
* [adb_usb](converter/adb_usb/) - [ADB keyboard to USB][GH_adb]
* [m0110_usb](converter/m0110_usb) - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
* [terminal_usb](converter/terminal_usb/) - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
* [news_usb](converter/news_usb/) - [Sony NEWS keyboard to USB][GH_news]
* [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
* [pc98_usb](converter/pc98_usb/) - [PC98] to USB
* [usb_usb](converter/usb_usb/) - USB to USB(experimental)
* [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB
* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704]
### keyboard
* [hhkb](keyboards/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] hasu's main board
* [gh60](keyboards/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] hasu's second board
* [hbkb](keyboards/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
* [hid_liber](keyboards/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
* [phantom](keyboards/phantom/) - [Phantom] keyboard (by Tranquilite)
* [IIgs_Standard](keyboards/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [macway](keyboards/macway/) - [Compact keyboard mod][GH_macway] [retired]
* [KMAC](keyboards/kmac/) - Korean custom keyboard
* [Lightsaber](keyboards/lightsaber/) - Korean custom keyboard
* [Infinity](keyboards/infinity/) - Massdrop [Infinity keyboard][Infinity]
* [NerD](keyboards/nerd/) - Korean custom keyboard
* [KittenPaw](keyboards/kitten_paw) - Custom Majestouch controller
* [Lightpad](keyboards/lightpad) - Korean custom keypad
* [ghost_squid](keyboards/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
### Extenal projects using tmk_keyboard
* [ErgoDox_cub-uanic][cub-uanic] - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
* [mcdox][mcdox_tmk] - [mcdox][mcdox]
[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
[GH_hhkb_bt]: http://geekhack.org/showwiki.php?title=Island:20851
[GH_m0110]: http://geekhack.org/showwiki.php?title=Island:24965
[GH_news]: http://geekhack.org/showwiki.php?title=Island:25759
[GH_terminal]: http://geekhack.org/showwiki.php?title=Island:27272
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
[Phantom]: http://geekhack.org/index.php?topic=26742
[GH60]: http://geekhack.org/index.php?topic=34959
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
[Sun]: http://en.wikipedia.org/wiki/Sun-3
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
[cmxt]: http://gaming.coolermaster.com/en/products/keyboard/quickfirext/
[ergodox_org]: http://ergodox.org/
[cub-uanic]: https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
[mcdox]: https://github.com/DavidMcEwan/mcdox
[mcdox_tmk]: https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
[Planck]: http://olkb.co/planck
[Preonic]: http://olkb.co/preonic
[Atomic]: http://olkb.co/atomic
[Ergodox_EZ]: https://www.indiegogo.com/projects/ergodox-ez-an-incredible-mechanical-keyboard
License
-------
**GPLv2** or later. Some protocol files are under **Modified BSD License**.
Third party libraries like LUFA, PJRC and V-USB have their own license respectively.
Build Firmware and Program Controller
-------------------------------------
See [build environment setup](build_environment_setup.md), or the readme in the particular keyboards/* folder.
Change your keymap
------------------
See [keymap.md](keymap.md).
Magic Commands
--------------
To see help press `Magic` + `H`.
`Magic` key combination is `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.
Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
----- Command Help -----
c: enter console mode
d: toggle debug enable
x: toggle matrix debug
k: toggle keyboard debug
m: toggle mouse debug
v: print device version & info
t: print timer count
s: print status
e: print eeprom config
n: toggle NKRO
0/F10: switch to Layer0
1/F1: switch to Layer1
2/F2: switch to Layer2
3/F3: switch to Layer3
4/F4: switch to Layer4
PScr: power down/remote wake-up
Caps: Lock Keyboard(Child Proof)
Paus: jump to bootloader
Boot Magic Configuration - Virtual DIP Switch
---------------------------------------------
Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable.
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.
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 [tmk_core/common/bootmagic.h](/tmk_core/common/bootmagic.h).
#### General
- Skip reading EEPROM to start with default configuration(`ESC`)
- Clear configuration stored in EEPROM to reset configuration(`Backspace`)
#### Bootloader
- Kick up Bootloader(`B`)
#### Debug
- Debug enable(`D`)
- Debug matrix enable(`D`+`X`)
- Debug keyboard enable(`D`+`K`)
- Debug mouse enable(`D`+`M`)
#### Keymap
- Swap Control and CapsLock(`Left Control`)
- Change CapsLock to Control(`Caps Lock`)
- Swap LeftAlt and Gui(`Left Alt`)
- Swap RightAlt and Gui(`Right Alt`)
- Disable Gui(`Left Gui`)
- Swap Grave and Escape(`Grave`)
- Swap BackSlash and BackSpace(`Back Slash`)
- Enable NKRO on boot(`N`)
#### Default Layer
- Set Default Layer to 0(`0`)
- Set Default Layer to 1(`1`)
- Set Default Layer to 2(`2`)
- Set Default Layer to 3(`3`)
- Set Default Layer to 4(`4`)
- Set Default Layer to 5(`5`)
- Set Default Layer to 6(`6`)
- Set Default Layer to 7(`7`)
Mechanical Locking support
--------------------------
This feature makes it possible for you to use mechanical locking switch for `CapsLock`, `NumLock`
or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LN
UM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Res
ync option tries to keep switch state consistent with keyboard LED state.
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE
Start Your Own Project
-----------------------
**TBD**
Debugging
--------
Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/common/xprintf.h`.
Files and Directories
-------------------
### Top
* tmk_core/ - core library
* keyboards/ - keyboard projects
* converter/ - protocol converter projects
* doc/ - documents
Coding Style
-------------
- Doesn't use Tab to indent, use 4-spaces instead.
Other Keyboard Firmware Projects
------------------
You can learn a lot about keyboard firmware from these. See [docs/other_projects.md](other_projects.md).

@ -1,11 +0,0 @@
# Getting Report Descriptor
```
$ cd /sys/bus/usb/drivers/usbhid
$ ls
1-1.3.4:1.0 1-1.3.4:1.2 bind new_id uevent
1-1.3.4:1.1 1-1.3.4:1.3 module remove_id unbind
$ echo -n 1-1.4\:1.0 | sudo tee unbind
$ sudo lsusb -vvv -d 046d:c01d
$ echo -n 1-1.4\:1.0 | sudo tee bind
```
Loading…
Cancel
Save