Introduced firmware for framework 16 keyboard
Some checks failed
Automatic Approve / automatic_approve (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled

This commit is contained in:
Ezri Brimhall 2025-11-05 12:11:15 -07:00
parent f513c31058
commit c02b0c5afd
Signed by: ezri
GPG Key ID: 058A78E5680C6F24
38 changed files with 2124 additions and 2 deletions

View File

@ -0,0 +1,4 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H

View File

@ -0,0 +1,17 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#define MATRIX_COLS 16
#define MATRIX_ROWS 8
#define DRIVER_COUNT 2
#define DRIVER_ADDR_1 0b0100000
#define DRIVER_ADDR_2 0b0100011
#define DRIVER_1_LED_TOTAL 48
#define DRIVER_2_LED_TOTAL 49
#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
#define ISSI_CONFIGURATION 0x21 // Enable only the first 9 SW and disable software shutdown
// Limit current to ensure max current draw is just about 500mA
// when white att 100% brightness
#define ISSI_GLOBALCURRENT 104

View File

@ -0,0 +1,119 @@
{
"keyboard_name": "Laptop 16 Keyboard Module - ANSI",
"manufacturer": "Framework",
"maintainer": "JohnAZoidberg",
"bootloader": "rp2040",
"features": {
"bootmagic": false,
"mousekey": false,
"extrakey": true,
"console": true,
"command": false,
"nkro": true,
"audio": false
},
"debounce": 5,
"processor": "RP2040",
"url": "https://frame.work/de/en/products/laptop16-diy-amd-7040",
"usb": {
"device_version": "0.2.2",
"pid": "0x0012",
"vid": "0x32AC",
"force_nkro": true
},
"backlight": {
"pin": "GP25"
},
"layout_aliases": {
"LAYOUT_default": "LAYOUT"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [7, 5], "label": "Esc", "x": 0, "y": 0, "w": 1.25, "h": 0.5 },
{ "matrix": [3, 5], "label": "F1", "x": 1.5, "y": 0, "h": 0.5 },
{ "matrix": [2, 5], "label": "F2", "x": 2.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 4], "label": "F3", "x": 4, "y": 0, "h": 0.5 },
{ "matrix": [3, 4], "label": "F4", "x": 5.25, "y": 0, "h": 0.5 },
{ "matrix": [4, 10], "label": "F5", "x": 6.5, "y": 0, "h": 0.5 },
{ "matrix": [3, 10], "label": "F6", "x": 7.75, "y": 0, "h": 0.5 },
{ "matrix": [2, 10], "label": "F7", "x": 9, "y": 0, "h": 0.5 },
{ "matrix": [1, 15], "label": "F8", "x": 10.25, "y": 0, "h": 0.5 },
{ "matrix": [3, 11], "label": "F9", "x": 11.5, "y": 0, "h": 0.5 },
{ "matrix": [4, 8], "label": "F10", "x": 12.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 8], "label": "F11", "x": 14, "y": 0, "h": 0.5 },
{ "matrix": [3, 13], "label": "F12", "x": 15.25, "y": 0, "h": 0.5 },
{ "matrix": [0, 1], "label": "Delete", "x": 16.5, "y": 0, "w": 1.75, "h": 0.5 },
{ "matrix": [4, 2], "label": "~", "x": 0, "y": 0.75 },
{ "matrix": [5, 2], "label": "!", "x": 1.25, "y": 0.75 },
{ "matrix": [5, 5], "label": "@", "x": 2.5, "y": 0.75 },
{ "matrix": [5, 4], "label": "#", "x": 3.75, "y": 0.75 },
{ "matrix": [5, 6], "label": "$", "x": 5, "y": 0.75 },
{ "matrix": [4, 6], "label": "%", "x": 6.25, "y": 0.75 },
{ "matrix": [4, 7], "label": "^", "x": 7.5, "y": 0.75 },
{ "matrix": [5, 7], "label": "&", "x": 8.75, "y": 0.75 },
{ "matrix": [5, 10], "label": "*", "x": 10, "y": 0.75 },
{ "matrix": [5, 8], "label": "(", "x": 11.25, "y": 0.75 },
{ "matrix": [4, 13], "label": ")", "x": 12.5, "y": 0.75 },
{ "matrix": [2, 13], "label": "_", "x": 13.75, "y": 0.75 },
{ "matrix": [4, 14], "label": "+", "x": 15, "y": 0.75 },
{ "matrix": [5, 14], "label": "Backspace", "x": 16.25, "y": 0.75, "w": 2 },
{ "matrix": [3, 2], "label": "Tab", "x": 0, "y": 2, "w": 1.5 },
{ "matrix": [0, 2], "label": "Q", "x": 1.75, "y": 2 },
{ "matrix": [6, 5], "label": "W", "x": 3, "y": 2 },
{ "matrix": [2, 4], "label": "E", "x": 4.25, "y": 2 },
{ "matrix": [6, 6], "label": "R", "x": 5.5, "y": 2 },
{ "matrix": [3, 6], "label": "T", "x": 6.75, "y": 2 },
{ "matrix": [3, 7], "label": "Y", "x": 8, "y": 2 },
{ "matrix": [6, 7], "label": "U", "x": 9.25, "y": 2 },
{ "matrix": [6, 10], "label": "I", "x": 10.5, "y": 2 },
{ "matrix": [3, 8], "label": "O", "x": 11.75, "y": 2 },
{ "matrix": [5, 13], "label": "P", "x": 13, "y": 2 },
{ "matrix": [6, 13], "label": "{", "x": 14.25, "y": 2 },
{ "matrix": [6, 14], "label": "}", "x": 15.5, "y": 2 },
{ "matrix": [2, 8], "label": "|", "x": 16.75, "y": 2, "w": 1.5 },
{ "matrix": [4, 4], "label": "Caps Lock", "x": 0, "y": 3.25, "w": 1.75 },
{ "matrix": [7, 2], "label": "A", "x": 2, "y": 3.25 },
{ "matrix": [4, 5], "label": "S", "x": 3.25, "y": 3.25 },
{ "matrix": [7, 14], "label": "D", "x": 4.5, "y": 3.25 },
{ "matrix": [7, 6], "label": "F", "x": 5.75, "y": 3.25 },
{ "matrix": [2, 6], "label": "G", "x": 7, "y": 3.25 },
{ "matrix": [2, 7], "label": "H", "x": 8.25, "y": 3.25 },
{ "matrix": [7, 7], "label": "J", "x": 9.5, "y": 3.25 },
{ "matrix": [7, 10], "label": "K", "x": 10.75, "y": 3.25 },
{ "matrix": [7, 8], "label": "L", "x": 12, "y": 3.25 },
{ "matrix": [7, 13], "label": ":", "x": 13.25, "y": 3.25 },
{ "matrix": [0, 14], "label": "\"", "x": 14.5, "y": 3.25 },
{ "matrix": [1, 14], "label": "Enter", "x": 15.75, "y": 3.25, "w": 2.5 },
{ "matrix": [1, 9], "label": "Shift", "x": 0, "y": 4.5, "w": 2.5 },
{ "matrix": [1, 5], "label": "Z", "x": 2.75, "y": 4.5 },
{ "matrix": [0, 5], "label": "X", "x": 4, "y": 4.5 },
{ "matrix": [0, 0], "label": "C", "x": 5.25, "y": 4.5 },
{ "matrix": [0, 6], "label": "V", "x": 6.5, "y": 4.5 },
{ "matrix": [1, 6], "label": "B", "x": 7.75, "y": 4.5 },
{ "matrix": [1, 7], "label": "N", "x": 9, "y": 4.5 },
{ "matrix": [0, 7], "label": "M", "x": 10.25, "y": 4.5 },
{ "matrix": [0, 10], "label": "<", "x": 11.5, "y": 4.5 },
{ "matrix": [0, 8], "label": ">", "x": 12.75, "y": 4.5 },
{ "matrix": [0, 13], "label": "?", "x": 14, "y": 4.5 },
{ "matrix": [0, 9], "label": "Shift", "x": 15.25, "y": 4.5, "w": 3 },
{ "matrix": [1, 12], "label": "Ctrl", "x": 0, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 2], "label": "Fn", "x": 1.5, "y": 5.75 },
{ "matrix": [3, 1], "label": "Win", "x": 2.75, "y": 5.75 },
{ "matrix": [1, 3], "label": "Alt", "x": 4, "y": 5.75 },
{ "matrix": [1, 4], "label": "Space", "x": 5.25, "y": 5.75, "w": 6 },
{ "matrix": [0, 3], "label": "Alt", "x": 11.5, "y": 5.75 },
{ "matrix": [0, 12], "label": "Ctrl", "x": 12.75, "y": 5.75 },
{ "matrix": [6, 11], "label": "←", "x": 14, "y": 5.75, "w": 1.25 },
{ "matrix": [1, 13], "label": "↑", "x": 15.5, "y": 5.75, "w": 1.25, "h": 0.5 },
{ "matrix": [1, 8], "label": "→", "x": 17, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 15], "label": "↓", "x": 15.5, "y": 6.25, "w": 1.25, "h": 0.5 }
]
}
}
}

