Merge branch 'master' into promethium
@ -0,0 +1,5 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
NKRO_ENABLE = true
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
@ -0,0 +1,56 @@
|
||||
<!-- -*- mode: markdown; fill-column: 8192 -*- -->
|
||||
|
||||
Mnemes Swedish Bonaza
|
||||
=======================
|
||||
|
||||
My Layout in process, most of the code is shamelessly stolen from [algernons][algernon] excellent layout
|
||||
|
||||
[algernon]: https://github.com/algernon/ergodox-layout
|
||||
|
||||
It's for Windows (current work forces me to) and Swedish (matter of birth) so ymmw.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Layouts](#layouts)
|
||||
- [Base layer](#base-layer)
|
||||
- [Nav layer](#nav-layer)
|
||||
- [Sym layer](#sym-layer)
|
||||
- [LED states](#led-states)
|
||||
|
||||
# Layouts
|
||||
|
||||
## Base layer
|
||||
|
||||
![Base layer](img/base.png)
|
||||
|
||||
|
||||
* The number row doubles as a function row. Short presses produces numbers, long presses produces Fxx
|
||||
* The `Shift`, `Alt`, and `Control` modifiers are one-shot.
|
||||
* `Backspace` and `Enter` doubles as switches to the `sym` layer when held
|
||||
* The `ESC` key also doubles as a one-shot cancel key.
|
||||
* The **Lead** key is followed by a sequence of keys.
|
||||
- `LEAD l` : `lgui+l`.
|
||||
- `LEAD s l` : `λ`.
|
||||
- `LEAD s s` : `¯\_(ツ)_/¯`
|
||||
- `LEAD s f` : `凸(ツ)凸`
|
||||
- `LEAD a *` : Application switching based on position in start menu. Very specific to my computer.
|
||||
|
||||
|
||||
## Nav layer
|
||||
|
||||
![Nav layer](img/fun.png)
|
||||
|
||||
Basic navigation on the right hand and modifiers close
|
||||
by for the left. The latter because I tend to use `ctrl+arrows` quite a lot.
|
||||
|
||||
## Sym layer
|
||||
|
||||
![Sym layer](img/sym.png)
|
||||
|
||||
* Easy access to most symbols I use on a daily basis. Most common are on the home row, the rest are grouped as best as I could.
|
||||
|
||||
- `eq` : Tapdance, produces `===` and `!==`
|
||||
- `fun`: Tapdance, produces `=>` and `() => {\n`
|
||||
|
||||
# License
|
||||
GPL-3+
|
@ -0,0 +1,7 @@
|
||||
#define ONESHOT_TIMEOUT 3000
|
||||
#define TAPPING_TERM 200
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#define LEADER_TIMEOUT 1000
|
||||
|
||||
#include "../../config.h"
|
After Width: | Height: | Size: 448 KiB |
After Width: | Height: | Size: 420 KiB |
After Width: | Height: | Size: 423 KiB |
@ -0,0 +1,226 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
EPRM,
|
||||
VRSN,
|
||||
RGB_SLD
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------------. ,--------------------------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | Cmd,Shft,[ | | Cmd,Shft,] | 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |--------+------+------+------+------+-------------------| |------------+------+------+------+------+------+--------|
|
||||
* | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |BkSp/Cmd| A | S | D | F | G |------------| |------------| H | J | K | L |; / L2|' / Cmd |
|
||||
* |--------+------+------+------+------+------| Hyper | | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Ctrl/Esc|PgUp| | App | LGui |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | PgDn | | Home | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | Esc | | Alt | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, M(2),
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
GUI_T(KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
|
||||
CTL_T(KC_ESC),KC_PGUP,
|
||||
KC_PGDN,
|
||||
KC_SPC,KC_BSPC, KC_ESC,
|
||||
// right hand
|
||||
M(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
|
||||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
|
||||
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_LALT,KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | <- | 1 | 2 | 3 | \ | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
|
||||
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_TRNS, M(1), KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
// KC_COMM, KC_MINS
|
||||
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | MsUp | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | Prev | Next | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
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_TRNS, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
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) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
// dynamically generate these.
|
||||
case EPRM:
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RGB_SLD:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 42 KiB |
@ -1,3 +1,5 @@
|
||||
SUBPROJECT_DEFAULT = alvicstep
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
||||
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,105 @@
|
||||
#include "kinesis.h"
|
||||
|
||||
// begin section origin https://github.com/alvicstep/tmk_keyboard
|
||||
|
||||
void all_led_off(void)
|
||||
{
|
||||
PORTD = 0b11111111;
|
||||
}
|
||||
|
||||
void all_led_on(void)
|
||||
{
|
||||
PORTD = 0b00000000;
|
||||
}
|
||||
void num_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b11101111;
|
||||
}
|
||||
|
||||
void caps_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b01111111;
|
||||
}
|
||||
|
||||
void scroll_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b11011111;
|
||||
}
|
||||
void keypad_led_on(void)
|
||||
{
|
||||
PORTD = 0b10111111;
|
||||
}
|
||||
void blink_all_leds(void)
|
||||
{
|
||||
all_led_on();
|
||||
_delay_ms(500);
|
||||
|
||||
all_led_off();
|
||||
_delay_ms(100);
|
||||
|
||||
caps_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
num_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
scroll_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
keypad_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
//back
|
||||
|
||||
scroll_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
num_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
caps_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
all_led_off();
|
||||
}
|
||||
|
||||
// End section origin https://github.com/alvicstep/tmk_keyboard
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
blink_all_leds();
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
//Copyright 2014 Warren Janssens <warren.janssens@gmail.com>
|
||||
uint8_t leds = 0xF0;
|
||||
if (usb_led & 1 << USB_LED_NUM_LOCK)
|
||||
leds &= ~0x10;
|
||||
if (usb_led & 1 << USB_LED_CAPS_LOCK)
|
||||
leds &= ~0x80;
|
||||
if (usb_led & 1 << USB_LED_SCROLL_LOCK)
|
||||
leds &= ~0x20;
|
||||
PORTD = (PORTD & 0x0F) | leds;
|
||||
|
||||
led_set_user(usb_led);
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,67 @@
|
||||
#ifndef KINESIS_ALVICSTEP_H
|
||||
#define KINESIS_ALVICSTEP_H
|
||||
|
||||
#include "../kinesis.h"
|
||||
|
||||
|
||||
#define KEYMAP( \
|
||||
k02,k22,k12,k01,k21,k11,k00,k20,k10, \
|
||||
k80,k70,k60,k50,k40,k30, \
|
||||
k81,k71,k61,k51,k41,k31, \
|
||||
k82,k72,k62,k52,k42,k32, \
|
||||
k83,k73,k63,k53,k43,k33, \
|
||||
k74,k64,k54,k34, \
|
||||
k36,k35, \
|
||||
k55, \
|
||||
k56,k46,k75, \
|
||||
k03,k23,k13,k04,k24,k14,k05,k85,k84, \
|
||||
k94,kA4,kB4,kD4,kE4,kF4, \
|
||||
k95,kA5,kB5,kD5,kE5,kF5, \
|
||||
k96,kA6,kB6,kD6,kE6,kF6, \
|
||||
k97,kA7,kB7,kD7,kE7,kF7, \
|
||||
k93,kB3,kD3,kE3, \
|
||||
k47,k66, \
|
||||
k67, \
|
||||
k87,k76,k86 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, KC_NO }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46, k47 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56, KC_NO }, \
|
||||
{ k60, k61, k62, k63, k64, KC_NO, k66, k67 }, \
|
||||
{ k70, k71, k72, k73, k74, k75, k76, KC_NO }, \
|
||||
{ k80, k81, k82, k83, k84, k85, k86, k87}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,k93, k94, k95, k96, k97}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kA4, kA5, kA6, kA7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kB3, kB4, kB5, kB6, kB7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kD3, kD4, kD5, kD6, kD7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kE3, kE4, kE5, kE6, kE7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kF4, kF5, kF6, kF7} \
|
||||
}
|
||||
|
||||
|
||||
/* Row pin configuration
|
||||
PF0 A
|
||||
PF1 B
|
||||
PF2 C
|
||||
PF3 G 0 = U4, 1 = U5
|
||||
|
||||
|
||||
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 rA rB rC rD rE rF
|
||||
PB0 c0| f6 f8 f7 5 4 3 2 1 =+
|
||||
PB1 c1| f3 f5 f4 t r e w q TAB
|
||||
PB2 c2| ESC f2 f1 g f d s a CL
|
||||
PB3 c3| f9 f11 f10 b v c x z LS UP DN [{ ]}
|
||||
PB4 c4| f12 SL PS RT LT §± `~ 6 7 8 9 0 -_
|
||||
PB5 c5| PB PGM KPD y u i o p \
|
||||
PB6 c6| LC DL BS RC EN SP h j k l ;: '"
|
||||
PB7 c7| RA PU PD n m ,< .> /? RS
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,35 @@
|
||||
#ifndef ALVICSTEP_CONFIG_H
|
||||
#define ALVICSTEP_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 16
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
//Passed through the port multipler, so 4 pins =16
|
||||
#define MATRIX_ROW_PINS { F0,F1, F2, F3 }
|
||||
|
||||
// May be upside down.
|
||||
#define MATRIX_COL_PINS { B0,B1, B2, B3, B4, B5, B6, B7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
|
||||
#endif
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 336 KiB After Width: | Height: | Size: 336 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
@ -0,0 +1,46 @@
|
||||
kinesis-advantage keyboard firmware
|
||||
======================
|
||||
|
||||
This directory is called alvicstep because https://github.com/alvicstep did the heavy work and took the photos in the doc directory.
|
||||
alvicstep did NOT do anything related to the QMK implementation, so don't bug him/her.
|
||||
|
||||
There are other ways of replacing the CPU in the kinesis, this one uses jumper wires from the Teensy to the original DIP socket
|
||||
|
||||
|
||||
## Kinesis specific information
|
||||
This is a port of https://github.com/alvicstep/tmk_keyboard,
|
||||
which is a fork of https://github.com/wjanssens/tmk_keyboard,
|
||||
which is based on work from https://github.com/chrisandreae/keyboard-firmware
|
||||
|
||||
If you replace the kinesis CPU as described in the doc folder, then this code should allow you to use QMK.
|
||||
I've tested with a Teensy 2++, remember to change the CPU if you use a 32u4 instead.
|
||||
|
||||
Not yet implemented:
|
||||
- Kinesis EEProm reading or writing
|
||||
- Audio - this should be simple if we remove hardcoded pins from audio.h and switch to E7
|
||||
|
||||
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/kinesis-advantage folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, simply run `make`.
|
||||
|
||||
### Other Keymaps
|
||||
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
|
||||
|
||||
$ make keymap=[default|jack|<name>]
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
@ -0,0 +1,10 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
# just silently stop, since we need to upload with teensy uploader
|
||||
upload: build
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
#include "kinesis.h"
|
||||
|
||||
#define _DVORAK 0 // Base Dvorak layer
|
||||
#define _MEDIA 1 // Media layer
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_DVORAK] = KEYMAP(
|
||||
// left hand
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y,
|
||||
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X,
|
||||
KC_ESC, KC_LBRC, KC_DOWN, KC_UP,
|
||||
// left thumb
|
||||
KC_LGUI, KC_LCTL,
|
||||
KC_LALT,
|
||||
KC_BSPC, KC_DEL, TG(_MEDIA),
|
||||
// right hand
|
||||
KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_FN0, KC_1,
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
|
||||
KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
|
||||
KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
|
||||
KC_LEFT, KC_RIGHT, KC_RBRC, KC_BSLS,
|
||||
// right thumb
|
||||
KC_RCTL, KC_RGUI,
|
||||
KC_RALT,
|
||||
TG(_MEDIA), KC_ENT, KC_SPC
|
||||
),
|
||||
|
||||
[_MEDIA] = KEYMAP(
|
||||
// left hand
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_NO,
|
||||
KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO,
|
||||
KC_NO, KC_NO, KC_MS_D, KC_MS_U,
|
||||
// left thumb
|
||||
KC_NO, KC_NO,
|
||||
KC_NO,
|
||||
KC_NO, KC_NO, KC_TRNS,
|
||||
// right hand
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_POWER,
|
||||
KC_NO, KC_VOLU, KC_MS_U, KC_VOLD, KC_NO, KC_NO,
|
||||
KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
|
||||
KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO,
|
||||
KC_MS_L, KC_MS_R, KC_NO, KC_NO,
|
||||
// right thumb
|
||||
KC_NO, KC_NO,
|
||||
KC_NO,
|
||||
KC_TRNS, KC_ENT, KC_NO
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# 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
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -1,67 +1,23 @@
|
||||
#ifndef KINESIS_H
|
||||
#define KINESIS_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
// The first section contains all of the arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#ifdef SUBPROJECT_alvicstep
|
||||
#include "alvicstep.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_stapelberg
|
||||
#include "stapelberg.h"
|
||||
#endif
|
||||
|
||||
#define KEYMAP( \
|
||||
k02,k22,k12,k01,k21,k11,k00,k20,k10, \
|
||||
k80,k70,k60,k50,k40,k30, \
|
||||
k81,k71,k61,k51,k41,k31, \
|
||||
k82,k72,k62,k52,k42,k32, \
|
||||
k83,k73,k63,k53,k43,k33, \
|
||||
k74,k64,k54,k34, \
|
||||
k36,k35, \
|
||||
k55, \
|
||||
k56,k46,k75, \
|
||||
k03,k23,k13,k04,k24,k14,k05,k85,k84, \
|
||||
k94,kA4,kB4,kD4,kE4,kF4, \
|
||||
k95,kA5,kB5,kD5,kE5,kF5, \
|
||||
k96,kA6,kB6,kD6,kE6,kF6, \
|
||||
k97,kA7,kB7,kD7,kE7,kF7, \
|
||||
k93,kB3,kD3,kE3, \
|
||||
k47,k66, \
|
||||
k67, \
|
||||
k87,k76,k86 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, KC_NO }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46, k47 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56, KC_NO }, \
|
||||
{ k60, k61, k62, k63, k64, KC_NO, k66, k67 }, \
|
||||
{ k70, k71, k72, k73, k74, k75, k76, KC_NO }, \
|
||||
{ k80, k81, k82, k83, KC_NO ,KC_NO, k86, k87}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,k93, k94, k95, k96, k97}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kA4, kA5, kA6, kA7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kB3, kB4, kB5, kB6, kB7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, KC_NO, KC_NO, k84, k85}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kD3, kD4, kD5, kD6, kD7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kE3, kE4, kE5, kE6, kE7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kF4, kF5, kF6, kF7} \
|
||||
}
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
/* 4y0 A 4y1 B 4y2 4y3 D 4y4 E 4y5 F 4y6 G 4y7 H 5y0 I 5y1 J 5y2 K 5y3 L 5y4 M 5y5 N 5y6 O 5y7 P */
|
||||
void all_led_off(void);
|
||||
void all_led_on(void);
|
||||
void num_lock_led_on(void);
|
||||
void caps_lock_led_on(void);
|
||||
void scroll_lock_led_on(void);
|
||||
void keypad_led_on(void);
|
||||
|
||||
/*
|
||||
0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||
A B C D E F G H I J K L M N O P
|
||||
4y0 4y1 4y2 4y3 4y4 4y5 4y6 4y7 5y0 5y1 5y2 5y3 5y4 5y5 5y6 5y7
|
||||
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
|
||||
0 PB0 21 c0 f6 f8 f7 5 4 3 2 1 =+
|
||||
1 PB1 22 c1 f3 f5 f4 t r e w q TAB
|
||||
2 PB2 23 c2 ESC f2 f1 g f d s a CL
|
||||
3 PB3 24 c3 f9 f11 f10 b v c x z LS UP DN [{ ]}
|
||||
4 PB4 25 c4 f12 SL PS RT LT §± `~ 6 7 8 9 0 -_
|
||||
5 PB5 26 c5 PB PGM KPD LA HM END y u i o p \
|
||||
6 PB6 27 c6 LC DEL BS RC ENT SP h j k l ;: '"
|
||||
7 PB7 28 c7 RA PU PD n m ,< .> /? RS
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,50 @@
|
||||
#ifndef STAPELBERG_CONFIG_H
|
||||
#define STAPELBERG_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0002
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 15
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5, D6, D7, C0, C1, C2, C3, C4, C5, C6 }
|
||||
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* don't know if this should be defined at the board or top level. Assuming board
|
||||
#define MOUSEKEY_DELAY 100
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_MAX_SPEED 3
|
||||
#define MOUSEKEY_TIME_TO_MAX 10
|
||||
*/
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
||||
#endif
|
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 117 KiB |
@ -0,0 +1,55 @@
|
||||
# kinesis_stapelberg keyboard firmware
|
||||
|
||||
This folder contains the firmware customization required to run QMK on the custom controller for the Kinesis Advantage created by Michael Stapelberg.
|
||||
It differs from the `alvicstep keyboard in that the existing QMK Kinesis Advantage project uses the existing controller board provided by Kinesis.
|
||||
|
||||
The controller board hardware is described
|
||||
[here](http://michael.stapelberg.de/Artikel/kinesis_custom_controller)
|
||||
|
||||
Mapping the pin assignments was done using the corresponding matrix description provided at this
|
||||
[link](https://github.com/stapelberg/kinesis-firmware/blob/master/kb_kinesis/config.kspec)
|
||||
|
||||
This code makes no attempt to drive the four LEDs provided on the controller board.
|
||||
|
||||
|
||||
## Building the Hardware
|
||||
|
||||
If you want to perform this customization, these parts may be helpful.
|
||||
|
||||
| Function | Quantity | Vendor | Part Number |
|
||||
| ------------------------------------------------------ | -------- | ------- | ------------ |
|
||||
| 13 pin connector for function keys and finger keywells | 4 | Digi-Key | WM14526-ND |
|
||||
| 10 pin headers for thumb clusters | 4 | Digi-Key | 609-3250-ND |
|
||||
| 8 pin cable for thumb clusters | 2 | Digi-Key | SAM8928-ND |
|
||||
| Teensy++ 2.0 | 1 | Digi-Key | 1528-1056-ND |
|
||||
| 2 pin right angle header for reset | 1 | Digi-Key | 3M9467-ND |
|
||||
| Reset cables | 2 | Sparkfun | PRT-09140 |
|
||||
|
||||
The board and connections are shown here
|
||||
![](images/controller_board.jpg)
|
||||
|
||||
The Teensy mounting detail can be seen here.
|
||||
I used a socket for prototyping.
|
||||
![](images/teensy_detail.jpg)
|
||||
|
||||
|
||||
Since the proper mounting of the Teensy board places the reset button in a tight space, I added a 2-pin header to the reset and ground pins on the edge of the board.
|
||||
Shorting these two pins together will reset the board.
|
||||
I also put female to male header jumper cables on these so they could be accessed outside the enclosure.
|
||||
The exterior cables can be seen here.
|
||||
![](images/exterior_reset.jpg)
|
||||
|
||||
|
||||
## Keymaps
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, run `make default` while in the
|
||||
`kinesis_stapelberg` working directory.
|
||||
|
||||
### Dvorak
|
||||
|
||||
This keymap contains a dvorak implementation as well as media and symbol layers.
|
||||
|
||||
Run `make dvorak` while in the `kinesis_stapelberg` working directory.
|
||||
|
@ -0,0 +1,10 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
# just silently stop, since we need to upload with teensy uploader
|
||||
upload: build
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
#include "stapelberg.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
#ifndef KINESIS_STAPELBERG_H
|
||||
#define KINESIS_STAPELBERG_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// This a shortcut to help you visually see your layout.
|
||||
// The first section contains all of the arguments as on the physical keyboard
|
||||
// The second converts the arguments into the 2-D scanned array
|
||||
|
||||
#define KEYMAP( \
|
||||
kC0,kD0,kE0,kC1,kD1,kE1,kC2,kD2,kE2, \
|
||||
k00,k10,k20,k30,k40,k50, \
|
||||
k01,k11,k21,k31,k41,k51, \
|
||||
k02,k12,k22,k32,k42,k52, \
|
||||
k03,k13,k23,k33,k43,k53, \
|
||||
k14,k24,k34,k54, \
|
||||
k56,k55, \
|
||||
k35, \
|
||||
k36,k46,k25, \
|
||||
kC3,kD3,kE3,kC4,kD4,kE4,kC5,kE5,kD5, \
|
||||
k60,k70,k80,k90,kA0,kB0, \
|
||||
k61,k71,k81,k91,kA1,kB1, \
|
||||
k62,k72,k82,k92,kA2,kB2, \
|
||||
k63,k73,k83,k93,kA3,kB3, \
|
||||
k64,k84,k94,kA4, \
|
||||
k96,k85, \
|
||||
k86, \
|
||||
k66,k75,k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, k25, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36 }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56 }, \
|
||||
{ k60, k61, k62, k63, k64, k65, k66 }, \
|
||||
{ k70, k71, k72, k73, KC_NO, k75, KC_NO }, \
|
||||
{ k80, k81, k82, k83, k84, k85, k86 }, \
|
||||
{ k90, k91, k92, k93, k94, KC_NO, k96 }, \
|
||||
{ kA0, kA1, kA2, kA3, kA4, KC_NO, KC_NO }, \
|
||||
{ kB0, kB1, kB2, kB3, KC_NO, KC_NO, KC_NO }, \
|
||||
{ kC0, kC1, kC2, kC3, kC4, kC5, KC_NO }, \
|
||||
{ kD0, kD1, kD2, kD3, kD4, kD5, KC_NO }, \
|
||||
{ kE0, kE1, kE2, kE3, kE4, kE5, KC_NO } \
|
||||
}
|
||||
|
||||
/*
|
||||
This is the Stapelberg matrix as published at
|
||||
https://github.com/stapelberg/kinesis-firmware/blob/master/kb_kinesis/config.kspec
|
||||
Along with the pins for each row and column
|
||||
PB0 PB1 PB2 PB3 PB4 PB5 PB6
|
||||
kx0 kx1 kx2 kx3 kx4 kx5 kx6
|
||||
PD0 k0x Row: EQL TAB CAP LSH X2 -- --
|
||||
PD1 k1x Row: 1 Q A Z BQ -- --
|
||||
PD2 k2x Row: 2 W S X INS END --
|
||||
PD3 k3x Row: 3 E D C LFT HOM BAK
|
||||
PD4 k4x Row: 4 R F V -- -- DEL
|
||||
PD5 k5x Row: 5 T G B RT LAL LCT
|
||||
PD6 k6x Row: 6 Y H N UP SPC PGD
|
||||
PD7 k7x Row: 7 U J M -- RET --
|
||||
PB0 k8x Row: 8 I K COM DWN RCT PGU
|
||||
PB1 k9x Row: 9 O L PER LBR -- RAL
|
||||
PB2 kAx Row: 0 P SEM SLA RBR -- --
|
||||
PB3 kBx Row: MIN BSL APO RSH X1 -- --
|
||||
PB4 kCx Row: ESC F3 F6 F9 F12 PAU --
|
||||
PB5 kDx Row: F1 F4 F7 F10 PRT PRG --
|
||||
PB6 kEx Row: F2 F5 F8 F11 SLK KEY --
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1 @@
|
||||
#define KIIBOHD_BOOTLOADER
|
@ -0,0 +1,524 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 100000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
@ -0,0 +1,78 @@
|
||||
/*
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0F0F
|
||||
#define DEVICE_VER 0x0001
|
||||
/* in python2: list(u"whatever".encode('utf-16-le')) */
|
||||
/* at most 32 characters or the ugly hack in usb_main.c borks */
|
||||
#define MANUFACTURER "Input Club"
|
||||
#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00'
|
||||
#define PRODUCT "WhiteFox/QMK"
|
||||
#define USBSTR_PRODUCT 'W', '\x00', 'h', '\x00', 'i', '\x00', 't', '\x00', 'e', '\x00', 'F', '\x00', 'o', '\x00', 'x', '\x00', ' ', '\x00'
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 9
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 6
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
//#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* Keymap for Infinity prototype */
|
||||
//#define INFINITY_PROTOTYPE
|
||||
|
||||
/* Keymap for Infinity 1.1a (first revision with LED support) */
|
||||
//#define INFINITY_LED
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,353 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ADC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* CAN driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* I2C driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables the mutual exclusion APIs on the I2C bus.
|
||||
*/
|
||||
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define I2C_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MAC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_ZERO_COPY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MMC_SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
* This option is recommended also if the SPI driver does not
|
||||
* use a DMA channel and heavily loads the CPU.
|
||||
*/
|
||||
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define MMC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SDC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Number of initialization attempts before rejecting the card.
|
||||
* @note Attempts are performed at 10mS intervals.
|
||||
*/
|
||||
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
|
||||
#define SDC_INIT_RETRY 100
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Include support for MMC cards.
|
||||
* @note MMC support is not yet implemented so this option must be kept
|
||||
* at @p FALSE.
|
||||
*/
|
||||
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
|
||||
#define SDC_MMC_SUPPORT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
*/
|
||||
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define SDC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Default bit rate.
|
||||
* @details Configuration parameter, this is the baud rate selected for the
|
||||
* default configuration.
|
||||
*/
|
||||
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_DEFAULT_BITRATE 38400
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Serial buffers size.
|
||||
* @details Configuration parameter, you can change the depth of the queue
|
||||
* buffers depending on the requirements of your application.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_BUFFERS_SIZE 16
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL_USB driver related setting. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Serial over USB buffers size.
|
||||
* @details Configuration parameter, the buffer size must be a multiple of
|
||||
* the USB data endpoint maximum packet size.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
[0] = 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_INS, \
|
||||
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_DEL, \
|
||||
KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP,\
|
||||
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_FN0, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \
|
||||
),
|
||||
[1] = KEYMAP( \
|
||||
KC_TRNS,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_TRNS,KC_TRNS,KC_MUTE,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,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_VOLU,\
|
||||
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_PGUP,KC_VOLD,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1),
|
||||
};
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
[0] = 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_MUTE,\
|
||||
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_DEL, \
|
||||
KC_FN0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP,\
|
||||
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_FN1, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \
|
||||
),
|
||||
[1] = KEYMAP( \
|
||||
KC_TRNS,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_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_DEL , KC_INS ,\
|
||||
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_VOLU,\
|
||||
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_PGUP,KC_VOLD,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \
|
||||
),
|
||||
[2] = KEYMAP( \
|
||||
KC_SLEP,KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN2, \
|
||||
KC_TRNS,KC_TRNS,KC_FN5 ,KC_FN6 ,KC_TRNS,KC_FN7 ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_TRNS,KC_TRNS,KC_TRNS, KC_FN3, \
|
||||
KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN4 ,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_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_MAIL,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 \
|
||||
),
|
||||
};
|
||||
|
||||
/* Give numbers some descriptive names */
|
||||
#define ACTION_LEDS_ALL 1
|
||||
#define ACTION_LEDS_GAME 2
|
||||
|
||||
const uint16_t fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1),
|
||||
[1] = ACTION_LAYER_MOMENTARY(2),
|
||||
[2] = ACTION_FUNCTION(ACTION_LEDS_ALL),
|
||||
[3] = ACTION_FUNCTION(ACTION_LEDS_GAME),
|
||||
|
||||
[4] = ACTION_USAGE_CONSUMER(0x1B4),
|
||||
[5] = ACTION_USAGE_CONSUMER(0x196),
|
||||
[6] = ACTION_USAGE_CONSUMER(0x1A6),
|
||||
[7] = ACTION_USAGE_CONSUMER(0x1A0),
|
||||
|
||||
};
|
||||
|
||||
/* custom action function */
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
/*
|
||||
(void)opt;
|
||||
switch(id) {
|
||||
case ACTION_LEDS_ALL:
|
||||
if(record->event.pressed) {
|
||||
// signal the LED controller thread
|
||||
chMBPost(&led_mailbox, LED_MSG_GAME_TOGGLE, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
case ACTION_LEDS_GAME:
|
||||
if(record->event.pressed) {
|
||||
// signal the LED controller thread
|
||||
chMBPost(&led_mailbox, LED_MSG_ALL_TOGGLE, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void led_set(uint8_t usb_led) {
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "hal.h"
|
||||
#include "timer.h"
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "matrix.h"
|
||||
|
||||
|
||||
/*
|
||||
* Matt3o's WhiteFox
|
||||
* Column pins are input with internal pull-down. Row pins are output and strobe with high.
|
||||
* Key is high or 1 when it turns on.
|
||||
*
|
||||
* col: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
|
||||
* row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC8, PTC9, PTC10, PTC11 }
|
||||
*/
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
//debug_matrix = true;
|
||||
/* Column(sense) */
|
||||
palSetPadMode(GPIOD, 0, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_PULLDOWN);
|
||||
|
||||
/* Row(strobe) */
|
||||
palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 8, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix_row_t data = 0;
|
||||
|
||||
// strobe row
|
||||
switch (row) {
|
||||
case 0: palSetPad(GPIOB, 2); break;
|
||||
case 1: palSetPad(GPIOB, 3); break;
|
||||
case 2: palSetPad(GPIOB, 18); break;
|
||||
case 3: palSetPad(GPIOB, 19); break;
|
||||
case 4: palSetPad(GPIOC, 0); break;
|
||||
case 5: palSetPad(GPIOC, 8); break;
|
||||
case 6: palSetPad(GPIOC, 9); break;
|
||||
case 7: palSetPad(GPIOC, 10); break;
|
||||
case 8: palSetPad(GPIOC, 11); break;
|
||||
}
|
||||
|
||||
wait_us(20); // need wait to settle pin state
|
||||
|
||||
// read col data: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
|
||||
data = ((palReadPort(GPIOC) & 0x06UL) << 5) |
|
||||
((palReadPort(GPIOD) & 0xF0UL) >> 2) |
|
||||
(palReadPort(GPIOD) & 0x03UL);
|
||||
|
||||
// un-strobe row
|
||||
switch (row) {
|
||||
case 0: palClearPad(GPIOB, 2); break;
|
||||
case 1: palClearPad(GPIOB, 3); break;
|
||||
case 2: palClearPad(GPIOB, 18); break;
|
||||
case 3: palClearPad(GPIOB, 19); break;
|
||||
case 4: palClearPad(GPIOC, 0); break;
|
||||
case 5: palClearPad(GPIOC, 8); break;
|
||||
case 6: palClearPad(GPIOC, 9); break;
|
||||
case 7: palClearPad(GPIOC, 10); break;
|
||||
case 8: palClearPad(GPIOC, 11); break;
|
||||
}
|
||||
|
||||
if (matrix_debouncing[row] != data) {
|
||||
matrix_debouncing[row] = data;
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
}
|
||||
|
||||
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix[row] = matrix_debouncing[row];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & (1<<col));
|
||||
}
|
||||
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
xprintf("\nr/c 01234567\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
xprintf("%X0: ", row);
|
||||
matrix_row_t data = matrix_get_row(row);
|
||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||
if (data & (1<<col))
|
||||
xprintf("1");
|
||||
else
|
||||
xprintf("0");
|
||||
}
|
||||
xprintf("\n");
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define K20x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
|
||||
/* Select the MCU clocking mode below by enabling the appropriate block. */
|
||||
|
||||
#define KINETIS_NO_INIT FALSE
|
||||
|
||||
/* PEE mode - 48MHz system clock driven by external crystal. */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
|
||||
#define KINETIS_PLLCLK_FREQUENCY 72000000UL
|
||||
#define KINETIS_SYSCLK_FREQUENCY 72000000UL
|
||||
#define KINETIS_BUSCLK_FREQUENCY 36000000UL
|
||||
#define KINETIS_FLASHCLK_FREQUENCY 24000000UL
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 5
|
||||
|
||||
/*
|
||||
* I2C driver settings
|
||||
*/
|
||||
#define KINETIS_I2C_USE_I2C0 TRUE
|
||||
#define KINETIS_I2C_I2C0_PRIORITY 4
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
@ -0,0 +1,7 @@
|
||||
WhiteFox keyboard firmware
|
||||
======================
|
||||
|
||||
This is an experimental port which came from the original TMK WhiteFox repo.
|
||||
|
||||
The LED controller was not ported, as the original was a dirty hack and it would
|
||||
be good to have complete support.
|
@ -0,0 +1,68 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
# - For Infinity KB, SERIES = K20x
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = K20x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
|
||||
# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
|
||||
MCU_LDSCRIPT = MK20DX256BLDR8
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0 and Infinity KB
|
||||
# - k20x7 for Teensy 3.1 and 3.2
|
||||
MCU_STARTUP = k20x7
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
# - MCHCK_K20 for Infinity KB
|
||||
BOARD = PJRC_TEENSY_3_1
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m4
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 7
|
||||
|
||||
# Vector table for application
|
||||
# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
|
||||
# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
|
||||
#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
|
||||
OPT_DEFS =
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
#CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
Copyright 2014 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef WHITEFOX_H
|
||||
#define WHITEFOX_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* WhiteFox
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |App |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
#define KEYMAP( \
|
||||
K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, K61, \
|
||||
K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, K23, K33, \
|
||||
K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, K64, K74, K84, K05, \
|
||||
K15, K25, K35, K45, K55, K65, K75, K85, K06, K16, K26, K36, K46, K56, K66, \
|
||||
K76, K86, K07, K17, K27, K37, K47, K57, K67, K77 \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
|
||||
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
|
||||
{ K80, K81, K82, K83, K84, K85, K86, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|