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

Add system76/launch_1 keyboard features #17916

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6cd4e7d
Enable Bootmagic Lite and update formatting and comments for system76…
jecassis Jul 20, 2022
84da10c
Correct Bootmagic Lite comment typos
jecassis Jul 20, 2022
842ee9d
Refactor System76 EC command interface
jecassis Jul 20, 2022
b3385c6
Merge downstream USB hub changes and clean up for system76/launch_1
jecassis Jul 20, 2022
e6fa388
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Jul 20, 2022
d3007c5
Update system76/launch_1 comments and documentation
jecassis Jul 23, 2022
19acdcb
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Jul 23, 2022
53bb65f
Shorten system76/launch_1 product name to shrink LUFA DFU bootloader …
jecassis Jul 24, 2022
1a85e0b
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Jul 24, 2022
c5aefd2
Update USB multiplexer in system76/launch_1
jecassis Aug 5, 2022
17511d3
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Aug 5, 2022
59e4eff
Revert comment typo corrections
jecassis Aug 6, 2022
16ce82c
Revert some changes
jecassis Aug 8, 2022
286379b
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Aug 17, 2022
a32ae91
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Aug 21, 2022
6c8d98e
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Dec 12, 2022
d09f8fc
Remove duplicate header inclusions in system76/launch_1 EC
jecassis Dec 12, 2022
6ff4a2c
Make indentation consistent in system76/launch_1 configuration
jecassis Dec 12, 2022
b46f9c5
Break system76/launch_1 config.h dependencies by hardcoding EEPROM size
jecassis Jan 30, 2023
c8bf6cd
Merge branch 'master' of github.com:qmk/qmk_firmware into system76/la…
jecassis Apr 3, 2023
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
77 changes: 31 additions & 46 deletions keyboards/system76/launch_1/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 System76
* Copyright (C) 2021-2022 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
Expand All @@ -17,38 +17,34 @@

#pragma once


/*
* Key matrix pins
* ROWS: AVR pins used for rows, top to bottom
* COLS: AVR pins used for columns, left to right
*/
// Key matrix pins
// ROWS: AVR pins used for rows, top to bottom
// COLS: AVR pins used for columns, left to right
#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 }
#define MATRIX_COL_PINS { D7, C7, C6, B6, B5, B4, D6, D4, E6, D5, D3, D2, B7, B0 }

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

// RGB matrix
#ifdef RGB_MATRIX_ENABLE
# define RGB_DI_PIN E2
# 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
# define RGB_DI_PIN E2 // Pin connected to the data pin of the LEDs
# define RGB_MATRIX_LED_COUNT 84 // Number of LEDs connected
# 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 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
Expand All @@ -61,43 +57,32 @@
# 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
#endif // RGB_MATRIX_ENABLE

// I2C {
// I2C
#define F_SCL 100000UL // Run I2C bus at 100 kHz
#define I2C_START_RETRY_COUNT 20
#define I2C_TIMEOUT 100 // milliseconds
// } I2C

// EEPROM {
#define EEPROM_SIZE 1024
// TODO: Refactor with new user EEPROM code (coming soon)
// EEPROM
#define EEPROM_SIZE 1024 // (TOTAL_EEPROM_BYTE_COUNT)
#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_MAGIC_ADDR (EECONFIG_SIZE)
// Bump `EEPROM_VERSION' every time what is stored changes
// to 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 {
// 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 {
// 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
82 changes: 42 additions & 40 deletions keyboards/system76/launch_1/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 System76
* Copyright (C) 2021-2022 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
Expand All @@ -17,28 +17,29 @@

#include QMK_KEYBOARD_H

// clang-format off
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 |
|____________|________|_______|________|_________________|_________________|________|________|_____________| |________|________|________|
_________________________________________________________________________________________________________________________________ ________
| | | | | | | | | | | | | | || |
| 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(
Expand All @@ -51,32 +52,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

/* 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 |
|____________|________|_______|________|_________________|_________________|________|________|_____________| |________|________|________|
_________________________________________________________________________________________________________________________________ ________
| | | | | | | | | | | | | | || 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,
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,
Expand All @@ -102,3 +103,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};
// clang-format on
5 changes: 5 additions & 0 deletions keyboards/system76/launch_1/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Default keymap for launch_1

![launch_1 Base Layout Image](https://i.imgur.com/7RTC4iVh.png "launch_1 Base Layout")

This is the default layout that comes flashed out of the box. The `Fn` keys are used to access the additional layer. There are 4 layers available which can be modified without flashing using the [System76 Keyboard Configurator](https://system76.com/accessories/launch/download) application.
Loading