View File

@ -0,0 +1,116 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "framework.h"
// clang-format off
enum _layers {
_BASE,
_FN,
_FN_LOCK,
_FM
};
// Changes from regular layout
// - Capslock => Map as ctrl and escape
// - FN+Backtick => Sleep
// Control when held and combined, Escape when tapped
#define KC_ECPS CTL_T(KC_ESC)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 14 keys Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10F11F12 Del
*
* 14 keys ` 1 2 3 4 5 6 7 8 9 0 - = Backsp
*
* 14 keys Tab Q W E R T Y U I O P [ ] \
*
* 13 keys ECaps A S D F G H J K L ; ' Enter
*
* 12 keys Shift Z X C V B N M , . / Shift
*
*
* 11 keys CtrlFN GUIAlt AltCtl
*
*
* 78 total
*/
[_BASE] = LAYOUT(
KC_ESC, 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_DEL,
KC_GRV, 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_BSPC,
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_BSLS,
KC_ECPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
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_LCTL, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
),
/*
* Function layer
*
* 14 keys FN lkMutvDnvUpPrvPlyNxtbDnbUpScnAirPrtAppIns
*
* 14 keys SLP
*
* 14 keys RGBNxtHueSatSpdBrt Pau
*
* 13 keys SRqPrvHueSatSpdBrtScL
*
* 12 keys Brk
*
* PgU
* 11 keys Toggle Backlight HomeEnd
* PgD
*
* 78 total
*/
[_FN] = LAYOUT(
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
// Function lock layer
// Everything on F-row locked to function layer, except ESC and DEL
[_FN_LOCK] = LAYOUT(
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FM] = LAYOUT(
FN_LOCK, 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_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
};
// clang-format on
// Make sure to keep FN Lock even after reset
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case FN_LOCK:
if (record->event.pressed) {
if (layer_state_is(_FN)) {
set_single_persistent_default_layer(_FN_LOCK);
}
if (layer_state_is(_FM)) {
set_single_persistent_default_layer(_BASE);
}
}
return false;
break;
default:
break;
}
return true;
}

View File

@ -0,0 +1,108 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "framework.h"
// clang-format off
enum _layers {
_BASE,
_FN,
_FN_LOCK,
_FM
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 14 keys Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10F11F12 Del
*
* 14 keys ` 1 2 3 4 5 6 7 8 9 0 - = Backsp
*
* 14 keys Tab Q W E R T Y U I O P [ ] \
*
* 13 keys Caps A S D F G H J K L ; ' Enter
*
* 12 keys Shift Z X C V B N M , . / Shift
*
*
* 11 keys CtrlFN GUIAlt AltCtl
*
*
* 78 total
*/
[_BASE] = LAYOUT(
KC_ESC, 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_DEL,
KC_GRV, 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_BSPC,
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_BSLS,
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_ENT,
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_LCTL, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
),
/*
* Function layer
*
* 14 keys FN lkMutvDnvUpPrvPlyNxtbDnbUpScnAirPrtAppIns
*
* 14 keys
*
* 14 keys RGBNxtHueSatSpdBrt Pau
*
* 13 keys SRqPrvHueSatSpdBrtScL
*
* 12 keys Brk
*
* PgU
* 11 keys Toggle Backlight HomeEnd
* PgD
*
* 78 total
*/
[_FN] = LAYOUT(
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
// Function lock layer
// Everything on F-row locked to function layer, except ESC and DEL
[_FN_LOCK] = LAYOUT(
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FM] = LAYOUT(
FN_LOCK, 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_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, RGB_VAI, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_SPD, RGB_VAD, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
};
// clang-format on
// Make sure to keep FN Lock even after reset
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case FN_LOCK:
if (record->event.pressed) {
if (layer_state_is(_FN)) {
set_single_persistent_default_layer(_FN_LOCK);
}
if (layer_state_is(_FM)) {
set_single_persistent_default_layer(_BASE);
}
}
return false;
break;
default:
break;
}
return true;
}

View File

