https://github.com/tartanllama/etkf
Embarrassingly templated keyboard framework
https://github.com/tartanllama/etkf
firmware keyboard template-metaprogramming
Last synced: 6 months ago
JSON representation
Embarrassingly templated keyboard framework
- Host: GitHub
- URL: https://github.com/tartanllama/etkf
- Owner: TartanLlama
- License: mit
- Created: 2017-03-29T08:56:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T14:29:41.000Z (almost 8 years ago)
- Last Synced: 2025-08-15T19:16:20.554Z (7 months ago)
- Topics: firmware, keyboard, template-metaprogramming
- Language: C
- Size: 42 KB
- Stars: 34
- Watchers: 9
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# etkf
Embarrassingly templated keyboard framework
The aim of this is to have very terse descriptions of keyboards and give good compile-time diagnostics when mistaeks are made. Here's the entire configuration file for a simple 40% Dvorak keyboard:
```
#include "keys.hpp"
#include "type.hpp"
using namespace etkf;
using namespace etkf::pins;
struct test_keyboard {
using rows = pin_set;
using columns = pin_set;
static auto layouts();
using key_positions = typelist<
row<1,1,1,1,1,1,1,1,1,1,1,1,1>,
row<1,1,1,1,1,1,1,1,1,1,1,0,1>,
row<1,0,1,1,1,1,1,1,1,1,1,1,1>,
row<1,1,1,0,1,1,0,1,1,1,1,1,1>
>;
};
using keyboard_to_run = test_keyboard;
auto test_keyboard::layouts() {
using namespace etkf::keys;
return typelist<
typelist<
row,
row,
row,
row
>
>{};
}
```
Currently it has only been tested on Linux, but I guess it could work elsewhere if you can get the toolchain set up.
### How to build:
mkdir build
cd build
cmake -DKEYBOARD_TO_BUILD= ..
make
### How to add a new keyboard:
There is a Python script which will do all of the legwork for you:
tools/add_new_keyboard.py
### Current state:
- A configuration like the above will allow you to type things!
- Supports Teensy 2 (ATMEGA32U4)
- 6 key rollover
- Modifier keys
- Basic layer support
- Change default layer (e.g. QWERTY to Dvorak)
### To do:
- Debouncing
- NKRO
- Better compile-time diagnostics
- Debugging support
- Rewrite of the USB code
- Support more chips
- Port some keyboards
- Profile-driven optimisations
### Dependencies:
- C++17 AVR compiler (you can build one by following [these instructions](https://www.microchip.com/webdoc/AVRLibcReferenceManual/install_tools.html))
- CMake
- Hardware to run it on
- Nachos (optional)