Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Add System76 Launch 3 #24673

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions keyboards/system76/launch_3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright (C) 2021 System76
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#pragma once

/*
* Key matrix pins
* ROWS: GPIO pins used for rows, top to bottom
* COLS: GPIO pins used for columns, left to right
*/
#define MATRIX_ROW_PINS {GP24, GP23, GP22, GP21, GP28, GP15}
#define MATRIX_COL_PINS {GP12, GP11, GP10, GP9, GP8, GP6, GP13, GP14, GP16, GP17, GP18, GP19, GP7, GP25}

/*
* Diode Direction
* COL2ROW = COL => Anode (+), ROW => Cathode (-)
* ROW2COL = ROW => Anode (+), COL => Cathode (-)
*/
#define DIODE_DIRECTION COL2ROW

#ifdef RGB_MATRIX_ENABLE
# define WS2812_DI_PIN GP5
# define RGB_MATRIX_LED_COUNT 84
# define RGB_MATRIX_KEYPRESSES // Reacts to keypresses
// # define RGB_MATRIX_KEYRELEASES // Reacts to keyreleases (instead of keypresses)
// # define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enables framebuffer effects
# define RGB_DISABLE_WHEN_USB_SUSPENDED // Turns off effects when suspended
// Limit brightness to support USB-A at 0.5 A
// TODO: Do this dynamically based on power source
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 176 // Limits maximum brightness of LEDs to 176 out of 255. If not defined, maximum brightness is set to 255
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set
# define RGB_MATRIX_DEFAULT_HUE 142 // Sets the default hue value, if none has been set
# define RGB_MATRIX_DEFAULT_SAT 255 // Sets the default saturation value, if none has been set
# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
# define RGB_MATRIX_DEFAULT_SPD 127 // Sets the default animation speed, if none has been set
# define RGB_MATRIX_DISABLE_KEYCODES // Disables control of rgb matrix by keycodes (must use code functions to control the feature)

# define ENABLE_RGB_MATRIX_CYCLE_ALL
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
# define ENABLE_RGB_MATRIX_RAINDROPS
# define ENABLE_RGB_MATRIX_SPLASH
# define ENABLE_RGB_MATRIX_MULTISPLASH
#endif // RGB_MATRIX_ENABLE

// Mechanical locking support; use KC_LCAP, KC_LNUM, or KC_LSCR instead in keymap
#define LOCKING_SUPPORT_ENABLE

// Locking resynchronize hack
#define LOCKING_RESYNC_ENABLE

// I2C {
#define I2C_DRIVER I2CD1
#define I2C1_CLOCK_SPEED 100000UL // Run I2C bus at 100 kHz
#define I2C1_SCL_PIN GP27
#define I2C1_SDA_PIN GP26
// } I2C

// EEPROM {
#define EEPROM_SIZE 1024
// TODO: Refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x76EC
#define EEPROM_MAGIC_ADDR 64
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x02
#define EEPROM_VERSION_ADDR (EEPROM_MAGIC_ADDR + 2)
// } EEPROM

// Dynamic keymap {
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
#define DYNAMIC_KEYMAP_MACRO_COUNT 0
// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR (EEPROM_VERSION_ADDR + 1)
// Dynamic macro starts after dynamic keymaps, it is disabled
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2))
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 0
// } Dynamic keymap

// System76 EC {
#define SYSTEM76_EC_EEPROM_ADDR (DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE)
#define SYSTEM76_EC_EEPROM_SIZE (EEPROM_SIZE - SYSTEM76_EC_EEPROM_ADDR)
// } System76 EC
21 changes: 21 additions & 0 deletions keyboards/system76/launch_3/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Copyright 2023 System76
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#define HAL_USE_I2C TRUE

