forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add steelseries prime, take 1, duplicated from prime+ and oled removed
- Loading branch information
Showing
13 changed files
with
263 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include_next <board.h> | ||
|
||
#undef STM32_HSECLK | ||
#define STM32_HSECLK 12000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#define POINTING_DEVICE_CS_PIN A4 | ||
#define POINTING_DEVICE_MOTION_PIN B0 | ||
#define POINTING_DEVICE_TASK_THROTTLE_MS 1 | ||
|
||
#define SPI_DRIVER SPID1 | ||
#define SPI_SCK_PIN A5 | ||
#define SPI_MOSI_PIN A7 | ||
#define SPI_MISO_PIN A6 | ||
|
||
#define RGB_PWM_DRIVER PWMD1 | ||
#define RGB_BLUE_PIN A10 | ||
#define RGB_BLUE_PWM_CHANNEL 3 | ||
#define RGB_GREEN_PIN A8 | ||
#define RGB_GREEN_PWM_CHANNEL 1 | ||
#define RGB_RED_PIN A9 | ||
#define RGB_RED_PWM_CHANNEL 2 | ||
|
||
#define OPTICAL_SW_PWR A2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#define HAL_USE_SPI TRUE | ||
#define HAL_USE_PWM TRUE | ||
|
||
#include_next <halconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"manufacturer": "SteelSeries", | ||
"keyboard_name": "Prime+", | ||
"maintainer": "Dasky", | ||
"bootloader": "uf2boot", | ||
"build": { | ||
"debounce_type": "asym_eager_defer_pk", | ||
"lto": true | ||
}, | ||
"encoder": { | ||
"rotary": [ | ||
{"pin_a": "B5", "pin_b": "B4", "resolution": 2} | ||
] | ||
}, | ||
"features": { | ||
"bootmagic": true, | ||
"encoder": true, | ||
"extrakey": true, | ||
"mousekey": true, | ||
"pointing_device": true, | ||
"rgblight": true | ||
}, | ||
"matrix_pins": { | ||
"direct": [ | ||
["A0", "C15", "A1", "C13", "C14", "A3"] | ||
] | ||
}, | ||
"processor": "STM32F103", | ||
"rgblight": { | ||
"animations": { | ||
"breathing": true, | ||
"rainbow_mood": true | ||
}, | ||
"default": { | ||
"animation": "rainbow_mood" | ||
}, | ||
"driver": "custom", | ||
"led_count": 1 | ||
}, | ||
"url": "https://steelseries.com/gaming-mice/prime", | ||
"usb": { | ||
"device_version": "1.0.0", | ||
"pid": "0x0000", | ||
"vid": "0xFEED" | ||
}, | ||
"layouts": { | ||
"LAYOUT": { | ||
"layout": [ | ||
{"matrix": [0, 0], "x": 0, "y": 0}, | ||
{"matrix": [0, 1], "x": 1, "y": 0}, | ||
{"matrix": [0, 2], "x": 2, "y": 0}, | ||
{"matrix": [0, 3], "x": 0, "y": 1}, | ||
{"matrix": [0, 4], "x": 0, "y": 2}, | ||
{"matrix": [0, 5], "x": 2, "y": 2} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include QMK_KEYBOARD_H | ||
|
||
// clang-format off | ||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
// Left, Middle, Right, | ||
// Forward | ||
// Back | ||
// Underneath | ||
[0] = LAYOUT( | ||
MS_BTN1, MS_BTN3, MS_BTN2, | ||
MS_BTN5, | ||
MS_BTN4, | ||
QK_BOOT | ||
) | ||
}; | ||
// clang-format on | ||
|
||
void pointing_device_init_kb(void) { | ||
pointing_device_set_cpi(1600); | ||
} | ||
|
||
#if defined(ENCODER_MAP_ENABLE) | ||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { | ||
[0] = {ENCODER_CCW_CW(MS_WHLU, MS_WHLD)}, | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ENCODER_MAP_ENABLE = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include_next <mcuconf.h> | ||
|
||
##undef STM32_I2C_USE_I2C1 | ||
##define STM32_I2C_USE_I2C1 TRUE | ||
|
||
#undef STM32_PWM_USE_TIM1 | ||
#define STM32_PWM_USE_TIM1 TRUE | ||
|
||
#undef STM32_SPI_USE_SPI1 | ||
#define STM32_SPI_USE_SPI1 TRUE | ||
|
||
#undef STM32_PLLMUL_VALUE | ||
#define STM32_PLLMUL_VALUE 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "quantum.h" | ||
|
||
|
||
void board_init(void) { | ||
|
||
gpio_set_pin_output(A15); | ||
gpio_write_pin_high(A15); // Activate D+ pullup | ||
|
||
gpio_set_pin_output(OPTICAL_SW_PWR); | ||
gpio_write_pin_low(OPTICAL_SW_PWR); // Enable power for optical switches | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# SteelSeries Prime | ||
|
||
![Prime+](https://i.imgur.com/QhNHmwxh.png) | ||
|
||
This firmware does not support the dedicated lift off sensor. | ||
|
||
Erase with an stlink and flash this [uf2boot bootloader](https://github.com/daskygit/uf2-prime-plus), this is a a one way procedure voiding any warranty so be sure you don't want to use the original manufacturers firmware. | ||
|
||
* Keyboard Maintainer: [Dasky](https://github.com/daskygit) | ||
* Hardware Supported: SteelSeries Prime+ | ||
* Hardware Availability: https://steelseries.com/gaming-mice/prime | ||
|
||
Make example for this keyboard (after setting up your build environment): | ||
|
||
make steelseries/prime:default | ||
|
||
Flashing example for this keyboard: | ||
|
||
make steelseries/prime:default:flash | ||
|
||
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 2 ways: | ||
|
||
* **Bootmagic reset**: Hold down left mouse button and plug in. | ||
* **Bootloader entry**: Hold the underneath button while plugging in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2024 Dasky (@daskygit) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include <hal.h> | ||
#include "chibios_config.h" | ||
#include "gpio.h" | ||
#include "color.h" | ||
#include "rgblight_drivers.h" | ||
|
||
static PWMConfig pwmCFG = { | ||
.frequency = 0xFFFF, | ||
.period = 256, | ||
}; | ||
|
||
rgb_t prime_leds[RGBLIGHT_LED_COUNT]; | ||
|
||
void init_custom(void) { | ||
palSetPadMode(PAL_PORT(RGB_RED_PIN), PAL_PAD(RGB_RED_PIN), PAL_MODE_ALTERNATE_PUSHPULL); | ||
palSetPadMode(PAL_PORT(RGB_GREEN_PIN), PAL_PAD(RGB_GREEN_PIN), PAL_MODE_ALTERNATE_PUSHPULL); | ||
palSetPadMode(PAL_PORT(RGB_BLUE_PIN), PAL_PAD(RGB_BLUE_PIN), PAL_MODE_ALTERNATE_PUSHPULL); | ||
pwmCFG.channels[RGB_RED_PWM_CHANNEL - 1].mode = PWM_OUTPUT_ACTIVE_HIGH; | ||
pwmCFG.channels[RGB_GREEN_PWM_CHANNEL - 1].mode = PWM_OUTPUT_ACTIVE_HIGH; | ||
pwmCFG.channels[RGB_BLUE_PWM_CHANNEL - 1].mode = PWM_OUTPUT_ACTIVE_HIGH; | ||
pwmStart(&RGB_PWM_DRIVER, &pwmCFG); | ||
} | ||
|
||
void set_color_custom(int index, uint8_t red, uint8_t green, uint8_t blue) { | ||
prime_leds[index].r = red; | ||
prime_leds[index].g = green; | ||
prime_leds[index].b = blue; | ||
} | ||
|
||
void set_color_all_custom(uint8_t red, uint8_t green, uint8_t blue) { | ||
for (int i = 0; i < RGBLIGHT_LED_COUNT; i++) { | ||
set_color_custom(i, red, green, blue); | ||
} | ||
} | ||
|
||
void flush_custom(void) { | ||
if (prime_leds[0].r == 0) { | ||
pwmDisableChannel(&RGB_PWM_DRIVER, RGB_RED_PWM_CHANNEL - 1); | ||
} else { | ||
uint32_t duty = ((uint32_t)0xFFFF * prime_leds[0].r) / 0xFF; | ||
pwmEnableChannel(&RGB_PWM_DRIVER, RGB_RED_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&RGB_PWM_DRIVER, 0xFFFF, duty)); | ||
} | ||
if (prime_leds[0].g == 0) { | ||
pwmDisableChannel(&RGB_PWM_DRIVER, RGB_GREEN_PWM_CHANNEL - 1); | ||
} else { | ||
uint32_t duty = ((uint32_t)0xFFFF * prime_leds[0].g) / 0xFF; | ||
pwmEnableChannel(&RGB_PWM_DRIVER, RGB_GREEN_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&RGB_PWM_DRIVER, 0xFFFF, duty)); | ||
} | ||
if (prime_leds[0].b == 0) { | ||
pwmDisableChannel(&RGB_PWM_DRIVER, RGB_BLUE_PWM_CHANNEL - 1); | ||
} else { | ||
uint32_t duty = ((uint32_t)0xFFFF * prime_leds[0].b) / 0xFF; | ||
pwmEnableChannel(&RGB_PWM_DRIVER, RGB_BLUE_PWM_CHANNEL - 1, PWM_FRACTION_TO_WIDTH(&RGB_PWM_DRIVER, 0xFFFF, duty)); | ||
} | ||
} | ||
|
||
const rgblight_driver_t rgblight_driver = { | ||
.init = init_custom, | ||
.set_color = set_color_custom, | ||
.set_color_all = set_color_all_custom, | ||
.flush = flush_custom, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MCU_LDSCRIPT = STM32F103xB_uf2boot | ||
|
||
POINTING_DEVICE_DRIVER = pmw3389 | ||
|
||
SRC += rgblight_custom.c |
Submodule chibios
updated
69 files
Submodule chibios-contrib
updated
261 files