Add Vial support for keyten/lisa (#761)

* Update lisa.c

* Create config.h

* Create config.h

* Add files via upload

* Update keyboard.json
This commit is contained in:
Ivan Gromov 2024-07-27 20:01:57 +04:00 committed by GitHub
parent e63bb7f7ae
commit 0feb01eef8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 481 additions and 9 deletions

View File

@ -0,0 +1 @@
#define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2

View File

@ -16,10 +16,6 @@
"cols": ["B7", "B6", "B5", "B4", "B3", "A15", "A3", "A4", "A5", "A6", "A7", "B0", "B1"],
"rows": ["B13", "B15", "B14", "A8"]
},
"indicators": {
"caps_lock": "B10",
"num_lock": "B11"
}
"processor": "STM32F072",
"usb": {
"vid": "0xEB69",

View File

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#define VIAL_KEYBOARD_UID {0x53, 0xB6, 0xC9, 0x0C, 0xCF, 0x17, 0xD4, 0x8B}
#define VIAL_UNLOCK_COMBO_ROWS {0, 3}
#define VIAL_UNLOCK_COMBO_COLS {0, 12}

View File

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_ESC, 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_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_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, LT(1,KC_SPC), LT(2,KC_BSPC), KC_RALT, KC_RGUI, KC_RCTL
),
[1] = LAYOUT(
KC_TRNS, 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_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_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
),
[2] = LAYOUT(
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_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
)
};

View File

@ -0,0 +1,3 @@
VIA_ENABLE = yes
VIAL_ENABLE = yes
LTO_ENABLE = yes

View File

@ -0,0 +1,365 @@
{
"name": "Lisa",
"vendorId": "0xEB69",
"productId": "0x4001",
"lighting": "none",
"matrix": {
"rows": 4,
"cols": 13
},
"layouts": {
"labels": [
[
"Left Spacebar",
"1.25U | 2U",
"2U | 1.25U"
],
[
"Right Spacebar",
"2.25U | 1.25U",
"1.25U | 2.25U"
],
[
"Upper LED",
"Off",
"On",
"Caps Lock",
"Num Lock",
"Scroll Lock",
"Layer 1",
"Layer 2",
"Layer 3"
],
[
"Middle LED",
"Off",
"On",
"Caps Lock",
"Num Lock",
"Scroll Lock",
"Layer 1",
"Layer 2",
"Layer 3"
],
[
"Lower LED",
"Off",
"On",
"Caps Lock",
"Num Lock",
"Scroll Lock",
"Layer 1",
"Layer 2",
"Layer 3"
]
],
"keymap": [
[
{
"y": 0.38,
"x": 0.36
},
"0,0",
"0,1"
],
[
{
"y": -0.99,
"x": 11.4
},
"0,10",
"0,11",
"0,12"
],
[
{
"y": -0.41,
"x": 5.25,
"d": true
},
"0,0\n\n\n2,2",
{
"d": true
},
"0,0\n\n\n2,3",
{
"d": true
},
"0,0\n\n\n2,4",
{
"d": true
},
"0,0\n\n\n2,5",
{
"d": true
},
"0,0\n\n\n2,6",
{
"d": true
},
"0,0\n\n\n2,7"
],
[
{
"y": -0.98,
"x": 3.25,
"d": true
},
"0,0\n\n\n2,0",
{
"d": true
},
"0,0\n\n\n2,1"
],
[
{
"y": -0.61,
"x": 0.22,
"w": 1.25
},
"1,0",
"1,1"
],
[
{
"y": -0.99,
"x": 11.79
},
"1,10",
{
"w": 1.75
},
"1,12"
],
[
{
"y": -0.42,
"x": 5.25,
"d": true
},
"0,1\n\n\n3,2",
{
"d": true
},
"0,1\n\n\n3,3",
{
"d": true
},
"0,1\n\n\n3,4",
{
"d": true
},
"0,1\n\n\n3,5",
{
"d": true
},
"0,1\n\n\n3,6",
{
"d": true
},
"0,1\n\n\n3,7"
],
[
{
"y": -0.98,
"x": 3.25,
"d": true
},
"0,1\n\n\n3,0",
{
"d": true
},
"0,1\n\n\n3,1"
],
[
{
"y": -0.6,
"x": 0.07,
"w": 1.75
},
"2,0",
"2,1"
],
[
{
"y": -0.99,
"x": 11.43
},
"2,10",
"2,11",
{
"w": 1.25
},
"2,12"
],
[
{
"y": -0.43,
"x": 5.25,
"d": true
},
"0,2\n\n\n4,2",
{
"d": true
},
"0,2\n\n\n4,3",
{
"d": true
},
"0,2\n\n\n4,4",
{
"d": true
},
"0,2\n\n\n4,5",
{
"d": true
},
"0,2\n\n\n4,6",
{
"d": true
},
"0,2\n\n\n4,7"
],
[
{
"y": -0.98,
"x": 3.25,
"d": true
},
"0,2\n\n\n4,0",
{
"d": true
},
"0,2\n\n\n4,1"
],
[
{
"y": -0.59,
"x": 0.17,
"w": 1.25
},
"3,0",
{
"w": 1.25
},
"3,1"
],
[
{
"y": -0.99,
"x": 12.069,
"w": 1.25
},
"3,11",
{
"w": 1.25
},
"3,12"
],
[
{
"r": 8,
"y": -4.42,
"x": 2.5
},
"0,2",
"0,3",
"0,4",
"0,5"
],
[
{
"x": 2.75
},
"1,2",
"1,3",
"1,4",
"1,5"
],
[
{
"x": 3.25
},
"2,2",
"2,3",
"2,4",
"2,5"
],
[
{
"x": 4,
"w": 1.25
},
"3,3\n\n\n0,0",
{
"w": 2
},
"3,5\n\n\n0,0"
],
[
{
"y": 0.25,
"x": 4,
"w": 2
},
"3,3\n\n\n0,1",
{
"w": 1.25
},
"3,5\n\n\n0,1"
],
[
{
"r": -8,
"y": -3.27,
"x": 7.1
},
"0,6",
"0,7",
"0,8",
"0,9"
],
[
{
"x": 7.35
},
"1,6",
"1,7",
"1,8",
"1,9"
],
[
{
"x": 6.85
},
"2,6",
"2,7",
"2,8",
"2,9"
],
[
{
"x": 6.85,
"w": 2.25
},
"3,6\n\n\n1,0",
{
"w": 1.25
},
"3,8\n\n\n1,0"
],
[
{
"y": 0.25,
"x": 6.85,
"w": 1.25
},
"3,6\n\n\n1,1",
{
"w": 2.25
},
"3,8\n\n\n1,1"
]
]
}
}