#include_next <halconf.h>
102 changes: 102 additions & 0 deletions keyboards/system76/launch_3/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"keyboard_name": "Launch Configurable Keyboard (launch_3)",
"manufacturer": "System76",
"url": "https://system76.com/accessories/launch",
"usb": {
"vid": "0x3384",
"pid": "0x0009",
"device_version": "0.0.1"
},
"processor": "RP2040",
"bootloader": "rp2040",
"layouts": {
"LAYOUT": {
"layout": [
{ "label": "Esc", "x": 0, "y": 0 },
{ "label": "F1", "x": 1, "y": 0 },
{ "label": "F2", "x": 2, "y": 0 },
{ "label": "F3", "x": 3, "y": 0 },
{ "label": "F4", "x": 4, "y": 0 },
{ "label": "F5", "x": 5, "y": 0 },
{ "label": "F6", "x": 6, "y": 0 },
{ "label": "F7", "x": 7, "y": 0 },
{ "label": "F8", "x": 8, "y": 0 },
{ "label": "F9", "x": 9, "y": 0 },
{ "label": "F10", "x": 10, "y": 0 },
{ "label": "F11", "x": 11, "y": 0 },
{ "label": "F12", "x": 12, "y": 0 },
{ "label": "Del", "x": 13, "y": 0, "w": 1.5 },
{ "label": "Home", "x": 14.75, "y": 0 },
{ "label": "`", "x": 0, "y": 1 },
{ "label": "1", "x": 1, "y": 1 },
{ "label": "2", "x": 2, "y": 1 },
{ "label": "3", "x": 3, "y": 1 },
{ "label": "4", "x": 4, "y": 1 },
{ "label": "5", "x": 5, "y": 1 },
{ "label": "6", "x": 6, "y": 1 },
{ "label": "7", "x": 7, "y": 1 },
{ "label": "8", "x": 8, "y": 1 },
{ "label": "9", "x": 9, "y": 1 },
{ "label": "0", "x": 10, "y": 1 },
{ "label": "-", "x": 11, "y": 1 },
{ "label": "=", "x": 12, "y": 1 },
{ "label": "Bksp", "x": 13, "y": 1, "w": 1.5 },
{ "label": "PgUp", "x": 14.75, "y": 1 },
{ "label": "Tab", "x": 0, "y": 2, "w": 1.5 },
{ "label": "Q", "x": 1.5, "y": 2 },
{ "label": "W", "x": 2.5, "y": 2 },
{ "label": "E", "x": 3.5, "y": 2 },
{ "label": "R", "x": 4.5, "y": 2 },
{ "label": "T", "x": 5.5, "y": 2 },
{ "label": "Y", "x": 6.5, "y": 2 },
{ "label": "U", "x": 7.5, "y": 2 },
{ "label": "I", "x": 8.5, "y": 2 },
{ "label": "O", "x": 9.5, "y": 2 },
{ "label": "P", "x": 10.5, "y": 2 },
{ "label": "[", "x": 11.5, "y": 2 },
{ "label": "]", "x": 12.5, "y": 2 },
{ "label": "\\", "x": 13.5, "y": 2 },
{ "label": "PgDn", "x": 14.75, "y": 2 },
{ "label": "Caps", "x": 0.25, "y": 3, "w": 1.5 },
{ "label": "A", "x": 1.75, "y": 3 },
{ "label": "S", "x": 2.75, "y": 3 },
{ "label": "D", "x": 3.75, "y": 3 },
{ "label": "F", "x": 4.75, "y": 3 },
{ "label": "G", "x": 5.75, "y": 3 },
{ "label": "H", "x": 6.75, "y": 3 },
{ "label": "J", "x": 7.75, "y": 3 },
{ "label": "K", "x": 8.75, "y": 3 },
{ "label": "L", "x": 9.75, "y": 3 },
{ "label": ";", "x": 10.75, "y": 3 },
{ "label": "'", "x": 11.75, "y": 3 },
{ "label": "Enter", "x": 12.75, "y": 3, "w": 1.5 },
{ "label": "End", "x": 14.75, "y": 3 },
{ "label": "LShift", "x": 0.25, "y": 4, "w": 2 },
{ "label": "Z", "x": 2.25, "y": 4 },
{ "label": "X", "x": 3.25, "y": 4 },
{ "label": "C", "x": 4.25, "y": 4 },
{ "label": "V", "x": 5.25, "y": 4 },
{ "label": "B", "x": 6.25, "y": 4 },
{ "label": "N", "x": 7.25, "y": 4 },
{ "label": "M", "x": 8.25, "y": 4 },
{ "label": ",", "x": 9.25, "y": 4 },
{ "label": ".", "x": 10.25, "y": 4 },
{ "label": "/", "x": 11.25, "y": 4 },
{ "label": "RShift", "x": 12.25, "y": 4, "w": 1.5 },
{ "label": "Up", "x": 13.75, "y": 4 },
{ "label": "LCtrl", "x": 0.25, "y": 5, "w": 1.5 },
{ "label": "LAlt", "x": 1.75, "y": 5 },
{ "label": "LFn", "x": 2.75, "y": 5 },
{ "label": "Super", "x": 3.75, "y": 5 },
{ "label": "Space", "x": 4.75, "y": 5, "w": 2 },
{ "label": "Space", "x": 6.75, "y": 5, "w": 2 },
{ "label": "RCtrl", "x": 8.75, "y": 5 },
{ "label": "RAlt", "x": 9.75, "y": 5 },
{ "label": "RFn", "x": 10.75, "y": 5, "w": 1.5 },
{ "label": "Left", "x": 12.75, "y": 5 },
{ "label": "Down", "x": 13.75, "y": 5 },
{ "label": "Right", "x": 14.75, "y": 5 }
]
}
}
}
91 changes: 91 additions & 0 deletions keyboards/system76/launch_3/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Layer 0, default layer
__________________________________________________________________________________________________________________________________ ________
| | | | | | | | | | | | | | || |
| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE || HOME |
|________|________|________|________|________|________|________|________|________|________|________|________|________|____________||________|
| | | | | | | | | | | | | | || |
| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | BACKSPACE || PGUP |
|________|________|________|________|________|________|________|________|________|________|________|________|________|____________||________|
| | | | | | | | | | | | [ | ] | || |
| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ || PGDN |
|____________|________|________|________|________|________|________|________|________|________|________|________|________|________||________|
| | | | | | | | | | | ; | ' | | | |
| CAPS | A | S | D | F | G | H | J | K | L | : | " | ENTER | | END |
|____________|________|________|________|________|________|________|________|________|________|________|________|____________|___|________|
| | | | | | | | | , | . | / | | |
| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP |
|________________|________|________|________|________|________|________|________|________|________|________|____________|________|_________
| | | | | | | | | | | | | |
| CTRL | LALT | FN | LGUI | SPACE | SPACE | RCTRL | RALT | FN | | LEFT | DOWN | RIGHT |
|____________|________|_______|________|_________________|_________________|________|________|_____________| |________|________|________|
*/