@ -0,0 +1,121 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "framework.h"
// clang-format off
enum _layers {
_BASE,
_FN,
_FN_LOCK,
_FM
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 14 keys Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10F11F12 Del
*
* 14 keys ` 1 2 3 4 5 6 7 8 9 0 - = Backsp
*
* 14 keys Tab Q W E R T Y U I O P [ ] \
*
* 13 keys Caps A S D F G H J K L ; ' Enter
*
* 12 keys Shift Z X C V B N M , . / Shift
*
*
* 11 keys CtrlFN GUIAlt AltCtl
*
*
* 78 total
*/
[_BASE] = LAYOUT(
KC_ESC, 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_DEL,
KC_GRV, 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_BSPC,
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_BSLS,
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_ENT,
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_LCTL, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
),
/*
* Function layer
*
* 14 keys FN lkMutvDnvUpPrvPlyNxtbDnbUpScnAirPrtAppIns
*
* 14 keys
*
* 14 keys Pau
*
* 13 keys SRqBLd ScL
*
* 12 keys Brt Brk
*
* PgU
* 11 keys Toggle Backlight HomeEnd
* PgD
*
* 78 total
*/
[_FN] = LAYOUT(
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, QK_BOOT, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
// Function lock layer
// Everything on F-row locked to function layer, except ESC and DEL
[_FN_LOCK] = LAYOUT(
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FM] = LAYOUT(
FN_LOCK, 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_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______,
_______, _______, KC_SYRQ, QK_BOOT, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
};
// clang-format on
// Make sure to keep FN Lock even after reset
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
uint8_t mod_state = get_mods();
switch (keycode) {
case KC_SPC:
// If the keypress is space and we only have shift pressed, send KC_MINS (which when shifted gives underscore) instead of KC_SPC.
// This will allow us to still use key combos that include space _and_ shift _and_ some other modifier.
if (mod_state & MOD_MASK_SHIFT && !(mod_state & MOD_MASK_CAG)) {
if (record->event.pressed) {
register_code(KC_MINS);
} else {
unregister_code(KC_MINS);
}
return false;
}
break;
case FN_LOCK:
if (record->event.pressed) {
if (layer_state_is(_FN)) {
set_single_persistent_default_layer(_FN_LOCK);
}
if (layer_state_is(_FM)) {
set_single_persistent_default_layer(_BASE);
}
}
return false;
break;
default:
break;
}
return true;
}

View File

@ -0,0 +1,2 @@
# No VIA
VIA_ENABLE = no

View File

@ -0,0 +1,5 @@
# Debugging (enabled in info.json)
#CONSOLE_ENABLE = yes
# TODO: Wait for PR #21343 to hit master
RGB_MATRIX_ENABLE = no
RGB_MATRIX_DRIVER = IS31FL3743A

View File

@ -0,0 +1,131 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
// Allow (emulated) EEPROM reset using VIA
#define VIA_EEPROM_ALLOW_RESET
// Increase to 16K for more storage space
// With 64K backing size, this spread the wear level over 4 blocks
#define WEAR_LEVELING_LOGICAL_SIZE (4 * 4096)
// Increase to 64K backing size to allow more wear leveling
#define WEAR_LEVELING_BACKING_SIZE (16 * 4096)
// We use 1MB flash
#define PICO_FLASH_SIZE_BYTES (1 * 1024 * 1024)
#define WEAR_LEVELING_RP2040_FLASH_SIZE PICO_FLASH_SIZE_BYTES
// Keep the last 4K sector free for the serial number
#define WEAR_LEVELING_RP2040_FLASH_BASE ((PICO_FLASH_SIZE_BYTES) - (WEAR_LEVELING_BACKING_SIZE + 4096))
// Prints every second how many matrix scans were done (Frequency in Hz)
// Only during debugging, since it prevents the host from going to sleep
//#define DEBUG_MATRIX_SCAN_RATE
// Prototype for Framework Laptop 16 with Raspberry Pi Pico
// It'll disable column drive because we need to remap some pins to there
// SDB is mapped to GP22
//#define PICO_FL16
#ifdef KEYBOARD_framework_ansi
# define LED_CAPS_LOCK_PIN GP24
#elif KEYBOARD_framework_iso
# define LED_CAPS_LOCK_PIN GP24
#elif KEYBOARD_framework_jis
# define LED_CAPS_LOCK_PIN GP24
#endif
// PWM single one backlight configuration
// GPIO25 maps to PWM channel 4B of the RP2040
// On the Raspberry Pi Pico this is the green LED on the board, good for prototyping
#define BACKLIGHT_PWM_DRIVER PWMD4
#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B
#define BACKLIGHT_BREATHING
// Change PWM frequency to 24kHz, the default of 2048Hz causes loud noise
// TODO: Waiting for PR #21717
// #define BACKLIGHT_PWM_PERIOD BACKLIGHT_PWM_COUNTER_FREQUENCY / 24000
// I2C for the RBG controller
#define I2C_DRIVER I2CD1
#define I2C1_SDA_PIN GP26
#define I2C1_SCL_PIN GP27
// RGB config
#define RGB_DISABLE_WHEN_USB_SUSPENDED
// RGB Matrix Animation modes. Explicitly enabled
// For full list of effects, see:
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
// 0 = Off
// 1 = Solid Color
// 2
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
// 10
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
// 20
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
// 30
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#define RGB_MATRIX_KEYPRESSES
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
// 33
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
// 40
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
/*
* 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

View File

@ -0,0 +1,157 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "framework.h"
void keyboard_post_init_kb(void) {
keyboard_post_init_user();
// Enable debug output
debug_enable = true;
debug_matrix = true;
debug_keyboard = true;
}
/**
* Hook into early keyboard initialization
*/
void keyboard_pre_init_kb(void) {
keyboard_pre_init_user();
// Mark boot as done.
// Before this, when holding down both alt keys QSPI_SS is pulled low to put
// the RP2040 in bootloader mode during reset.
setPinOutput(BOOT_DONE_GPIO);
writePinLow(BOOT_DONE_GPIO);
// TODO: Do we ever need to disable it to save power?
setPinOutput(MUX_ENABLE_GPIO);
writePinHigh(MUX_ENABLE_GPIO);
#ifdef RGB_MATRIX_ENABLE
setPinOutput(IS31FL3743A_ENABLE_GPIO);
writePinHigh(IS31FL3743A_ENABLE_GPIO);
#endif
setPinInput(SLEEP_GPIO);
}
/**
* Called by QMK when the keyboard suspends
*/
void suspend_power_down_kb(void) {
suspend_power_down_user();
#ifdef RGB_MATRIX_ENABLE
writePinLow(IS31FL3743A_ENABLE_GPIO);
#endif
}
/**
* Called by QMK when the keyboard wakes up from suspend
*/
void suspend_wakeup_init_kb(void) {
suspend_wakeup_init_user();
#ifdef RGB_MATRIX_ENABLE
setPinOutput(IS31FL3743A_ENABLE_GPIO);
writePinHigh(IS31FL3743A_ENABLE_GPIO);
#endif
}
// If in BIOS mode, no matter what the keys have been remapped to,
// always send them as the F keys
bool bios_mode = false;
bool handle_bios_hotkeys(uint16_t keycode, keyrecord_t *record) {
// Not in bios mode, no special handling, handle as normal
if (!bios_mode) return true;
if (record->event.key.col == 5 && record->event.key.row == 2) {
if (record->event.pressed) {
register_code(KC_F2);
} else {
unregister_code(KC_F2);
}
return false;
}
if (record->event.key.col == 8 && record->event.key.row == 4) {
if (record->event.pressed) {
register_code(KC_F10);
} else {
unregister_code(KC_F10);
}
return false;
}
if (record->event.key.col == 13 && record->event.key.row == 3) {
if (record->event.pressed) {
register_code(KC_F12);
} else {
unregister_code(KC_F12);
}
return false;
}
return true;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!handle_bios_hotkeys(keycode, record)) {
return false;
}
// STOP PROCESSING IF USER FUNC RETURNS FALSE!!! WHY IS THIS NOT DONE PROPERLY?
if (!process_record_user(keycode, record)) {
return false;
}
#ifdef RGB_MATRIX_ENABLE
uint8_t h;
uint8_t s;
uint8_t v;
uint8_t new_v;
#endif
switch (keycode) {
// Implement step brightness for RGB backlight
#ifdef RGB_MATRIX_ENABLE
case BL_STEP:
if (record->event.pressed) {
h = rgb_matrix_get_hue();
s = rgb_matrix_get_sat();
v = rgb_matrix_get_val();
switch (v) {
default: // Default when user set to a different level
case 0:
new_v = 85;
break;
case 85:
new_v = 170;
break;
case 170:
new_v = 255;
break;
case 255:
new_v = 0;
break;
}
rgb_matrix_sethsv(h, s, new_v);
}
return true;
#endif
case KC_SCRN:
// Simulate press WIN+P
// Works (at least) on Windows and GNOME
if (record->event.pressed) {
register_code(KC_LGUI);
register_code(KC_P);
} else {
unregister_code(KC_P);
unregister_code(KC_LGUI);
}
return false; // Skip all further processing of this key
default:
return true; // Process all other keycodes normally
}
}

View File

@ -0,0 +1,29 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "quantum.h"
#if KEYBOARD_framework_numpad
# include "numpad.h"
#endif
enum framework_keycodes {
// Custom keycode to change screen modes (e.g. enable external screen)
KC_SCRN = SAFE_RANGE,
FN_LOCK,
};
extern bool bios_mode;
#define SLEEP_GPIO GP0
#define MUX_ENABLE_GPIO GP4
#define BOOT_DONE_GPIO GP5
// Pin SDB to enable the RGB controller
#ifdef PICO_FL16
// 22 only on RPi Pico because it doesn't have GP29
# define IS31FL3743A_ENABLE_GPIO GP22
#else
# define IS31FL3743A_ENABLE_GPIO GP29
#endif

View File

@ -0,0 +1,13 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define HAL_USE_SIO TRUE
// For single-zone backlight
#define HAL_USE_PWM TRUE
#define HAL_USE_ADC TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,5 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#define MATRIX_COLS 16
#define MATRIX_ROWS 8

View File

@ -0,0 +1,117 @@
{
"keyboard_name": "Laptop 16 Keyboard Module - ISO",
"manufacturer": "Framework",
"maintainer": "JohnAZoidberg",
"bootloader": "rp2040",
"features": {
"bootmagic": false,
"mousekey": false,
"extrakey": true,
"console": true,
"command": false,
"nkro": true,
"audio": false
},
"debounce": 5,
"processor": "RP2040",
"url": "https://frame.work/de/en/products/laptop16-diy-amd-7040",
"usb": {
"device_version": "0.2.2",
"pid": "0x0018",
"vid": "0x32AC",
"force_nkro": true
},
"backlight": {
"pin": "GP25"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [7, 5], "label": "Esc", "x": 0, "y": 0, "w": 1.25, "h": 0.5 },
{ "matrix": [3, 5], "label": "F1", "x": 1.5, "y": 0, "h": 0.5 },
{ "matrix": [2, 5], "label": "F2", "x": 2.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 4], "label": "F3", "x": 4, "y": 0, "h": 0.5 },
{ "matrix": [3, 4], "label": "F4", "x": 5.25, "y": 0, "h": 0.5 },
{ "matrix": [4, 10], "label": "F5", "x": 6.5, "y": 0, "h": 0.5 },
{ "matrix": [3, 10], "label": "F6", "x": 7.75, "y": 0, "h": 0.5 },
{ "matrix": [2, 10], "label": "F7", "x": 9, "y": 0, "h": 0.5 },
{ "matrix": [1, 15], "label": "F8", "x": 10.25, "y": 0, "h": 0.5 },
{ "matrix": [3, 11], "label": "F9", "x": 11.5, "y": 0, "h": 0.5 },
{ "matrix": [4, 8], "label": "F10", "x": 12.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 8], "label": "F11", "x": 14, "y": 0, "h": 0.5 },
{ "matrix": [3, 13], "label": "F12", "x": 15.25, "y": 0, "h": 0.5 },
{ "matrix": [0, 1], "label": "Delete", "x": 16.5, "y": 0, "w": 1.75, "h": 0.5 },
{ "matrix": [4, 2], "label": "~", "x": 0, "y": 0.75 },
{ "matrix": [5, 2], "label": "!", "x": 1.25, "y": 0.75 },
{ "matrix": [5, 5], "label": "\"", "x": 2.5, "y": 0.75 },
{ "matrix": [5, 4], "label": "", "x": 3.75, "y": 0.75 },
{ "matrix": [5, 6], "label": "$", "x": 5, "y": 0.75 },
{ "matrix": [4, 6], "label": "%", "x": 6.25, "y": 0.75 },
{ "matrix": [4, 7], "label": "^", "x": 7.5, "y": 0.75 },
{ "matrix": [5, 7], "label": "&", "x": 8.75, "y": 0.75 },
{ "matrix": [5, 10], "label": "*", "x": 10, "y": 0.75 },
{ "matrix": [5, 8], "label": "(", "x": 11.25, "y": 0.75 },
{ "matrix": [4, 13], "label": ")", "x": 12.5, "y": 0.75 },
{ "matrix": [2, 13], "label": "_", "x": 13.75, "y": 0.75 },
{ "matrix": [4, 14], "label": "+", "x": 15, "y": 0.75 },
{ "matrix": [5, 14], "label": "Backspace", "x": 16.25, "y": 0.75, "w": 2 },
{ "matrix": [3, 2], "label": "Tab", "x": 0, "y": 2, "w": 1.5 },
{ "matrix": [0, 2], "label": "Q", "x": 1.75, "y": 2 },
{ "matrix": [6, 5], "label": "W", "x": 3, "y": 2 },
{ "matrix": [2, 4], "label": "E", "x": 4.25, "y": 2 },
{ "matrix": [6, 6], "label": "R", "x": 5.5, "y": 2 },
{ "matrix": [3, 6], "label": "T", "x": 6.75, "y": 2 },
{ "matrix": [3, 7], "label": "Y", "x": 8, "y": 2 },
{ "matrix": [6, 7], "label": "U", "x": 9.25, "y": 2 },
{ "matrix": [6, 10], "label": "I", "x": 10.5, "y": 2 },
{ "matrix": [3, 8], "label": "O", "x": 11.75, "y": 2 },
{ "matrix": [5, 13], "label": "P", "x": 13, "y": 2 },
{ "matrix": [6, 13], "label": "{", "x": 14.25, "y": 2 },
{ "matrix": [6, 14], "label": "}", "x": 15.5, "y": 2 },
{ "matrix": [4, 4], "label": "Caps Lock", "x": 0, "y": 3.25, "w": 1.75 },
{ "matrix": [7, 2], "label": "A", "x": 2, "y": 3.25 },
{ "matrix": [4, 5], "label": "S", "x": 3.25, "y": 3.25 },
{ "matrix": [7, 14], "label": "D", "x": 4.5, "y": 3.25 },
{ "matrix": [7, 6], "label": "F", "x": 5.75, "y": 3.25 },
{ "matrix": [2, 6], "label": "G", "x": 7, "y": 3.25 },
{ "matrix": [2, 7], "label": "H", "x": 8.25, "y": 3.25 },
{ "matrix": [7, 7], "label": "J", "x": 9.5, "y": 3.25 },
{ "matrix": [7, 10], "label": "K", "x": 10.75, "y": 3.25 },
{ "matrix": [7, 8], "label": "L", "x": 12, "y": 3.25 },
{ "matrix": [7, 13], "label": ":", "x": 13.25, "y": 3.25 },
{ "matrix": [0, 14], "label": "@", "x": 14.5, "y": 3.25 },
{ "matrix": [2, 8], "label": "~", "x": 15.75, "y": 3.25 },
{ "matrix": [1, 14], "label": "Enter", "x": 17, "y": 2, "w": 1.25, "h": 2.25 },
{ "matrix": [1, 9], "label": "Shift", "x": 0, "y": 4.5, "w": 1.25 },
{ "matrix": [5, 11], "label": "|", "x": 1.5, "y": 4.5 },
{ "matrix": [1, 5], "label": "Z", "x": 2.75, "y": 4.5 },
{ "matrix": [0, 5], "label": "X", "x": 4, "y": 4.5 },
{ "matrix": [0, 0], "label": "C", "x": 5.25, "y": 4.5 },
{ "matrix": [0, 6], "label": "V", "x": 6.5, "y": 4.5 },
{ "matrix": [1, 6], "label": "B", "x": 7.75, "y": 4.5 },
{ "matrix": [1, 7], "label": "N", "x": 9, "y": 4.5 },
{ "matrix": [0, 7], "label": "M", "x": 10.25, "y": 4.5 },
{ "matrix": [0, 10], "label": "<", "x": 11.5, "y": 4.5 },
{ "matrix": [0, 8], "label": ">", "x": 12.75, "y": 4.5 },
{ "matrix": [0, 13], "label": "?", "x": 14, "y": 4.5 },
{ "matrix": [0, 9], "label": "Shift", "x": 15.25, "y": 4.5, "w": 3 },
{ "matrix": [1, 12], "label": "Ctrl", "x": 0, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 2], "label": "Fn", "x": 1.5, "y": 5.75 },
{ "matrix": [3, 1], "label": "Win", "x": 2.75, "y": 5.75 },
{ "matrix": [1, 3], "label": "Alt", "x": 4, "y": 5.75 },
{ "matrix": [1, 4], "label": "Space", "x": 5.25, "y": 5.75, "w": 6 },
{ "matrix": [0, 3], "label": "Alt", "x": 11.5, "y": 5.75 },
{ "matrix": [0, 12], "label": "Ctrl", "x": 12.75, "y": 5.75 },
{ "matrix": [6, 11], "label": "←", "x": 14, "y": 5.75, "w": 1.25 },
{ "matrix": [1, 13], "label": "↑", "x": 15.5, "y": 5.75, "w": 1.25, "h": 0.5 },
{ "matrix": [1, 8], "label": "→", "x": 17, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 15], "label": "↓", "x": 15.5, "y": 6.25, "w": 1.25, "h": 0.5 }
]
}
}
}

View File

@ -0,0 +1,108 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "framework.h"
// clang-format off
enum _layers {
_BASE,
_FN,
_FN_LOCK,
_FM
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 14 keys Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10F11F12 Del
*
* 14 keys ` 1 2 3 4 5 6 7 8 9 0 - = Backsp
*
* 13 keys Tab Q W E R T Y U I O P [ ] Entr
*
* 14 keys Caps A S D F G H J K L ; ' #
*
* 13 keys Shft \ Z X C V B N M , . / Shift
*
*
* 11 keys CtrlFN GUIAlt AltCtl
*
*
* 79 total
*/
[_BASE] = LAYOUT(
KC_ESC, 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_DEL,
KC_GRV, 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_BSPC,
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_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_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_LCTL, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
),
/*
* Function layer
*
* 14 keys FN lkMutvDnvUpPrvPlyNxtbDnbUpScnAirPrtAppIns
*
* 14 keys
*
* 13 keys Pau
*
* 14 keys ScL
*
* 13 keys Brk
*
* PgU
* 11 keys Toggle Backlight HomeEnd
* PgD
*
* 78 total
*/
[_FN] = LAYOUT(
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______,
_______, _______, KC_SYRQ, _______, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
// Function lock layer
// Everything on F-row locked to function layer, except ESC and DEL
[_FN_LOCK] = LAYOUT(
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FM] = LAYOUT(
FN_LOCK, 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_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______,
_______, _______, KC_SYRQ, _______, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_STEP, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
};
// clang-format on
// Make sure to keep FN Lock even after reset
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case FN_LOCK:
if (record->event.pressed) {
if (layer_state_is(_FN)) {
set_single_persistent_default_layer(_FN_LOCK);
}
if (layer_state_is(_FM)) {
set_single_persistent_default_layer(_BASE);
}
}
return false;
break;
default:
break;
}
return true;
}

