This commit is contained in:
Marek Schmitt 2025-07-16 17:51:16 +02:00 committed by GitHub
commit 45f3aba757
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 399 additions and 0 deletions

View File

@ -0,0 +1,22 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#define CH_CFG_ST_RESOLUTION 16
#define CH_CFG_ST_FREQUENCY 10000
#include_next <chconf.h>

View File

@ -0,0 +1,30 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#define STM32_FLASH_SECTORS_PER_BANK 128
#define I2C1_SCL_PIN A9
#define I2C1_SDA_PIN A10
#define WS2812_PWM_DRIVER PWMD2
#define WS2812_PWM_CHANNEL 2
#define WS2812_PWM_PAL_MODE 1
#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM2
#define WS2812_PWM_DMA_CHANNEL 4
#define RGB_MATRIX_MODE_NAME_ENABLE

View File

@ -0,0 +1,22 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#define HAL_USE_I2C TRUE
#define HAL_USE_PWM TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,137 @@
{
"manufacturer": "mawaeg",
"keyboard_name": "Sharkropad",
"maintainer": "mawaeg",
"bootloader": "stm32-dfu",
"bootmagic": {
"matrix": [0, 3]
},
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "A0", "pin_b": "A1"}
]
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"nkro": true,
"oled": true,
"rgb_matrix": true
},
"matrix_pins": {
"cols": ["B1", "B0", "A4", "A2"],
"rows": ["A3", "A7", "A6", "A5"]
},
"processor": "STM32L432",
"rgb_matrix": {
"animations": {
"alphas_mods": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_sat": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"band_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"digital_rain": true,
"dual_beacon": true,
"effect_max": true,
"flower_blooming": true,
"gradient_left_right": true,
"gradient_up_down": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"jellybean_raindrops": true,
"multisplash": true,
"pixel_flow": true,
"pixel_fractal": true,
"pixel_rain": true,
"rainbow_beacon": true,
"rainbow_moving_chevron": true,
"rainbow_pinwheels": true,
"raindrops": true,
"riverflow": true,
"solid_multisplash": true,
"solid_reactive": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_multinexus": true,
"solid_reactive_multiwide": true,
"solid_reactive_nexus": true,
"solid_reactive_simple": true,
"solid_reactive_wide": true,
"solid_splash": true,
"splash": true,
"starlight": true,
"starlight_dual_hue": true,
"starlight_dual_sat": true,
"typing_heatmap": true
},
"default": {
"animation": "cycle_up_down"
},
"driver": "ws2812",
"layout": [
{"matrix": [1, 0], "x": 189, "y": 27, "flags": 4},
{"matrix": [1, 1], "x": 137, "y": 27, "flags": 4},
{"matrix": [1, 2], "x": 86, "y": 27, "flags": 4},
{"matrix": [1, 3], "x": 35, "y": 27, "flags": 4},
{"matrix": [2, 0], "x": 189, "y": 41, "flags": 4},
{"matrix": [2, 1], "x": 137, "y": 41, "flags": 4},
{"matrix": [2, 2], "x": 86, "y": 41, "flags": 4},
{"matrix": [2, 3], "x": 35, "y": 41, "flags": 4},
{"matrix": [3, 0], "x": 189, "y": 55, "flags": 4},
{"matrix": [3, 1], "x": 137, "y": 55, "flags": 4},
{"matrix": [3, 2], "x": 86, "y": 55, "flags": 4},
{"matrix": [3, 3], "x": 35, "y": 55, "flags": 4},
{"x": 76, "y": 3, "flags": 2},
{"x": 148, "y": 3, "flags": 2},
{"x": 216, "y": 17, "flags": 2},
{"x": 216, "y": 45, "flags": 2},
{"x": 224, "y": 61, "flags": 2},
{"x": 60, "y": 61, "flags": 2},
{"x": 8, "y": 45, "flags": 2},
{"x": 8, "y": 17, "flags": 2}
],
"max_brightness": 180
},
"url": "https://github.com/mawaeg/sharkropad",
"usb": {
"device_version": "1.0.0",
"pid": "0xAFFE",
"vid": "0x6D73"
},
"ws2812": {
"driver": "pwm",
"pin": "B3"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3}
]
}
}
}