View File

@ -3,10 +3,82 @@
#include "quantum.h"
#define LED_INDICATOR_PIN B2
#define LOWER_LED_PIN B11
#define MIDDLE_LED_PIN B10
#define UPPER_LED_PIN B2
void matrix_init_kb(void) {
gpio_set_pin_output(LED_INDICATOR_PIN);
gpio_write_pin_high(LED_INDICATOR_PIN);
matrix_init_user();
typedef union {
uint16_t raw;
struct {
uint16_t lower_led : 3;
uint16_t middle_led: 3;
uint16_t upper_led : 3;
};
} layout_options_t;
static layout_options_t layout_options;
static layer_state_t current_layer_state = 0;
void via_set_layout_options_kb(uint32_t value) {
layout_options.raw = value;
led_update_kb(host_keyboard_led_state());
}
enum led_mode_t {
LED_MODE_OFF,
LED_MODE_ON,
LED_MODE_CAPS_LOCK,
LED_MODE_NUM_LOCK,
LED_MODE_SCROLL_LOCK,
LED_MODE_LAYER_1,
LED_MODE_LAYER_2,
LED_MODE_LAYER_3,
};
void set_led_state(uint32_t pin, uint8_t mode, led_t led_state) {
switch (mode) {
case LED_MODE_OFF:
gpio_write_pin_low(pin);
break;
case LED_MODE_ON:
gpio_write_pin_high(pin);
break;
case LED_MODE_CAPS_LOCK:
gpio_write_pin(pin, led_state.caps_lock);
break;
case LED_MODE_NUM_LOCK:
gpio_write_pin(pin, led_state.num_lock);
break;
case LED_MODE_SCROLL_LOCK:
gpio_write_pin(pin, led_state.scroll_lock);
break;
case LED_MODE_LAYER_1:
gpio_write_pin(pin, (current_layer_state & (1 << 1)) != 0);
break;
case LED_MODE_LAYER_2:
gpio_write_pin(pin, (current_layer_state & (1 << 2)) != 0);
break;
case LED_MODE_LAYER_3:
gpio_write_pin(pin, (current_layer_state & (1 << 3)) != 0);
break;
default:
gpio_write_pin_low(pin);
break;
}
}
void led_update_ports(led_t led_state) {
gpio_set_pin_output(LOWER_LED_PIN);
gpio_set_pin_output(MIDDLE_LED_PIN);
gpio_set_pin_output(UPPER_LED_PIN);
set_led_state(LOWER_LED_PIN, layout_options.lower_led, led_state);
set_led_state(MIDDLE_LED_PIN, layout_options.middle_led, led_state);
set_led_state(UPPER_LED_PIN, layout_options.upper_led, led_state);
}
layer_state_t layer_state_set_user(layer_state_t state) {
current_layer_state = state;
return current_layer_state;
}