View File

@ -0,0 +1,2 @@
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm

View File

@ -0,0 +1,5 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#define MATRIX_COLS 16
#define MATRIX_ROWS 8

View File

@ -0,0 +1,121 @@
{
"keyboard_name": "Laptop 16 Keyboard Module - JIS",
"manufacturer": "Framework",
"maintainer": "JohnAZoidberg",
"bootloader": "rp2040",
"features": {
"bootmagic": false,
"mousekey": false,
"extrakey": true,
"console": true,
"command": false,
"nkro": true,
"audio": false
},
"debounce": 5,
"processor": "RP2040",
"url": "https://frame.work/de/en/products/laptop16-diy-amd-7040",
"usb": {
"device_version": "0.2.2",
"pid": "0x0019",
"vid": "0x32AC",
"force_nkro": true
},
"backlight": {
"pin": "GP25"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [7, 5], "label": "Esc", "x": 0, "y": 0, "w": 1.25, "h": 0.5 },
{ "matrix": [3, 5], "label": "F1", "x": 1.5, "y": 0, "h": 0.5 },
{ "matrix": [2, 5], "label": "F2", "x": 2.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 4], "label": "F3", "x": 4, "y": 0, "h": 0.5 },
{ "matrix": [3, 4], "label": "F4", "x": 5.25, "y": 0, "h": 0.5 },
{ "matrix": [4, 10], "label": "F5", "x": 6.5, "y": 0, "h": 0.5 },
{ "matrix": [3, 10], "label": "F6", "x": 7.75, "y": 0, "h": 0.5 },
{ "matrix": [2, 10], "label": "F7", "x": 9, "y": 0, "h": 0.5 },
{ "matrix": [1, 15], "label": "F8", "x": 10.25, "y": 0, "h": 0.5 },
{ "matrix": [3, 11], "label": "F9", "x": 11.5, "y": 0, "h": 0.5 },
{ "matrix": [4, 8], "label": "F10", "x": 12.75, "y": 0, "h": 0.5 },
{ "matrix": [6, 8], "label": "F11", "x": 14, "y": 0, "h": 0.5 },
{ "matrix": [3, 13], "label": "F12", "x": 15.25, "y": 0, "h": 0.5 },
{ "matrix": [0, 1], "label": "Delete", "x": 16.5, "y": 0, "w": 1.75, "h": 0.5 },
{ "matrix": [4, 2], "label": "~", "x": 0, "y": 0.75 },
{ "matrix": [5, 2], "label": "!", "x": 1.25, "y": 0.75 },
{ "matrix": [5, 5], "label": "\"", "x": 2.5, "y": 0.75 },
{ "matrix": [5, 4], "label": "", "x": 3.75, "y": 0.75 },
{ "matrix": [5, 6], "label": "$", "x": 5, "y": 0.75 },
{ "matrix": [4, 6], "label": "%", "x": 6.25, "y": 0.75 },
{ "matrix": [4, 7], "label": "^", "x": 7.5, "y": 0.75 },
{ "matrix": [5, 7], "label": "&", "x": 8.75, "y": 0.75 },
{ "matrix": [5, 10], "label": "*", "x": 10, "y": 0.75 },
{ "matrix": [5, 8], "label": "(", "x": 11.25, "y": 0.75 },
{ "matrix": [4, 13], "label": ")", "x": 12.5, "y": 0.75 },
{ "matrix": [2, 13], "label": "_", "x": 13.75, "y": 0.75 },
{ "matrix": [4, 14], "label": "+", "x": 15, "y": 0.75 },
{ "matrix": [0, 15], "x": 16.25, "y": 0.75, "w": 0.5 },
{ "matrix": [5, 14], "label": "Backsp", "x": 17, "y": 0.75, "w": 1.25 },
{ "matrix": [3, 2], "label": "Tab", "x": 0, "y": 2, "w": 1.5 },
{ "matrix": [0, 2], "label": "Q", "x": 1.75, "y": 2 },
{ "matrix": [6, 5], "label": "W", "x": 3, "y": 2 },
{ "matrix": [2, 4], "label": "E", "x": 4.25, "y": 2 },
{ "matrix": [6, 6], "label": "R", "x": 5.5, "y": 2 },
{ "matrix": [3, 6], "label": "T", "x": 6.75, "y": 2 },
{ "matrix": [3, 7], "label": "Y", "x": 8, "y": 2 },
{ "matrix": [6, 7], "label": "U", "x": 9.25, "y": 2 },
{ "matrix": [6, 10], "label": "I", "x": 10.5, "y": 2 },
{ "matrix": [3, 8], "label": "O", "x": 11.75, "y": 2 },
{ "matrix": [5, 13], "label": "P", "x": 13, "y": 2 },
{ "matrix": [6, 13], "label": "{", "x": 14.25, "y": 2 },
{ "matrix": [6, 14], "label": "}", "x": 15.5, "y": 2 },
{ "matrix": [4, 4], "label": "Caps Lock", "x": 0, "y": 3.25, "w": 1.75 },
{ "matrix": [7, 2], "label": "A", "x": 2, "y": 3.25 },
{ "matrix": [4, 5], "label": "S", "x": 3.25, "y": 3.25 },
{ "matrix": [7, 14], "label": "D", "x": 4.5, "y": 3.25 },
{ "matrix": [7, 6], "label": "F", "x": 5.75, "y": 3.25 },
{ "matrix": [2, 6], "label": "G", "x": 7, "y": 3.25 },
{ "matrix": [2, 7], "label": "H", "x": 8.25, "y": 3.25 },
{ "matrix": [7, 7], "label": "J", "x": 9.5, "y": 3.25 },
{ "matrix": [7, 10], "label": "K", "x": 10.75, "y": 3.25 },
{ "matrix": [7, 8], "label": "L", "x": 12, "y": 3.25 },
{ "matrix": [7, 13], "label": ":", "x": 13.25, "y": 3.25 },
{ "matrix": [0, 14], "label": "@", "x": 14.5, "y": 3.25 },
{ "matrix": [2, 8], "label": "~", "x": 15.75, "y": 3.25 },
{ "matrix": [1, 14], "label": "Enter", "x": 17, "y": 2, "w": 1.25, "h": 2.25 },
{ "matrix": [1, 9], "label": "Shift", "x": 0, "y": 4.5, "w": 2.5 },
{ "matrix": [1, 5], "label": "Z", "x": 2.75, "y": 4.5 },
{ "matrix": [0, 5], "label": "X", "x": 4, "y": 4.5 },
{ "matrix": [0, 0], "label": "C", "x": 5.25, "y": 4.5 },
{ "matrix": [0, 6], "label": "V", "x": 6.5, "y": 4.5 },
{ "matrix": [1, 6], "label": "B", "x": 7.75, "y": 4.5 },
{ "matrix": [1, 7], "label": "N", "x": 9, "y": 4.5 },
{ "matrix": [0, 7], "label": "M", "x": 10.25, "y": 4.5 },
{ "matrix": [0, 10], "label": "<", "x": 11.5, "y": 4.5 },
{ "matrix": [0, 8], "label": ">", "x": 12.75, "y": 4.5 },
{ "matrix": [0, 13], "label": "?", "x": 14, "y": 4.5 },
{ "matrix": [4, 11], "x": 15.25, "y": 4.5 },
{ "matrix": [0, 9], "label": "Shift", "x": 16.5, "y": 4.5, "w": 1.75 },
{ "matrix": [1, 12], "label": "Ctrl", "x": 0, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 2], "label": "Fn", "x": 1.5, "y": 5.75 },
{ "matrix": [3, 1], "label": "Win", "x": 2.75, "y": 5.75 },
{ "matrix": [1, 3], "label": "Alt", "x": 4, "y": 5.75 },
{ "matrix": [6, 2], "x": 5.25, "y": 5.75, "w": 0.5 },
{ "matrix": [1, 4], "x": 6, "y": 5.75, "w": 3.75 },
{ "matrix": [1, 11], "x": 10, "y": 5.75, "w": 0.5 },
{ "matrix": [0, 11], "x": 10.75, "y": 5.75, "w": 0.5 },
{ "matrix": [0, 3], "label": "Alt", "x": 11.5, "y": 5.75 },
{ "matrix": [0, 12], "label": "Ctrl", "x": 12.75, "y": 5.75 },
{ "matrix": [6, 11], "label": "←", "x": 14, "y": 5.75, "w": 1.25 },
{ "matrix": [1, 13], "label": "↑", "x": 15.5, "y": 5.75, "w": 1.25, "h": 0.5 },
{ "matrix": [1, 8], "label": "→", "x": 17, "y": 5.75, "w": 1.25 },
{ "matrix": [2, 15], "label": "↓", "x": 15.5, "y": 6.25, "w": 1.25, "h": 0.5 }
]
}
}
}

