forked from vial-kb/vial-qmk
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1ed463
commit df91319
Showing
30 changed files
with
758 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#define VIAL_KEYBOARD_UID {0x74, 0x2A, 0xFA, 0x6B, 0xEB, 0x6E, 0x5B, 0x17} | ||
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } | ||
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include QMK_KEYBOARD_H | ||
#include "ergohaven.h" | ||
|
||
// clang-format off | ||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
[_BASE] = LAYOUT( | ||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
KC_PGDN, KC_PGUP, KC_LCTL, LOWER, KC_LALT, KC_SPACE, KC_ENT, KC_RGUI, RAISE, KC_RCTL, KC_LBRC, KC_RBRC, | ||
KC_MUTE | ||
|
||
), | ||
|
||
[_LOWER] = LAYOUT( | ||
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_HOME, KC_UP, KC_END, KC_INS, _______, KC_7, KC_8, KC_9, _______, _______, | ||
_______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT, _______, KC_4, KC_5, KC_6, _______, _______, | ||
_______, _______, PREVWRD, KC_CAPS, NEXTWRD, KC_DEL, KC_PSCR, KC_1, KC_2, KC_3, _______, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______, ADJUST, _______, KC_0, _______, | ||
_______ | ||
), | ||
|
||
[_RAISE] = LAYOUT( | ||
_______, _______, KC_AT, KC_DLR, KC_HASH, _______, _______, _______, KC_CIRC, _______, _______, _______, | ||
_______, _______, KC_LT, KC_EQL, KC_GT, KC_GRV, _______, KC_LBRC, KC_UNDS, KC_RBRC, _______, _______, | ||
_______, KC_BSLS, KC_LPRN, KC_MINS, KC_RPRN, KC_PLUS, KC_PERC, KC_LCBR, KC_SCLN, KC_RCBR, KC_EXLM, _______, | ||
_______, _______, KC_ASTR, KC_COLN, KC_SLSH, _______, _______, KC_PIPE, KC_TILD, KC_AMPR, _______, _______, | ||
_______, _______, _______, ADJUST, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______ | ||
), | ||
|
||
[_ADJUST] = LAYOUT( | ||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_REC1, | ||
_______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, DM_PLY2, DM_REC2, | ||
_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, DM_RSTP, | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______ | ||
), | ||
}; | ||
// clang-format on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VIAL_ENABLE = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"matrix": { | ||
"rows": 12, | ||
"cols": 7 | ||
}, | ||
#include "keyboards/ergohaven/vial_custom_keycodes.json" | ||
"layouts": { | ||
"keymap":[ | ||
[{"y":0.4},"0,0","0,1",{"y":-0.45},"0,2",{"y":-0.1},"0,3",{"y":0.1},"0,4","0,5"], | ||
[{"y":0.45},"1,0","1,1",{"y":-0.45},"1,2",{"y":-0.1},"1,3",{"y":0.1},"1,4","1,5"], | ||
[{"y":0.45},"2,0","2,1",{"y":-0.45},"2,2",{"y":-0.1},"2,3",{"y":0.1},"2,4","2,5"], | ||
[{"y":0.45},"3,0","3,1",{"y":-0.45},"3,2",{"y":-0.1},"3,3",{"y":0.1},"3,4","3,5"], | ||
[{"x":2},"4,2",{"y":-0.1},"4,3",{"x":0.2,"y":0.3},"4,4",{"y":0.2},"4,5",{"y":0.2},"4,0",{"y":0.2},"4,1"], | ||
|
||
[{"r":0,"rx":11.5,"ry":-0.05},"6,5","6,4",{"y":-0.1},"6,3",{"y":0.1},"6,2",{"y":0.45},"6,1","6,0"], | ||
[{"y":-0.45},"7,5","7,4",{"y":-0.1},"7,3",{"y":0.1},"7,2",{"y":0.45},"7,1","7,0"], | ||
[{"y":-0.45},"8,5","8,4",{"y":-0.1},"8,3",{"y":0.1},"8,2",{"y":0.45},"8,1","8,0"], | ||
[{"y":-0.45},"9,5","9,4",{"y":-0.1},"9,3",{"y":0.1},"9,2",{"y":0.45},"9,1","9,0"], | ||
[{"x":-2.2,"y":0.35},"10,1",{"y":-0.2},"10,0",{"y":-0.2},"10,5",{"y":-0.2},"10,4",{"x":0.2,"y":-0.3},"10,3",{"y":0.1},"10,2"] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#define VIAL_KEYBOARD_UID {0x74, 0x2A, 0xFA, 0x6B, 0xEB, 0x6E, 0x5B, 0x17} | ||
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } | ||
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 } | ||
|
||
#define ENCODERS_PAD_A { GP8 } | ||
#define ENCODERS_PAD_B { GP9 } | ||
#define ENCODER_RESOLUTION 4 | ||
#define ENCODER_DEFAULT_POS 0x3 | ||
#define ENCODERS_PAD_A_RIGHT { } | ||
#define ENCODERS_PAD_B_RIGHT { } | ||
|
||
#define MATRIX_COLS 7 | ||
#define MATRIX_ROWS 12 | ||
|
||
#undef MATRIX_COL_PINS | ||
#undef MATRIX_ROW_PINS | ||
#define MATRIX_COL_PINS { GP7, GP12, GP13, GP14, GP15, GP28, GP10 } | ||
#define MATRIX_ROW_PINS { GP6, GP5, GP4, GP3, GP2, GP11 } | ||
#define MATRIX_COL_PINS_RIGHT { GP7, GP12, GP13, GP14, GP15, GP28, NO_PIN } | ||
#define MATRIX_ROW_PINS_RIGHT { GP6, GP5, GP4, GP3, GP2, NO_PIN } | ||
|
||
#define WS2812_DI_PIN GP26 | ||
#define RGBLIGHT_LED_COUNT 1 | ||
#define RGBLED_SPLIT {1, 0} | ||
#define RGBLIGHT_SLEEP | ||
#define RGBLIGHT_SPLIT | ||
#define RGBLIGHT_LAYERS | ||
#define RGBLIGHT_MAX_LAYERS 16 | ||
#define RGBLIGHT_LAYERS_RETAIN_VAL | ||
#define RGBLIGHT_DEFAULT_VAL 50 | ||
#define RGBLIGHT_LIMIT_VAL 150 | ||
#define RGBLIGHT_DEFAULT_SAT 0 | ||
|
||
#define SPI_DRIVER SPID1 | ||
#define SPI_SCK_PIN GP10 | ||
#define SPI_MOSI_PIN GP11 | ||
#define SPI_MISO_PIN GP8 | ||
|
||
#define PMW33XX_CS_PIN GP9 | ||
#define SPLIT_POINTING_ENABLE | ||
#define POINTING_DEVICE_RIGHT | ||
#define POINTING_DEVICE_TASK_THROTTLE_MS 10 | ||
#define POINTING_DEVICE_INVERT_X | ||
|
||
#define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2 | ||
#define VIA_EEPROM_LAYOUT_OPTIONS_DEFAULT 0x0000035d | ||
|
||
#define POINTING_DEVICE_AUTO_MOUSE_ENABLE | ||
#define EH_POINTING_KEYCODES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#define HAL_USE_SPI TRUE | ||
|
||
#include_next <halconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#include QMK_KEYBOARD_H | ||
#include "ergohaven.h" | ||
#include "ergohaven_pointing.h" | ||
|
||
// clang-format off | ||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
[_BASE] = LAYOUT( | ||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, | ||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, | ||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
KC_PGDN, KC_PGUP, KC_LCTL, LOWER, KC_LALT, KC_SPACE, KC_ENT, KC_RGUI, RAISE, KC_RCTL, KC_LBRC, KC_RBRC, | ||
KC_MUTE | ||
|
||
), | ||
|
||
[_LOWER] = LAYOUT( | ||
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_HOME, KC_UP, KC_END, KC_INS, _______, KC_7, KC_8, KC_9, _______, _______, | ||
_______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT, _______, KC_4, KC_5, KC_6, _______, _______, | ||
_______, _______, PREVWRD, KC_CAPS, NEXTWRD, KC_DEL, KC_PSCR, KC_1, KC_2, KC_3, _______, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______, ADJUST, _______, KC_0, _______, | ||
_______ | ||
), | ||
|
||
[_RAISE] = LAYOUT( | ||
_______, _______, KC_AT, KC_DLR, KC_HASH, _______, _______, _______, KC_CIRC, _______, _______, _______, | ||
_______, _______, KC_LT, KC_EQL, KC_GT, KC_GRV, _______, KC_LBRC, KC_UNDS, KC_RBRC, _______, _______, | ||
_______, KC_BSLS, KC_LPRN, KC_MINS, KC_RPRN, KC_PLUS, KC_PERC, KC_LCBR, KC_SCLN, KC_RCBR, KC_EXLM, _______, | ||
_______, _______, KC_ASTR, KC_COLN, KC_SLSH, _______, _______, KC_PIPE, KC_TILD, KC_AMPR, _______, _______, | ||
_______, _______, _______, ADJUST, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______ | ||
), | ||
|
||
[_ADJUST] = LAYOUT( | ||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_REC1, | ||
_______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, DM_PLY2, DM_REC2, | ||
_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, DM_RSTP, | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
_______ | ||
), | ||
}; | ||
// clang-format on | ||
|
||
#ifdef ENCODER_MAP_ENABLE | ||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | ||
[0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, | ||
[1] = {ENCODER_CCW_CW(_______, _______)}, | ||
[2] = {ENCODER_CCW_CW(_______, _______)}, | ||
[3] = {ENCODER_CCW_CW(_______, _______)}, | ||
}; | ||
#endif | ||
|
||
typedef union { | ||
uint32_t raw; | ||
struct { | ||
uint8_t text_mode : 3; | ||
uint8_t scroll_mode : 3; | ||
uint8_t sniper_mode : 2; | ||
uint8_t dpi_mode : 4; | ||
uint8_t auto_mouse_layer : 4; | ||
}; | ||
} vial_config_t; | ||
|
||
static vial_config_t vial_config; | ||
|
||
const int DPI_TABLE[15] = {100, 200, 300, 400, 500, 600, 800, 1000, 1200, 1600, 2000, 2500, 3200, 4000, 5000}; | ||
const int32_t SNIPER_TABLE[15] = {2, 3, 4, 5}; | ||
const int32_t SCROLL_TABLE[15] = {6, 8, 11, 16, 23, 32, 45, 64}; | ||
const int32_t TEXT_TABLE[15] = {6, 8, 11, 16, 23, 32, 45, 64}; | ||
|
||
int get_dpi(uint8_t dpi_mode) { | ||
if (dpi_mode < ARRAY_SIZE(DPI_TABLE)) | ||
return DPI_TABLE[dpi_mode]; | ||
else | ||
return DPI_TABLE[0]; | ||
} | ||
|
||
void via_set_layout_options_kb(uint32_t value) { | ||
dprintf("via_set_layout_options_kb %lx\n", value); | ||
vial_config.raw = value; | ||
pointing_device_set_cpi(get_dpi(vial_config.dpi_mode)); | ||
set_scroll_sens(SCROLL_TABLE[vial_config.scroll_mode]); | ||
set_sniper_sens(SNIPER_TABLE[vial_config.sniper_mode]); | ||
set_text_sens(TEXT_TABLE[vial_config.text_mode]); | ||
set_automouse(vial_config.auto_mouse_layer); | ||
} | ||
|
||
void keyboard_post_init_user(void) { | ||
vial_config.raw = via_get_layout_options(); | ||
via_set_layout_options_kb(vial_config.raw); | ||
set_led_blinks(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include_next <mcuconf.h> | ||
|
||
#undef RP_SPI_USE_SPI1 | ||
#define RP_SPI_USE_SPI1 TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
VIAL_ENABLE = yes | ||
ENCODER_ENABLE = yes | ||
ENCODER_MAP_ENABLE = yes | ||
|
||
POINTING_DEVICE_ENABLE = yes | ||
POINTING_DEVICE_DRIVER = pmw3389 | ||
|
||
RGBLIGHT_ENABLE = yes | ||
RGBLIGHT_DRIVER = ws2812 | ||
WS2812_DRIVER = vendor | ||
|
||
SRC += keyboards/ergohaven/ergohaven_rgb.c | ||
SRC += keyboards/ergohaven/ergohaven_pointing.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"lighting": "qmk_rgblight", | ||
"matrix": { | ||
"rows": 12, | ||
"cols": 7 | ||
}, | ||
"customKeycodes": [ | ||
#include "keyboards/ergohaven/vial_keycodes_base.json" | ||
#include "keyboards/ergohaven/vial_keycodes_ruen.json" | ||
#include "keyboards/ergohaven/vial_keycodes_pointing.json" | ||
], | ||
"layouts": { | ||
"labels": [ | ||
[ | ||
"Auto mouse layer", | ||
"Off", | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5", | ||
"6", | ||
"7", | ||
"8", | ||
"9", | ||
"10", | ||
"11", | ||
"12", | ||
"13", | ||
"14", | ||
"15" | ||
], | ||
[ | ||
"DPI", | ||
"100", | ||
"200", | ||
"300", | ||
"400", | ||
"500", | ||
"600", | ||
"800", | ||
"1000", | ||
"1200", | ||
"1600", | ||
"2000", | ||
"2500", | ||
"3200", | ||
"4000", | ||
"5000" | ||
], | ||
[ | ||
"Sniper sens", | ||
"1/2", | ||
"1/3", | ||
"1/4", | ||
"1/5" | ||
], | ||
[ | ||
"Scroll sens", | ||
"1/6", | ||
"1/8", | ||
"1/11", | ||
"1/16", | ||
"1/23", | ||
"1/32", | ||
"1/45", | ||
"1/64" | ||
], | ||
[ | ||
"Text sens", | ||
"1/6", | ||
"1/8", | ||
"1/11", | ||
"1/16", | ||
"1/23", | ||
"1/32", | ||
"1/45", | ||
"1/64" | ||
] | ||
], | ||
"keymap":[ | ||
[{"y":0.4},"0,0","0,1",{"y":-0.45},"0,2",{"y":-0.1},"0,3",{"y":0.1},"0,4","0,5"], | ||
[{"y":0.45},"1,0","1,1",{"y":-0.45},"1,2",{"y":-0.1},"1,3",{"y":0.1},"1,4","1,5"], | ||
[{"y":0.45},"2,0","2,1",{"y":-0.45},"2,2",{"y":-0.1},"2,3",{"y":0.1},"2,4","2,5"], | ||
[{"y":0.45},"3,0","3,1",{"y":-0.45},"3,2",{"y":-0.1},"3,3",{"y":0.1},"3,4","3,5"], | ||
[{"x":2},"4,2",{"y":-0.1},"4,3",{"x":0.2,"y":0.3},"4,4",{"y":0.2},"4,5",{"y":0.2},"4,0",{"y":0.2},"4,1"], | ||
|
||
[{"r":0,"rx":11.5,"ry":-0.05},"6,5","6,4",{"y":-0.1},"6,3",{"y":0.1},"6,2",{"y":0.45},"6,1","6,0"], | ||
[{"y":-0.45},"7,5","7,4",{"y":-0.1},"7,3",{"y":0.1},"7,2",{"y":0.45},"7,1","7,0"], | ||
[{"y":-0.45},"8,5","8,4",{"y":-0.1},"8,3",{"y":0.1},"8,2",{"y":0.45},"8,1","8,0"], | ||
[{"y":-0.45},"9,5","9,4",{"y":-0.1},"9,3",{"y":0.1},"9,2",{"y":0.45},"9,1","9,0"], | ||
[{"x":-2.2,"y":0.35},"10,1",{"y":-0.2},"10,0",{"y":-0.2},"10,5",{"y":-0.2},"10,4",{"x":0.2,"y":-0.3},"10,3",{"y":0.1},"10,2"], | ||
|
||
[{"rx":6.5,"ry":2.95},"5,6",{"y":-0.5},"0,1\n\n\n\n\n\n\n\n\ne",{"y":1.0,"x":-1},"0,0\n\n\n\n\n\n\n\n\ne"] | ||
] | ||
} | ||
} |
Oops, something went wrong.