Add KPrepublic BM16A v2 (#19194)

This commit is contained in:
Ryan 2022-12-09 15:31:13 +11:00 committed by GitHub
parent aa06a6e094
commit 8c12559edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 273 additions and 237 deletions

View File

@ -1,16 +0,0 @@
/* Copyright 2019
*
* 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/>.
*/
#include "bm16a.h"

View File

@ -1,39 +0,0 @@
/* Copyright 2019
*
* 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
#include "quantum.h"
/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT_ortho_4x4( \
K01, K02, K03, K04, \
K11, K12, K13, K14, \
K21, K22, K23, K24, \
K31, K32, K33, K34 \
) \
{ \
{ K01, K02, K03, K04 }, \
{ K11, K12, K13, K14 }, \
{ K21, K22, K23, K24 }, \
{ K31, K32, K33, K34 } \
}

View File

@ -1,128 +0,0 @@
/* Copyright 2019
*
* 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
#include "config_common.h"
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 4
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { D3, D5, D1, D2}
#define MATRIX_COL_PINS { D6, D4, D7, B4}
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
/*
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
*/
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
#define BACKLIGHT_PIN B6
// #define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 5
#define RGB_DI_PIN E2
#define RGBLED_NUM 4
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
// #ifdef RGB_DI_PIN
// #define RGBLED_NUM 16
// #define RGBLIGHT_HUE_STEP 8
// #define RGBLIGHT_SAT_STEP 8
// #define RGBLIGHT_VAL_STEP 8
// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
// #endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
// #define GRAVE_ESC_CTRL_OVERRIDE
/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
/* Bootmagic Lite key configuration */
// #define BOOTMAGIC_LITE_ROW 0
// #define BOOTMAGIC_LITE_COLUMN 0

View File

@ -1,33 +0,0 @@
{
"keyboard_name": "bm16a",
"manufacturer": "KPrepublic",
"url": "",
"maintainer": "qmk",
"usb": {
"vid": "0x4B50",
"pid": "0x016A",
"device_version": "0.0.1"
},
"layouts": {
"LAYOUT_ortho_4x4": {
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":0, "y":1},
{"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3}
]
}
}
}

View File

@ -1,20 +0,0 @@
# MCU name
MCU = atmega32u4
# Bootloader selection
BOOTLOADER = atmel-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
LAYOUTS = ortho_4x4

View File

@ -0,0 +1,75 @@
{
"keyboard_name": "bm16a",
"manufacturer": "KPrepublic",
"url": "",
"maintainer": "qmk",
"usb": {
"vid": "0x4B50",
"pid": "0x016A",
"device_version": "0.0.1"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"console": false,
"command": false,
"nkro": true,
"backlight": true,
"rgblight": true,
"audio": false
},
"matrix_pins": {
"rows": ["D3", "D5", "D1", "D2"],
"cols": ["D6", "D4", "D7", "B4"]
},
"diode_direction": "COL2ROW",
"backlight": {
"pin": "B6",
"levels": 5
},
"rgblight": {
"pin": "E2",
"led_count": 4,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"community_layouts": ["ortho_4x4"],
"layouts": {
"LAYOUT_ortho_4x4": {
"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": 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

@ -10,6 +10,6 @@ A 16 key macropad, with USB C, RGB underglow and backlight.
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
make kprepublic/bm16a:default make kprepublic/bm16a/v1:default
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). 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).

View File

@ -0,0 +1 @@
# This file intentionally left blank

View File

@ -0,0 +1,12 @@
// Copyright 2022 fauxpark (@fauxpark)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define RGB_DI_PIN B9
#define RGB_MATRIX_LED_COUNT 16
#define WS2812_PWM_DRIVER PWMD4
#define WS2812_PWM_CHANNEL 4
#define WS2812_DMA_STREAM STM32_DMA1_STREAM7
#define WS2812_DMA_CHANNEL 7

View File

@ -0,0 +1,8 @@
// Copyright 2022 fauxpark (@fauxpark)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define HAL_USE_PWM TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,120 @@
{
"manufacturer": "kprepublic",
"keyboard_name": "BM16v2",
"maintainer": "qmk",
"bootloader": "stm32duino",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"matrix_pins": {
"cols": ["B1", "A3", "B0", "B4"],
"rows": ["A8", "A9", "B5", "B3"]
},
"processor": "STM32F103", // GD32F303CCT6
"url": "",
"usb": {
"device_version": "0.0.2",
"pid": "0x016C",
"vid": "0x4B50"
},
"layouts": {
"LAYOUT_ortho_4x4": {
"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": 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}
]
}
},
"community_layouts": ["ortho_4x4"],
"rgb_matrix": {
"driver": "WS2812",
"animations": {
"alphas_mods": true,
"gradient_up_down": true,
"gradient_left_right": true,
"breathing": true,
"band_sat": true,
"band_val": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_up_down": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"rainbow_moving_chevron": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"dual_beacon": true,
"rainbow_beacon": true,
"rainbow_pinwheels": true,
"raindrops": true,
"jellybean_raindrops": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"pixel_fractal": true,
"pixel_flow": true,
"pixel_rain": true,
"solid_reactive_simple": true,
"solid_reactive": true,
"solid_reactive_wide": true,
"solid_reactive_multiwide": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_nexus": true,
"solid_reactive_multinexus": true,
"splash": true,
"multisplash": true,
"solid_splash": true,
"solid_multisplash": true
},
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 75, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 149, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 224, "y": 0, "flags": 4},
{"matrix": [1, 0], "x": 0, "y": 21, "flags": 4},
{"matrix": [1, 1], "x": 75, "y": 21, "flags": 4},
{"matrix": [1, 2], "x": 149, "y": 21, "flags": 4},
{"matrix": [1, 3], "x": 224, "y": 21, "flags": 4},
{"matrix": [2, 0], "x": 0, "y": 43, "flags": 4},
{"matrix": [2, 1], "x": 75, "y": 43, "flags": 4},
{"matrix": [2, 2], "x": 149, "y": 43, "flags": 4},
{"matrix": [2, 3], "x": 224, "y": 43, "flags": 4},
{"matrix": [3, 0], "x": 0, "y": 64, "flags": 4},
{"matrix": [3, 1], "x": 75, "y": 64, "flags": 4},
{"matrix": [3, 2], "x": 149, "y": 64, "flags": 4},
{"matrix": [3, 3], "x": 224, "y": 64, "flags": 4},
]
}
}

View File

@ -0,0 +1,19 @@
// Copyright 2022 fauxpark (@fauxpark)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_PDOT, KC_SPC, MO(1)
),
[1] = LAYOUT_ortho_4x4(
QK_BOOT, KC_PAST, KC_PSLS, _______,
RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD,
RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD,
_______, _______, _______, _______
)
};

View File

@ -0,0 +1,9 @@
// Copyright 2022 fauxpark (@fauxpark)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <mcuconf.h>
#undef STM32_PWM_USE_TIM4
#define STM32_PWM_USE_TIM4 TRUE

View File

@ -0,0 +1,27 @@
# BM16A V2
![bm16v2](https://i.imgur.com/3nr7bSoh.png)
A 16 key macropad, with USB-C and per-key RGB.
* Keyboard Maintainer: QMK Community
* Hardware Supported: BM16A PCB (`BM16V2-ARM`)
* Hardware Availability: [KPrepublic](https://kprepublic.com/collections/bm16/products/bm16a-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-bottom-underglow-alps-mx)
Make example for this keyboard (after setting up your build environment):
make kprepublic/bm16v2:default
Flashing example for this keyboard:
make kprepublic/bm16a/v2: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 3 ways:
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -0,0 +1 @@
WS2812_DRIVER = pwm