3by2 macropad

This commit is contained in:
Jan Lunge 2021-05-19 23:03:44 -04:00 committed by Ilya Zhuravlev
parent afb490c297
commit edd7115766
10 changed files with 214 additions and 0 deletions

1
keyboards/3by2/3by2.c Normal file
View File

@ -0,0 +1 @@
#include "3by2.h"

7
keyboards/3by2/3by2.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include "quantum.h"
#define LAYOUT_h( K00, K01, K02, K03, K04, K05 ) \
{ { K00, K01, K02 }, { K03, K04, K05 } }
#define LAYOUT LAYOUT_h

28
keyboards/3by2/config.h Normal file
View File

@ -0,0 +1,28 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xEEEE
#define PRODUCT_ID 0x2019
#define DEVICE_VER 0x0001
#define MANUFACTURER Jan Lunge
#define PRODUCT 3by2
/* key matrix size */
#define MATRIX_ROWS 2
#define MATRIX_COLS 3
/* key matrix pins for beccas board*/
#define MATRIX_ROW_PINS { F6,B2 }
#define MATRIX_COL_PINS { F7, B1, B3 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define VIAL_KEYBOARD_UID {0x6F, 0xD2, 0x03, 0xC4, 0x16, 0xAF, 0x61, 0x27}
#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 }
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 }

50
keyboards/3by2/info.json Normal file
View File

@ -0,0 +1,50 @@
{
"keyboard_name": "3by2",
"keyboard": "3by2",
"url": "https://blog.heaper.de/3d-printed-macropad/",
"maintainer": "wlard",
"width": 3,
"height": 2,
"keymap": "default",
"layouts": {
"LAYOUT_horizontal": {
"key_count": 6,
"layout": [
{
"x": 0,
"y": 0
},
{
"x": 1,
"y": 0
},
{
"x": 2,
"y": 0
},
{
"x": 0,
"y": 1
},
{
"x": 1,
"y": 1
},
{
"x": 2,
"y": 1
}
]
}
},
"layers": [
[
"KC_F13",
"KC_F14",
"KC_F15",
"KC_F16",
"KC_F17",
"KC_F18"
]
]
}

View File

@ -0,0 +1,8 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_h(
KC_F13 , KC_F14 , KC_F15,
KC_F16 , KC_F17 , KC_F18
)
};

View File

@ -0,0 +1,54 @@
#include QMK_KEYBOARD_H
#include "raw_hid.h"
#include "quantum.h"
#define ____ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_F13 , KC_F14 , KC_F15,
KC_F16 , KC_F17 , KC_F18
),
[1] = LAYOUT(
____, ____, ____,
____, ____, ____
),
[2] = LAYOUT(
____, ____, ____,
____, ____, ____
),
[3] = LAYOUT(
____, ____, ____,
____, ____, ____
),
};
void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
if(data[0] == 0xFC){
switch (data[1]) {
case 0x01:{
// move to layer
data[1] = 0xFD;
layer_move(data[2]);
break;
}
case 0x02:{
// turn on layer
data[1] = 0xFD;
layer_on(data[2]);
break;
}
case 0x03:{
// turn off layer
data[1] = 0xFD;
layer_off(data[2]);
break;
}
}
}
raw_hid_send(data, length);
}

View File

@ -0,0 +1,2 @@
VIA_ENABLE = yes
VIAL_ENABLE = yes

View File

@ -0,0 +1,24 @@
{
"name": "3by2",
"vendorId": "0xEEEE",
"productId": "0x2019",
"lighting": "none",
"matrix": {
"rows": 2,
"cols": 3
},
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2"
],
[
"1,0",
"1,1",
"1,2"
]
]
}
}

21
keyboards/3by2/readme.md Normal file
View File

@ -0,0 +1,21 @@
# 3by2
┌───┬───┬───┐
│K00│K01│K02│
├───┼───┼───┤
│K03│K04│K05│
└───┴───┴───┘
A 6 key mechanical keypad.
Keyboard Maintainer: [wlard](https://github.com/wlard)
Make example for this keyboard (after setting up your build environment):
make 3by2:default
or with vial support
make 3by2:via
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

19
keyboards/3by2/rules.mk Normal file
View File

@ -0,0 +1,19 @@
# MCU name
MCU = atmega32u4
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = caterina
EXTRAKEY_ENABLE = yes
NKRO_ENABLE = yes
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
MOUSEKEY_ENABLE = yes