1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
tmk 71381457fa Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6
d5c5ac6 Merge branch 'develop'
5957682 Merge branch 'hotfix-mediakey'
a478c62 Merge branch 'hotfix-vusb'
cccebfe Merge branch 'njbair-docfix'
0aaab57 Clean up wording in keymap example
dc8bbc3 Clarify layer precedence
9e0b4c1 clarify layer documentation
915eb48 core: Fix media/consumer keys
88f90f3 Fix for VUSB configuration
3e290cd Fix including board.mk in chibios.mk
32c69e0 Merge branch 'newapi' into develop
c9a56f9 Merge remote-tracking branch 'flabbergast/chibios' into develop
01e33ea Fix chibios and mbed common.mk for hook.c
bea79d9 hook: Change func name of usb events
3e97536 hook: Change file and func names(*_hook -> hook_*)
c286d8c Merge pull request #10 from fredizzimo/chibios-contrib2
062d74e Update ChibiOS instructions
d47150f Add support for new version of ChibiOS and Contrib
62b5401 Chibios: disable LTO (link-time optimisation).
c64e9aa hooks: Fix for LUFA
54e68b0 hooks: Remove led_restore_hook
325c09d Chibios: make the default bootloader_jump redefinable (weak).
078c722 Chibios: fix STM32_BOOTLOADER_ADDRESS name.
e73cfe5 hooks: Fix for keyboard LED update
e6120c5 Implement basic hooks.
7c370e9 Chibios: Update the main chibios README.
7f0198d Chibios: implement sleep LED for STM32.
afef9b4 Fix hard-coded path of CHIBIOS
95c5b19 Merge pull request #7 from fredizzimo/sysvsize
27128a8 Sysv format for ChibiOS arm-none-eabi-size
d4b8e68 core: Fix chibios user compile options
b85d462 Merge branch 'chibios' of https://github.com/flabbergast/tmk_keyboard into flabbergast_chibios
de41aa1 core: Fix ps2_mouse.c debug print
d79d925 Removed duplicate debug message code and surrounded it with IFDEF as needed
8f28589 Chibios: Revert common.mk change (fix AVR linking problem).
ec9eff2 Chibios: cleanup usb_main code.
28c4665 Chibios: Fix a HardFault bug (wait after start).

git-subtree-dir: tmk_core
git-subtree-split: d5c5ac63e60dfc6da6661a21bd968b4d577a27d5
2016-04-21 14:35:48 +09:00
common Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6 2016-04-21 14:35:48 +09:00
doc Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6 2016-04-21 14:35:48 +09:00
protocol Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6 2016-04-21 14:35:48 +09:00
tool Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6 2016-04-21 14:35:48 +09:00
.gitignore Squashed 'tmk_core/' content from commit 05caacc 2015-04-10 01:32:04 +09:00
.gitmodules Squashed 'tmk_core/' changes from caca2c0..dc0e46e 2015-05-13 11:13:10 +09:00
common.mk Squashed 'tmk_core/' changes from ee8c5ba..d5c5ac6 2016-04-21 14:35:48 +09:00
ldscript_keymap_avr5.x Squashed 'tmk_core/' changes from dc0e46e..57d27a8 2015-09-24 12:29:11 +09:00
ldscript_keymap_avr35.x Squashed 'tmk_core/' changes from dc0e46e..57d27a8 2015-09-24 12:29:11 +09:00
protocol.mk Squashed 'tmk_core/' changes from b9e0ea0..caca2c0 2015-04-28 11:27:10 +09:00
README.md Squashed 'tmk_core/' changes from 57d27a8..08ce4c3 2016-02-11 12:21:21 +09:00
ring_buffer.h Squashed 'tmk_core/' changes from b9e0ea0..caca2c0 2015-04-28 11:27:10 +09:00
rules.mk Squashed 'tmk_core/' changes from 57d27a8..08ce4c3 2016-02-11 12:21:21 +09:00

TMK Keyboard Firmware Core Library

This is a keyboard firmware library with some useful features for Atmel AVR and Cortex-M.

Source code is available here: https://github.com/tmk/tmk_keyboard/tree/core

Updates

2016/02/10

flabbergast's Chibios protocol was merged from https://github.com/flabbergast/tmk_keyboard/tree/chibios. See protocol/chibios/README.md. Chibios protocol supports Cortex-M such as STM32 and Kinetis.

2015/04/22

separated with TMK Keyboard Firmware Collection

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

TMK Keyboard Firmware Collection

Complete firmwares for various keyboards and protocol converters.

https://github.com/tmk/tmk_keyboard

License

GPLv2 or later. Some protocol files are under Modified BSD License. LUFA, PJRC and V-USB stack have their own license respectively.

Build Firmware and Program Controller

See doc/build.md.

Start Your Own Project

TBD

Config.h Options

1. USB vendor/product ID and device description

#define VENDOR_ID       0xFEED
#define PRODUCT_ID      0xBEEF
#define MANUFACTURER    t.m.k.
#define PRODUCT         Macway mod
#define DESCRIPTION     t.m.k. keyboard firmware for Macway mod

2. Keyboard matrix configuration

#define MATRIX_ROWS 8
#define MATRIX_COLS 8
#define MATRIX_HAS_GHOST

Architecture

Architecture Diagram
                           +---------------+---------------+-------------+
                           |    Host       |   Keyboard    | Matrix, LED |
   ___________             |-----------+-+ +-------------+ | +-----------|
  /          /| Keys/Mouse | Protocol  |d| | Action      | | | Protocol  |
 /__________/ |<-----------|  LUFA     |r| |  Layer, Tap | | |  Matrix   |
 |.--------.| |   LED      |  V-USB    |i| |-------------| | |  PS/2,IBM |             __________________
 ||        || |----------->|  PJRC     |v| | Keymap      | | |  ADB,M0110|  Keys      / /_/_/_/_/_/_/_/ /|
 ||  Host  || |  Console   |  iWRAP(BT)|e| | Mousekey    | | |  SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
 ||________||/.<-----------|  UART     |r| | Report      | | |  X68K/PC98| Control  / /_/_/_/_/_/_/_/ / /
 `_========_'/|            |---------------------------------------------|-------->/___ /_______/ ___/ /
 |_o______o_|/             | Sendchar, Print, Debug, Command, ...        |         |_________________|/
                           +---------------------------------------------+              Keyboard

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 common/xprintf.h.

Files and Directories

Top

  • common/ - common codes
  • protocol/ - keyboard protocol support
  • doc/ - documents
  • common.mk - Makefile for common
  • protocol.mk - Makefile for protocol
  • rules.mk - Makefile for build rules

Common

  • host.h
  • host_driver.h
  • keyboard.h
  • command.h
  • keymap.h
  • action.h
  • keycode.h
  • matrix.h
  • led.h
  • mousekey.h
  • report.h
  • debug.h
  • print.h
  • bootloader.h
  • sendchar.h
  • timer.h
  • util.h

Keyboard Protocols

  • lufa/ - LUFA USB stack
  • pjrc/ - PJRC USB stack
  • vusb/ - Objective Development V-USB
  • iwrap/ - Bluetooth HID for Bluegiga iWRAP
  • ps2.c - PS/2 protocol
  • adb.c - Apple Desktop Bus protocol
  • m0110.c - Macintosh 128K/512K/Plus keyboard protocol
  • news.c - Sony NEWS keyboard protocol
  • x68k.c - Sharp X68000 keyboard protocol
  • serial_soft.c - Asynchronous Serial protocol implemented by software

Coding Style

  • Doesn't use Tab to indent, use 4-spaces instead.