• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    C
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TMK keyboard library

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

2017/05/30

Fixed Modifier/Layer key stuck problem. See this wiki entry. https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#modifierlayer-stuck If you need old keymap behaviour for some reason define NO_TRACK_KEY_PRESS in your config.h.

This is virtually equivalent to QMK PREVENT_STUCK_MODIFIERS. qmk/qmk_firmware#182

2017/01/11

Changed action code for ACTION_LAYER_MODS and this may cause incompatibility with existent shared URL and downloaded firmwware of keymap editor. If you are using the action you just have to redefine it on keymap editor. Existent keymap code should not suffer.

2016/06/26

Keymap framework was updated. fn_actions[] should be defined as action_t instead of uint16_t. And default code for keymap handling is now included in core you just need define uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] and action_t fn_actions[].

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.

More Repositories

1

tmk_keyboard

Keyboard firmwares for Atmel AVR and Cortex-M
C
3,991
star
2

HHKB_controller

Keyboard Controller Board for HHKB pro2 - KiCad project
KiCad Layout
252
star
3

keyboard_parts.pretty

KiCad modules for keyboard design
171
star
4

kicad_lib_tmk

KiCad library for tmk project
144
star
5

USB2USB_Converter

USB to USB keyboard protocol converter supported by TMK keyboard firmware
139
star
6

alps64

Poker X compatible 60% size PCB supports various Alps switch keyboard layouts like AEK, Omnikey, Dell, V60MTS and Infinity(KiCad Project)
82
star
7

infinity_ergodox

Unofficial keyboard firmware for Input Club's Infinity Ergodox
C
28
star
8

whitefox

Keyboard firmware for matt3o's WhiteFox -- This won't be updated actively, see https://github.com/flabbergast/whitefox instead
C
25
star
9

capsense_qmatrix

Capacitive Sense with Atmel QMatrix method
C
21
star
10

keyboard_converter

Keyboard Protocol Converter Board - KiCad project
KiCad Layout
19
star
11

alps64_plate

KiCAD design for Alps64 Plate
Python
12
star
12

kbdbabel

Source code mirror of www.kbdbabel.org keyboard protocol converters for reference purpose. Got from CVS repository: kbdbabel.cvs.sourceforge.net.
Assembly
9
star
13

USBaspLoader

My custom version. USBaspLoader is a USB boot loader for AVR microcontrollers.
C
9
star
14

elm-chan_xprintf

printf function for microcontroller
C
8
star
15

HeadlessReflowOven

Simple reflow oven controller just with button, buzzer and LED, no LCD
C++
6
star
16

blargg-adb-teensy

ADB keyboard converter on PJRC Teensy board
C
4
star
17

keyboard_converter_adapter_ibm4704

D-sub 9p Connector adapter PCB for TMK keyboard converter(IBM4704/NEWS)
KiCad Layout
4
star
18

decoder-adb

sigrok decoder for ADB - Apple Desktop Bus
Python
3
star
19

KL27Z_breakout

300mil breakout PCB for QFN32 Kinetis KL27Z
KiCad Layout
2
star
20

blargg-adb-usbasp

ADB keyboard converter on USBASP board with V-USB
C
2
star
21

tmk_test

test test test
C
1
star
22

tinyusb_ps2

PS/2 keyboar converter for Raspberry Pi PICO RP2040
C
1
star
23

vagrant_tmk_build

Make vm enviroment on VirtualBox to compile tmk_firmware codes and program microcontroller.
Shell
1
star
24

elm-chan_xitoa

printf assembler library for AVR
Assembly
1
star