[0] = 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_HOME,
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_PGUP,
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_PGDN,
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_END,
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_UP,
KC_LCTL, KC_LALT, MO(1), KC_LGUI, KC_SPC, KC_SPC, KC_RCTL, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),

/* Layer 1, function layer
__________________________________________________________________________________________________________________________________ ________
| | | | | | | | | | | | | | || PLAY/ |
| QK_BOOT | | | | | | | | | | | | | || PAUSE |
|________|________|________|________|________|________|________|________|________|________|________|________|________|____________||________|
| | | | | | | | | | | LED | LED | LED | || VOLUME |
| | | | | | | | | | | TOGGLE | DOWN | UP | || UP |
|________|________|________|________|________|________|________|________|________|________|________|________|________|____________||________|
| | | | | | | | | | | | | | || VOLUME |
|PRINT SCREEN| | | | | | HOME | PGDN | PGUP | END | | | | || DOWN |
|____________|________|________|________|________|________|________|________|________|________|________|________|________|________||________|
| | | | | | | | | | | | | | | |
| | | | | | | LEFT | DOWN | UP | RIGHT | | | | | MUTE |
|____________|________|________|________|________|________|________|________|________|________|________|________|____________|___|________|
| | | | | | | | | | | | | |
| | | | | | | | | | | | | PGUP |
|________________|________|________|________|________|________|________|________|________|________|________|____________|________|_________
| | | | | | | | | | | | | |
| | | | | | | | | | | HOME | PGDN | END |
|____________|________|_______|________|_________________|_________________|________|________|_____________| |________|________|________|

* 'QK_BOOT' resets the controller and puts the board into firmware flashing mode. If this key is hit accidentally, just unplug the board
* and plug it back in.
*/

[1] = LAYOUT(
QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAD, RGB_VAI, KC_TRNS, KC_VOLU,
KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END
),

[2] = LAYOUT(
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, 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, 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
),

[3] = LAYOUT(
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, 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, 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
),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
Loading
Loading