View File

@ -0,0 +1,45 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format off
/*
*
* RGB_MOD
*
* 7 8 9 RGB_TOGGLE
*
* 4 5 6 NUM
*
* 1 2 3 0
*
*/
[0] = LAYOUT(
RM_NEXT,
KC_P7, KC_P8, KC_P9, RM_TOGG,
KC_P4, KC_P5, KC_P6, KC_NUM,
KC_P1, KC_P2, KC_P3, KC_P0
)
// clang-format on
};
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(RM_SPDD, RM_SPDU)},
};
#endif

View File

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,28 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
#include_next <mcuconf.h>
#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE
#undef STM32_PWM_USE_TIM2
#define STM32_PWM_USE_TIM2 TRUE
#undef STM32_ST_USE_TIMER
#define STM32_ST_USE_TIMER 15

View File

@ -0,0 +1,24 @@
# sharkropad
![sharkropad](https://i.imgur.com/qatvstX.jpeg)
**Sharkropad** is an open-source hotswappable macropad.
* Keyboard Maintainer: [Marek Schmitt](https://github.com/mawaeg)
* Hardware Supported: PCB included in the [Sharkropad repository](https://github.com/mawaeg/sharkropad).
* Hardware Availability: PCB has to be sourced yourserlf
Make example for this keyboard (after setting up your build environment):
make mawaeg/sharkropad:default
Flashing example for this keyboard:
make mawaeg/sharkropad: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:
* **Bootmagic reset**: Hold down the rotary encoder knob and plug in the keyboard

View File

@ -0,0 +1,90 @@
/* Copyright 2025 @mawaeg
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
#include <ctype.h>
#include <lib/lib8tion/lib8tion.h>
#include <rgb_matrix.h>
static uint8_t effect_name_len = 0;
const char *rgb_matrix_get_effect_name(void) {
static char buf[32] = {0};
snprintf(buf, sizeof(buf), "%s", rgb_matrix_get_mode_name(rgb_matrix_get_mode()));
for (uint8_t i = 1; i < sizeof(buf); ++i) {
if (buf[i] == 0) {
effect_name_len = i;
break;
} else if (buf[i] == '_')
buf[i] = ' ';
else if (buf[i - 1] == ' ')
buf[i] = toupper(buf[i]);
else if (buf[i - 1] != ' ')
buf[i] = tolower(buf[i]);
}
return buf;
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
static uint8_t last_effect = 0;
static uint8_t last_speed = 0;
static uint16_t key_timer = 0;
static uint8_t start_index = 0;
uint8_t speedPercentage = scale8(rgb_matrix_get_speed(), 100);
bool is_timer_elapsed = timer_elapsed(key_timer) > 200;
if (last_effect != rgb_matrix_get_mode() || last_speed != speedPercentage || is_timer_elapsed) {
last_effect = rgb_matrix_get_mode();
last_speed = speedPercentage;
oled_write_ln_P(PSTR("Mode: "), false);
const char *name = rgb_matrix_get_effect_name();
if (effect_name_len > 21) {
if (!is_timer_elapsed && start_index != 0) {
start_index -= 1;
} else {
key_timer = timer_read();
}
if (start_index > effect_name_len) {
start_index = 0;
}
for (uint8_t char_index = 0; char_index < 21; char_index++) {
if ((start_index + char_index) % effect_name_len == 0 && char_index != 0) {
oled_write_char(' ', false);
} else {
oled_write_char(name[(start_index + char_index) % (effect_name_len + 1)], false);
}
}
start_index += 1;
} else {
oled_write_ln(name, false);
start_index = 0;
}
oled_set_cursor(0, 2);
oled_write_ln_P(PSTR("RGB Speed: "), false);
oled_write(get_u8_str(speedPercentage, ' '), false);
oled_write("%", false);
}
return true;
}