From 113d3d60016a1158d1eca8a12a55a2c330a7f498 Mon Sep 17 00:00:00 2001 From: David Hoelscher Date: Fri, 8 Mar 2024 09:40:32 -0600 Subject: [Keyboard] Add CMK11 (#23239) * adding cmk11 * correcting default keymap * removing rules.mk * removing unnecessary comment --- keyboards/custommk/cmk11/config.h | 29 ++++++ keyboards/custommk/cmk11/halconf.h | 30 ++++++ keyboards/custommk/cmk11/info.json | 121 ++++++++++++++++++++++ keyboards/custommk/cmk11/keymaps/default/keymap.c | 11 ++ keyboards/custommk/cmk11/keymaps/via/config.h | 6 ++ keyboards/custommk/cmk11/keymaps/via/keymap.c | 11 ++ keyboards/custommk/cmk11/keymaps/via/rules.mk | 1 + keyboards/custommk/cmk11/mcuconf.h | 31 ++++++ keyboards/custommk/cmk11/readme.md | 27 +++++ keyboards/custommk/cmk11/rules.mk | 1 + 10 files changed, 268 insertions(+) create mode 100644 keyboards/custommk/cmk11/config.h create mode 100644 keyboards/custommk/cmk11/halconf.h create mode 100644 keyboards/custommk/cmk11/info.json create mode 100644 keyboards/custommk/cmk11/keymaps/default/keymap.c create mode 100644 keyboards/custommk/cmk11/keymaps/via/config.h create mode 100644 keyboards/custommk/cmk11/keymaps/via/keymap.c create mode 100644 keyboards/custommk/cmk11/keymaps/via/rules.mk create mode 100644 keyboards/custommk/cmk11/mcuconf.h create mode 100644 keyboards/custommk/cmk11/readme.md create mode 100644 keyboards/custommk/cmk11/rules.mk diff --git a/keyboards/custommk/cmk11/config.h b/keyboards/custommk/cmk11/config.h new file mode 100644 index 0000000000..122d32c5da --- /dev/null +++ b/keyboards/custommk/cmk11/config.h @@ -0,0 +1,29 @@ +// Copyright 2024 customMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +// FRAM configuration +#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN B7 +#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 4 // 48MHz / 4 = 12MHz; max supported by MB85R64 is 20MHz + +// SPI configuration +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN B3 +#define SPI_MOSI_PIN B5 +#define SPI_MISO_PIN B4 + +// Audio configuration +#define AUDIO_PIN B8 +#define AUDIO_PWM_DRIVER PWMD4 +#define AUDIO_PWM_CHANNEL 3 +#define AUDIO_PWM_PAL_MODE 2 +#define AUDIO_STATE_TIMER GPTD5 +#define AUDIO_INIT_DELAY + +// WS2812 configuration +#define WS2812_PWM_DRIVER PWMD1 +#define WS2812_PWM_CHANNEL 3 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA2_STREAM5 +#define WS2812_DMA_CHANNEL 6 diff --git a/keyboards/custommk/cmk11/halconf.h b/keyboards/custommk/cmk11/halconf.h new file mode 100644 index 0000000000..6791d829f9 --- /dev/null +++ b/keyboards/custommk/cmk11/halconf.h @@ -0,0 +1,30 @@ +/* Copyright 2024 customMK + * + * 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 . + */ + +#pragma once + +#define HAL_USE_PWM TRUE + +#define HAL_USE_SPI TRUE + +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#define SERIAL_BUFFERS_SIZE 256 + +// This enables interrupt-driven mode +#define SPI_USE_WAIT TRUE + +#include_next diff --git a/keyboards/custommk/cmk11/info.json b/keyboards/custommk/cmk11/info.json new file mode 100644 index 0000000000..d831351aa7 --- /dev/null +++ b/keyboards/custommk/cmk11/info.json @@ -0,0 +1,121 @@ +{ + "manufacturer": "customMK", + "keyboard_name": "CMK11", + "maintainer": "customMK", + "bootloader": "stm32-dfu", + "diode_direction": "ROW2COL", + "dynamic_keymap": { + "layer_count": 32 + }, + "eeprom": { + "driver": "spi" + }, + "features": { + "audio": true, + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true + }, + "matrix_pins": { + "cols": ["B0", "A1", "A2", "A3", "A6", "B10"], + "rows": ["A5", "A4"] + }, + "processor": "STM32F411", + "qmk": { + "tap_keycode_delay": 10 + }, + "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, + "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, + "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, + "typing_heatmap": true + }, + "driver": "ws2812", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 45, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 90, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 134, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 179, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 224, "y": 0, "flags": 4}, + {"matrix": [1, 0], "x": 23, "y": 64, "flags": 4}, + {"matrix": [1, 1], "x": 68, "y": 64, "flags": 4}, + {"matrix": [1, 2], "x": 112, "y": 64, "flags": 4}, + {"matrix": [1, 3], "x": 157, "y": 64, "flags": 4}, + {"matrix": [1, 4], "x": 202, "y": 64, "flags": 4} + ], + "max_brightness": 120, + "sat_steps": 8, + "speed_steps": 10, + "val_steps": 8 + }, + "url": "https://shop.custommk.com/collections/cmk11/products/ckm11", + "usb": { + "device_version": "1.0.0", + "pid": "0xFABA", + "vid": "0xF35B" + }, + "ws2812": { + "driver": "pwm", + "pin": "A10" + }, + "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": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0}, + {"matrix": [0, 5], "x": 5, "y": 0}, + {"matrix": [1, 0], "x": 0.5, "y": 1}, + {"matrix": [1, 1], "x": 1.5, "y": 1}, + {"matrix": [1, 2], "x": 2.5, "y": 1}, + {"matrix": [1, 3], "x": 3.5, "y": 1}, + {"matrix": [1, 4], "x": 4.5, "y": 1} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/custommk/cmk11/keymaps/default/keymap.c b/keyboards/custommk/cmk11/keymaps/default/keymap.c new file mode 100644 index 0000000000..a6d6db48c9 --- /dev/null +++ b/keyboards/custommk/cmk11/keymaps/default/keymap.c @@ -0,0 +1,11 @@ +// Copyright 2024 customMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_C, KC_V, KC_VOLU, KC_VOLD, KC_DEL, + KC_LCTL, KC_PGUP, KC_SPC, KC_PGDN, KC_ENT + ) +}; diff --git a/keyboards/custommk/cmk11/keymaps/via/config.h b/keyboards/custommk/cmk11/keymaps/via/config.h new file mode 100644 index 0000000000..c2dca38277 --- /dev/null +++ b/keyboards/custommk/cmk11/keymaps/via/config.h @@ -0,0 +1,6 @@ +// Copyright 2024 customMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define DYNAMIC_KEYMAP_MACRO_COUNT 128 diff --git a/keyboards/custommk/cmk11/keymaps/via/keymap.c b/keyboards/custommk/cmk11/keymaps/via/keymap.c new file mode 100644 index 0000000000..a4ee324f3f --- /dev/null +++ b/keyboards/custommk/cmk11/keymaps/via/keymap.c @@ -0,0 +1,11 @@ +// Copyright 2024 customMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_C, KC_V, KC_VOLU, KC_VOLD, KC_DEL, + KC_LCTL, KC_PGUP, KC_SPC, KC_PGDN, MO(1) + ) +}; diff --git a/keyboards/custommk/cmk11/keymaps/via/rules.mk b/keyboards/custommk/cmk11/keymaps/via/rules.mk new file mode 100644 index 0000000000..036bd6d1c3 --- /dev/null +++ b/keyboards/custommk/cmk11/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes \ No newline at end of file diff --git a/keyboards/custommk/cmk11/mcuconf.h b/keyboards/custommk/cmk11/mcuconf.h new file mode 100644 index 0000000000..8151abdcba --- /dev/null +++ b/keyboards/custommk/cmk11/mcuconf.h @@ -0,0 +1,31 @@ +/* Copyright 2024 customMK + * + * 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 . + */ + +#pragma once + +#include_next + +// Used for audio +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +// Used for FRAM +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE + +// Used for RGB matrix +#undef STM32_PWM_USE_TIM1 +#define STM32_PWM_USE_TIM1 TRUE \ No newline at end of file diff --git a/keyboards/custommk/cmk11/readme.md b/keyboards/custommk/cmk11/readme.md new file mode 100644 index 0000000000..961261ac66 --- /dev/null +++ b/keyboards/custommk/cmk11/readme.md @@ -0,0 +1,27 @@ +# CMK11 + +![cmk11](https://i.imgur.com/y8MEwXYh.jpeg) + +CMK11 supports eleven 1u keys (or eight 1u keys and one 3u key). The PCB is fully compatible with the Cary Works C11 macropad. + +* Keyboard Maintainer: [customMK](https://github.com/customMK) +* Hardware Supported: CMK11 +* Hardware Availability: [customMK](https://shop.custommk.com/products/cmk11) + +Make example for this keyboard (after setting up your build environment): + + make custommk/cmk11:default + +Flashing example for this keyboard: + + make custommk/cmk11: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 (the key in the top left corner) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/custommk/cmk11/rules.mk b/keyboards/custommk/cmk11/rules.mk new file mode 100644 index 0000000000..72f75f4367 --- /dev/null +++ b/keyboards/custommk/cmk11/rules.mk @@ -0,0 +1 @@ +AUDIO_DRIVER = pwm_hardware -- cgit v1.2.3