View File

@ -0,0 +1,109 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "keymap_japanese.h"
#include "framework.h"
// clang-format off
enum _layers {
_BASE,
_FN,
_FN_LOCK,
_FM
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 14 keys Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10F11F12 Del
*
* 15 keys ZH 1 2 3 4 5 6 7 8 9 0 - ^ ¥ Bck
*
* 13 keys Tab Q W E R T Y U I O P @ [ Entr
*
* 14 keys Eisū A S D F G H J K L ; : ]
*
* 13 keys Shift Z X C V B N M , . / \ Shift
*
* M H K
* 14 keys CtrlFN GUIAltu e AltCtl
* h n H
*
* 83 total
*/
[_BASE] = LAYOUT(
KC_ESC, 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_DEL,
JP_ZKHK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JP_CIRC, JP_YEN, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_LBRC,
JP_EISU, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_RBRC, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, JP_BSLS, KC_RSFT,
KC_LCTL, MO(_FN), KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, JP_HENK, JP_KANA, KC_RALT, KC_RCTL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
),
/*
* Function layer
*
* 14 keys FN lkMutvDnvUpPrvPlyNxtbDnbUpScnAirPrtAppIns
*
* 15 keys
*
* 13 keys Pau
*
* 14 keys SRq ScL
*
* 13 keys Brk
*
* Toggle PgU
* 14 keys Backlight HomeEnd
* PgD
*
* 83 total
*/
[_FN] = LAYOUT(
FN_LOCK, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______,
_______, _______, KC_SYRQ, _______, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BL_STEP, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
// Function lock layer
// Everything on F-row locked to function layer, except ESC and DEL
[_FN_LOCK] = LAYOUT(
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_BRID, KC_BRIU, KC_SCRN, XXXXXXX, KC_PSCR, KC_MSEL, KC_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, MO(_FM), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_FN] = LAYOUT(
FN_LOCK, 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_INS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, _______, _______,
_______, _______, KC_SYRQ, _______, _______, _______, _______, _______, KC_SCRL, _______, _______, _______, _______, _______,
_______, _______, _______, BL_BRTG, _______, KC_BRK, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, BL_STEP, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END
),
};
// clang-format on
// Make sure to keep FN Lock even after reset
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case FN_LOCK:
if (record->event.pressed) {
if (layer_state_is(_FN)) {
set_single_persistent_default_layer(_FN_LOCK);
}
if (layer_state_is(_FM)) {
set_single_persistent_default_layer(_BASE);
}
}
return false;
break;
default:
break;
}
return true;
}

