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 12 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
115 changes: 55 additions & 60 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 @@ -18,97 +18,92 @@
#pragma once

#include "config_common.h"
#ifndef __ASSEMBLER__
jecassis marked this conversation as resolved.
Show resolved Hide resolved
#include "eeconfig.h"
#include "eeprom.h"
#endif

// Key matrix size
#define MATRIX_ROWS 6
#define MATRIX_COLS 14

/*
* 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 }
#define UNUSED_PINS

/*
* 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

// Set 0 if debouncing isn't needed
// Delay when reading the value of the pin; set to `0' if debouncing is not needed
#define DEBOUNCE 5

#ifdef RGB_MATRIX_ENABLE
# define RGB_DI_PIN E2
# define DRIVER_LED_TOTAL 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_TIMEOUT 0 // Number of milliseconds to wait until RGB automatically turns off
# define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: Number of ticks to wait until disabling 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_STARTUP_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set
# define RGB_MATRIX_STARTUP_HUE 142 // Sets the default hue value, if none has been set
# define RGB_MATRIX_STARTUP_SAT 255 // Sets the default saturation value, if none has been set
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
# define RGB_MATRIX_STARTUP_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)
// Disable mechanical locking support (`KC_LCAP', `KC_LNUM', or `KC_LSCR')
#undef LOCKING_SUPPORT_ENABLE

# 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
// Disable switch state consistency with keyboard LED state
#undef LOCKING_RESYNC_ENABLE

// Mechanical locking support; use KC_LCAP, KC_LNUM, or KC_LSCR instead in keymap
#define LOCKING_SUPPORT_ENABLE
// RGB matrix
#ifdef RGB_MATRIX_ENABLE
#define RGB_DI_PIN E2
jecassis marked this conversation as resolved.
Show resolved Hide resolved
#define DRIVER_LED_TOTAL 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_TIMEOUT 0 // Number of milliseconds to wait until RGB automatically turns off
#define RGB_DISABLE_WHEN_USB_SUSPENDED // Turns off effects when suspended
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 176 // Limits maximum brightness of LEDs to 176 out of 255 to support USB-A at 0.5 A; if not defined, maximum brightness is set to 255 (TODO: Do this dynamically based on power source)
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Sets the default mode, if none has been set
#define RGB_MATRIX_STARTUP_HUE 142 // Sets the default hue value, if none has been set
#define RGB_MATRIX_STARTUP_SAT 255 // Sets the default saturation value, if none has been set
#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set
#define RGB_MATRIX_STARTUP_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)

// Locking resynchronize hack
#define LOCKING_RESYNC_ENABLE
#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

// 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)
#ifndef __ASSEMBLER__
// EEPROM
#define EEPROM_SIZE (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
#endif // __ASSEMBLER__
Loading