An open API service indexing awesome lists of open source software.

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

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)