View File

@ -0,0 +1,2 @@
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm

View File

@ -0,0 +1,16 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#define MATRIX_COLS 8
#define MATRIX_ROWS 4
#define DRIVER_COUNT 1
#define DRIVER_ADDR_1 0b0100000
#define RGB_MATRIX_LED_COUNT 24
// Enable only the first 4 SW and disable software shutdown
// Otherwise voltage on SW pins without LEDs causes voltage rise and noise
#define ISSI_CONFIGURATION 0x71
// Limit current to ensure max current draw is just about 500mA
// when white at 100% brightness
#define ISSI_GLOBALCURRENT 185

View File

@ -0,0 +1,62 @@
{
"keyboard_name": "Laptop 16 RGB Macropad",
"manufacturer": "Framework",
"maintainer": "JohnAZoidberg",
"bootloader": "rp2040",
"features": {
"bootmagic": false,
"mousekey": false,
"extrakey": true,
"console": true,
"command": false,
"nkro": true,
"audio": false
},
"debounce": 5,
"processor": "RP2040",
"url": "https://frame.work/de/en/products/laptop16-diy-amd-7040",
"usb": {
"device_version": "0.2.2",
"pid": "0x0013",
"vid": "0x32AC",
"force_nkro": true
},
"backlight": {
"pin": "GP25"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [ 2, 1], "x": 0, "y": 0, "h": 0.75 },
{ "matrix": [ 2, 2], "x": 1.25, "y": 0, "h": 0.75 },
{ "matrix": [ 3, 4], "x": 2.5, "y": 0, "h": 0.75 },
{ "matrix": [ 2, 4], "x": 3.75, "y": 0, "h": 0.75 },
{ "matrix": [ 0, 0], "x": 0, "y": 1, "h": 1.25 },
{ "matrix": [ 0, 4], "x": 1.25, "y": 1, "h": 1.25 },
{ "matrix": [ 1, 1], "x": 2.5, "y": 1, "h": 1.25 },
{ "matrix": [ 1, 6], "x": 3.75, "y": 1, "h": 1.25 },
{ "matrix": [ 0, 1], "x": 0, "y": 2.5, "h": 1.25 },
{ "matrix": [ 0, 5], "x": 1.25, "y": 2.5, "h": 1.25 },
{ "matrix": [ 1, 2], "x": 2.5, "y": 2.5, "h": 1.25 },
{ "matrix": [ 2, 5], "x": 3.75, "y": 2.5, "h": 1.25 },
{ "matrix": [ 0, 2], "x": 0, "y": 4, "h": 1.25 },
{ "matrix": [ 0, 6], "x": 1.25, "y": 4, "h": 1.25 },
{ "matrix": [ 1, 3], "x": 2.5, "y": 4, "h": 1.25 },
{ "matrix": [ 1, 7], "x": 3.75, "y": 4, "h": 1.25 },
{ "matrix": [ 0, 3], "x": 0, "y": 5.5, "h": 1.25 },
{ "matrix": [ 0, 7], "x": 1.25, "y": 5.5, "h": 1.25 },
{ "matrix": [ 1, 4], "x": 2.5, "y": 5.5, "h": 1.25 },
{ "matrix": [ 2, 6], "x": 3.75, "y": 5.5, "h": 1.25 },
{ "matrix": [ 1, 0], "x": 0, "y": 7, "w": 2.25, "h": 1.25 },
{ "matrix": [ 2, 7], "x": 1.25, "y": 7, "h": 1.25 },
{ "matrix": [ 1, 5], "x": 2.5, "y": 7, "h": 1.25 },
{ "matrix": [ 2, 0], "x": 3.75, "y": 7, "h": 1.25 }
]
}
}
}

View File

@ -0,0 +1,87 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 4 keys RGB RGB Nxt RGB + Sleep
* Toggle Effect Brightn
*
* 4 keys Numpad RGB Prv RGB - RGB BL
* Layer Effect Brightn Step
*
* 4 keys RGB + RGB + RGB + <--
* Hue Sat Speed
*
* 4 keys RGB - RGB - RGB - Enter
* Hue Sat Speed
*
* 4 keys Up
*
*
* 4 keys Left Down Right
*
*
* 24 total
*/
[0] = LAYOUT(
RGB_TOG, RGB_MOD, RGB_VAI, KC_SLEP,
TG(1), RGB_RMOD,RGB_VAD, BL_STEP,
RGB_HUI, RGB_SAI, RGB_SPI, KC_BSPC,
RGB_HUD, RGB_SAD, RGB_SPD, KC_ENT,
XXXXXXX, KC_UP, XXXXXXX, XXXXXXX,
KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX
),
/* Numpad
*
* 4 keys Esc Calc = <-
*
* 4 keys / * -
*
* 4 keys 7 8 9 +
*
* 4 keys 4 5 6 +
*
* 4 keys 1 2 3 Entr
*
* 4 keys 0 0 . Entr
*
* 24 total
*/
[1] = LAYOUT(
KC_ESC, KC_CALC, KC_EQL, KC_BSPC,
_______, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_P0, KC_PDOT, KC_PENT
),
/* Alphabet
*
* 4 keys A B C D
*
* 4 keys E F G H
*
* 4 keys I J K L
*
* 4 keys M N O P
*
* 4 keys Q R S T
*
* 4 keys U V W X
*
* 24 total
*/
[2] = LAYOUT(
KC_A, KC_B, KC_C, KC_D,
KC_E, KC_F, KC_G, KC_H,
KC_I, KC_J, KC_K, KC_L,
KC_M, KC_N, KC_O, KC_P,
KC_Q, KC_R, KC_S, KC_T,
KC_U, KC_V, KC_W, KC_X
)
};
// clang-format on

View File

@ -0,0 +1,63 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 4 keys RGB + RGB - RGB NxtRGB Prv
* BrightnBrightnEffect Effect
*
* 4 keys Numpad CTRL+A
* Layer
*
* 4 keys Enter Delete
*
*
* 4 keys Save A V Cut
*
*
* 4 keys + CTRL Undo Copy
* +
*
* 4 keys - CTRL Redo Paste
* -
*
* 24 total
*/
[0] = LAYOUT(
RGB_VAI, RGB_VAD, RGB_MOD, RGB_RMOD,
TG(1), XXXXXXX, XXXXXXX, C(KC_A),
KC_ENT, XXXXXXX, XXXXXXX, KC_DEL,
C(KC_S), KC_A, KC_V, C(KC_X),
KC_PPLS, C(KC_EQL), C(KC_Z), C(KC_C),
KC_PMNS, C(KC_MINS),C(KC_Y), C(KC_V)
),
/* Numpad
*
* 4 keys Esc Calc = <-
*
* 4 keys Num / * -
*
* 3 keys 7 8 9 +
*
* 4 keys 4 5 6 +
*
* 3 keys 1 2 3 Entr
*
* 3 keys 0 0 . Entr
*
* 21 total
*/
[1] = LAYOUT(
KC_ESC, KC_CALC, KC_EQL, KC_BSPC,
_______, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_P0, KC_PDOT, KC_PENT
)
};
// clang-format on

View File

@ -0,0 +1,4 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H

View File

@ -0,0 +1,3 @@
# TODO: Wait for PR #21343 to hit master
RGB_MATRIX_ENABLE = no
RGB_MATRIX_DRIVER = IS31FL3743A

View File

@ -0,0 +1,335 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include <stdio.h>
#include <stdint.h>
#include "debug.h"
#include "analog.h"
#include "print.h"
#include "quantum.h"
#include "hal_adc.h"
#include "chprintf.h"
#include "matrix.h"
#include "framework.h"
#define adc10ksample_t int
// Mux GPIOs
#define MUX_A GP1
#define MUX_B GP2
#define MUX_C GP3
#define MUX_ENABLE GP4
// Rows to ADC input
#define KSI0 2
#define KSI1 0
#define KSI2 1
#define KSI3 3
// Columns to GPIOs
#define KSO0 GP8
#define KSO1 GP9
#define KSO2 GP10
#define KSO3 GP11
#define KSO4 GP12
#define KSO5 GP13
#define KSO6 GP14
#define KSO7 GP15
#define KSO8 GP21
#define KSO9 GP20
#define KSO10 GP19
#define KSO11 GP18
#define KSO12 GP17
#define KSO13 GP16
#define KSO14 GP23
#define KSO15 GP22
#define ADC_CH2_PIN GP28
// Voltage threshold - anything below that counts as pressed
// 29000 = 2.9V * 10000
const adc10ksample_t ADC_THRESHOLD = (adc10ksample_t)29000;
bool have_slept = false;
adc10ksample_t to_voltage(adcsample_t sample) {
int voltage = sample * 33000;
return voltage / 1023;
}
/**
* Tell RP2040 ADC controller to initialize a specific GPIO for ADC input
*/
void adc_gpio_init(int gpio) {
assert(gpio >= GP26 && gpio <= GP28);
// Enable pull-up on GPIO input so that we always have high input
// Even on the rows that don't have the external pull-up.
// Otherwise they would be floating.
#define PAL_MODE_ADC_PULLUP (PAL_MODE_INPUT_ANALOG | PAL_RP_PAD_PUE)
palSetLineMode(gpio, PAL_MODE_ADC_PULLUP);
}
/**
* Tell the mux to select a specific column
*
* Splits the positive integer (<=7) into its three component bits.
*/
static void mux_select_row(int row) {
assert(col >= 0 && col <= 7);
// Not in order - need to remap them
// X0 - KSI1
// X1 - KSI2
// X2 - KSI0
// X3 - KSI3
// Only for keyboard, not for num-/grid-pad
// X4 - KSI4
// X5 - KSI5
// X6 - KSI6
// X7 - KSI7
int index = 0;
switch (row) {
case 0:
index = 2;
break;
case 1:
index = 0;
break;
case 2:
index = 1;
break;
default:
index = row;
break;
}
int bits[] = {(index & 0x1) > 0, (index & 0x2) > 0, (index & 0x4) > 0};
writePin(MUX_A, bits[0]);
writePin(MUX_B, bits[1]);
writePin(MUX_C, bits[2]);
}
/**
* Based on the ADC value, update the matrix for this column
* */
static bool interpret_adc_row(matrix_row_t cur_matrix[], adc10ksample_t voltage, int col, int row) {
bool changed = false;
// By default the voltage is high (3.3V)
// When a key is pressed it causes the voltage to go down.
// But because every key is connected in a matrix, pressing multiple keys
// changes the voltage at every key again. So we can't check for a specific
// voltage but need to have a threshold.
bool key_state = false;
if (voltage < ADC_THRESHOLD) {
key_state = true;
}
// Don't update matrix on Pico to avoid messing with the debug system
// Can't attach the matrix anyways
//#ifdef PICO_FL16
//(void)key_state;
// return false;
//#endif
matrix_row_t new_row = cur_matrix[row];
if (key_state) {
new_row |= (1 << col);
} else {
new_row &= ~(1 << col);
}
changed = cur_matrix[row] != new_row;
if (key_state) {
uprintf("old row: %d\n", cur_matrix[row]);
uprintf("new row: %d\n", new_row);
}
cur_matrix[row] = new_row;
return changed;
}
/**
* Drive the GPIO for a column low or high.
*/
void drive_col(int col, bool high) {
assert(col >= 0 && col <= MATRIX_COLS);
int gpio = 0;
switch (col) {
case 0:
gpio = GP8;
break;
case 1:
gpio = GP9;
break;
case 2:
gpio = GP10;
break;
case 3:
gpio = GP11;
break;
case 4:
gpio = GP12;
break;
case 5:
gpio = GP13;
break;
case 6:
gpio = GP14;
break;
case 7:
gpio = GP15;
break;
case 8:
gpio = GP21;
break;
case 9:
gpio = GP20;
break;
case 10:
gpio = GP19;
break;
case 11:
gpio = GP18;
break;
case 12:
gpio = GP17;
break;
case 13:
gpio = GP16;
break;
case 14:
gpio = GP23;
break;
case 15:
gpio = GP22;
break;
default:
// Not supposed to happen
assert(false);
return;
}
// Don't drive columns on pico because we're using these GPIOs for other purposes
//#ifdef PICO_FL16
// (void)gpio;
// return;
//#endif
if (high) {
// TODO: Could set up the pins with `setPinOutputOpenDrain` instead
writePinHigh(gpio);
} else {
writePinLow(gpio);
}
}
/**
* Read a value from the ADC and print some debugging details
*/
static adc10ksample_t read_adc(void) {
// Can't use analogReadPin because it gets rid of the internal pullup on
// this pin, that we configure in matrix_init_custom
uint16_t val = adc_read(pinToMux(ADC_CH2_PIN));
return to_voltage(val);
}
/**
* Handle the host going to sleep or the keyboard being idle
* If the host is asleep the keyboard should reduce the scan rate and turn backlight off.
*
* If the host is awake but the keyboard is idle it should enter a low-power state
*/
bool handle_idle(void) {
bool asleep = !readPin(SLEEP_GPIO);
static uint8_t prev_asleep = -1;
if (prev_asleep != asleep) {
prev_asleep = asleep;
}
#ifdef RGB_MATRIX_ENABLE
if (rgb_matrix_get_suspend_state() != asleep) {
rgb_matrix_set_suspend_state(asleep);
}
#endif
return false;
}
/**
* Overriding behavior of matrix_scan from quantum/matrix.c
*/
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
bool changed = false;
if (handle_idle()) {
return false;
}
// Drive all high to deselect them
for (int col = 0; col < MATRIX_COLS; col++) {
drive_col(col, true);
}
// Go through every matrix column (KSO) and drive them low individually
// Then go through every matrix row (KSI), select it with the mux and check their ADC value
for (int col = 0; col < MATRIX_COLS; col++) {
// Drive column low so we can measure the resistors on each row in this column
drive_col(col, false);
for (int row = 0; row < MATRIX_ROWS; row++) {
// Read ADC for this row
mux_select_row(row);
// Interpret ADC value as rows
changed |= interpret_adc_row(current_matrix, read_adc(), col, row);
}
// Drive column high again
drive_col(col, true);
}
return changed;
}
/**
* Enable the ADC MUX
*
* TODO: Do we need a de-init? Probably not.
*/
static void adc_mux_init(void) {
setPinOutput(MUX_ENABLE);
writePinLow(MUX_ENABLE);
setPinOutput(MUX_A);
setPinOutput(MUX_B);
setPinOutput(MUX_C);
}
/**
* Overriding behavior of matrix_init from quantum/matrix.c
*/
void matrix_init_custom(void) {
adc_mux_init();
adc_gpio_init(ADC_CH2_PIN);
// KS0 - KSO7 for Keyboard and Numpad
setPinOutput(KSO0);
setPinOutput(KSO1);
setPinOutput(KSO2);
setPinOutput(KSO3);
setPinOutput(KSO4);
setPinOutput(KSO5);
setPinOutput(KSO6);
setPinOutput(KSO7);
// KS08 - KS015 for Keyboard only
setPinOutput(KSO8);
setPinOutput(KSO9);
setPinOutput(KSO10);
setPinOutput(KSO11);
setPinOutput(KSO12);
setPinOutput(KSO13);
setPinOutput(KSO14);
setPinOutput(KSO15);
// Set unused pins to input to avoid interfering. They're hooked up to rows 5 and 6
setPinInput(GP6);
setPinInput(GP7);
}

View File

@ -0,0 +1,6 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "quantum.h"

View File

@ -0,0 +1,29 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <mcuconf.h>
#undef RP_SIO_USE_UART0
#define RP_SIO_USE_UART0 TRUE
#undef RP_SIO_USE_UART1
#define RP_SIO_USE_UART1 FALSE
// For RGB backlight
#undef RP_ADC_USE_ADC1
#define RP_ADC_USE_ADC1 TRUE
// For single-zone backlight
#undef RP_PWM_USE_PWM4
#define RP_PWM_USE_PWM4 TRUE
#undef RP_I2C_USE_I2C1
#define RP_I2C_USE_I2C1 TRUE
/*
* IRQ system settings.
* TODO: Default is 3, should it be 2?
*/
#undef RP_IRQ_ADC1_PRIORITY
#define RP_IRQ_ADC1_PRIORITY 2

View File

@ -0,0 +1,5 @@
// Copyright 2022 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#define MATRIX_COLS 8
#define MATRIX_ROWS 4

View File

@ -0,0 +1,59 @@
{
"keyboard_name": "Laptop 16 Numpad Module",
"manufacturer": "Framework",
"maintainer": "JohnAZoidberg",
"bootloader": "rp2040",
"features": {
"bootmagic": false,
"mousekey": false,
"extrakey": true,
"console": true,
"command": false,
"nkro": true,
"audio": false
},
"debounce": 5,
"processor": "RP2040",
"url": "https://frame.work/de/en/products/laptop16-diy-amd-7040",
"usb": {
"device_version": "0.2.2",
"pid": "0x0014",
"vid": "0x32AC",
"force_nkro": true
},
"backlight": {
"pin": "GP25"
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [ 2, 1], "label": "ESC", "x": 0, "y": 0, "h": 0.75 },
{ "matrix": [ 2, 2], "label": "+ -", "x": 1.25, "y": 0, "h": 0.75 },
{ "matrix": [ 3, 4], "label": "=", "x": 2.5, "y": 0, "h": 0.75 },
{ "matrix": [ 2, 4], "label": "<--", "x": 3.75, "y": 0, "h": 0.75 },
{ "matrix": [ 0, 0], "label": "Num Lock", "x": 0, "y": 1, "h": 1.25 },
{ "matrix": [ 0, 4], "label": "-", "x": 1.25, "y": 1, "h": 1.25 },
{ "matrix": [ 1, 1], "label": "*", "x": 2.5, "y": 1, "h": 1.25 },
{ "matrix": [ 1, 6], "label": "-", "x": 3.75, "y": 1, "h": 1.25 },
{ "matrix": [ 0, 1], "label": "7", "x": 0, "y": 2.5, "h": 1.25 },
{ "matrix": [ 0, 5], "label": "8", "x": 1.25, "y": 2.5, "h": 1.25 },
{ "matrix": [ 1, 2], "label": "9", "x": 2.5, "y": 2.5, "h": 1.25 },
{ "matrix": [ 0, 2], "label": "4", "x": 0, "y": 4, "h": 1.25 },
{ "matrix": [ 0, 6], "label": "5", "x": 1.25, "y": 4, "h": 1.25 },
{ "matrix": [ 1, 3], "label": "6", "x": 2.5, "y": 4, "h": 1.25 },
{ "matrix": [ 1, 7], "label": "+", "x": 3.75, "y": 2.5, "h": 2.75 },
{ "matrix": [ 0, 3], "label": "1", "x": 0, "y": 5.5, "h": 1.25 },
{ "matrix": [ 0, 7], "label": "2", "x": 1.25, "y": 5.5, "h": 1.25 },
{ "matrix": [ 1, 4], "label": "3", "x": 2.5, "y": 5.5, "h": 1.25 },
{ "matrix": [ 1, 0], "label": "0", "x": 0, "y": 7, "w": 2.25, "h": 1.25 },
{ "matrix": [ 2, 7], "label": ".", "x": 2.5, "y": 7, "h": 1.25 }
{ "matrix": [ 1, 5], "label": "Enter", "x": 3.75, "y": 5.5, "h": 2.75 },
]
}
}
}

View File

@ -0,0 +1,73 @@
// Copyright 2022-2023 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* 4 keys Esc Calc = <-
*
* 4 keys Num / * -
*
* 3 keys 7 8 9
*
* 4 keys 4 5 6 +
*
* 3 keys 1 2 3
*
* 3 keys 0 . Entr
*
* 21 total
*/
[_NUMLOCK] = LAYOUT(
KC_ESC, KC_CALC, KC_EQL, KC_BSPC,
KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3,
KC_P0, KC_PDOT, KC_PENT
),
/*
* Extra keys for when numlock is disabled.
* Numlock keys are passed through to the number layer,
* and automatically remapped by the OS.
*
* 4 keys
*
* 4 keys
*
* 3 keys Home PgUpBL
* Brtg
* 4 keys |
*
* 3 keys End PdDnBL
* Step
* 3 keys Insert Del
*
* 21 total
*/
[_FN] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______,
_______, _______, _______, BL_BRTG,
_______, _______, _______,
_______, _______, BL_STEP
)
};
// clang-format on
bool led_update_user(led_t led_state) {
// Change layer if numlock state changes, either triggered by OS or
// by numlock key on this keyboard
if (led_state.num_lock) {
layer_off(_FN);
} else {
layer_on(_FN);
}
return true;
}

View File

@ -0,0 +1,14 @@
// Copyright 2023 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "numpad.h"
void keyboard_post_init_user(void) {
// Sync initial numlock state from the host
if (host_keyboard_led_state().num_lock) {
layer_on(_NUMLOCK);
} else {
layer_off(_FN);
}
}

View File

@ -0,0 +1,7 @@
// Copyright 2022-2023 Framework Computer
// SPDX-License-Identifier: GPL-2.0-or-later
enum _layers {
_NUMLOCK,
_FN
};

View File

@ -0,0 +1,2 @@
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm

View File

@ -0,0 +1,44 @@
# Framework Laptop 16 Keyboard
Keyboard input modules for the Framework Laptop 16.
* Keyboard Maintainer: [Daniel Schaefer](https://github.com/JohnAZoidberg)
* Hardware Supported: Framework Laptop 16 Keyboard, Numpad and Macropad
* Hardware Availability: Soon available at https://frame.work/marketplace
## Variants
There are 5 different hardware variants with different number of keys and
backlight options.
| Name | Size | Backlight | Keys |
| -------- | -------- | ---------- | ---- |
| ansi | Keyboard | RGB/White | 78 |
| iso | Keyboard | White | 79 |
| jis | Keyboard | White | 83 |
| numpad | Numpad | White | 21 |
| macropad | Numpad | RGB | 24 |
Make example for this keyboard (after setting up your build environment):
qmk compile -kb framework/ansi -km default
qmk compile -kb framework/iso -km default
qmk compile -kb framework/jis -km default
qmk compile -kb framework/numpad -km default
qmk compile -kb framework/macropad -km default
Flashing example for the ANSI keyboard:
qmk compile -kb framework/ansi -km default
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).
## Bootloader
Enter the bootloader in 3 ways:
* **On Framework Laptop 16 Keyboard**: Hold down left ALT and right ALT while installing the module
* **On Framework Laptop 16 Numpad**: Hold down keys for 2 and 6 while installing the module
* **On Raspberry Pi Pico**: Hold down bootsel button when plugging in
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -0,0 +1,21 @@
# VIA support uses raw HID, don't need to enable it extra.
# Only when disabling VIA but still wanting to use RAW, need to enable it here.
VIA_ENABLE = yes
RAW_ENABLE = no
# Enabled in info.json
# EXTRAKEY_ENABLE = yes # Audio control and System control
# Enable for all. ANSI keyboard supports RGB and white, macropad only RGB, all others only white.
# No harm in enabling it for all.
# Also RP pico has the built-in LED wired to the same GPIO. Good for prototyping
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm
# Custom matrix scanning code via ADC
CUSTOM_MATRIX = lite
SRC += matrix.c analog.c
DEFAULT_FOLDER = framework/ansi
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

View File

@ -58,11 +58,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
}
return true;
break;
default:
return true;
break;
}
return true;
}
void keyboard_post_init_user(void) {