From d9588c0ce16158cfe35c43df8a13b2220147e537 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 7 Jun 2022 09:19:49 +0800 Subject: [PATCH 01/59] Add files via upload --- .../darkproject/kd83a_bfg_edition/config.h | 146 ++++ .../darkproject/kd83a_bfg_edition/halconf.h | 25 + .../darkproject/kd83a_bfg_edition/info.json | 104 +++ .../kd83a_bfg_edition/kd83a_bfg_edition.c | 257 +++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 54 ++ .../keymaps/default/keymap.c | 59 ++ .../keymaps/default/readme.md | 1 + .../kd83a_bfg_edition/keymaps/via/config.h | 23 + .../kd83a_bfg_edition/keymaps/via/keymap.c | 73 ++ .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 + .../darkproject/kd83a_bfg_edition/mcuconf.h | 26 + .../darkproject/kd83a_bfg_edition/readme.md | 23 + .../darkproject/kd83a_bfg_edition/rules.mk | 24 + .../kd83a_bfg_edition/src/eeprom_flash.c | 693 ++++++++++++++++++ .../kd83a_bfg_edition/src/flash_spi.c | 376 ++++++++++ .../kd83a_bfg_edition/src/flash_spi.h | 136 ++++ .../kd83a_bfg_edition/src/wb32_spi_master.c | 147 ++++ .../kd83a_bfg_edition/src/wb32_spi_master.h | 53 ++ 18 files changed, 2221 insertions(+) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/config.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/halconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/info.json create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk create mode 100644 keyboards/darkproject/kd83a_bfg_edition/mcuconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/rules.mk create mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h new file mode 100644 index 000000000000..47dc9baf6001 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -0,0 +1,146 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +#define RGB_DISABLE_WHEN_USB_SUSPENDED +#define EXTERNAL_FLASH_SIZE (8 * 1024) +#define EEPROM_SIZE EXTERNAL_FLASH_SIZE + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0001 +#define VENDOR_ID 0x2442 +#define PRODUCT_ID 0x0026 +#define MANUFACTURER GSKY +#define PRODUCT KD83A_BFG_Edition + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 + +#define TAP_CODE_DELAY 10 + +/* 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 + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define RGB_DISABLE_WHEN_USB_SUSPENDED +#define EXTERNAL_FLASH_SIZE (8 * 1024) +#define EEPROM_SIZE EXTERNAL_FLASH_SIZE + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + + +#define LED_NUM_LOCK_PIN C15 +#define LED_CAPS_LOCK_PIN C14 +#define LED_SCROLL_LOCK_PIN C0 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 66 +#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +/* Send up to 4 key press events per scan */ +#define QMK_KEYS_PER_SCAN 4 + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO + + diff --git a/keyboards/darkproject/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/halconf.h new file mode 100644 index 000000000000..68b32360b3a5 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/halconf.h @@ -0,0 +1,25 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json new file mode 100644 index 000000000000..00b148a9fe2c --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -0,0 +1,104 @@ +{ + "keyboard_name": "KD83A_BFG_Edition", + "url": "", + "maintainer": "GSKY", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Home", "x": 15.5, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Ins", "x": 15.5, "y": 1 }, + + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "Del", "x": 15.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + { "label": "PgUp", "x": 15.5, "y": 3 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + { "label": "PgDn", "x": 15.5, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "Ctrl", "x": 12, "y": 5 }, + { "label": "Left", "x": 13.25, "y": 5 }, + { "label": "Down", "x": 14.25, "y": 5 }, + { "label": "Right", "x": 15.25, "y": 5 } + ] + } + } +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c new file mode 100644 index 000000000000..0a5a7e2206b2 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -0,0 +1,257 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd83a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Home + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Ins + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, Del + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right + + {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 + {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 +}; + +#undef ___ +#define ___ NO_LED +#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + RGB_LAYOUT( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82) +, { + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, Home + + { 11, 11}, // 15, k01, ` + { 22, 11}, // 16, k11, 1 + { 33, 11}, // 17, k21, 2 + { 44, 11}, // 18, k31, 3 + { 55, 11}, // 19, k41, 4 + { 66, 11}, // 20, k51, 5 + { 77, 11}, // 21, k61, 6 + { 88, 11}, // 22, k71, 7 + { 99, 11}, // 23, k81, 8 + { 110, 11}, // 24, k91, 9 + { 121, 11}, // 25, ka1, 0 + { 132, 11}, // 26, kb1, - + { 143, 11}, // 27, kc1, = + { 154, 11}, // 28, kd1, Backspace + { 165, 11}, // 29, k16, Ins + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, Del + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + { 165, 33}, // 58, k26, PgUp + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + { 165, 44}, // 72, k36, PgDn + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 79, kc5, Ctrl_R + { 143, 55}, // 80, k07, Left + { 154, 55}, // 81, k27, Down + { 165, 55}, // 82, k37, Right + + { 0, 18}, // 83, Z1 + { 0, 24}, // 84, Z2 +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 2, 2 +} }; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h new file mode 100644 index 000000000000..9dc318e51fef --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -0,0 +1,54 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +##define ___ KC_NO + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Home +// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Ins +// Tab Q W E R T Y U I O P [ ] \\ Del +// Caps A S D F G H J K L ; ' Enter PgUp +// Sh_L Z X C V B N M , . / Sh_R Up PgDn +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + +// clang-format off +#define LAYOUT( \ + k00, k10, k20, k30, k40, k50, k60, k70, k80, k90, ka0, kb0, kc0, kd0, k56, \ + k01, k11, k21, k31, k41, k51, k61, k71, k81, k91, ka1, kb1, kc1, kd1, k16, \ + k02, k12, k22, k32, k42, k52, k62, k72, k82, k92, ka2, kb2, kc2, kd2, k06, \ + k03, k13, k23, k33, k43, k53, k63, k73, k83, k93, ka3, kb3, kd3, k26, \ + k04, k24, k34, k44, k54, k64, k74, k84, k94, ka4, kb4, kd4, k17, k36, \ + k05, k15, k25, k65, k95, ka5, kc5, k07, k27, k37 \ +)\ +{\ + { k04, ___, k56, k07, kc5, k37, k05, k50},\ + { k12, k02, k13, k00, k24, k26, k01, k11},\ + { k22, k03, k23, ___, k34, k36, k10, k21},\ + { k32, k30, k33, k40, k44, k17, k20, k31},\ + { k42, k52, k43, k53, k54, k64, k51, k41},\ + { k72, k62, k73, k63, k84, k74, k61, k71},\ + { k82, kc2, k83, k60, k94, k06, kc1, k81},\ + { k92, k70, k93, k27, ka4, ___, k80, k91},\ + { ka2, kb2, ka3, kb3, kd2, kb4, kb1, ka1},\ + { k15, kd4, ka5, k25, k65, k95, ___, kd0},\ + { ___, kd1, kd2, kb0, kd3, kc0, k90, ka0},\ + { ___, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, k56, ___, k16, ___},\ + { ___, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..fae0e1115c8d --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + RESET, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), +}; +// clang-format on + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; +} +#endif // ENCODER_ENABLE diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1bdbac95804d --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD83A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h new file mode 100644 index 000000000000..57df51d132ab --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h @@ -0,0 +1,23 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +#define DYNAMIC_KEYMAP_LAYER_COUNT 3 +#define STM32_USB_USE_OTG1 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..2e650c437899 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + RESET, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), +[2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; +// clang-format on + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; +} +#endif // ENCODER_ENABLE + + + + + + + diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..e39ad58743fd --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h @@ -0,0 +1,26 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md new file mode 100644 index 000000000000..83fb3e390752 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD83A_BFG_Edition + +An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD83A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd83a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd83a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk new file mode 100644 index 000000000000..c93191dacc4c --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = WB32F3G71 + +# Bootloader selection +BOOTLOADER = wb32-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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes # Enable RGB matrix effects. +RGB_MATRIX_DRIVER = AW20216 # Enable RGB matrix effects. +FLASH_DRIVER = spi # Enable SPI flash +EEPROM_DRIVER = custom # Enable SPI flash memory +SRC += src/eeprom_flash.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c b/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c new file mode 100644 index 000000000000..323e6078f030 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c @@ -0,0 +1,693 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 . +*/ + +#include +#include +#include "util.h" +#include "debug.h" +#include "wait.h" +#include "timer.h" +#include "eeprom.h" +#include "flash_spi.h" + +/* + * We emulate eeprom by writing a snapshot compacted view of eeprom contents, + * followed by a write log of any change since that snapshot: + * + * === SIMULATED EEPROM CONTENTS === + * + * ┌─ Compacted ┬ Write Log ─┐ + * │............│[BYTE][BYTE]│ + * │FFFF....FFFF│[WRD0][WRD1]│ + * │FFFFFFFFFFFF│[WORD][NEXT]│ + * │....FFFFFFFF│[BYTE][WRD0]│ + * ├────────────┼────────────┤ + * └──PAGE_BASE │ │ + * PAGE_LAST─┴─WRITE_BASE │ + * WRITE_LAST ┘ + * + * Compacted contents are the 1's complement of the actual EEPROM contents. + * e.g. An 'FFFF' represents a '0000' value. + * + * The size of the 'compacted' area is equal to the size of the 'emulated' eeprom. + * The size of the compacted-area and write log are configurable, and the combined + * size of Compacted + WriteLog is a multiple EXTERNAL_FLASH_PAGE_SIZE, which is MCU dependent. + * Simulated Eeprom contents are located at the end of available flash space. + * + * The following configuration defines can be set: + * + * EXTERNAL_FLASH_PAGE_COUNT # Total number of pages to use for eeprom simulation (Compact + Write log) + * FEE_DENSITY_BYTES # Size of simulated eeprom. (Defaults to half the space allocated by EXTERNAL_FLASH_PAGE_COUNT) + * NOTE: The current implementation does not include page swapping, + * and FEE_DENSITY_BYTES will consume that amount of RAM as a cached view of actual EEPROM contents. + * + * The maximum size of FEE_DENSITY_BYTES is currently 16384. The write log size equals + * EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE - FEE_DENSITY_BYTES. + * The larger the write log, the less frequently the compacted area needs to be rewritten. + * + * + * *** General Algorithm *** + * + * During initialization: + * The contents of the Compacted-flash area are loaded and the 1's complement value + * is cached into memory (e.g. 0xFFFF in Flash represents 0x0000 in cache). + * Write log entries are processed until a 0xFFFF is reached. + * Each log entry updates a byte or word in the cache. + * + * During reads: + * EEPROM contents are given back directly from the cache in memory. + * + * During writes: + * The contents of the cache is updated first. + * If the Compacted-flash area corresponding to the write address is unprogrammed, the 1's complement of the value is written directly into Compacted-flash + * Otherwise: + * If the write log is full, erase both the Compacted-flash area and the Write log, then write cached contents to the Compacted-flash area. + * Otherwise a Write log entry is constructed and appended to the next free position in the Write log. + * + * + * *** Write Log Structure *** + * + * Write log entries allow for optimized byte writes to addresses below 128. Writing 0 or 1 words are also optimized when word-aligned. + * + * === WRITE LOG ENTRY FORMATS === + * + * ╔═══ Byte-Entry ══╗ + * ║0XXXXXXX║YYYYYYYY║ + * ║ └──┬──┘║└──┬───┘║ + * ║ Address║ Value ║ + * ╚════════╩════════╝ + * 0 <= Address < 0x80 (128) + * + * ╔ Word-Encoded 0 ╗ + * ║100XXXXXXXXXXXXX║ + * ║ │└─────┬─────┘║ + * ║ │Address >> 1 ║ + * ║ └── Value: 0 ║ + * ╚════════════════╝ + * 0 <= Address <= 0x3FFE (16382) + * + * ╔ Word-Encoded 1 ╗ + * ║101XXXXXXXXXXXXX║ + * ║ │└─────┬─────┘║ + * ║ │Address >> 1 ║ + * ║ └── Value: 1 ║ + * ╚════════════════╝ + * 0 <= Address <= 0x3FFE (16382) + * + * ╔═══ Reserved ═══╗ + * ║110XXXXXXXXXXXXX║ + * ╚════════════════╝ + * + * ╔═══════════ Word-Next ═══════════╗ + * ║111XXXXXXXXXXXXX║YYYYYYYYYYYYYYYY║ + * ║ └─────┬─────┘║└───────┬──────┘║ + * ║(Address-128)>>1║ ~Value ║ + * ╚════════════════╩════════════════╝ + * ( 0 <= Address < 0x0080 (128): Reserved) + * 0x80 <= Address <= 0x3FFE (16382) + * + * Write Log entry ranges: + * 0x0000 ... 0x7FFF - Byte-Entry; address is (Entry & 0x7F00) >> 4; value is (Entry & 0xFF) + * 0x8000 ... 0x9FFF - Word-Encoded 0; address is (Entry & 0x1FFF) << 1; value is 0 + * 0xA000 ... 0xBFFF - Word-Encoded 1; address is (Entry & 0x1FFF) << 1; value is 1 + * 0xC000 ... 0xDFFF - Reserved + * 0xE000 ... 0xFFBF - Word-Next; address is (Entry & 0x1FFF) << 1 + 0x80; value is ~(Next_Entry) + * 0xFFC0 ... 0xFFFE - Reserved + * 0xFFFF - Unprogrammed + * + */ + +/* These bits are used for optimizing encoding of bytes, 0 and 1 */ +#define FEE_WORD_ENCODING 0x8000 +#define FEE_VALUE_NEXT 0x6000 +#define FEE_VALUE_RESERVED 0x4000 +#define FEE_VALUE_ENCODED 0x2000 +#define FEE_BYTE_RANGE 0x80 + +/* Addressable range 16KByte: 0 <-> (0x1FFF << 1) */ +#define FEE_ADDRESS_MAX_SIZE 0x4000 + +/* Flash word value after erase */ +#define FEE_EMPTY_WORD ((uint16_t)0xFFFF) + +/* Size of combined compacted eeprom and write log pages */ +#define FEE_DENSITY_MAX_SIZE (EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE) + +#ifndef EXTERNAL_FLASH_SIZE_IGNORE_CHECK /* *TODO: Get rid of this check */ +# if FEE_DENSITY_MAX_SIZE > (EXTERNAL_FLASH_SIZE * 1024) +# pragma message STR(FEE_DENSITY_MAX_SIZE) " > " STR(EXTERNAL_FLASH_SIZE * 1024) +# error emulated eeprom: FEE_DENSITY_MAX_SIZE is greater than available flash size +# endif +#endif + +/* Size of emulated eeprom */ +#ifdef FEE_DENSITY_BYTES +# if (FEE_DENSITY_BYTES > FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) +# error emulated eeprom: FEE_DENSITY_BYTES exceeds FEE_DENSITY_MAX_SIZE +# endif +# if (FEE_DENSITY_BYTES == FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " == " STR(FEE_DENSITY_MAX_SIZE) +# warning emulated eeprom: FEE_DENSITY_BYTES leaves no room for a write log. This will greatly increase the flash wear rate! +# endif +# if FEE_DENSITY_BYTES > FEE_ADDRESS_MAX_SIZE +# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_ADDRESS_MAX_SIZE) +# error emulated eeprom: FEE_DENSITY_BYTES is greater than FEE_ADDRESS_MAX_SIZE allows +# endif +# if ((FEE_DENSITY_BYTES) % 2) == 1 +# error emulated eeprom: FEE_DENSITY_BYTES must be even +# endif +#else +/* Default to half of allocated space used for emulated eeprom, half for write log */ +# define FEE_DENSITY_BYTES (EXTERNAL_FLASH_PAGE_COUNT * (EXTERNAL_FLASH_PAGE_SIZE >> 1)) +#endif + +/* Size of write log */ +#ifdef FEE_WRITE_LOG_BYTES +# if ((FEE_DENSITY_BYTES + FEE_WRITE_LOG_BYTES) > FEE_DENSITY_MAX_SIZE) +# pragma message STR(FEE_DENSITY_BYTES) " + " STR(FEE_WRITE_LOG_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) +# error emulated eeprom: FEE_WRITE_LOG_BYTES exceeds remaining FEE_DENSITY_MAX_SIZE +# endif +# if ((FEE_WRITE_LOG_BYTES) % 2) == 1 +# error emulated eeprom: FEE_WRITE_LOG_BYTES must be even +# endif +#else +/* Default to use all remaining space */ +# define FEE_WRITE_LOG_BYTES (EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE - FEE_DENSITY_BYTES) +#endif + +#define EXTERNAL_FLASH_PAGE_BASE_ADDRESS 0 +/* Start of the emulated eeprom compacted flash area */ +#define FEE_COMPACTED_BASE_ADDRESS EXTERNAL_FLASH_PAGE_BASE_ADDRESS +/* End of the emulated eeprom compacted flash area */ +#define FEE_COMPACTED_LAST_ADDRESS (FEE_COMPACTED_BASE_ADDRESS + FEE_DENSITY_BYTES) +/* Start of the emulated eeprom write log */ +#define FEE_WRITE_LOG_BASE_ADDRESS FEE_COMPACTED_LAST_ADDRESS +/* End of the emulated eeprom write log */ +#define FEE_WRITE_LOG_LAST_ADDRESS (FEE_WRITE_LOG_BASE_ADDRESS + FEE_WRITE_LOG_BYTES) + +#if defined(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) && (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR >= FEE_DENSITY_BYTES) +# error emulated eeprom: DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is greater than the FEE_DENSITY_BYTES available +#endif + +/* In-memory contents of emulated eeprom for faster access */ +/* *TODO: Implement page swapping */ +uint16_t WordBuf[FEE_DENSITY_BYTES / 2] = {0xFFFF}; +static uint8_t *DataBuf = (uint8_t *)WordBuf; + +/* Pointer to the first available slot within the write log */ +static uint16_t *empty_slot; + +#define DEBUG_EEPROM_OUTPUT + +/* + * Debug print utils + */ + +#if defined(DEBUG_EEPROM_OUTPUT) + +# define debug_eeprom debug_enable +# define eeprom_println(s) println(s) +# define eeprom_printf(fmt, ...) dprintf(fmt, ##__VA_ARGS__) + +#else /* NO_DEBUG */ + +# define debug_eeprom false +# define eeprom_println(s) +# define eeprom_printf(fmt, ...) + +#endif /* NO_DEBUG */ + +void print_eeprom(void) { +#ifndef NO_DEBUG + int empty_rows = 0; + for (uint16_t i = 0; i < FEE_DENSITY_BYTES; i++) { + if (i % 16 == 0) { + if (i >= FEE_DENSITY_BYTES - 16) { + /* Make sure we display the last row */ + empty_rows = 0; + } + /* Check if this row is uninitialized */ + ++empty_rows; + for (uint16_t j = 0; j < 16; j++) { + if (DataBuf[i + j]) { + empty_rows = 0; + break; + } + } + if (empty_rows > 1) { + /* Repeat empty row */ + if (empty_rows == 2) { + /* Only display the first repeat empty row */ + println("*"); + } + i += 15; + continue; + } + xprintf("%04x", i); + } + if (i % 8 == 0) print(" "); + + xprintf(" %02x", DataBuf[i]); + if ((i + 1) % 16 == 0) { + println(""); + } + } +#endif +} + +static flash_status_t external_flash_program_half_word(uint32_t addr, uint16_t value) { + uint8_t *src = (uint8_t *)&value; + + return flash_write_block(addr, src, 2); +} + +static uint32_t EEPROM_Init(void) { + /* Load emulated eeprom contents from compacted flash into memory */ + uint32_t src = (uint32_t)FEE_COMPACTED_BASE_ADDRESS; + uint16_t *dest = (uint16_t *)DataBuf; + + flash_read_block(src, (uint8_t *)dest, FEE_COMPACTED_LAST_ADDRESS - FEE_COMPACTED_BASE_ADDRESS); + + for (int i = 0; i < ((FEE_COMPACTED_LAST_ADDRESS - FEE_COMPACTED_BASE_ADDRESS) >> 1); i++, ++dest) { + *dest = ~*dest; + } + + if (debug_eeprom) { + println("EEPROM_Init Compacted Pages:"); + print_eeprom(); + println("EEPROM_Init Write Log:"); + } + + /* Replay write log */ + uint16_t *log_addr; + for (log_addr = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; log_addr < (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS; ++log_addr) { + uint16_t address; + + flash_read_block((uint32_t)log_addr, (uint8_t *)&address, 0x02); + if (address == FEE_EMPTY_WORD) { + break; + } + /* Check for lowest 128-bytes optimization */ + if (!(address & FEE_WORD_ENCODING)) { + uint8_t bvalue = (uint8_t)address; + address >>= 8; + DataBuf[address] = bvalue; + eeprom_printf("DataBuf[0x%02x] = 0x%02x;\n", address, bvalue); + } else { + uint16_t wvalue; + + /* Check if value is in next word */ + if ((address & FEE_VALUE_NEXT) == FEE_VALUE_NEXT) { + /* Read value from next word */ + if (++log_addr >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { + break; + } + flash_read_block((uint32_t)log_addr, (uint8_t *)&wvalue, 0x02); + wvalue = ~wvalue; + if (!wvalue) { + eeprom_printf("Incomplete write at log_addr: 0x%04x;\n", (uint32_t)log_addr); + /* Possibly incomplete write. Ignore and continue */ + continue; + } + address &= 0x1FFF; + address <<= 1; + /* Writes to addresses less than 128 are byte log entries */ + address += FEE_BYTE_RANGE; + } else { + /* Reserved for future use */ + if (address & FEE_VALUE_RESERVED) { + eeprom_printf("Reserved encoded value at log_addr: 0x%04x;\n", (uint32_t)log_addr); + continue; + } + + /* Optimization for 0 or 1 values. */ + wvalue = (address & FEE_VALUE_ENCODED) >> 13; + address &= 0x1FFF; + address <<= 1; + } + if (address < FEE_DENSITY_BYTES) { + eeprom_printf("DataBuf[0x%04x] = 0x%04x;\n", address, wvalue); + *(uint16_t *)(&DataBuf[address]) = wvalue; + } else { + eeprom_printf("DataBuf[0x%04x] cannot be set to 0x%04x [BAD ADDRESS]\n", address, wvalue); + } + } + } + + empty_slot = log_addr; + + if (debug_eeprom) { + println("EEPROM_Init Final DataBuf:"); + print_eeprom(); + } + + return (uint32_t)FEE_DENSITY_BYTES; +} + +/* Clear flash contents (doesn't touch in-memory DataBuf) */ +static void eeprom_clear(void) { + uint32_t erase_addr = EXTERNAL_FLASH_PAGE_BASE_ADDRESS; + + for ( ; erase_addr < (uint32_t)(EXTERNAL_FLASH_SIZE);) { + + if (erase_addr % ((uint32_t)(EXTERNAL_FLASH_SECTOR_SIZE)) != 0) { + eeprom_printf("The external Flash address to be erased is incorrect: 0x%08x\n", (uint32_t)erase_addr); + break; + } + flash_erase_sector(erase_addr); + erase_addr += (uint32_t)(EXTERNAL_FLASH_SECTOR_SIZE); + } + + empty_slot = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; + eeprom_printf("eeprom_clear empty_slot: 0x%08x\n", (uint32_t)empty_slot); +} + +/* Erase emulated eeprom */ +void EEPROM_Erase(void) { + eeprom_println("EEPROM_Erase"); + /* Erase compacted pages and write log */ + eeprom_clear(); + /* re-initialize to reset DataBuf */ + EEPROM_Init(); +} + +/* Compact write log */ +static uint8_t eeprom_compact(void) { + /* Erase compacted pages and write log */ + eeprom_clear(); + + flash_status_t final_status = FLASH_STATUS_SUCCESS; + + /* Write emulated eeprom contents from memory to compacted flash */ + uint16_t *src = (uint16_t *)DataBuf; + uintptr_t dest = FEE_COMPACTED_BASE_ADDRESS; + uint16_t value; + for (; dest < FEE_COMPACTED_LAST_ADDRESS; ++src, dest += 2) { + value = *src; + if (value) { + eeprom_printf("external_flash_program_half_word(0x%04x, 0x%04x)\n", (uint32_t)dest, ~value); + flash_status_t status = external_flash_program_half_word(dest, ~value); + if (status != FLASH_STATUS_SUCCESS) final_status = status; + } + } + + if (debug_eeprom) { + println("eeprom_compacted:"); + print_eeprom(); + } + + return final_status; +} + +static uint8_t eeprom_write_direct_entry(uint16_t Address) { + /* Check if we can just write this directly to the compacted flash area */ + uint32_t directAddress = FEE_COMPACTED_BASE_ADDRESS + (Address & 0xFFFE); + uint16_t wvalue; + + flash_read_block(directAddress, (uint8_t *)&wvalue, 0x02); + if (wvalue == FEE_EMPTY_WORD) { + /* Write the value directly to the compacted area without a log entry */ + wvalue = ~*(uint16_t *)(&DataBuf[Address & 0xFFFE]); + + /* Early exit if a write isn't needed */ + if (wvalue == FEE_EMPTY_WORD) return FLASH_STATUS_SUCCESS; + + eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x) [DIRECT]\n", directAddress, wvalue); + flash_status_t status = external_flash_program_half_word(directAddress, wvalue); + + return status; + } + return 0; +} + +static uint8_t eeprom_write_log_word_entry(uint16_t Address) { + flash_status_t final_status = FLASH_STATUS_SUCCESS; + + uint16_t value = *(uint16_t *)(&DataBuf[Address]); + eeprom_printf("eeprom_write_log_word_entry(0x%04x): 0x%04x\n", Address, value); + + /* MSB signifies the lowest 128-byte optimization is not in effect */ + uint16_t encoding = FEE_WORD_ENCODING; + uint8_t entry_size; + if (value <= 1) { + encoding |= value << 13; + entry_size = 2; + } else { + encoding |= FEE_VALUE_NEXT; + entry_size = 4; + /* Writes to addresses less than 128 are byte log entries */ + Address -= FEE_BYTE_RANGE; + } + + /* if we can't find an empty spot, we must compact emulated eeprom */ + if (empty_slot > (uint16_t *)(FEE_WRITE_LOG_LAST_ADDRESS - entry_size)) { + /* compact the write log into the compacted flash area */ + return eeprom_compact(); + } + + /* Word log writes should be word-aligned. Take back a bit */ + Address >>= 1; + Address |= encoding; + + /* ok we found a place let's write our data */ + + /* address */ + eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, Address); + final_status = external_flash_program_half_word((uintptr_t)empty_slot++, Address); + + /* value */ + if (encoding == (FEE_WORD_ENCODING | FEE_VALUE_NEXT)) { + eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, ~value); + flash_status_t status = external_flash_program_half_word((uintptr_t)empty_slot++, ~value); + if (status != FLASH_STATUS_SUCCESS) final_status = status; + } + + return final_status; +} + +static uint8_t eeprom_write_log_byte_entry(uint16_t Address) { + eeprom_printf("eeprom_write_log_byte_entry(0x%04x): 0x%02x\n", Address, DataBuf[Address]); + + /* if couldn't find an empty spot, we must compact emulated eeprom */ + if (empty_slot >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { + /* compact the write log into the compacted flash area */ + return eeprom_compact(); + } + + /* ok we found a place let's write our data */ + + /* Pack address and value into the same word */ + uint16_t value = (Address << 8) | DataBuf[Address]; + + /* write to flash */ + eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, value); + flash_status_t status = external_flash_program_half_word((uintptr_t)empty_slot++, value); + + return status; +} + +flash_status_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte) { + /* if the address is out-of-bounds, do nothing */ + if (Address >= FEE_DENSITY_BYTES) { + eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [BAD ADDRESS]\n", Address, DataByte); + return FLASH_STATUS_BAD_ADDRESS; + } + + /* if the value is the same, don't bother writing it */ + if (DataBuf[Address] == DataByte) { + eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [SKIP SAME]\n", Address, DataByte); + return FLASH_STATUS_SUCCESS; + } + + /* keep DataBuf cache in sync */ + DataBuf[Address] = DataByte; + eeprom_printf("EEPROM_WriteDataByte DataBuf[0x%04x] = 0x%02x\n", Address, DataBuf[Address]); + + /* perform the write into flash memory */ + /* First, attempt to write directly into the compacted flash area */ + flash_status_t status = eeprom_write_direct_entry(Address); + if (!status) { + /* Otherwise append to the write log */ + if (Address < FEE_BYTE_RANGE) { + status = eeprom_write_log_byte_entry(Address); + } else { + status = eeprom_write_log_word_entry(Address & 0xFFFE); + } + } + if (status != 0 && status != FLASH_STATUS_SUCCESS) { + eeprom_printf("EEPROM_WriteDataByte [STATUS == %d]\n", status); + } + return status; +} + +flash_status_t EEPROM_WriteDataWord(uint16_t Address, uint16_t DataWord) { + /* if the address is out-of-bounds, do nothing */ + if (Address >= FEE_DENSITY_BYTES) { + eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [BAD ADDRESS]\n", Address, DataWord); + return FLASH_STATUS_BAD_ADDRESS; + } + + /* Check for word alignment */ + flash_status_t final_status = FLASH_STATUS_SUCCESS; + if (Address % 2) { + final_status = EEPROM_WriteDataByte(Address, DataWord); + flash_status_t status = EEPROM_WriteDataByte(Address + 1, DataWord >> 8); + if (status != FLASH_STATUS_SUCCESS) final_status = status; + if (final_status != 0 && final_status != FLASH_STATUS_SUCCESS) { + eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); + } + return final_status; + } + + /* if the value is the same, don't bother writing it */ + uint16_t oldValue = *(uint16_t *)(&DataBuf[Address]); + if (oldValue == DataWord) { + eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [SKIP SAME]\n", Address, DataWord); + return FLASH_STATUS_SUCCESS; + } + + /* keep DataBuf cache in sync */ + *(uint16_t *)(&DataBuf[Address]) = DataWord; + eeprom_printf("EEPROM_WriteDataWord DataBuf[0x%04x] = 0x%04x\n", Address, *(uint16_t *)(&DataBuf[Address])); + + /* perform the write into flash memory */ + /* First, attempt to write directly into the compacted flash area */ + final_status = eeprom_write_direct_entry(Address); + if (!final_status) { + /* Otherwise append to the write log */ + /* Check if we need to fall back to byte write */ + if (Address < FEE_BYTE_RANGE) { + final_status = FLASH_STATUS_SUCCESS; + /* Only write a byte if it has changed */ + if ((uint8_t)oldValue != (uint8_t)DataWord) { + final_status = eeprom_write_log_byte_entry(Address); + } + flash_status_t status = FLASH_STATUS_SUCCESS; + /* Only write a byte if it has changed */ + if ((oldValue >> 8) != (DataWord >> 8)) { + status = eeprom_write_log_byte_entry(Address + 1); + } + if (status != FLASH_STATUS_SUCCESS) final_status = status; + } else { + final_status = eeprom_write_log_word_entry(Address); + } + } + if (final_status != 0 && final_status != FLASH_STATUS_SUCCESS) { + eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); + } + return final_status; +} + +uint8_t EEPROM_ReadDataByte(uint16_t Address) { + uint8_t DataByte = 0xFF; + + if (Address < FEE_DENSITY_BYTES) { + DataByte = DataBuf[Address]; + } + + eeprom_printf("EEPROM_ReadDataByte(0x%04x): 0x%02x\n", Address, DataByte); + + return DataByte; +} + +uint16_t EEPROM_ReadDataWord(uint16_t Address) { + uint16_t DataWord = 0xFFFF; + + if (Address < FEE_DENSITY_BYTES - 1) { + /* Check word alignment */ + if (Address % 2) { + DataWord = DataBuf[Address] | (DataBuf[Address + 1] << 8); + } else { + DataWord = *(uint16_t *)(&DataBuf[Address]); + } + } + + eeprom_printf("EEPROM_ReadDataWord(0x%04x): 0x%04x\n", Address, DataWord); + + return DataWord; +} + +/***************************************************************************** + * Bind to eeprom_driver.c + *******************************************************************************/ +void eeprom_driver_init(void) { + flash_init(); + EEPROM_Init(); +} + +void eeprom_driver_erase(void) { EEPROM_Erase(); } + +void eeprom_read_block(void *buf, const void *addr, size_t len) { + const uint8_t *src = (const uint8_t *)addr; + uint8_t * dest = (uint8_t *)buf; + + /* Check word alignment */ + if (len && (uintptr_t)src % 2) { + /* Read the unaligned first byte */ + *dest++ = EEPROM_ReadDataByte((const uintptr_t)src++); + --len; + } + + uint16_t value; + bool aligned = ((uintptr_t)dest % 2 == 0); + while (len > 1) { + value = EEPROM_ReadDataWord((const uintptr_t)((uint16_t *)src)); + if (aligned) { + *(uint16_t *)dest = value; + dest += 2; + } else { + *dest++ = value; + *dest++ = value >> 8; + } + src += 2; + len -= 2; + } + if (len) { + *dest = EEPROM_ReadDataByte((const uintptr_t)src); + } +} + +void eeprom_write_block(const void *buf, void *addr, size_t len) { + uint8_t * dest = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + + /* Check word alignment */ + if (len && (uintptr_t)dest % 2) { + /* Write the unaligned first byte */ + EEPROM_WriteDataByte((uintptr_t)dest++, *src++); + --len; + } + + uint16_t value; + bool aligned = ((uintptr_t)src % 2 == 0); + while (len > 1) { + if (aligned) { + value = *(uint16_t *)src; + } else { + value = *(uint8_t *)src | (*(uint8_t *)(src + 1) << 8); + } + EEPROM_WriteDataWord((uintptr_t)((uint16_t *)dest), value); + dest += 2; + src += 2; + len -= 2; + } + + if (len) { + EEPROM_WriteDataByte((uintptr_t)dest, *src); + } +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c new file mode 100644 index 000000000000..8a95801974d7 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c @@ -0,0 +1,376 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 . +*/ + +#include + +#include "util.h" +#include "wait.h" +#include "debug.h" +#include "timer.h" +#include "flash_spi.h" +#include "wb32_spi_master.h" + +/* + The time-out time of spi flash transmission. +*/ +#ifndef EXTERNAL_FLASH_SPI_TIMEOUT +# define EXTERNAL_FLASH_SPI_TIMEOUT 1000 +#endif + +/* ID comands */ +#define FLASH_CMD_RDID 0x9F /* RDID (Read Identification) */ +#define FLASH_CMD_RES 0xAB /* RES (Read Electronic ID) */ +#define FLASH_CMD_REMS 0x90 /* REMS (Read Electronic & Device ID) */ + +/* register comands */ +#define FLASH_CMD_WRSR 0x01 /* WRSR (Write Status register) */ +#define FLASH_CMD_RDSR 0x05 /* RDSR (Read Status register) */ + +/* READ comands */ +#define FLASH_CMD_READ 0x03 /* READ (1 x I/O) */ +#define FLASH_CMD_FASTREAD 0x0B /* FAST READ (Fast read data) */ +#define FLASH_CMD_DREAD 0x3B /* DREAD (1In/2 Out fast read) */ + +/* Program comands */ +#define FLASH_CMD_WREN 0x06 /* WREN (Write Enable) */ +#define FLASH_CMD_WRDI 0x04 /* WRDI (Write Disable) */ +#define FLASH_CMD_PP 0x02 /* PP (page program) */ + +/* Erase comands */ +#define FLASH_CMD_SE 0x20 /* SE (Sector Erase) */ +#define FLASH_CMD_BE 0xD8 /* BE (Block Erase) */ +#define FLASH_CMD_CE 0x60 /* CE (Chip Erase) hex code: 60 or C7 */ + +/* Mode setting comands */ +#define FLASH_CMD_DP 0xB9 /* DP (Deep Power Down) */ +#define FLASH_CMD_RDP 0xAB /* RDP (Release form Deep Power Down) */ + +/* Status register */ +#define FLASH_FLAG_WIP 0x01 /* Write in progress bit */ +#define FLASH_FLAG_WEL 0x02 /* Write enable latch bit */ + +// #define DEBUG_FLASH_SPI_OUTPUT + +static bool spi_flash_start(void) { + return wb32_spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); +} + +static flash_status_t spi_flash_wait_while_busy(void) { + uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t retval; + + do { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash wait while busy]\n"); + return FLASH_STATUS_ERROR; + } + + wb32_spi_write(FLASH_CMD_RDSR); + + retval = (uint8_t)wb32_spi_read(); + + wb32_spi_stop(); + + if (timer_read32() >= deadline) { + response = FLASH_STATUS_TIMEOUT; + break; + } + } while (retval & FLASH_FLAG_WIP); + + return response; +} + +static flash_status_t spi_flash_write_enable(void) { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash write enable]\n"); + return FLASH_STATUS_ERROR; + } + + wb32_spi_write(FLASH_CMD_WREN); + + wb32_spi_stop(); + + return FLASH_STATUS_SUCCESS; +} + +static flash_status_t spi_flash_write_disable(void) { + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash write disable]\n"); + return FLASH_STATUS_ERROR; + } + + wb32_spi_write(FLASH_CMD_WRDI); + + wb32_spi_stop(); + + return FLASH_STATUS_SUCCESS; +} + +/* This function is used for read transfer, write transfer and erase transfer. */ +static flash_status_t spi_flash_transaction(uint8_t cmd, uint32_t addr, uint8_t *data, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t buffer[EXTERNAL_FLASH_ADDRESS_SIZE + 1]; + + buffer[0] = cmd; + for (int i = 0; i < EXTERNAL_FLASH_ADDRESS_SIZE; ++i) { + buffer[EXTERNAL_FLASH_ADDRESS_SIZE - i] = addr & 0xFF; + addr >>= 8; + } + + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash transmit]\n"); + return FLASH_STATUS_ERROR; + } + + response = wb32_spi_transmit(buffer, sizeof(buffer)); + + if ((!response) && (data != NULL)) { + switch (cmd) { + case FLASH_CMD_READ: + response = wb32_spi_receive(data, len); + break; + case FLASH_CMD_PP: + response = wb32_spi_transmit(data, len); + break; + default: + response = FLASH_STATUS_ERROR; + break; + } + } + + wb32_spi_stop(); + + return response; +} + +void flash_init(void) { + wb32_spi_init(); +} + +flash_status_t flash_erase_chip(void) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase chip]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase chip]\n"); + return response; + } + + /* Erase Chip. */ + bool res = spi_flash_start(); + if (!res) { + dprint("Failed to start SPI! [spi flash erase chip]\n"); + return FLASH_STATUS_ERROR; + } + wb32_spi_write(FLASH_CMD_CE); + wb32_spi_stop(); + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase chip]\n"); + return response; + } + + return response; +} + +flash_status_t flash_erase_sector(uint32_t addr) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Check that the address exceeds the limit. */ + if ((addr + (EXTERNAL_FLASH_SECTOR_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_SECTOR_SIZE)) != 0)) { + dprintf("Flash erase sector address over limit! [addr:0x%x]\n", (uint32_t)addr); + return FLASH_STATUS_ERROR; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase sector]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase sector]\n"); + return response; + } + + /* Erase Sector. */ + response = spi_flash_transaction(FLASH_CMD_SE, addr, NULL, 0); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to erase sector! [spi flash erase sector]\n"); + return response; + } + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase sector]\n"); + return response; + } + + return response; +} + +flash_status_t flash_erase_block(uint32_t addr) { + flash_status_t response = FLASH_STATUS_SUCCESS; + + /* Check that the address exceeds the limit. */ + if ((addr + (EXTERNAL_FLASH_BLOCK_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_BLOCK_SIZE)) != 0)) { + dprintf("Flash erase block address over limit! [addr:0x%x]\n", (uint32_t)addr); + return FLASH_STATUS_ERROR; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase block]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash erase block]\n"); + return response; + } + + /* Erase Block. */ + response = spi_flash_transaction(FLASH_CMD_BE, addr, NULL, 0); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to erase block! [spi flash erase block]\n"); + return response; + } + + /* Wait for the write-in-progress bit to be cleared.*/ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash erase block]\n"); + return response; + } + + return response; +} + +flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t * read_buf = (uint8_t *)buf; + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash read block]\n"); + memset(read_buf, 0, len); + return response; + } + + /* Perform read. */ + response = spi_flash_transaction(FLASH_CMD_READ, addr, read_buf, len); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to read block! [spi flash read block]\n"); + memset(read_buf, 0, len); + return response; + } + +#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) + dprintf("[SPI FLASH R] 0x%08lX: ", addr); + for (size_t i = 0; i < len; ++i) { + dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); + } + dprintf("\n"); +#endif // DEBUG_FLASH_SPI_OUTPUT + + return response; +} + +flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { + flash_status_t response = FLASH_STATUS_SUCCESS; + uint8_t * write_buf = (uint8_t *)buf; + + while (len > 0) { + uint32_t page_offset = addr % EXTERNAL_FLASH_PAGE_SIZE; + size_t write_length = EXTERNAL_FLASH_PAGE_SIZE - page_offset; + if (write_length > len) { + write_length = len; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash write block]\n"); + return response; + } + + /* Enable writes. */ + response = spi_flash_write_enable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-enable! [spi flash write block]\n"); + return response; + } + +#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) + dprintf("[SPI FLASH W] 0x%08lX: ", addr); + for (size_t i = 0; i < write_length; i++) { + dprintf(" %02X", (int)(uint8_t)(write_buf[i])); + } + dprintf("\n"); +#endif // DEBUG_FLASH_SPI_OUTPUT + + /* Perform the write. */ + response = spi_flash_transaction(FLASH_CMD_PP, addr, write_buf, write_length); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write block! [spi flash write block]\n"); + return response; + } + + write_buf += write_length; + addr += write_length; + len -= write_length; + } + + /* Wait for the write-in-progress bit to be cleared. */ + response = spi_flash_wait_while_busy(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to check WIP flag! [spi flash write block]\n"); + return response; + } + + /* Disable writes. */ + response = spi_flash_write_disable(); + if (response != FLASH_STATUS_SUCCESS) { + dprint("Failed to write-disable! [spi flash write block]\n"); + return response; + } + + return response; +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h new file mode 100644 index 000000000000..9e696eb0aafd --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h @@ -0,0 +1,136 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 + +/* All the following default configurations are based on MX25L4006E Nor FLASH. */ + +/* + The slave select pin of the FLASH. + This needs to be a normal GPIO pin_t value, such as B14. +*/ +#ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN +# error "No chip select pin defined -- missing EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN" +#endif + +/* + The clock divisor for SPI to ensure that the MCU is within the + specifications of the FLASH chip. Generally this will be PCLK divided by + the intended divisor -- check your clock settings and the datasheet of + your FLASH. +*/ +#ifndef EXTERNAL_FLASH_SPI_CLOCK_DIVISOR +# ifdef __AVR__ +# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 4 +# else +# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 8 +# endif +#endif + +/* + The SPI mode to communicate with the FLASH. +*/ +#ifndef EXTERNAL_FLASH_SPI_MODE +# define EXTERNAL_FLASH_SPI_MODE 0 +#endif + +/* + Whether or not the SPI communication between the MCU and FLASH should be + LSB-first. +*/ +#ifndef EXTERNAL_FLASH_SPI_LSBFIRST +# define EXTERNAL_FLASH_SPI_LSBFIRST false +#endif + +/* + The Flash address size in bytes, as specified in datasheet. +*/ +#ifndef EXTERNAL_FLASH_ADDRESS_SIZE +# define EXTERNAL_FLASH_ADDRESS_SIZE 3 +#endif + +/* + The page size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_PAGE_SIZE +# define EXTERNAL_FLASH_PAGE_SIZE 256 +#endif + +/* + The sector size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_SECTOR_SIZE +# define EXTERNAL_FLASH_SECTOR_SIZE (4 * 1024) +#endif + +/* + The block size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_BLOCK_SIZE +# define EXTERNAL_FLASH_BLOCK_SIZE (64 * 1024) +#endif + +/* + The total size of the FLASH in bytes, as specified in the datasheet. +*/ +#ifndef EXTERNAL_FLASH_SIZE +# define EXTERNAL_FLASH_SIZE (512 * 1024) +#endif + +/* + The block count of the FLASH, calculated by total FLASH size and block size. +*/ +#define EXTERNAL_FLASH_BLOCK_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_BLOCK_SIZE)) + +/* + The sector count of the FLASH, calculated by total FLASH size and sector size. +*/ +#define EXTERNAL_FLASH_SECTOR_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_SECTOR_SIZE)) + +/* + The page count of the FLASH, calculated by total FLASH size and page size. +*/ +#define EXTERNAL_FLASH_PAGE_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_PAGE_SIZE)) + +typedef int16_t flash_status_t; + +#define FLASH_STATUS_SUCCESS (0) +#define FLASH_STATUS_ERROR (-1) +#define FLASH_STATUS_TIMEOUT (-2) +#define FLASH_STATUS_BAD_ADDRESS (-3) + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void flash_init(void); + +flash_status_t flash_erase_chip(void); + +flash_status_t flash_erase_block(uint32_t addr); + +flash_status_t flash_erase_sector(uint32_t addr); + +flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len); + +flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len); + +#ifdef __cplusplus +} +#endif diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c new file mode 100644 index 000000000000..ffa55c6e9231 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c @@ -0,0 +1,147 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 . +*/ + +#include "wb32_spi_master.h" + +#include "timer.h" + +#ifndef WB32_SPI_DRIVER +# define WB32_SPI_DRIVER SPIDQ +#endif + +#ifndef WB32_SPI_SCK_PIN +# define WB32_SPI_SCK_PIN A5 +#endif + +#ifndef WB32_SPI_MOSI_PIN +# define WB32_SPI_MOSI_PIN A7 +#endif + +#ifndef WB32_SPI_MISO_PIN +# define WB32_SPI_MISO_PIN A6 +#endif + +#ifndef WB32_SPI_SCK_PAL_MODE +# define WB32_SPI_SCK_PAL_MODE 5 +#endif + +#ifndef WB32_SPI_MOSI_PAL_MODE +# define WB32_SPI_MOSI_PAL_MODE 5 +#endif + +#ifndef WB32_SPI_MISO_PAL_MODE +# define WB32_SPI_MISO_PAL_MODE 5 +#endif + +static pin_t currentSlavePin = NO_PIN; + +static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0}; + + void wb32_spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(WB32_SPI_SCK_PIN); + setPinInput(WB32_SPI_MOSI_PIN); + setPinInput(WB32_SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(WB32_SPI_SCK_PIN), PAL_PAD(WB32_SPI_SCK_PIN), PAL_MODE_ALTERNATE(WB32_SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(WB32_SPI_MOSI_PIN), PAL_PAD(WB32_SPI_MOSI_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(WB32_SPI_MISO_PIN), PAL_PAD(WB32_SPI_MISO_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +bool wb32_spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { + if (currentSlavePin != NO_PIN || slavePin == NO_PIN) { + return false; + } + + if (!lsbFirst) { + osalDbgAssert(lsbFirst != FALSE, "unsupported lsbFirst"); + } + + if (divisor < 1) { + return false; + } + + spiConfig.SPI_BaudRatePrescaler = (divisor << 2); + + switch (mode) { + case 0: + spiConfig.SPI_CPHA = SPI_CPHA_1Edge; + spiConfig.SPI_CPOL = SPI_CPOL_Low; + break; + case 1: + spiConfig.SPI_CPHA = SPI_CPHA_2Edge; + spiConfig.SPI_CPOL = SPI_CPOL_Low; + break; + case 2: + spiConfig.SPI_CPHA = SPI_CPHA_1Edge; + spiConfig.SPI_CPOL = SPI_CPOL_High; + break; + case 3: + spiConfig.SPI_CPHA = SPI_CPHA_2Edge; + spiConfig.SPI_CPOL = SPI_CPOL_High; + break; + } + + currentSlavePin = slavePin; + spiConfig.ssport = PAL_PORT(slavePin); + spiConfig.sspad = PAL_PAD(slavePin); + + setPinOutput(slavePin); + spiStart(&WB32_SPI_DRIVER, &spiConfig); + spiSelect(&WB32_SPI_DRIVER); + + return true; +} + +spi_status_t wb32_spi_write(uint8_t data) { + uint8_t rxData; + spiExchange(&WB32_SPI_DRIVER, 1, &data, &rxData); + + return rxData; +} + +spi_status_t wb32_spi_read(void) { + uint8_t data = 0; + spiReceive(&WB32_SPI_DRIVER, 1, &data); + + return data; +} + +spi_status_t wb32_spi_transmit(const uint8_t *data, uint16_t length) { + spiSend(&WB32_SPI_DRIVER, length, data); + return SPI_STATUS_SUCCESS; +} + +spi_status_t wb32_spi_receive(uint8_t *data, uint16_t length) { + spiReceive(&WB32_SPI_DRIVER, length, data); + return SPI_STATUS_SUCCESS; +} + +void wb32_spi_stop(void) { + if (currentSlavePin != NO_PIN) { + spiUnselect(&WB32_SPI_DRIVER); + spiStop(&WB32_SPI_DRIVER); + currentSlavePin = NO_PIN; + } +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h new file mode 100644 index 000000000000..f0917f6de52c --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h @@ -0,0 +1,53 @@ +/* +Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + +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 +#include +#include + +#include "gpio.h" +#include "chibios_config.h" + +typedef int16_t spi_status_t; + +#define SPI_STATUS_SUCCESS (0) +#define SPI_STATUS_ERROR (-1) +#define SPI_STATUS_TIMEOUT (-2) + +#define SPI_TIMEOUT_IMMEDIATE (0) +#define SPI_TIMEOUT_INFINITE (0xFFFF) + +#ifdef __cplusplus +extern "C" { +#endif +void wb32_spi_init(void); + +bool wb32_spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); + +spi_status_t wb32_spi_write(uint8_t data); + +spi_status_t wb32_spi_read(void); + +spi_status_t wb32_spi_transmit(const uint8_t *data, uint16_t length); + +spi_status_t wb32_spi_receive(uint8_t *data, uint16_t length); + +void wb32_spi_stop(void); +#ifdef __cplusplus +} +#endif From 8c7aff1384aa169dcd49d02e382d5ace5c49ad07 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:26:47 +0800 Subject: [PATCH 02/59] [keyboard] --- .../darkproject/kd83a_bfg_edition/config.h | 10 +++---- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 26 ++++++++++++++----- .../keymaps/default/keymap.c | 15 ++--------- .../kd83a_bfg_edition/keymaps/via/keymap.c | 22 ++-------------- 4 files changed, 27 insertions(+), 46 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 47dc9baf6001..9c4c30d1d295 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -18,14 +18,10 @@ #include "config_common.h" -#define RGB_DISABLE_WHEN_USB_SUSPENDED -#define EXTERNAL_FLASH_SIZE (8 * 1024) -#define EEPROM_SIZE EXTERNAL_FLASH_SIZE - /* USB Device descriptor parameter */ #define DEVICE_VER 0x0001 -#define VENDOR_ID 0x2442 -#define PRODUCT_ID 0x0026 +#define VENDOR_ID 0x342D +#define PRODUCT_ID 0xE392 #define MANUFACTURER GSKY #define PRODUCT KD83A_BFG_Edition @@ -81,7 +77,7 @@ #define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 66 -#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_2_LED_TOTAL 19 #define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) // RGB Matrix Animation modes. Explicitly enabled diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index 0a5a7e2206b2..df0afdc63fff 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -222,13 +222,13 @@ led_config_t g_led_config = { { 0, 18}, // 83, Z1 { 0, 24}, // 84, Z2 }, { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 2, 2 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4 } }; #endif @@ -255,3 +255,17 @@ void spi_init(void) { } #endif + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } + return true; +} +#endif diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index fae0e1115c8d..21190c97ff03 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -43,17 +43,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), }; -// clang-format on - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif // ENCODER_ENABLE +// clang-format on \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 2e650c437899..56a59a6aae32 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), [2] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -52,22 +52,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; -// clang-format on - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - return true; -} -#endif // ENCODER_ENABLE - - - - - - - +// clang-format on \ No newline at end of file From 1dd4c871666ac7b5d0e51ef6315f31c14da9745d Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 11:22:40 +0800 Subject: [PATCH 03/59] [Keyboard] --- keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c | 2 +- keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h | 2 +- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index df0afdc63fff..2e6486528121 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -128,7 +128,7 @@ led_config_t g_led_config = { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82) + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84) , { { 11, 0}, // 0, k00, Esc { 22, 0}, // 1, k10, F1 diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h index 9dc318e51fef..eee68a32ee83 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -18,7 +18,7 @@ #include "quantum.h" -##define ___ KC_NO +#define ___ KC_NO // ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Home // ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Ins diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h index 57df51d132ab..6f28d150ea17 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h @@ -20,4 +20,4 @@ #include "config_common.h" #define DYNAMIC_KEYMAP_LAYER_COUNT 3 -#define STM32_USB_USE_OTG1 TRUE + From 74e52d3232c9d96646a741e3a87aa9fa8b3c7f83 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 15:12:59 +0800 Subject: [PATCH 04/59] Delete flash_spi.c --- .../kd83a_bfg_edition/src/flash_spi.c | 376 ------------------ 1 file changed, 376 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c deleted file mode 100644 index 8a95801974d7..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.c +++ /dev/null @@ -1,376 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 . -*/ - -#include - -#include "util.h" -#include "wait.h" -#include "debug.h" -#include "timer.h" -#include "flash_spi.h" -#include "wb32_spi_master.h" - -/* - The time-out time of spi flash transmission. -*/ -#ifndef EXTERNAL_FLASH_SPI_TIMEOUT -# define EXTERNAL_FLASH_SPI_TIMEOUT 1000 -#endif - -/* ID comands */ -#define FLASH_CMD_RDID 0x9F /* RDID (Read Identification) */ -#define FLASH_CMD_RES 0xAB /* RES (Read Electronic ID) */ -#define FLASH_CMD_REMS 0x90 /* REMS (Read Electronic & Device ID) */ - -/* register comands */ -#define FLASH_CMD_WRSR 0x01 /* WRSR (Write Status register) */ -#define FLASH_CMD_RDSR 0x05 /* RDSR (Read Status register) */ - -/* READ comands */ -#define FLASH_CMD_READ 0x03 /* READ (1 x I/O) */ -#define FLASH_CMD_FASTREAD 0x0B /* FAST READ (Fast read data) */ -#define FLASH_CMD_DREAD 0x3B /* DREAD (1In/2 Out fast read) */ - -/* Program comands */ -#define FLASH_CMD_WREN 0x06 /* WREN (Write Enable) */ -#define FLASH_CMD_WRDI 0x04 /* WRDI (Write Disable) */ -#define FLASH_CMD_PP 0x02 /* PP (page program) */ - -/* Erase comands */ -#define FLASH_CMD_SE 0x20 /* SE (Sector Erase) */ -#define FLASH_CMD_BE 0xD8 /* BE (Block Erase) */ -#define FLASH_CMD_CE 0x60 /* CE (Chip Erase) hex code: 60 or C7 */ - -/* Mode setting comands */ -#define FLASH_CMD_DP 0xB9 /* DP (Deep Power Down) */ -#define FLASH_CMD_RDP 0xAB /* RDP (Release form Deep Power Down) */ - -/* Status register */ -#define FLASH_FLAG_WIP 0x01 /* Write in progress bit */ -#define FLASH_FLAG_WEL 0x02 /* Write enable latch bit */ - -// #define DEBUG_FLASH_SPI_OUTPUT - -static bool spi_flash_start(void) { - return wb32_spi_start(EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN, EXTERNAL_FLASH_SPI_LSBFIRST, EXTERNAL_FLASH_SPI_MODE, EXTERNAL_FLASH_SPI_CLOCK_DIVISOR); -} - -static flash_status_t spi_flash_wait_while_busy(void) { - uint32_t deadline = timer_read32() + EXTERNAL_FLASH_SPI_TIMEOUT; - flash_status_t response = FLASH_STATUS_SUCCESS; - uint8_t retval; - - do { - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash wait while busy]\n"); - return FLASH_STATUS_ERROR; - } - - wb32_spi_write(FLASH_CMD_RDSR); - - retval = (uint8_t)wb32_spi_read(); - - wb32_spi_stop(); - - if (timer_read32() >= deadline) { - response = FLASH_STATUS_TIMEOUT; - break; - } - } while (retval & FLASH_FLAG_WIP); - - return response; -} - -static flash_status_t spi_flash_write_enable(void) { - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash write enable]\n"); - return FLASH_STATUS_ERROR; - } - - wb32_spi_write(FLASH_CMD_WREN); - - wb32_spi_stop(); - - return FLASH_STATUS_SUCCESS; -} - -static flash_status_t spi_flash_write_disable(void) { - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash write disable]\n"); - return FLASH_STATUS_ERROR; - } - - wb32_spi_write(FLASH_CMD_WRDI); - - wb32_spi_stop(); - - return FLASH_STATUS_SUCCESS; -} - -/* This function is used for read transfer, write transfer and erase transfer. */ -static flash_status_t spi_flash_transaction(uint8_t cmd, uint32_t addr, uint8_t *data, size_t len) { - flash_status_t response = FLASH_STATUS_SUCCESS; - uint8_t buffer[EXTERNAL_FLASH_ADDRESS_SIZE + 1]; - - buffer[0] = cmd; - for (int i = 0; i < EXTERNAL_FLASH_ADDRESS_SIZE; ++i) { - buffer[EXTERNAL_FLASH_ADDRESS_SIZE - i] = addr & 0xFF; - addr >>= 8; - } - - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash transmit]\n"); - return FLASH_STATUS_ERROR; - } - - response = wb32_spi_transmit(buffer, sizeof(buffer)); - - if ((!response) && (data != NULL)) { - switch (cmd) { - case FLASH_CMD_READ: - response = wb32_spi_receive(data, len); - break; - case FLASH_CMD_PP: - response = wb32_spi_transmit(data, len); - break; - default: - response = FLASH_STATUS_ERROR; - break; - } - } - - wb32_spi_stop(); - - return response; -} - -void flash_init(void) { - wb32_spi_init(); -} - -flash_status_t flash_erase_chip(void) { - flash_status_t response = FLASH_STATUS_SUCCESS; - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase chip]\n"); - return response; - } - - /* Enable writes. */ - response = spi_flash_write_enable(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write-enable! [spi flash erase chip]\n"); - return response; - } - - /* Erase Chip. */ - bool res = spi_flash_start(); - if (!res) { - dprint("Failed to start SPI! [spi flash erase chip]\n"); - return FLASH_STATUS_ERROR; - } - wb32_spi_write(FLASH_CMD_CE); - wb32_spi_stop(); - - /* Wait for the write-in-progress bit to be cleared.*/ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase chip]\n"); - return response; - } - - return response; -} - -flash_status_t flash_erase_sector(uint32_t addr) { - flash_status_t response = FLASH_STATUS_SUCCESS; - - /* Check that the address exceeds the limit. */ - if ((addr + (EXTERNAL_FLASH_SECTOR_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_SECTOR_SIZE)) != 0)) { - dprintf("Flash erase sector address over limit! [addr:0x%x]\n", (uint32_t)addr); - return FLASH_STATUS_ERROR; - } - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase sector]\n"); - return response; - } - - /* Enable writes. */ - response = spi_flash_write_enable(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write-enable! [spi flash erase sector]\n"); - return response; - } - - /* Erase Sector. */ - response = spi_flash_transaction(FLASH_CMD_SE, addr, NULL, 0); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to erase sector! [spi flash erase sector]\n"); - return response; - } - - /* Wait for the write-in-progress bit to be cleared.*/ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase sector]\n"); - return response; - } - - return response; -} - -flash_status_t flash_erase_block(uint32_t addr) { - flash_status_t response = FLASH_STATUS_SUCCESS; - - /* Check that the address exceeds the limit. */ - if ((addr + (EXTERNAL_FLASH_BLOCK_SIZE)) >= (EXTERNAL_FLASH_SIZE) || ((addr % (EXTERNAL_FLASH_BLOCK_SIZE)) != 0)) { - dprintf("Flash erase block address over limit! [addr:0x%x]\n", (uint32_t)addr); - return FLASH_STATUS_ERROR; - } - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase block]\n"); - return response; - } - - /* Enable writes. */ - response = spi_flash_write_enable(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write-enable! [spi flash erase block]\n"); - return response; - } - - /* Erase Block. */ - response = spi_flash_transaction(FLASH_CMD_BE, addr, NULL, 0); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to erase block! [spi flash erase block]\n"); - return response; - } - - /* Wait for the write-in-progress bit to be cleared.*/ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash erase block]\n"); - return response; - } - - return response; -} - -flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len) { - flash_status_t response = FLASH_STATUS_SUCCESS; - uint8_t * read_buf = (uint8_t *)buf; - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash read block]\n"); - memset(read_buf, 0, len); - return response; - } - - /* Perform read. */ - response = spi_flash_transaction(FLASH_CMD_READ, addr, read_buf, len); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to read block! [spi flash read block]\n"); - memset(read_buf, 0, len); - return response; - } - -#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) - dprintf("[SPI FLASH R] 0x%08lX: ", addr); - for (size_t i = 0; i < len; ++i) { - dprintf(" %02X", (int)(((uint8_t *)read_buf)[i])); - } - dprintf("\n"); -#endif // DEBUG_FLASH_SPI_OUTPUT - - return response; -} - -flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len) { - flash_status_t response = FLASH_STATUS_SUCCESS; - uint8_t * write_buf = (uint8_t *)buf; - - while (len > 0) { - uint32_t page_offset = addr % EXTERNAL_FLASH_PAGE_SIZE; - size_t write_length = EXTERNAL_FLASH_PAGE_SIZE - page_offset; - if (write_length > len) { - write_length = len; - } - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash write block]\n"); - return response; - } - - /* Enable writes. */ - response = spi_flash_write_enable(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write-enable! [spi flash write block]\n"); - return response; - } - -#if defined(CONSOLE_ENABLE) && defined(DEBUG_FLASH_SPI_OUTPUT) - dprintf("[SPI FLASH W] 0x%08lX: ", addr); - for (size_t i = 0; i < write_length; i++) { - dprintf(" %02X", (int)(uint8_t)(write_buf[i])); - } - dprintf("\n"); -#endif // DEBUG_FLASH_SPI_OUTPUT - - /* Perform the write. */ - response = spi_flash_transaction(FLASH_CMD_PP, addr, write_buf, write_length); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write block! [spi flash write block]\n"); - return response; - } - - write_buf += write_length; - addr += write_length; - len -= write_length; - } - - /* Wait for the write-in-progress bit to be cleared. */ - response = spi_flash_wait_while_busy(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to check WIP flag! [spi flash write block]\n"); - return response; - } - - /* Disable writes. */ - response = spi_flash_write_disable(); - if (response != FLASH_STATUS_SUCCESS) { - dprint("Failed to write-disable! [spi flash write block]\n"); - return response; - } - - return response; -} From 19b7d38830001961e0d841c39d50e3abac6c7b75 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 15:13:07 +0800 Subject: [PATCH 05/59] Delete flash_spi.h --- .../kd83a_bfg_edition/src/flash_spi.h | 136 ------------------ 1 file changed, 136 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h b/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h deleted file mode 100644 index 9e696eb0aafd..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/src/flash_spi.h +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 - -/* All the following default configurations are based on MX25L4006E Nor FLASH. */ - -/* - The slave select pin of the FLASH. - This needs to be a normal GPIO pin_t value, such as B14. -*/ -#ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN -# error "No chip select pin defined -- missing EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN" -#endif - -/* - The clock divisor for SPI to ensure that the MCU is within the - specifications of the FLASH chip. Generally this will be PCLK divided by - the intended divisor -- check your clock settings and the datasheet of - your FLASH. -*/ -#ifndef EXTERNAL_FLASH_SPI_CLOCK_DIVISOR -# ifdef __AVR__ -# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 4 -# else -# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 8 -# endif -#endif - -/* - The SPI mode to communicate with the FLASH. -*/ -#ifndef EXTERNAL_FLASH_SPI_MODE -# define EXTERNAL_FLASH_SPI_MODE 0 -#endif - -/* - Whether or not the SPI communication between the MCU and FLASH should be - LSB-first. -*/ -#ifndef EXTERNAL_FLASH_SPI_LSBFIRST -# define EXTERNAL_FLASH_SPI_LSBFIRST false -#endif - -/* - The Flash address size in bytes, as specified in datasheet. -*/ -#ifndef EXTERNAL_FLASH_ADDRESS_SIZE -# define EXTERNAL_FLASH_ADDRESS_SIZE 3 -#endif - -/* - The page size of the FLASH in bytes, as specified in the datasheet. -*/ -#ifndef EXTERNAL_FLASH_PAGE_SIZE -# define EXTERNAL_FLASH_PAGE_SIZE 256 -#endif - -/* - The sector size of the FLASH in bytes, as specified in the datasheet. -*/ -#ifndef EXTERNAL_FLASH_SECTOR_SIZE -# define EXTERNAL_FLASH_SECTOR_SIZE (4 * 1024) -#endif - -/* - The block size of the FLASH in bytes, as specified in the datasheet. -*/ -#ifndef EXTERNAL_FLASH_BLOCK_SIZE -# define EXTERNAL_FLASH_BLOCK_SIZE (64 * 1024) -#endif - -/* - The total size of the FLASH in bytes, as specified in the datasheet. -*/ -#ifndef EXTERNAL_FLASH_SIZE -# define EXTERNAL_FLASH_SIZE (512 * 1024) -#endif - -/* - The block count of the FLASH, calculated by total FLASH size and block size. -*/ -#define EXTERNAL_FLASH_BLOCK_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_BLOCK_SIZE)) - -/* - The sector count of the FLASH, calculated by total FLASH size and sector size. -*/ -#define EXTERNAL_FLASH_SECTOR_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_SECTOR_SIZE)) - -/* - The page count of the FLASH, calculated by total FLASH size and page size. -*/ -#define EXTERNAL_FLASH_PAGE_COUNT ((EXTERNAL_FLASH_SIZE) / (EXTERNAL_FLASH_PAGE_SIZE)) - -typedef int16_t flash_status_t; - -#define FLASH_STATUS_SUCCESS (0) -#define FLASH_STATUS_ERROR (-1) -#define FLASH_STATUS_TIMEOUT (-2) -#define FLASH_STATUS_BAD_ADDRESS (-3) - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -void flash_init(void); - -flash_status_t flash_erase_chip(void); - -flash_status_t flash_erase_block(uint32_t addr); - -flash_status_t flash_erase_sector(uint32_t addr); - -flash_status_t flash_read_block(uint32_t addr, void *buf, size_t len); - -flash_status_t flash_write_block(uint32_t addr, const void *buf, size_t len); - -#ifdef __cplusplus -} -#endif From 7f77d7ad8f913d89244b0a0a3d61f77a9f8b97f5 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 15:13:14 +0800 Subject: [PATCH 06/59] Delete wb32_spi_master.c --- .../kd83a_bfg_edition/src/wb32_spi_master.c | 147 ------------------ 1 file changed, 147 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c deleted file mode 100644 index ffa55c6e9231..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.c +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 . -*/ - -#include "wb32_spi_master.h" - -#include "timer.h" - -#ifndef WB32_SPI_DRIVER -# define WB32_SPI_DRIVER SPIDQ -#endif - -#ifndef WB32_SPI_SCK_PIN -# define WB32_SPI_SCK_PIN A5 -#endif - -#ifndef WB32_SPI_MOSI_PIN -# define WB32_SPI_MOSI_PIN A7 -#endif - -#ifndef WB32_SPI_MISO_PIN -# define WB32_SPI_MISO_PIN A6 -#endif - -#ifndef WB32_SPI_SCK_PAL_MODE -# define WB32_SPI_SCK_PAL_MODE 5 -#endif - -#ifndef WB32_SPI_MOSI_PAL_MODE -# define WB32_SPI_MOSI_PAL_MODE 5 -#endif - -#ifndef WB32_SPI_MISO_PAL_MODE -# define WB32_SPI_MISO_PAL_MODE 5 -#endif - -static pin_t currentSlavePin = NO_PIN; - -static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0}; - - void wb32_spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(WB32_SPI_SCK_PIN); - setPinInput(WB32_SPI_MOSI_PIN); - setPinInput(WB32_SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(WB32_SPI_SCK_PIN), PAL_PAD(WB32_SPI_SCK_PIN), PAL_MODE_ALTERNATE(WB32_SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(WB32_SPI_MOSI_PIN), PAL_PAD(WB32_SPI_MOSI_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(WB32_SPI_MISO_PIN), PAL_PAD(WB32_SPI_MISO_PIN), PAL_MODE_ALTERNATE(WB32_SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -bool wb32_spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { - if (currentSlavePin != NO_PIN || slavePin == NO_PIN) { - return false; - } - - if (!lsbFirst) { - osalDbgAssert(lsbFirst != FALSE, "unsupported lsbFirst"); - } - - if (divisor < 1) { - return false; - } - - spiConfig.SPI_BaudRatePrescaler = (divisor << 2); - - switch (mode) { - case 0: - spiConfig.SPI_CPHA = SPI_CPHA_1Edge; - spiConfig.SPI_CPOL = SPI_CPOL_Low; - break; - case 1: - spiConfig.SPI_CPHA = SPI_CPHA_2Edge; - spiConfig.SPI_CPOL = SPI_CPOL_Low; - break; - case 2: - spiConfig.SPI_CPHA = SPI_CPHA_1Edge; - spiConfig.SPI_CPOL = SPI_CPOL_High; - break; - case 3: - spiConfig.SPI_CPHA = SPI_CPHA_2Edge; - spiConfig.SPI_CPOL = SPI_CPOL_High; - break; - } - - currentSlavePin = slavePin; - spiConfig.ssport = PAL_PORT(slavePin); - spiConfig.sspad = PAL_PAD(slavePin); - - setPinOutput(slavePin); - spiStart(&WB32_SPI_DRIVER, &spiConfig); - spiSelect(&WB32_SPI_DRIVER); - - return true; -} - -spi_status_t wb32_spi_write(uint8_t data) { - uint8_t rxData; - spiExchange(&WB32_SPI_DRIVER, 1, &data, &rxData); - - return rxData; -} - -spi_status_t wb32_spi_read(void) { - uint8_t data = 0; - spiReceive(&WB32_SPI_DRIVER, 1, &data); - - return data; -} - -spi_status_t wb32_spi_transmit(const uint8_t *data, uint16_t length) { - spiSend(&WB32_SPI_DRIVER, length, data); - return SPI_STATUS_SUCCESS; -} - -spi_status_t wb32_spi_receive(uint8_t *data, uint16_t length) { - spiReceive(&WB32_SPI_DRIVER, length, data); - return SPI_STATUS_SUCCESS; -} - -void wb32_spi_stop(void) { - if (currentSlavePin != NO_PIN) { - spiUnselect(&WB32_SPI_DRIVER); - spiStop(&WB32_SPI_DRIVER); - currentSlavePin = NO_PIN; - } -} From 2c0fe8453db54a8900fc143c01095f818181acc8 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 15:13:20 +0800 Subject: [PATCH 07/59] Delete wb32_spi_master.h --- .../kd83a_bfg_edition/src/wb32_spi_master.h | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h b/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h deleted file mode 100644 index f0917f6de52c..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/src/wb32_spi_master.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 -#include -#include - -#include "gpio.h" -#include "chibios_config.h" - -typedef int16_t spi_status_t; - -#define SPI_STATUS_SUCCESS (0) -#define SPI_STATUS_ERROR (-1) -#define SPI_STATUS_TIMEOUT (-2) - -#define SPI_TIMEOUT_IMMEDIATE (0) -#define SPI_TIMEOUT_INFINITE (0xFFFF) - -#ifdef __cplusplus -extern "C" { -#endif -void wb32_spi_init(void); - -bool wb32_spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor); - -spi_status_t wb32_spi_write(uint8_t data); - -spi_status_t wb32_spi_read(void); - -spi_status_t wb32_spi_transmit(const uint8_t *data, uint16_t length); - -spi_status_t wb32_spi_receive(uint8_t *data, uint16_t length); - -void wb32_spi_stop(void); -#ifdef __cplusplus -} -#endif From ecbff72a179da5989c57b7d3f5f1acd3a198190e Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 10 Jun 2022 15:21:21 +0800 Subject: [PATCH 08/59] [Keyboard] From 9c423d155e1d2143aea3e4e311f06b3e552c0cb5 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 15 Jun 2022 10:30:54 +0800 Subject: [PATCH 09/59] Resolved requested changes --- keyboards/darkproject/kd83a_bfg_edition/info.json | 4 ++-- .../darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c | 1 - .../darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h | 7 +++---- .../kd83a_bfg_edition/keymaps/default/keymap.c | 7 +++---- .../darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 9 ++++----- keyboards/darkproject/kd83a_bfg_edition/rules.mk | 1 + 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 00b148a9fe2c..c6c8285ecf90 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -23,7 +23,7 @@ { "label": "F12", "x": 12.75, "y": 0 }, { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Home", "x": 15.5, "y": 0 }, + { "label": "Home", "x": 15.5, "y": 0 }, { "label": "`", "x": 0, "y": 1 }, { "label": "1", "x": 1, "y": 1 }, @@ -97,7 +97,7 @@ { "label": "Ctrl", "x": 12, "y": 5 }, { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 } + { "label": "Right", "x": 15.25, "y": 5 } ] } } diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index 2e6486528121..40978d66e274 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -255,7 +255,6 @@ void spi_init(void) { } #endif - #ifdef ENCODER_ENABLE bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) { return false; } diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h index eee68a32ee83..623a91f51845 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -27,14 +27,13 @@ // Sh_L Z X C V B N M , . / Sh_R Up PgDn // Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right -// clang-format off #define LAYOUT( \ k00, k10, k20, k30, k40, k50, k60, k70, k80, k90, ka0, kb0, kc0, kd0, k56, \ k01, k11, k21, k31, k41, k51, k61, k71, k81, k91, ka1, kb1, kc1, kd1, k16, \ k02, k12, k22, k32, k42, k52, k62, k72, k82, k92, ka2, kb2, kc2, kd2, k06, \ k03, k13, k23, k33, k43, k53, k63, k73, k83, k93, ka3, kb3, kd3, k26, \ k04, k24, k34, k44, k54, k64, k74, k84, k94, ka4, kb4, kd4, k17, k36, \ - k05, k15, k25, k65, k95, ka5, kc5, k07, k27, k37 \ + k05, k15, k25, k65, k95, ka5, kc5, k07, k27, k37, ke0, ke1 \ )\ {\ { k04, ___, k56, k07, kc5, k37, k05, k50},\ @@ -45,10 +44,10 @@ { k72, k62, k73, k63, k84, k74, k61, k71},\ { k82, kc2, k83, k60, k94, k06, kc1, k81},\ { k92, k70, k93, k27, ka4, ___, k80, k91},\ - { ka2, kb2, ka3, kb3, kd2, kb4, kb1, ka1},\ + { ka2, kb2, ka3, kb3, ___, kb4, kb1, ka1},\ { k15, kd4, ka5, k25, k65, k95, ___, kd0},\ { ___, kd1, kd2, kb0, kd3, kc0, k90, ka0},\ - { ___, ___, ___, ___, ___, ___, ___, ___},\ + { ke0, ke1, ___, ___, ___, ___, ___, ___},\ { ___, ___, ___, ___, k56, ___, k16, ___},\ { ___, ___, ___, ___, ___, ___, ___, ___} \ } diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index 21190c97ff03..b13fd4e5f5ee 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), /* Keymap _FL: Function Layer */ @@ -43,6 +43,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), -}; -// clang-format on \ No newline at end of file + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______), +}; \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 56a59a6aae32..97725b53b367 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), /* Keymap _FL: Function Layer */ @@ -43,13 +43,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD), + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______), [2] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) -}; -// clang-format on \ No newline at end of file + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index c93191dacc4c..5eb933b3ca4d 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -21,4 +21,5 @@ RGB_MATRIX_ENABLE = yes # Enable RGB matrix effects. RGB_MATRIX_DRIVER = AW20216 # Enable RGB matrix effects. FLASH_DRIVER = spi # Enable SPI flash EEPROM_DRIVER = custom # Enable SPI flash memory + SRC += src/eeprom_flash.c From 318c4637557d537dc05d79376850d61b4922965b Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 15 Jun 2022 11:45:36 +0800 Subject: [PATCH 10/59] Resolved requested changes --- keyboards/darkproject/kd83a_bfg_edition/info.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index c6c8285ecf90..66c7123d3aca 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -98,6 +98,8 @@ { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, { "label": "Right", "x": 15.25, "y": 5 } + { "label": "z1", "x": 16.25, "y": 5 }, + {"label": "z2", "x": 17.25, "y": 5 } ] } } From dd42220526ade323288a7ff7d2f6f7b2634fd454 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:50:34 +0800 Subject: [PATCH 11/59] Changed rules.mk file accordingly. --- .../darkproject/kd83a_bfg_edition/info.json | 8 +++--- .../darkproject/kd83a_bfg_edition/rules.mk | 26 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 66c7123d3aca..bc22d23570e1 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -23,7 +23,7 @@ { "label": "F12", "x": 12.75, "y": 0 }, { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Home", "x": 15.5, "y": 0 }, + { "label": "Home", "x": 15.5, "y": 0 }, { "label": "`", "x": 0, "y": 1 }, { "label": "1", "x": 1, "y": 1 }, @@ -97,9 +97,9 @@ { "label": "Ctrl", "x": 12, "y": 5 }, { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 } - { "label": "z1", "x": 16.25, "y": 5 }, - {"label": "z2", "x": 17.25, "y": 5 } + { "label": "Right", "x": 15.25, "y": 5 }, + { "label": "z1", "x": 16.25, "y": 5 } , + { "label": "z2", "x": 17.25, "y": 5 } ] } } diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index 5eb933b3ca4d..6b58f02d6fdd 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -7,19 +7,19 @@ BOOTLOADER = wb32-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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. +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 NKRO Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes # Enable RGB matrix effects. -RGB_MATRIX_DRIVER = AW20216 # Enable RGB matrix effects. -FLASH_DRIVER = spi # Enable SPI flash -EEPROM_DRIVER = custom # Enable SPI flash memory +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = AW20216 +FLASH_DRIVER = spi +EEPROM_DRIVER = custom SRC += src/eeprom_flash.c From 52a3301d21bbd70e77136e5dc72591f6ef44b79b Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:16:51 +0800 Subject: [PATCH 12/59] Resolved changes accordingly. --- keyboards/darkproject/kd83a_bfg_edition/info.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index bc22d23570e1..3a55ddd7139d 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -23,7 +23,7 @@ { "label": "F12", "x": 12.75, "y": 0 }, { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Home", "x": 15.5, "y": 0 }, + { "label": "Home", "x": 15.5, "y": 0 }, { "label": "`", "x": 0, "y": 1 }, { "label": "1", "x": 1, "y": 1 }, @@ -40,7 +40,7 @@ { "label": "=", "x": 12, "y": 1 }, { "label": "Backspace", "x": 13, "y": 1, "w": 2}, { "label": "Ins", "x": 15.5, "y": 1 }, - + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, { "label": "Q", "x": 1.5, "y": 2 }, @@ -57,7 +57,7 @@ { "label": "]", "x": 12.5, "y": 2 }, { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, { "label": "Del", "x": 15.5, "y": 2 }, - + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, { "label": "A", "x": 1.75, "y": 3 }, { "label": "S", "x": 2.75, "y": 3 }, @@ -72,7 +72,7 @@ { "label": "'", "x": 11.75, "y": 3 }, { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, { "label": "PgUp", "x": 15.5, "y": 3 }, - + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, { "label": "Z", "x": 2.25, "y": 4 }, { "label": "X", "x": 3.25, "y": 4 }, @@ -87,7 +87,7 @@ { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, { "label": "Up", "x": 14.25, "y": 4 }, { "label": "PgDn", "x": 15.5, "y": 4 }, - + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, @@ -98,7 +98,7 @@ { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, { "label": "Right", "x": 15.25, "y": 5 }, - { "label": "z1", "x": 16.25, "y": 5 } , + { "label": "z1", "x": 16.25, "y": 5 }, { "label": "z2", "x": 17.25, "y": 5 } ] } From 1c3f1e6a25aa2961ec2e0b319f9a90ad3eda11ff Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 1 Jul 2022 14:47:27 +0800 Subject: [PATCH 13/59] Update config.h file and rules.mk file --- keyboards/darkproject/kd83a_bfg_edition/config.h | 2 +- keyboards/darkproject/kd83a_bfg_edition/rules.mk | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 9c4c30d1d295..9e04d7a8e790 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -57,7 +57,7 @@ #define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 #define RGB_DISABLE_WHEN_USB_SUSPENDED #define EXTERNAL_FLASH_SIZE (8 * 1024) -#define EEPROM_SIZE EXTERNAL_FLASH_SIZE +#define TRANSIENT_EEPROM_SIZE_8192 /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index 6b58f02d6fdd..5c931641107c 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -20,6 +20,4 @@ ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = AW20216 FLASH_DRIVER = spi -EEPROM_DRIVER = custom - -SRC += src/eeprom_flash.c +EEPROM_DRIVER = transient From 8db03c1b86088390de7048fc1556d540dff504af Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 1 Jul 2022 14:51:31 +0800 Subject: [PATCH 14/59] Removed eeprom_flash.c file --- .../kd83a_bfg_edition/src/eeprom_flash.c | 693 ------------------ 1 file changed, 693 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c b/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c deleted file mode 100644 index 323e6078f030..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/src/eeprom_flash.c +++ /dev/null @@ -1,693 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 . -*/ - -#include -#include -#include "util.h" -#include "debug.h" -#include "wait.h" -#include "timer.h" -#include "eeprom.h" -#include "flash_spi.h" - -/* - * We emulate eeprom by writing a snapshot compacted view of eeprom contents, - * followed by a write log of any change since that snapshot: - * - * === SIMULATED EEPROM CONTENTS === - * - * ┌─ Compacted ┬ Write Log ─┐ - * │............│[BYTE][BYTE]│ - * │FFFF....FFFF│[WRD0][WRD1]│ - * │FFFFFFFFFFFF│[WORD][NEXT]│ - * │....FFFFFFFF│[BYTE][WRD0]│ - * ├────────────┼────────────┤ - * └──PAGE_BASE │ │ - * PAGE_LAST─┴─WRITE_BASE │ - * WRITE_LAST ┘ - * - * Compacted contents are the 1's complement of the actual EEPROM contents. - * e.g. An 'FFFF' represents a '0000' value. - * - * The size of the 'compacted' area is equal to the size of the 'emulated' eeprom. - * The size of the compacted-area and write log are configurable, and the combined - * size of Compacted + WriteLog is a multiple EXTERNAL_FLASH_PAGE_SIZE, which is MCU dependent. - * Simulated Eeprom contents are located at the end of available flash space. - * - * The following configuration defines can be set: - * - * EXTERNAL_FLASH_PAGE_COUNT # Total number of pages to use for eeprom simulation (Compact + Write log) - * FEE_DENSITY_BYTES # Size of simulated eeprom. (Defaults to half the space allocated by EXTERNAL_FLASH_PAGE_COUNT) - * NOTE: The current implementation does not include page swapping, - * and FEE_DENSITY_BYTES will consume that amount of RAM as a cached view of actual EEPROM contents. - * - * The maximum size of FEE_DENSITY_BYTES is currently 16384. The write log size equals - * EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE - FEE_DENSITY_BYTES. - * The larger the write log, the less frequently the compacted area needs to be rewritten. - * - * - * *** General Algorithm *** - * - * During initialization: - * The contents of the Compacted-flash area are loaded and the 1's complement value - * is cached into memory (e.g. 0xFFFF in Flash represents 0x0000 in cache). - * Write log entries are processed until a 0xFFFF is reached. - * Each log entry updates a byte or word in the cache. - * - * During reads: - * EEPROM contents are given back directly from the cache in memory. - * - * During writes: - * The contents of the cache is updated first. - * If the Compacted-flash area corresponding to the write address is unprogrammed, the 1's complement of the value is written directly into Compacted-flash - * Otherwise: - * If the write log is full, erase both the Compacted-flash area and the Write log, then write cached contents to the Compacted-flash area. - * Otherwise a Write log entry is constructed and appended to the next free position in the Write log. - * - * - * *** Write Log Structure *** - * - * Write log entries allow for optimized byte writes to addresses below 128. Writing 0 or 1 words are also optimized when word-aligned. - * - * === WRITE LOG ENTRY FORMATS === - * - * ╔═══ Byte-Entry ══╗ - * ║0XXXXXXX║YYYYYYYY║ - * ║ └──┬──┘║└──┬───┘║ - * ║ Address║ Value ║ - * ╚════════╩════════╝ - * 0 <= Address < 0x80 (128) - * - * ╔ Word-Encoded 0 ╗ - * ║100XXXXXXXXXXXXX║ - * ║ │└─────┬─────┘║ - * ║ │Address >> 1 ║ - * ║ └── Value: 0 ║ - * ╚════════════════╝ - * 0 <= Address <= 0x3FFE (16382) - * - * ╔ Word-Encoded 1 ╗ - * ║101XXXXXXXXXXXXX║ - * ║ │└─────┬─────┘║ - * ║ │Address >> 1 ║ - * ║ └── Value: 1 ║ - * ╚════════════════╝ - * 0 <= Address <= 0x3FFE (16382) - * - * ╔═══ Reserved ═══╗ - * ║110XXXXXXXXXXXXX║ - * ╚════════════════╝ - * - * ╔═══════════ Word-Next ═══════════╗ - * ║111XXXXXXXXXXXXX║YYYYYYYYYYYYYYYY║ - * ║ └─────┬─────┘║└───────┬──────┘║ - * ║(Address-128)>>1║ ~Value ║ - * ╚════════════════╩════════════════╝ - * ( 0 <= Address < 0x0080 (128): Reserved) - * 0x80 <= Address <= 0x3FFE (16382) - * - * Write Log entry ranges: - * 0x0000 ... 0x7FFF - Byte-Entry; address is (Entry & 0x7F00) >> 4; value is (Entry & 0xFF) - * 0x8000 ... 0x9FFF - Word-Encoded 0; address is (Entry & 0x1FFF) << 1; value is 0 - * 0xA000 ... 0xBFFF - Word-Encoded 1; address is (Entry & 0x1FFF) << 1; value is 1 - * 0xC000 ... 0xDFFF - Reserved - * 0xE000 ... 0xFFBF - Word-Next; address is (Entry & 0x1FFF) << 1 + 0x80; value is ~(Next_Entry) - * 0xFFC0 ... 0xFFFE - Reserved - * 0xFFFF - Unprogrammed - * - */ - -/* These bits are used for optimizing encoding of bytes, 0 and 1 */ -#define FEE_WORD_ENCODING 0x8000 -#define FEE_VALUE_NEXT 0x6000 -#define FEE_VALUE_RESERVED 0x4000 -#define FEE_VALUE_ENCODED 0x2000 -#define FEE_BYTE_RANGE 0x80 - -/* Addressable range 16KByte: 0 <-> (0x1FFF << 1) */ -#define FEE_ADDRESS_MAX_SIZE 0x4000 - -/* Flash word value after erase */ -#define FEE_EMPTY_WORD ((uint16_t)0xFFFF) - -/* Size of combined compacted eeprom and write log pages */ -#define FEE_DENSITY_MAX_SIZE (EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE) - -#ifndef EXTERNAL_FLASH_SIZE_IGNORE_CHECK /* *TODO: Get rid of this check */ -# if FEE_DENSITY_MAX_SIZE > (EXTERNAL_FLASH_SIZE * 1024) -# pragma message STR(FEE_DENSITY_MAX_SIZE) " > " STR(EXTERNAL_FLASH_SIZE * 1024) -# error emulated eeprom: FEE_DENSITY_MAX_SIZE is greater than available flash size -# endif -#endif - -/* Size of emulated eeprom */ -#ifdef FEE_DENSITY_BYTES -# if (FEE_DENSITY_BYTES > FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) -# error emulated eeprom: FEE_DENSITY_BYTES exceeds FEE_DENSITY_MAX_SIZE -# endif -# if (FEE_DENSITY_BYTES == FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " == " STR(FEE_DENSITY_MAX_SIZE) -# warning emulated eeprom: FEE_DENSITY_BYTES leaves no room for a write log. This will greatly increase the flash wear rate! -# endif -# if FEE_DENSITY_BYTES > FEE_ADDRESS_MAX_SIZE -# pragma message STR(FEE_DENSITY_BYTES) " > " STR(FEE_ADDRESS_MAX_SIZE) -# error emulated eeprom: FEE_DENSITY_BYTES is greater than FEE_ADDRESS_MAX_SIZE allows -# endif -# if ((FEE_DENSITY_BYTES) % 2) == 1 -# error emulated eeprom: FEE_DENSITY_BYTES must be even -# endif -#else -/* Default to half of allocated space used for emulated eeprom, half for write log */ -# define FEE_DENSITY_BYTES (EXTERNAL_FLASH_PAGE_COUNT * (EXTERNAL_FLASH_PAGE_SIZE >> 1)) -#endif - -/* Size of write log */ -#ifdef FEE_WRITE_LOG_BYTES -# if ((FEE_DENSITY_BYTES + FEE_WRITE_LOG_BYTES) > FEE_DENSITY_MAX_SIZE) -# pragma message STR(FEE_DENSITY_BYTES) " + " STR(FEE_WRITE_LOG_BYTES) " > " STR(FEE_DENSITY_MAX_SIZE) -# error emulated eeprom: FEE_WRITE_LOG_BYTES exceeds remaining FEE_DENSITY_MAX_SIZE -# endif -# if ((FEE_WRITE_LOG_BYTES) % 2) == 1 -# error emulated eeprom: FEE_WRITE_LOG_BYTES must be even -# endif -#else -/* Default to use all remaining space */ -# define FEE_WRITE_LOG_BYTES (EXTERNAL_FLASH_PAGE_COUNT * EXTERNAL_FLASH_PAGE_SIZE - FEE_DENSITY_BYTES) -#endif - -#define EXTERNAL_FLASH_PAGE_BASE_ADDRESS 0 -/* Start of the emulated eeprom compacted flash area */ -#define FEE_COMPACTED_BASE_ADDRESS EXTERNAL_FLASH_PAGE_BASE_ADDRESS -/* End of the emulated eeprom compacted flash area */ -#define FEE_COMPACTED_LAST_ADDRESS (FEE_COMPACTED_BASE_ADDRESS + FEE_DENSITY_BYTES) -/* Start of the emulated eeprom write log */ -#define FEE_WRITE_LOG_BASE_ADDRESS FEE_COMPACTED_LAST_ADDRESS -/* End of the emulated eeprom write log */ -#define FEE_WRITE_LOG_LAST_ADDRESS (FEE_WRITE_LOG_BASE_ADDRESS + FEE_WRITE_LOG_BYTES) - -#if defined(DYNAMIC_KEYMAP_EEPROM_MAX_ADDR) && (DYNAMIC_KEYMAP_EEPROM_MAX_ADDR >= FEE_DENSITY_BYTES) -# error emulated eeprom: DYNAMIC_KEYMAP_EEPROM_MAX_ADDR is greater than the FEE_DENSITY_BYTES available -#endif - -/* In-memory contents of emulated eeprom for faster access */ -/* *TODO: Implement page swapping */ -uint16_t WordBuf[FEE_DENSITY_BYTES / 2] = {0xFFFF}; -static uint8_t *DataBuf = (uint8_t *)WordBuf; - -/* Pointer to the first available slot within the write log */ -static uint16_t *empty_slot; - -#define DEBUG_EEPROM_OUTPUT - -/* - * Debug print utils - */ - -#if defined(DEBUG_EEPROM_OUTPUT) - -# define debug_eeprom debug_enable -# define eeprom_println(s) println(s) -# define eeprom_printf(fmt, ...) dprintf(fmt, ##__VA_ARGS__) - -#else /* NO_DEBUG */ - -# define debug_eeprom false -# define eeprom_println(s) -# define eeprom_printf(fmt, ...) - -#endif /* NO_DEBUG */ - -void print_eeprom(void) { -#ifndef NO_DEBUG - int empty_rows = 0; - for (uint16_t i = 0; i < FEE_DENSITY_BYTES; i++) { - if (i % 16 == 0) { - if (i >= FEE_DENSITY_BYTES - 16) { - /* Make sure we display the last row */ - empty_rows = 0; - } - /* Check if this row is uninitialized */ - ++empty_rows; - for (uint16_t j = 0; j < 16; j++) { - if (DataBuf[i + j]) { - empty_rows = 0; - break; - } - } - if (empty_rows > 1) { - /* Repeat empty row */ - if (empty_rows == 2) { - /* Only display the first repeat empty row */ - println("*"); - } - i += 15; - continue; - } - xprintf("%04x", i); - } - if (i % 8 == 0) print(" "); - - xprintf(" %02x", DataBuf[i]); - if ((i + 1) % 16 == 0) { - println(""); - } - } -#endif -} - -static flash_status_t external_flash_program_half_word(uint32_t addr, uint16_t value) { - uint8_t *src = (uint8_t *)&value; - - return flash_write_block(addr, src, 2); -} - -static uint32_t EEPROM_Init(void) { - /* Load emulated eeprom contents from compacted flash into memory */ - uint32_t src = (uint32_t)FEE_COMPACTED_BASE_ADDRESS; - uint16_t *dest = (uint16_t *)DataBuf; - - flash_read_block(src, (uint8_t *)dest, FEE_COMPACTED_LAST_ADDRESS - FEE_COMPACTED_BASE_ADDRESS); - - for (int i = 0; i < ((FEE_COMPACTED_LAST_ADDRESS - FEE_COMPACTED_BASE_ADDRESS) >> 1); i++, ++dest) { - *dest = ~*dest; - } - - if (debug_eeprom) { - println("EEPROM_Init Compacted Pages:"); - print_eeprom(); - println("EEPROM_Init Write Log:"); - } - - /* Replay write log */ - uint16_t *log_addr; - for (log_addr = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; log_addr < (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS; ++log_addr) { - uint16_t address; - - flash_read_block((uint32_t)log_addr, (uint8_t *)&address, 0x02); - if (address == FEE_EMPTY_WORD) { - break; - } - /* Check for lowest 128-bytes optimization */ - if (!(address & FEE_WORD_ENCODING)) { - uint8_t bvalue = (uint8_t)address; - address >>= 8; - DataBuf[address] = bvalue; - eeprom_printf("DataBuf[0x%02x] = 0x%02x;\n", address, bvalue); - } else { - uint16_t wvalue; - - /* Check if value is in next word */ - if ((address & FEE_VALUE_NEXT) == FEE_VALUE_NEXT) { - /* Read value from next word */ - if (++log_addr >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { - break; - } - flash_read_block((uint32_t)log_addr, (uint8_t *)&wvalue, 0x02); - wvalue = ~wvalue; - if (!wvalue) { - eeprom_printf("Incomplete write at log_addr: 0x%04x;\n", (uint32_t)log_addr); - /* Possibly incomplete write. Ignore and continue */ - continue; - } - address &= 0x1FFF; - address <<= 1; - /* Writes to addresses less than 128 are byte log entries */ - address += FEE_BYTE_RANGE; - } else { - /* Reserved for future use */ - if (address & FEE_VALUE_RESERVED) { - eeprom_printf("Reserved encoded value at log_addr: 0x%04x;\n", (uint32_t)log_addr); - continue; - } - - /* Optimization for 0 or 1 values. */ - wvalue = (address & FEE_VALUE_ENCODED) >> 13; - address &= 0x1FFF; - address <<= 1; - } - if (address < FEE_DENSITY_BYTES) { - eeprom_printf("DataBuf[0x%04x] = 0x%04x;\n", address, wvalue); - *(uint16_t *)(&DataBuf[address]) = wvalue; - } else { - eeprom_printf("DataBuf[0x%04x] cannot be set to 0x%04x [BAD ADDRESS]\n", address, wvalue); - } - } - } - - empty_slot = log_addr; - - if (debug_eeprom) { - println("EEPROM_Init Final DataBuf:"); - print_eeprom(); - } - - return (uint32_t)FEE_DENSITY_BYTES; -} - -/* Clear flash contents (doesn't touch in-memory DataBuf) */ -static void eeprom_clear(void) { - uint32_t erase_addr = EXTERNAL_FLASH_PAGE_BASE_ADDRESS; - - for ( ; erase_addr < (uint32_t)(EXTERNAL_FLASH_SIZE);) { - - if (erase_addr % ((uint32_t)(EXTERNAL_FLASH_SECTOR_SIZE)) != 0) { - eeprom_printf("The external Flash address to be erased is incorrect: 0x%08x\n", (uint32_t)erase_addr); - break; - } - flash_erase_sector(erase_addr); - erase_addr += (uint32_t)(EXTERNAL_FLASH_SECTOR_SIZE); - } - - empty_slot = (uint16_t *)FEE_WRITE_LOG_BASE_ADDRESS; - eeprom_printf("eeprom_clear empty_slot: 0x%08x\n", (uint32_t)empty_slot); -} - -/* Erase emulated eeprom */ -void EEPROM_Erase(void) { - eeprom_println("EEPROM_Erase"); - /* Erase compacted pages and write log */ - eeprom_clear(); - /* re-initialize to reset DataBuf */ - EEPROM_Init(); -} - -/* Compact write log */ -static uint8_t eeprom_compact(void) { - /* Erase compacted pages and write log */ - eeprom_clear(); - - flash_status_t final_status = FLASH_STATUS_SUCCESS; - - /* Write emulated eeprom contents from memory to compacted flash */ - uint16_t *src = (uint16_t *)DataBuf; - uintptr_t dest = FEE_COMPACTED_BASE_ADDRESS; - uint16_t value; - for (; dest < FEE_COMPACTED_LAST_ADDRESS; ++src, dest += 2) { - value = *src; - if (value) { - eeprom_printf("external_flash_program_half_word(0x%04x, 0x%04x)\n", (uint32_t)dest, ~value); - flash_status_t status = external_flash_program_half_word(dest, ~value); - if (status != FLASH_STATUS_SUCCESS) final_status = status; - } - } - - if (debug_eeprom) { - println("eeprom_compacted:"); - print_eeprom(); - } - - return final_status; -} - -static uint8_t eeprom_write_direct_entry(uint16_t Address) { - /* Check if we can just write this directly to the compacted flash area */ - uint32_t directAddress = FEE_COMPACTED_BASE_ADDRESS + (Address & 0xFFFE); - uint16_t wvalue; - - flash_read_block(directAddress, (uint8_t *)&wvalue, 0x02); - if (wvalue == FEE_EMPTY_WORD) { - /* Write the value directly to the compacted area without a log entry */ - wvalue = ~*(uint16_t *)(&DataBuf[Address & 0xFFFE]); - - /* Early exit if a write isn't needed */ - if (wvalue == FEE_EMPTY_WORD) return FLASH_STATUS_SUCCESS; - - eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x) [DIRECT]\n", directAddress, wvalue); - flash_status_t status = external_flash_program_half_word(directAddress, wvalue); - - return status; - } - return 0; -} - -static uint8_t eeprom_write_log_word_entry(uint16_t Address) { - flash_status_t final_status = FLASH_STATUS_SUCCESS; - - uint16_t value = *(uint16_t *)(&DataBuf[Address]); - eeprom_printf("eeprom_write_log_word_entry(0x%04x): 0x%04x\n", Address, value); - - /* MSB signifies the lowest 128-byte optimization is not in effect */ - uint16_t encoding = FEE_WORD_ENCODING; - uint8_t entry_size; - if (value <= 1) { - encoding |= value << 13; - entry_size = 2; - } else { - encoding |= FEE_VALUE_NEXT; - entry_size = 4; - /* Writes to addresses less than 128 are byte log entries */ - Address -= FEE_BYTE_RANGE; - } - - /* if we can't find an empty spot, we must compact emulated eeprom */ - if (empty_slot > (uint16_t *)(FEE_WRITE_LOG_LAST_ADDRESS - entry_size)) { - /* compact the write log into the compacted flash area */ - return eeprom_compact(); - } - - /* Word log writes should be word-aligned. Take back a bit */ - Address >>= 1; - Address |= encoding; - - /* ok we found a place let's write our data */ - - /* address */ - eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, Address); - final_status = external_flash_program_half_word((uintptr_t)empty_slot++, Address); - - /* value */ - if (encoding == (FEE_WORD_ENCODING | FEE_VALUE_NEXT)) { - eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, ~value); - flash_status_t status = external_flash_program_half_word((uintptr_t)empty_slot++, ~value); - if (status != FLASH_STATUS_SUCCESS) final_status = status; - } - - return final_status; -} - -static uint8_t eeprom_write_log_byte_entry(uint16_t Address) { - eeprom_printf("eeprom_write_log_byte_entry(0x%04x): 0x%02x\n", Address, DataBuf[Address]); - - /* if couldn't find an empty spot, we must compact emulated eeprom */ - if (empty_slot >= (uint16_t *)FEE_WRITE_LOG_LAST_ADDRESS) { - /* compact the write log into the compacted flash area */ - return eeprom_compact(); - } - - /* ok we found a place let's write our data */ - - /* Pack address and value into the same word */ - uint16_t value = (Address << 8) | DataBuf[Address]; - - /* write to flash */ - eeprom_printf("external_flash_program_half_word(0x%08x, 0x%04x)\n", (uint32_t)empty_slot, value); - flash_status_t status = external_flash_program_half_word((uintptr_t)empty_slot++, value); - - return status; -} - -flash_status_t EEPROM_WriteDataByte(uint16_t Address, uint8_t DataByte) { - /* if the address is out-of-bounds, do nothing */ - if (Address >= FEE_DENSITY_BYTES) { - eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [BAD ADDRESS]\n", Address, DataByte); - return FLASH_STATUS_BAD_ADDRESS; - } - - /* if the value is the same, don't bother writing it */ - if (DataBuf[Address] == DataByte) { - eeprom_printf("EEPROM_WriteDataByte(0x%04x, 0x%02x) [SKIP SAME]\n", Address, DataByte); - return FLASH_STATUS_SUCCESS; - } - - /* keep DataBuf cache in sync */ - DataBuf[Address] = DataByte; - eeprom_printf("EEPROM_WriteDataByte DataBuf[0x%04x] = 0x%02x\n", Address, DataBuf[Address]); - - /* perform the write into flash memory */ - /* First, attempt to write directly into the compacted flash area */ - flash_status_t status = eeprom_write_direct_entry(Address); - if (!status) { - /* Otherwise append to the write log */ - if (Address < FEE_BYTE_RANGE) { - status = eeprom_write_log_byte_entry(Address); - } else { - status = eeprom_write_log_word_entry(Address & 0xFFFE); - } - } - if (status != 0 && status != FLASH_STATUS_SUCCESS) { - eeprom_printf("EEPROM_WriteDataByte [STATUS == %d]\n", status); - } - return status; -} - -flash_status_t EEPROM_WriteDataWord(uint16_t Address, uint16_t DataWord) { - /* if the address is out-of-bounds, do nothing */ - if (Address >= FEE_DENSITY_BYTES) { - eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [BAD ADDRESS]\n", Address, DataWord); - return FLASH_STATUS_BAD_ADDRESS; - } - - /* Check for word alignment */ - flash_status_t final_status = FLASH_STATUS_SUCCESS; - if (Address % 2) { - final_status = EEPROM_WriteDataByte(Address, DataWord); - flash_status_t status = EEPROM_WriteDataByte(Address + 1, DataWord >> 8); - if (status != FLASH_STATUS_SUCCESS) final_status = status; - if (final_status != 0 && final_status != FLASH_STATUS_SUCCESS) { - eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); - } - return final_status; - } - - /* if the value is the same, don't bother writing it */ - uint16_t oldValue = *(uint16_t *)(&DataBuf[Address]); - if (oldValue == DataWord) { - eeprom_printf("EEPROM_WriteDataWord(0x%04x, 0x%04x) [SKIP SAME]\n", Address, DataWord); - return FLASH_STATUS_SUCCESS; - } - - /* keep DataBuf cache in sync */ - *(uint16_t *)(&DataBuf[Address]) = DataWord; - eeprom_printf("EEPROM_WriteDataWord DataBuf[0x%04x] = 0x%04x\n", Address, *(uint16_t *)(&DataBuf[Address])); - - /* perform the write into flash memory */ - /* First, attempt to write directly into the compacted flash area */ - final_status = eeprom_write_direct_entry(Address); - if (!final_status) { - /* Otherwise append to the write log */ - /* Check if we need to fall back to byte write */ - if (Address < FEE_BYTE_RANGE) { - final_status = FLASH_STATUS_SUCCESS; - /* Only write a byte if it has changed */ - if ((uint8_t)oldValue != (uint8_t)DataWord) { - final_status = eeprom_write_log_byte_entry(Address); - } - flash_status_t status = FLASH_STATUS_SUCCESS; - /* Only write a byte if it has changed */ - if ((oldValue >> 8) != (DataWord >> 8)) { - status = eeprom_write_log_byte_entry(Address + 1); - } - if (status != FLASH_STATUS_SUCCESS) final_status = status; - } else { - final_status = eeprom_write_log_word_entry(Address); - } - } - if (final_status != 0 && final_status != FLASH_STATUS_SUCCESS) { - eeprom_printf("EEPROM_WriteDataWord [STATUS == %d]\n", final_status); - } - return final_status; -} - -uint8_t EEPROM_ReadDataByte(uint16_t Address) { - uint8_t DataByte = 0xFF; - - if (Address < FEE_DENSITY_BYTES) { - DataByte = DataBuf[Address]; - } - - eeprom_printf("EEPROM_ReadDataByte(0x%04x): 0x%02x\n", Address, DataByte); - - return DataByte; -} - -uint16_t EEPROM_ReadDataWord(uint16_t Address) { - uint16_t DataWord = 0xFFFF; - - if (Address < FEE_DENSITY_BYTES - 1) { - /* Check word alignment */ - if (Address % 2) { - DataWord = DataBuf[Address] | (DataBuf[Address + 1] << 8); - } else { - DataWord = *(uint16_t *)(&DataBuf[Address]); - } - } - - eeprom_printf("EEPROM_ReadDataWord(0x%04x): 0x%04x\n", Address, DataWord); - - return DataWord; -} - -/***************************************************************************** - * Bind to eeprom_driver.c - *******************************************************************************/ -void eeprom_driver_init(void) { - flash_init(); - EEPROM_Init(); -} - -void eeprom_driver_erase(void) { EEPROM_Erase(); } - -void eeprom_read_block(void *buf, const void *addr, size_t len) { - const uint8_t *src = (const uint8_t *)addr; - uint8_t * dest = (uint8_t *)buf; - - /* Check word alignment */ - if (len && (uintptr_t)src % 2) { - /* Read the unaligned first byte */ - *dest++ = EEPROM_ReadDataByte((const uintptr_t)src++); - --len; - } - - uint16_t value; - bool aligned = ((uintptr_t)dest % 2 == 0); - while (len > 1) { - value = EEPROM_ReadDataWord((const uintptr_t)((uint16_t *)src)); - if (aligned) { - *(uint16_t *)dest = value; - dest += 2; - } else { - *dest++ = value; - *dest++ = value >> 8; - } - src += 2; - len -= 2; - } - if (len) { - *dest = EEPROM_ReadDataByte((const uintptr_t)src); - } -} - -void eeprom_write_block(const void *buf, void *addr, size_t len) { - uint8_t * dest = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - - /* Check word alignment */ - if (len && (uintptr_t)dest % 2) { - /* Write the unaligned first byte */ - EEPROM_WriteDataByte((uintptr_t)dest++, *src++); - --len; - } - - uint16_t value; - bool aligned = ((uintptr_t)src % 2 == 0); - while (len > 1) { - if (aligned) { - value = *(uint16_t *)src; - } else { - value = *(uint8_t *)src | (*(uint8_t *)(src + 1) << 8); - } - EEPROM_WriteDataWord((uintptr_t)((uint16_t *)dest), value); - dest += 2; - src += 2; - len -= 2; - } - - if (len) { - EEPROM_WriteDataByte((uintptr_t)dest, *src); - } -} From 6b050ac7012664a99d7552539ce91c087921f4ba Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 19 Jul 2022 09:54:36 +0800 Subject: [PATCH 15/59] Update default/keymap.c file --- keyboards/darkproject/kd83a_bfg_edition/info.json | 6 +++--- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 12 ++++++------ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 6 +++--- .../kd83a_bfg_edition/keymaps/default/keymap.c | 8 ++++---- .../kd83a_bfg_edition/keymaps/via/keymap.c | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 3a55ddd7139d..7c588187e86c 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -23,7 +23,7 @@ { "label": "F12", "x": 12.75, "y": 0 }, { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Home", "x": 15.5, "y": 0 }, + { "label": "Del", "x": 15.5, "y": 0 }, { "label": "`", "x": 0, "y": 1 }, { "label": "1", "x": 1, "y": 1 }, @@ -39,7 +39,7 @@ { "label": "-", "x": 11, "y": 1 }, { "label": "=", "x": 12, "y": 1 }, { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Ins", "x": 15.5, "y": 1 }, + { "label": "Home", "x": 15.5, "y": 1 }, { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, @@ -56,7 +56,7 @@ { "label": "[", "x": 11.5, "y": 2 }, { "label": "]", "x": 12.5, "y": 2 }, { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "Del", "x": 15.5, "y": 2 }, + { "label": "End", "x": 15.5, "y": 2 }, { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, { "label": "A", "x": 1.75, "y": 3 }, diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index 40978d66e274..0b255b3f1e84 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -39,7 +39,7 @@ const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Home + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 @@ -55,7 +55,7 @@ const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Ins + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q @@ -71,7 +71,7 @@ const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, Del + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A @@ -144,7 +144,7 @@ led_config_t g_led_config = { { 132, 0}, // 11, kb0, F11 { 143, 0}, // 12, kc0, F12 { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Home + { 165, 0}, // 14, k56, Del { 11, 11}, // 15, k01, ` { 22, 11}, // 16, k11, 1 @@ -160,7 +160,7 @@ led_config_t g_led_config = { { 132, 11}, // 26, kb1, - { 143, 11}, // 27, kc1, = { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Ins + { 165, 11}, // 29, k16, Home { 11, 22}, // 30, k02, Tab { 22, 22}, // 31, k12, Q @@ -176,7 +176,7 @@ led_config_t g_led_config = { { 132, 22}, // 41, kb2, [ { 143, 22}, // 42, kc2, ] { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, Del + { 165, 22}, // 44, k06, End { 11, 33}, // 45, k03, Caps Lock { 22, 33}, // 46, k13, A diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h index 623a91f51845..4467cee9f2b4 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -20,9 +20,9 @@ #define ___ KC_NO -// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Home -// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Ins -// Tab Q W E R T Y U I O P [ ] \\ Del +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del +// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home +// Tab Q W E R T Y U I O P [ ] \\ End // Caps A S D F G H J K L ; ' Enter PgUp // Sh_L Z X C V B N M , . / Sh_R Up PgDn // Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index b13fd4e5f5ee..449b46701032 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -28,10 +28,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ [_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 97725b53b367..ce1fe0f0d461 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -28,9 +28,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ [_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_HOME, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), From 03ff34ccdd6cc5d2e1febef337b730bd430ca6c9 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:33:06 +0800 Subject: [PATCH 16/59] Delete keyboards/darkproject/kd83a_bfg_edition directory --- .../darkproject/kd83a_bfg_edition/config.h | 142 --------- .../darkproject/kd83a_bfg_edition/halconf.h | 25 -- .../darkproject/kd83a_bfg_edition/info.json | 106 ------- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 270 ------------------ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 53 ---- .../keymaps/default/keymap.c | 47 --- .../keymaps/default/readme.md | 1 - .../kd83a_bfg_edition/keymaps/via/config.h | 23 -- .../kd83a_bfg_edition/keymaps/via/keymap.c | 54 ---- .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 - .../darkproject/kd83a_bfg_edition/mcuconf.h | 26 -- .../darkproject/kd83a_bfg_edition/readme.md | 23 -- .../darkproject/kd83a_bfg_edition/rules.mk | 23 -- 13 files changed, 794 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/config.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/halconf.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/info.json delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/mcuconf.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/readme.md delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h deleted file mode 100644 index 9e04d7a8e790..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -/* USB Device descriptor parameter */ -#define DEVICE_VER 0x0001 -#define VENDOR_ID 0x342D -#define PRODUCT_ID 0xE392 -#define MANUFACTURER GSKY -#define PRODUCT KD83A_BFG_Edition - -/* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 0 -#define BOOTMAGIC_LITE_COLUMN 0 - -#define TAP_CODE_DELAY 10 - -/* 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 - -/* External spi flash */ -#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 -#define RGB_DISABLE_WHEN_USB_SUSPENDED -#define EXTERNAL_FLASH_SIZE (8 * 1024) -#define TRANSIENT_EEPROM_SIZE_8192 - -/* SPI Config for LED Driver */ -#define SPI_DRIVER SPIDQ -#define SPI_SCK_PIN A5 -#define SPI_MOSI_PIN A7 -#define SPI_MISO_PIN A6 - -#define DRIVER_1_CS A15 -#define DRIVER_2_CS B15 -#define DRIVER_1_EN C13 -#define DRIVER_2_EN C13 - - -#define LED_NUM_LOCK_PIN C15 -#define LED_CAPS_LOCK_PIN C14 -#define LED_SCROLL_LOCK_PIN C0 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 66 -#define DRIVER_2_LED_TOTAL 19 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -/* Send up to 4 key press events per scan */ -#define QMK_KEYS_PER_SCAN 4 - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO - - diff --git a/keyboards/darkproject/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/halconf.h deleted file mode 100644 index 68b32360b3a5..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/halconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next - diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json deleted file mode 100644 index 7c588187e86c..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "keyboard_name": "KD83A_BFG_Edition", - "url": "", - "maintainer": "GSKY", - "layouts": { - "LAYOUT": { - "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Del", "x": 15.5, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Home", "x": 15.5, "y": 1 }, - - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "End", "x": 15.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - { "label": "PgUp", "x": 15.5, "y": 3 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - { "label": "PgDn", "x": 15.5, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "Ctrl", "x": 12, "y": 5 }, - { "label": "Left", "x": 13.25, "y": 5 }, - { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 }, - { "label": "z1", "x": 16.25, "y": 5 }, - { "label": "z2", "x": 17.25, "y": 5 } - ] - } - } -} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c deleted file mode 100644 index 0b255b3f1e84..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ /dev/null @@ -1,270 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include "kd83a_bfg_edition.h" - -#ifdef RGB_MATRIX_ENABLE - -const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home - - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right - - {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 - {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 -}; - -#undef ___ -#define ___ NO_LED -#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - RGB_LAYOUT( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84) -, { - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Del - - { 11, 11}, // 15, k01, ` - { 22, 11}, // 16, k11, 1 - { 33, 11}, // 17, k21, 2 - { 44, 11}, // 18, k31, 3 - { 55, 11}, // 19, k41, 4 - { 66, 11}, // 20, k51, 5 - { 77, 11}, // 21, k61, 6 - { 88, 11}, // 22, k71, 7 - { 99, 11}, // 23, k81, 8 - { 110, 11}, // 24, k91, 9 - { 121, 11}, // 25, ka1, 0 - { 132, 11}, // 26, kb1, - - { 143, 11}, // 27, kc1, = - { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Home - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, End - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - { 165, 33}, // 58, k26, PgUp - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - { 165, 44}, // 72, k36, PgDn - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 79, kc5, Ctrl_R - { 143, 55}, // 80, k07, Left - { 154, 55}, // 81, k27, Down - { 165, 55}, // 82, k37, Right - - { 0, 18}, // 83, Z1 - { 0, 24}, // 84, Z2 -}, { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4 -} }; -#endif - -#ifdef EEPROM_ENABLE - -#include "spi_master.h" - -void spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -#endif -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h deleted file mode 100644 index 4467cee9f2b4..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - -// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del -// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home -// Tab Q W E R T Y U I O P [ ] \\ End -// Caps A S D F G H J K L ; ' Enter PgUp -// Sh_L Z X C V B N M , . / Sh_R Up PgDn -// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right - -#define LAYOUT( \ - k00, k10, k20, k30, k40, k50, k60, k70, k80, k90, ka0, kb0, kc0, kd0, k56, \ - k01, k11, k21, k31, k41, k51, k61, k71, k81, k91, ka1, kb1, kc1, kd1, k16, \ - k02, k12, k22, k32, k42, k52, k62, k72, k82, k92, ka2, kb2, kc2, kd2, k06, \ - k03, k13, k23, k33, k43, k53, k63, k73, k83, k93, ka3, kb3, kd3, k26, \ - k04, k24, k34, k44, k54, k64, k74, k84, k94, ka4, kb4, kd4, k17, k36, \ - k05, k15, k25, k65, k95, ka5, kc5, k07, k27, k37, ke0, ke1 \ -)\ -{\ - { k04, ___, k56, k07, kc5, k37, k05, k50},\ - { k12, k02, k13, k00, k24, k26, k01, k11},\ - { k22, k03, k23, ___, k34, k36, k10, k21},\ - { k32, k30, k33, k40, k44, k17, k20, k31},\ - { k42, k52, k43, k53, k54, k64, k51, k41},\ - { k72, k62, k73, k63, k84, k74, k61, k71},\ - { k82, kc2, k83, k60, k94, k06, kc1, k81},\ - { k92, k70, k93, k27, ka4, ___, k80, k91},\ - { ka2, kb2, ka3, kb3, ___, kb4, kb1, ka1},\ - { k15, kd4, ka5, k25, k65, k95, ___, kd0},\ - { ___, kd1, kd2, kb0, kd3, kc0, k90, ka0},\ - { ke0, ke1, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, k56, ___, k16, ___},\ - { ___, ___, ___, ___, ___, ___, ___, ___} \ -} diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c deleted file mode 100644 index 449b46701032..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - _BL, - _FL, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - RESET, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______), -}; \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1bdbac95804d..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD83A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h deleted file mode 100644 index 6f28d150ea17..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -#define DYNAMIC_KEYMAP_LAYER_COUNT 3 - diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c deleted file mode 100644 index ce1fe0f0d461..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - _BL, - _FL, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - RESET, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, - _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______), -[2] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), -}; \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h deleted file mode 100644 index e39ad58743fd..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - -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 - -#undef WB32_SPI_USE_QSPI -#define WB32_SPI_USE_QSPI TRUE - -#undef WB32_SPI_USE_SPIM2 -#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md deleted file mode 100644 index 83fb3e390752..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# KD83A_BFG_Edition - -An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller - -* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) -* Hardware Supported: KD83A_BFG_Edition -* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) - -Make example for this keyboard (after setting up your build environment): - - make darkproject/kd83a_bfg_edition:default - -Flashing example for this keyboard: - - make darkproject/kd83a_bfg_edition:default:flash - -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - -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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk deleted file mode 100644 index 5c931641107c..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ /dev/null @@ -1,23 +0,0 @@ -# MCU name -MCU = WB32F3G71 - -# Bootloader selection -BOOTLOADER = wb32-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 NKRO Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = AW20216 -FLASH_DRIVER = spi -EEPROM_DRIVER = transient From da0a8e5ab443a03c617d0d36630d7db661f5b680 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:35:28 +0800 Subject: [PATCH 17/59] Add keyboard --- darkproject/kd83a_bfg_edition/config.h | 136 +++++++++ darkproject/kd83a_bfg_edition/halconf.h | 24 ++ darkproject/kd83a_bfg_edition/info.json | 104 +++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.c | 288 ++++++++++++++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ++++ .../keymaps/default/keymap.c | 46 +++ .../keymaps/default/readme.md | 1 + .../kd83a_bfg_edition/keymaps/via/keymap.c | 184 +++++++++++ .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 + darkproject/kd83a_bfg_edition/mcuconf.h | 25 ++ darkproject/kd83a_bfg_edition/readme.md | 23 ++ darkproject/kd83a_bfg_edition/rules.mk | 23 ++ 12 files changed, 910 insertions(+) create mode 100644 darkproject/kd83a_bfg_edition/config.h create mode 100644 darkproject/kd83a_bfg_edition/halconf.h create mode 100644 darkproject/kd83a_bfg_edition/info.json create mode 100644 darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c create mode 100644 darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h create mode 100644 darkproject/kd83a_bfg_edition/keymaps/default/keymap.c create mode 100644 darkproject/kd83a_bfg_edition/keymaps/default/readme.md create mode 100644 darkproject/kd83a_bfg_edition/keymaps/via/keymap.c create mode 100644 darkproject/kd83a_bfg_edition/keymaps/via/rules.mk create mode 100644 darkproject/kd83a_bfg_edition/mcuconf.h create mode 100644 darkproject/kd83a_bfg_edition/readme.md create mode 100644 darkproject/kd83a_bfg_edition/rules.mk diff --git a/darkproject/kd83a_bfg_edition/config.h b/darkproject/kd83a_bfg_edition/config.h new file mode 100644 index 000000000000..96996fdb5097 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/config.h @@ -0,0 +1,136 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0002 +#define VENDOR_ID 0x342D +#define PRODUCT_ID 0xE392 +#define MANUFACTURER GSKY +#define PRODUCT KD83A_BFG_Edition + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 1 +#define BOOTMAGIC_LITE_COLUMN 3 + +#define TAP_CODE_DELAY 10 + +/* 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 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 68 +#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +#define RGB_MATRIX_CENTER { 87, 22 } + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO diff --git a/darkproject/kd83a_bfg_edition/halconf.h b/darkproject/kd83a_bfg_edition/halconf.h new file mode 100644 index 000000000000..a041a06f75bc --- /dev/null +++ b/darkproject/kd83a_bfg_edition/halconf.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/darkproject/kd83a_bfg_edition/info.json b/darkproject/kd83a_bfg_edition/info.json new file mode 100644 index 000000000000..a3a6967dfbd1 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/info.json @@ -0,0 +1,104 @@ +{ + "keyboard_name": "KD83A_BFG_Edition", + "url": "", + "maintainer": "GSKY", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Del", "x": 15.5, "y": 0 }, + { "label": "z1", "x": 16.25, "y": 0 }, + { "label": "z2", "x": 17.25, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Home", "x": 15.5, "y": 1 }, + + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "End", "x": 15.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + { "label": "PgUp", "x": 15.5, "y": 3 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + { "label": "PgDn", "x": 15.5, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "Ctrl", "x": 12, "y": 5 }, + { "label": "Left", "x": 13.25, "y": 5 }, + { "label": "Down", "x": 14.25, "y": 5 }, + { "label": "Right", "x": 15.25, "y": 5 }, + + + ] + } + } +} diff --git a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c new file mode 100644 index 000000000000..332cd5411a58 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -0,0 +1,288 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd83a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc + + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right + + {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 + {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 +}; + +#define __ NO_LED +//#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + +{ + { 59, __, 14, 80, 79, 82, 73, 5}, + { 31, 30, 46, 0, 60, 58, 15, 16}, + { 32, 45, 47, __, 61, 72, 1 , 17}, + { 33, 3, 48, 4, 62, 71, 2, 18}, + { 34, 35, 49, 50, 63, 64, 20, 19}, + { 37, 36, 52, 51, 66, 65, 21, 22}, + { 38, 42, 53, 6, 67, 44, 27, 23}, + { 39, 7, 54, 81, 68, __, 8, 24}, + { 40, 41, 55, 56, __, 69, 26, 25}, + { 74, 70, 78, 75, 76, 77, __, 13}, + { __, 28, 43, 11, 57, 12, 9, 10}, + { 83, __, __, __, __, __, __, __}, + { __, __, __, __, __, __, 29, __}, + { 84, __, __, __, __, __, __, __} +}, +{ + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, Del + + { 11, 11}, // 15, k01, ` + { 22, 11}, // 16, k11, 1 + { 33, 11}, // 17, k21, 2 + { 44, 11}, // 18, k31, 3 + { 55, 11}, // 19, k41, 4 + { 66, 11}, // 20, k51, 5 + { 77, 11}, // 21, k61, 6 + { 88, 11}, // 22, k71, 7 + { 99, 11}, // 23, k81, 8 + { 110, 11}, // 24, k91, 9 + { 121, 11}, // 25, ka1, 0 + { 132, 11}, // 26, kb1, - + { 143, 11}, // 27, kc1, = + { 154, 11}, // 28, kd1, Backspace + { 165, 11}, // 29, k16, Home + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, End + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + { 165, 33}, // 58, k26, PgUp + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + { 165, 44}, // 72, k36, PgDn + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 79, kc5, Ctrl_R + { 143, 55}, // 80, k07, Left + { 154, 55}, // 81, k27, Down + { 165, 55}, // 82, k37, Right + + { 0, 18}, // 83, Z1 + { 0, 24}, // 84, Z2 +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, +} +}; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif + +#ifdef ENCODER_ENABLE + +bool encoder_update_kb(uint8_t index, bool clockwise) { + + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + return true; +} +#endif + diff --git a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h new file mode 100644 index 000000000000..4e3cb0fc0374 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -0,0 +1,55 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +#define ___ KC_NO + + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 +// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home +// Tab Q W E R T Y U I O P [ ] \\ End +// Caps A S D F G H J K L ; ' Enter PgUp +// Sh_L Z X C V B N M , . / Sh_R Up PgDn +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + + +#define LAYOUT( \ + k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ + k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ + k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ + k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ + k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ + k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ +)\ +{\ + { k00, ___, k02, k03, k04, k05, k06, k07},\ + { k10, k11, k12, k13, k14, k15, k16, k17},\ + { k20, k21, k22, ___, k24, k25, k26, k27},\ + { k30, k31, k32, k33, k34, k35, k36, k37},\ + { k40, k41, k42, k43, k44, k45, k46, k47},\ + { k50, k51, k52, k53, k54, k55, k56, k57},\ + { k60, k61, k62, k63, k64, k65, k66, k67},\ + { k70, k71, k72, k73, k74, ___, k76, k77},\ + { k80, k81, k82, k83, ___, k85, k86, k87},\ + { k90, k91, k92, k93, k94, k95, ___, k97},\ + { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ + { kb0, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, ___, ___, kc6, ___},\ + { kd0, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..a7c288859a63 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) +}; diff --git a/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/darkproject/kd83a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1bdbac95804d --- /dev/null +++ b/darkproject/kd83a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD83A_BFG_Edition Layout diff --git a/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..edf93a9f7f65 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,184 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H +int winlockled = 1; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); + //tap_code16(KC_1); + //rgblight_step(); + } else { + host_consumer_send(0); + //rgblight_step(); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_consumer_send(0xCF); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_system_send(0x9B); + // rgblight_step_reverse(); + } else { + host_system_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case GUI_TOG: + if (record->event.pressed) { + + if (winlockled == 0) { + + setPinInputLow(C15); + winlockled = 1; + + } else { + + setPinInputHigh(C15); + winlockled = 0; + + } + + } + return true; /* Skip all further processing of this key */ + + default: + return true; /* Process all other keycodes normally */ + } + + +} + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +void rgb_matrix_indicators_user(void) { + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + setPinInputHigh (C14); + } + else { + setPinInputLow (C14); + } + + + if (IS_LAYER_ON(0)) { + setPinInputLow (C0); + } + if (IS_LAYER_ON(1)) { + setPinInputHigh (C0); + } +} \ No newline at end of file diff --git a/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/darkproject/kd83a_bfg_edition/mcuconf.h b/darkproject/kd83a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..440f78d2bc27 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/darkproject/kd83a_bfg_edition/readme.md b/darkproject/kd83a_bfg_edition/readme.md new file mode 100644 index 000000000000..83fb3e390752 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD83A_BFG_Edition + +An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD83A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd83a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd83a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/darkproject/kd83a_bfg_edition/rules.mk b/darkproject/kd83a_bfg_edition/rules.mk new file mode 100644 index 000000000000..2914f6ffd9c0 --- /dev/null +++ b/darkproject/kd83a_bfg_edition/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = WB32F3G71 + +# Bootloader selection +BOOTLOADER = wb32-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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = AW20216 +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash From 273d1da31a89239fd1c6c8562ef7f64bda2e863d Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:41:40 +0800 Subject: [PATCH 18/59] Add keyboard --- .../darkproject/kd83a_bfg_edition/config.h | 136 +++++++++ .../darkproject/kd83a_bfg_edition/halconf.h | 24 ++ .../darkproject/kd83a_bfg_edition/info.json | 104 +++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.c | 288 ++++++++++++++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ++++ .../keymaps/default/keymap.c | 46 +++ .../keymaps/default/readme.md | 1 + .../kd83a_bfg_edition/keymaps/via/keymap.c | 184 +++++++++++ .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 + .../darkproject/kd83a_bfg_edition/mcuconf.h | 25 ++ .../darkproject/kd83a_bfg_edition/readme.md | 23 ++ .../darkproject/kd83a_bfg_edition/rules.mk | 23 ++ 12 files changed, 910 insertions(+) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/config.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/halconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/info.json create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk create mode 100644 keyboards/darkproject/kd83a_bfg_edition/mcuconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h new file mode 100644 index 000000000000..96996fdb5097 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -0,0 +1,136 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0002 +#define VENDOR_ID 0x342D +#define PRODUCT_ID 0xE392 +#define MANUFACTURER GSKY +#define PRODUCT KD83A_BFG_Edition + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 1 +#define BOOTMAGIC_LITE_COLUMN 3 + +#define TAP_CODE_DELAY 10 + +/* 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 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 68 +#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +#define RGB_MATRIX_CENTER { 87, 22 } + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/halconf.h new file mode 100644 index 000000000000..a041a06f75bc --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/halconf.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json new file mode 100644 index 000000000000..a3a6967dfbd1 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -0,0 +1,104 @@ +{ + "keyboard_name": "KD83A_BFG_Edition", + "url": "", + "maintainer": "GSKY", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Del", "x": 15.5, "y": 0 }, + { "label": "z1", "x": 16.25, "y": 0 }, + { "label": "z2", "x": 17.25, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Home", "x": 15.5, "y": 1 }, + + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "End", "x": 15.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + { "label": "PgUp", "x": 15.5, "y": 3 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + { "label": "PgDn", "x": 15.5, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "Ctrl", "x": 12, "y": 5 }, + { "label": "Left", "x": 13.25, "y": 5 }, + { "label": "Down", "x": 14.25, "y": 5 }, + { "label": "Right", "x": 15.25, "y": 5 }, + + + ] + } + } +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c new file mode 100644 index 000000000000..332cd5411a58 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -0,0 +1,288 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd83a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc + + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right + + {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 + {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 +}; + +#define __ NO_LED +//#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + +{ + { 59, __, 14, 80, 79, 82, 73, 5}, + { 31, 30, 46, 0, 60, 58, 15, 16}, + { 32, 45, 47, __, 61, 72, 1 , 17}, + { 33, 3, 48, 4, 62, 71, 2, 18}, + { 34, 35, 49, 50, 63, 64, 20, 19}, + { 37, 36, 52, 51, 66, 65, 21, 22}, + { 38, 42, 53, 6, 67, 44, 27, 23}, + { 39, 7, 54, 81, 68, __, 8, 24}, + { 40, 41, 55, 56, __, 69, 26, 25}, + { 74, 70, 78, 75, 76, 77, __, 13}, + { __, 28, 43, 11, 57, 12, 9, 10}, + { 83, __, __, __, __, __, __, __}, + { __, __, __, __, __, __, 29, __}, + { 84, __, __, __, __, __, __, __} +}, +{ + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, Del + + { 11, 11}, // 15, k01, ` + { 22, 11}, // 16, k11, 1 + { 33, 11}, // 17, k21, 2 + { 44, 11}, // 18, k31, 3 + { 55, 11}, // 19, k41, 4 + { 66, 11}, // 20, k51, 5 + { 77, 11}, // 21, k61, 6 + { 88, 11}, // 22, k71, 7 + { 99, 11}, // 23, k81, 8 + { 110, 11}, // 24, k91, 9 + { 121, 11}, // 25, ka1, 0 + { 132, 11}, // 26, kb1, - + { 143, 11}, // 27, kc1, = + { 154, 11}, // 28, kd1, Backspace + { 165, 11}, // 29, k16, Home + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, End + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + { 165, 33}, // 58, k26, PgUp + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + { 165, 44}, // 72, k36, PgDn + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 79, kc5, Ctrl_R + { 143, 55}, // 80, k07, Left + { 154, 55}, // 81, k27, Down + { 165, 55}, // 82, k37, Right + + { 0, 18}, // 83, Z1 + { 0, 24}, // 84, Z2 +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, +} +}; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif + +#ifdef ENCODER_ENABLE + +bool encoder_update_kb(uint8_t index, bool clockwise) { + + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + return true; +} +#endif + diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h new file mode 100644 index 000000000000..4e3cb0fc0374 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -0,0 +1,55 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +#define ___ KC_NO + + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 +// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home +// Tab Q W E R T Y U I O P [ ] \\ End +// Caps A S D F G H J K L ; ' Enter PgUp +// Sh_L Z X C V B N M , . / Sh_R Up PgDn +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + + +#define LAYOUT( \ + k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ + k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ + k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ + k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ + k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ + k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ +)\ +{\ + { k00, ___, k02, k03, k04, k05, k06, k07},\ + { k10, k11, k12, k13, k14, k15, k16, k17},\ + { k20, k21, k22, ___, k24, k25, k26, k27},\ + { k30, k31, k32, k33, k34, k35, k36, k37},\ + { k40, k41, k42, k43, k44, k45, k46, k47},\ + { k50, k51, k52, k53, k54, k55, k56, k57},\ + { k60, k61, k62, k63, k64, k65, k66, k67},\ + { k70, k71, k72, k73, k74, ___, k76, k77},\ + { k80, k81, k82, k83, ___, k85, k86, k87},\ + { k90, k91, k92, k93, k94, k95, ___, k97},\ + { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ + { kb0, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, ___, ___, kc6, ___},\ + { kd0, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..a7c288859a63 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) +}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1bdbac95804d --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD83A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..edf93a9f7f65 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,184 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H +int winlockled = 1; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); + //tap_code16(KC_1); + //rgblight_step(); + } else { + host_consumer_send(0); + //rgblight_step(); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_consumer_send(0xCF); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_system_send(0x9B); + // rgblight_step_reverse(); + } else { + host_system_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case GUI_TOG: + if (record->event.pressed) { + + if (winlockled == 0) { + + setPinInputLow(C15); + winlockled = 1; + + } else { + + setPinInputHigh(C15); + winlockled = 0; + + } + + } + return true; /* Skip all further processing of this key */ + + default: + return true; /* Process all other keycodes normally */ + } + + +} + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +void rgb_matrix_indicators_user(void) { + if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { + setPinInputHigh (C14); + } + else { + setPinInputLow (C14); + } + + + if (IS_LAYER_ON(0)) { + setPinInputLow (C0); + } + if (IS_LAYER_ON(1)) { + setPinInputHigh (C0); + } +} \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..440f78d2bc27 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md new file mode 100644 index 000000000000..83fb3e390752 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD83A_BFG_Edition + +An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD83A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd83a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd83a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk new file mode 100644 index 000000000000..2914f6ffd9c0 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = WB32F3G71 + +# Bootloader selection +BOOTLOADER = wb32-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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = AW20216 +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash From 4f3f6c9559543c5ed3d91eaec29b29cb96799203 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:51:44 +0800 Subject: [PATCH 19/59] Delete darkproject/kd83a_bfg_edition directory --- darkproject/kd83a_bfg_edition/config.h | 136 --------- darkproject/kd83a_bfg_edition/halconf.h | 24 -- darkproject/kd83a_bfg_edition/info.json | 104 ------- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 288 ------------------ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ---- .../keymaps/default/keymap.c | 46 --- .../keymaps/default/readme.md | 1 - .../kd83a_bfg_edition/keymaps/via/keymap.c | 184 ----------- .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 - darkproject/kd83a_bfg_edition/mcuconf.h | 25 -- darkproject/kd83a_bfg_edition/readme.md | 23 -- darkproject/kd83a_bfg_edition/rules.mk | 23 -- 12 files changed, 910 deletions(-) delete mode 100644 darkproject/kd83a_bfg_edition/config.h delete mode 100644 darkproject/kd83a_bfg_edition/halconf.h delete mode 100644 darkproject/kd83a_bfg_edition/info.json delete mode 100644 darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c delete mode 100644 darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h delete mode 100644 darkproject/kd83a_bfg_edition/keymaps/default/keymap.c delete mode 100644 darkproject/kd83a_bfg_edition/keymaps/default/readme.md delete mode 100644 darkproject/kd83a_bfg_edition/keymaps/via/keymap.c delete mode 100644 darkproject/kd83a_bfg_edition/keymaps/via/rules.mk delete mode 100644 darkproject/kd83a_bfg_edition/mcuconf.h delete mode 100644 darkproject/kd83a_bfg_edition/readme.md delete mode 100644 darkproject/kd83a_bfg_edition/rules.mk diff --git a/darkproject/kd83a_bfg_edition/config.h b/darkproject/kd83a_bfg_edition/config.h deleted file mode 100644 index 96996fdb5097..000000000000 --- a/darkproject/kd83a_bfg_edition/config.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -/* USB Device descriptor parameter */ -#define DEVICE_VER 0x0002 -#define VENDOR_ID 0x342D -#define PRODUCT_ID 0xE392 -#define MANUFACTURER GSKY -#define PRODUCT KD83A_BFG_Edition - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -/* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 1 -#define BOOTMAGIC_LITE_COLUMN 3 - -#define TAP_CODE_DELAY 10 - -/* 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 - -#define RGB_DISABLE_WHEN_USB_SUSPENDED - -/* External spi flash */ -#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 -#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) - -/* SPI Config for LED Driver */ -#define SPI_DRIVER SPIDQ -#define SPI_SCK_PIN A5 -#define SPI_MOSI_PIN A7 -#define SPI_MISO_PIN A6 - -#define DRIVER_1_CS A15 -#define DRIVER_2_CS B15 -#define DRIVER_1_EN C13 -#define DRIVER_2_EN C13 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 68 -#define DRIVER_2_LED_TOTAL 54 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -#define RGB_MATRIX_CENTER { 87, 22 } - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO diff --git a/darkproject/kd83a_bfg_edition/halconf.h b/darkproject/kd83a_bfg_edition/halconf.h deleted file mode 100644 index a041a06f75bc..000000000000 --- a/darkproject/kd83a_bfg_edition/halconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next - diff --git a/darkproject/kd83a_bfg_edition/info.json b/darkproject/kd83a_bfg_edition/info.json deleted file mode 100644 index a3a6967dfbd1..000000000000 --- a/darkproject/kd83a_bfg_edition/info.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "keyboard_name": "KD83A_BFG_Edition", - "url": "", - "maintainer": "GSKY", - "layouts": { - "LAYOUT": { - "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Del", "x": 15.5, "y": 0 }, - { "label": "z1", "x": 16.25, "y": 0 }, - { "label": "z2", "x": 17.25, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Home", "x": 15.5, "y": 1 }, - - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "End", "x": 15.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - { "label": "PgUp", "x": 15.5, "y": 3 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - { "label": "PgDn", "x": 15.5, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "Ctrl", "x": 12, "y": 5 }, - { "label": "Left", "x": 13.25, "y": 5 }, - { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 }, - - - ] - } - } -} diff --git a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c deleted file mode 100644 index 332cd5411a58..000000000000 --- a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include "kd83a_bfg_edition.h" - -#ifdef RGB_MATRIX_ENABLE - -const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc - - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home - - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right - - {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 - {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 -}; - -#define __ NO_LED -//#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - -{ - { 59, __, 14, 80, 79, 82, 73, 5}, - { 31, 30, 46, 0, 60, 58, 15, 16}, - { 32, 45, 47, __, 61, 72, 1 , 17}, - { 33, 3, 48, 4, 62, 71, 2, 18}, - { 34, 35, 49, 50, 63, 64, 20, 19}, - { 37, 36, 52, 51, 66, 65, 21, 22}, - { 38, 42, 53, 6, 67, 44, 27, 23}, - { 39, 7, 54, 81, 68, __, 8, 24}, - { 40, 41, 55, 56, __, 69, 26, 25}, - { 74, 70, 78, 75, 76, 77, __, 13}, - { __, 28, 43, 11, 57, 12, 9, 10}, - { 83, __, __, __, __, __, __, __}, - { __, __, __, __, __, __, 29, __}, - { 84, __, __, __, __, __, __, __} -}, -{ - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Del - - { 11, 11}, // 15, k01, ` - { 22, 11}, // 16, k11, 1 - { 33, 11}, // 17, k21, 2 - { 44, 11}, // 18, k31, 3 - { 55, 11}, // 19, k41, 4 - { 66, 11}, // 20, k51, 5 - { 77, 11}, // 21, k61, 6 - { 88, 11}, // 22, k71, 7 - { 99, 11}, // 23, k81, 8 - { 110, 11}, // 24, k91, 9 - { 121, 11}, // 25, ka1, 0 - { 132, 11}, // 26, kb1, - - { 143, 11}, // 27, kc1, = - { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Home - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, End - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - { 165, 33}, // 58, k26, PgUp - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - { 165, 44}, // 72, k36, PgDn - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 79, kc5, Ctrl_R - { 143, 55}, // 80, k07, Left - { 154, 55}, // 81, k27, Down - { 165, 55}, // 82, k37, Right - - { 0, 18}, // 83, Z1 - { 0, 24}, // 84, Z2 -}, -{ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, -} -}; -#endif - -#ifdef EEPROM_ENABLE - -#include "spi_master.h" - -void spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -#endif - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} -#endif - diff --git a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h deleted file mode 100644 index 4e3cb0fc0374..000000000000 --- a/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - - -// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 -// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home -// Tab Q W E R T Y U I O P [ ] \\ End -// Caps A S D F G H J K L ; ' Enter PgUp -// Sh_L Z X C V B N M , . / Sh_R Up PgDn -// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right - - -#define LAYOUT( \ - k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ - k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ - k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ - k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ - k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ - k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ -)\ -{\ - { k00, ___, k02, k03, k04, k05, k06, k07},\ - { k10, k11, k12, k13, k14, k15, k16, k17},\ - { k20, k21, k22, ___, k24, k25, k26, k27},\ - { k30, k31, k32, k33, k34, k35, k36, k37},\ - { k40, k41, k42, k43, k44, k45, k46, k47},\ - { k50, k51, k52, k53, k54, k55, k56, k57},\ - { k60, k61, k62, k63, k64, k65, k66, k67},\ - { k70, k71, k72, k73, k74, ___, k76, k77},\ - { k80, k81, k82, k83, ___, k85, k86, k87},\ - { k90, k91, k92, k93, k94, k95, ___, k97},\ - { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ - { kb0, ___, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, ___, ___, kc6, ___},\ - { kd0, ___, ___, ___, ___, ___, ___, ___} \ -} diff --git a/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c deleted file mode 100644 index a7c288859a63..000000000000 --- a/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - _BL, - _FL, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) -}; diff --git a/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/darkproject/kd83a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1bdbac95804d..000000000000 --- a/darkproject/kd83a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD83A_BFG_Edition Layout diff --git a/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c deleted file mode 100644 index edf93a9f7f65..000000000000 --- a/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H -int winlockled = 1; - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, - KC_DND, - KC_SPOT, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - //add_weak_mods(MOD_BIT(KC_1)); - //tap_code16(KC_1); - //rgblight_step(); - } else { - host_consumer_send(0); - //rgblight_step(); - } - return false; /* Skip all further processing of this key */ - - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SIRI: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_consumer_send(0xCF); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_system_send(0x9B); - // rgblight_step_reverse(); - } else { - host_system_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case GUI_TOG: - if (record->event.pressed) { - - if (winlockled == 0) { - - setPinInputLow(C15); - winlockled = 1; - - } else { - - setPinInputHigh(C15); - winlockled = 0; - - } - - } - return true; /* Skip all further processing of this key */ - - default: - return true; /* Process all other keycodes normally */ - } - - -} - -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; - -void rgb_matrix_indicators_user(void) { - if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { - setPinInputHigh (C14); - } - else { - setPinInputLow (C14); - } - - - if (IS_LAYER_ON(0)) { - setPinInputLow (C0); - } - if (IS_LAYER_ON(1)) { - setPinInputHigh (C0); - } -} \ No newline at end of file diff --git a/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/darkproject/kd83a_bfg_edition/mcuconf.h b/darkproject/kd83a_bfg_edition/mcuconf.h deleted file mode 100644 index 440f78d2bc27..000000000000 --- a/darkproject/kd83a_bfg_edition/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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 - -#undef WB32_SPI_USE_QSPI -#define WB32_SPI_USE_QSPI TRUE - -#undef WB32_SPI_USE_SPIM2 -#define WB32_SPI_USE_SPIM2 TRUE diff --git a/darkproject/kd83a_bfg_edition/readme.md b/darkproject/kd83a_bfg_edition/readme.md deleted file mode 100644 index 83fb3e390752..000000000000 --- a/darkproject/kd83a_bfg_edition/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# KD83A_BFG_Edition - -An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller - -* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) -* Hardware Supported: KD83A_BFG_Edition -* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) - -Make example for this keyboard (after setting up your build environment): - - make darkproject/kd83a_bfg_edition:default - -Flashing example for this keyboard: - - make darkproject/kd83a_bfg_edition:default:flash - -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - -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). diff --git a/darkproject/kd83a_bfg_edition/rules.mk b/darkproject/kd83a_bfg_edition/rules.mk deleted file mode 100644 index 2914f6ffd9c0..000000000000 --- a/darkproject/kd83a_bfg_edition/rules.mk +++ /dev/null @@ -1,23 +0,0 @@ -# MCU name -MCU = WB32F3G71 - -# Bootloader selection -BOOTLOADER = wb32-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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = AW20216 -EEPROM_DRIVER = wear_leveling -WEAR_LEVELING_DRIVER = spi_flash From 4773980a6a7837da91273044fb58cd9306d55096 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:34:27 +0800 Subject: [PATCH 20/59] Resolved Changes --- keyboards/darkproject/kd83a_bfg_edition/config.h | 10 +++++----- keyboards/darkproject/kd83a_bfg_edition/info.json | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 96996fdb5097..e6404691dbda 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -19,11 +19,11 @@ #include "config_common.h" /* USB Device descriptor parameter */ -#define DEVICE_VER 0x0002 -#define VENDOR_ID 0x342D -#define PRODUCT_ID 0xE392 -#define MANUFACTURER GSKY -#define PRODUCT KD83A_BFG_Edition +// #define DEVICE_VER 0x0002 +// #define VENDOR_ID 0x342D +// #define PRODUCT_ID 0xE392 +// #define MANUFACTURER GSKY +// #define PRODUCT KD83A_BFG_Edition #define DYNAMIC_KEYMAP_LAYER_COUNT 4 diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index a3a6967dfbd1..0fd4282e6412 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -1,7 +1,13 @@ { - "keyboard_name": "KD83A_BFG_Edition", + "keyboard_name": "kd83a_bfg_edition", + "manufacturer": "kd83a_bfg_edition", "url": "", - "maintainer": "GSKY", + "maintainer": "Gsky", + "usb": { + "vid": "0x342D", + "pid": "0xE392", + "device_version": "0.0.3" + }, "layouts": { "LAYOUT": { "layout": [ @@ -95,7 +101,7 @@ { "label": "Ctrl", "x": 12, "y": 5 }, { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 }, + { "label": "Right", "x": 15.25, "y": 5 } ] From e79a657e29d1a2abd459f218696879281ea2f3e1 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:32:16 +0800 Subject: [PATCH 21/59] Resolved requested changes --- keyboards/darkproject/kd83a_bfg_edition/config.h | 7 ------- keyboards/darkproject/kd83a_bfg_edition/info.json | 6 +++--- .../darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 10 ++++------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index e6404691dbda..af46990b90e4 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -18,13 +18,6 @@ #include "config_common.h" -/* USB Device descriptor parameter */ -// #define DEVICE_VER 0x0002 -// #define VENDOR_ID 0x342D -// #define PRODUCT_ID 0xE392 -// #define MANUFACTURER GSKY -// #define PRODUCT KD83A_BFG_Edition - #define DYNAMIC_KEYMAP_LAYER_COUNT 4 /* key matrix size */ diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 0fd4282e6412..9e10ee1cd4c8 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -1,12 +1,12 @@ { - "keyboard_name": "kd83a_bfg_edition", - "manufacturer": "kd83a_bfg_edition", + "keyboard_name": "KD83A_BFG_Edition", + "manufacturer": "GSKY", "url": "", "maintainer": "Gsky", "usb": { "vid": "0x342D", "pid": "0xE392", - "device_version": "0.0.3" + "device_version": "0.0.2" }, "layouts": { "LAYOUT": { diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index edf93a9f7f65..bc3d558e4484 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2022 GSKY +/* Copyright 2021 Glorious, LLC * * 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 @@ -167,15 +167,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void rgb_matrix_indicators_user(void) { - if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { - setPinInputHigh (C14); + if (host_keyboard_led_state().caps_lock) { + setPinInputHigh (C14); } else { setPinInputLow (C14); } - - - if (IS_LAYER_ON(0)) { + if (IS_LAYER_ON(0)) { setPinInputLow (C0); } if (IS_LAYER_ON(1)) { From c89ae6be83f4a6b7d7785981750f8bf6f97ff495 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:30:57 +0800 Subject: [PATCH 22/59] keyboard --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index bc3d558e4484..71f30cba83b9 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 Glorious, LLC +/* Copyright 2022 GSKY * * 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 From 45d803f8bac606d2a057daa49bf3ca8522e235ac Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 3 Nov 2022 18:53:06 +0800 Subject: [PATCH 23/59] Add keyboard --- .../darkproject/kd87a_bfg_edition/config.h | 129 ++++++++ .../darkproject/kd87a_bfg_edition/halconf.h | 24 ++ .../darkproject/kd87a_bfg_edition/info.json | 110 +++++++ .../kd87a_bfg_edition/kd87a_bfg_edition.c | 294 ++++++++++++++++++ .../kd87a_bfg_edition/kd87a_bfg_edition.h | 47 +++ .../keymaps/default/keymap.c | 46 +++ .../keymaps/default/readme.md | 1 + .../kd87a_bfg_edition/keymaps/via/keymap.c | 184 +++++++++++ .../kd87a_bfg_edition/keymaps/via/rules.mk | 1 + .../darkproject/kd87a_bfg_edition/mcuconf.h | 25 ++ .../darkproject/kd87a_bfg_edition/readme.md | 23 ++ .../darkproject/kd87a_bfg_edition/rules.mk | 23 ++ 12 files changed, 907 insertions(+) create mode 100644 keyboards/darkproject/kd87a_bfg_edition/config.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/halconf.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/info.json create mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk create mode 100644 keyboards/darkproject/kd87a_bfg_edition/mcuconf.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/readme.md create mode 100644 keyboards/darkproject/kd87a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd87a_bfg_edition/config.h b/keyboards/darkproject/kd87a_bfg_edition/config.h new file mode 100644 index 000000000000..af46990b90e4 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/config.h @@ -0,0 +1,129 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 1 +#define BOOTMAGIC_LITE_COLUMN 3 + +#define TAP_CODE_DELAY 10 + +/* 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 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 68 +#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +#define RGB_MATRIX_CENTER { 87, 22 } + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd87a_bfg_edition/halconf.h b/keyboards/darkproject/kd87a_bfg_edition/halconf.h new file mode 100644 index 000000000000..a041a06f75bc --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/halconf.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/keyboards/darkproject/kd87a_bfg_edition/info.json b/keyboards/darkproject/kd87a_bfg_edition/info.json new file mode 100644 index 000000000000..68f290034178 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/info.json @@ -0,0 +1,110 @@ +{ + "keyboard_name": "KD87A_BFG_Edition", + "manufacturer": "GSKY", + "url": "", + "maintainer": "Gsky", + "usb": { + "vid": "0x342D", + "pid": "0xE393", + "device_version": "0.0.3" + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Scrolllock", "x": 15, "y": 0 }, + { "label": "Pausebreak", "x": 16, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Insert", "x": 15.5, "y": 1 }, + { "label": "Home", "x": 16.5, "y": 1 }, + { "label": "Pageup", "x": 17.5, "y": 1 }, + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "Delete", "x": 15.5, "y": 2 }, + { "label": "End", "x": 16.5, "y": 2 }, + { "label": "Pagedown", "x": 17.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "App", "x": 12, "y": 5 }, + { "label": "Ctrl", "x": 13, "y": 5 }, + { "label": "Left", "x": 14.25, "y": 5 }, + { "label": "Down", "x": 15.25, "y": 5 }, + { "label": "Right", "x": 16.25, "y": 5 } + + ] + } + } +} diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c new file mode 100644 index 000000000000..8b23bd2828f9 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c @@ -0,0 +1,294 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd87a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc + + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS1_SW3, CS2_SW3, CS3_SW3}, // 14, ke0, ScrollLock + {1, CS1_SW4, CS2_SW4, CS3_SW4}, // 15, kf0, PauseBreak + + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 16, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 17, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 18, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 20, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 21, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 22, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 23, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 24, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 25, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 26, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 27, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 28, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 29, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 30, ke6, Insert + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 31, kf6, Home + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 32, kf6, Pageup + + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 33, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 34, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 35, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 36, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 37, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 38, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 39, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 40, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 41, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 42, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 43, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 44, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 45, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 46, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 47, ke3, Delete + {1, CS4_SW6, CS5_SW6, CS6_SW6}, // 48, k06, End + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 49, k16, Pagedown + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 50, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 51, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 52, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 53, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 54, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 55, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 56, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 57, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 58, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 59, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 60, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 61, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 62, kc3, Enter + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 63, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 64, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 65, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 66, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 67, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 68, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 69, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 70, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 71, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 72, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 73, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 74, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 75, k17, Up + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 76, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 77, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 78, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 79, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 80, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 81, ka5, FN + {0, CS16_SW11, CS17_SW11, CS18_SW11}, // 82, ka5, App + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 83, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 84, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 85, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 86, k37, Right +}; + +#define __ NO_LED +//#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + +{ + { 63, __, 31, 84, 83, 86, 76, 5}, + { 34, 33, 51, 0, 64, 32, 16, 17}, + { 35, 50, 52, __, 65, 49, 1, 18}, + { 36, 3, 53, 4, 66, 75, 2, 19}, + { 37, 38, 54, 55, 67, 68, 21, 20}, + { 40, 39, 57, 56, 70, 69, 22, 23}, + { 41, 45, 58, 6, 71, 47, 28, 24}, + { 42, 7, 59, 85, 72, 48, 8, 25}, + { 43, 44, 60, 61, 82, 73, 27, 26}, + { 77, 74, 81, 78, 79, 80, 15, 13}, + { 14, 29, 46, 11, 62, 12, 9, 10}, + { __, __, __, __, __, __, __, __}, + { __, __, __, __, __, __, 30, __}, + { __, __, __, __, __, __, __, __} +}, +{ + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, SL + { 175, 0}, // 15, k56, PB + + + { 11, 11}, // 16, k01, ` + { 22, 11}, // 17, k11, 1 + { 33, 11}, // 18, k21, 2 + { 44, 11}, // 19, k31, 3 + { 55, 11}, // 20, k41, 4 + { 66, 11}, // 21, k51, 5 + { 77, 11}, // 22, k61, 6 + { 88, 11}, // 23, k71, 7 + { 99, 11}, // 24, k81, 8 + { 110, 11}, // 25, k91, 9 + { 121, 11}, // 26, ka1, 0 + { 132, 11}, // 27, kb1, - + { 143, 11}, // 28, kc1, = + { 154, 11}, // 29, kd1, Backspace + { 165, 11}, // 30, k16, Ins + { 175, 11}, // 31, k16, Home + { 185, 11}, // 32, k16, PGUP + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, Del + { 175, 22}, // 29, k16, END + { 185, 22}, // 29, k16, PGDN + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 29, k16, App + { 143, 55}, // 79, kc5, Ctrl_R + { 154, 55}, // 80, k07, Left + { 165, 55}, // 81, k27, Down + { 176, 55}, // 82, k37, Right +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +} +}; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif + +#ifdef ENCODER_ENABLE + +bool encoder_update_kb(uint8_t index, bool clockwise) { + + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + return true; +} +#endif + diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h new file mode 100644 index 000000000000..9163fc43e5c0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h @@ -0,0 +1,47 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +#define ___ KC_NO + + +#define LAYOUT( \ + k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, Ka0, k96, \ + k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, k02, k15, \ + k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, k75, k25, \ + k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, \ + k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, \ + k06, k90, k93, k94, k95, k92, k84, k04, k03, k73, k05 \ +)\ +{\ + { k00, ___, k02, k03, k04, k05, k06, k07},\ + { k10, k11, k12, k13, k14, k15, k16, k17},\ + { k20, k21, k22, ___, k24, k25, k26, k27},\ + { k30, k31, k32, k33, k34, k35, k36, k37},\ + { k40, k41, k42, k43, k44, k45, k46, k47},\ + { k50, k51, k52, k53, k54, k55, k56, k57},\ + { k60, k61, k62, k63, k64, k65, k66, k67},\ + { k70, k71, k72, k73, k74, k75, k76, k77},\ + { k80, k81, k82, k83, k84, k85, k86, k87},\ + { k90, k91, k92, k93, k94, k95, k96, k97},\ + { Ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ + { ___, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, ___, ___, kc6, ___},\ + { ___, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..a7c288859a63 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) +}; diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1cbba91b2145 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD87A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..7637b924e1a0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,184 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H +int winlockled = 1; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); + //tap_code16(KC_1); + //rgblight_step(); + } else { + host_consumer_send(0); + //rgblight_step(); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_consumer_send(0xCF); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_system_send(0x9B); + // rgblight_step_reverse(); + } else { + host_system_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case GUI_TOG: + if (record->event.pressed) { + + if (winlockled == 0) { + + setPinInputLow(C15); + winlockled = 1; + + } else { + + setPinInputHigh(C15); + winlockled = 0; + + } + + } + return true; /* Skip all further processing of this key */ + + default: + return true; /* Process all other keycodes normally */ + } + + +} + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_GESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_GESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +void rgb_matrix_indicators_user(void) { + if (host_keyboard_led_state().caps_lock) { + setPinInputHigh (C14); + } + else { + setPinInputLow (C14); + } + + + if (IS_LAYER_ON(0)) { + setPinInputLow (C0); + } + if (IS_LAYER_ON(1)) { + setPinInputHigh (C0); + } +} \ No newline at end of file diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..440f78d2bc27 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd87a_bfg_edition/readme.md b/keyboards/darkproject/kd87a_bfg_edition/readme.md new file mode 100644 index 000000000000..b563a84bb5c3 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD87A_BFG_Edition + +An 87 keys keyboard. Equipped with the WestBerry G7 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD87A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard1) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd87a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd87a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/keyboards/darkproject/kd87a_bfg_edition/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/rules.mk new file mode 100644 index 000000000000..2914f6ffd9c0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = WB32F3G71 + +# Bootloader selection +BOOTLOADER = wb32-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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = AW20216 +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash From 11e36a353bb6e0f7c064b9403a56432f44233102 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 3 Nov 2022 19:02:47 +0800 Subject: [PATCH 24/59] Delete keyboard --- .../darkproject/kd87a_bfg_edition/config.h | 129 -------- .../darkproject/kd87a_bfg_edition/halconf.h | 24 -- .../darkproject/kd87a_bfg_edition/info.json | 110 ------- .../kd87a_bfg_edition/kd87a_bfg_edition.c | 294 ------------------ .../kd87a_bfg_edition/kd87a_bfg_edition.h | 47 --- .../keymaps/default/keymap.c | 46 --- .../keymaps/default/readme.md | 1 - .../kd87a_bfg_edition/keymaps/via/keymap.c | 184 ----------- .../kd87a_bfg_edition/keymaps/via/rules.mk | 1 - .../darkproject/kd87a_bfg_edition/mcuconf.h | 25 -- .../darkproject/kd87a_bfg_edition/readme.md | 23 -- .../darkproject/kd87a_bfg_edition/rules.mk | 23 -- 12 files changed, 907 deletions(-) delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/config.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/halconf.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/info.json delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/mcuconf.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/readme.md delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd87a_bfg_edition/config.h b/keyboards/darkproject/kd87a_bfg_edition/config.h deleted file mode 100644 index af46990b90e4..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/config.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -/* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 1 -#define BOOTMAGIC_LITE_COLUMN 3 - -#define TAP_CODE_DELAY 10 - -/* 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 - -#define RGB_DISABLE_WHEN_USB_SUSPENDED - -/* External spi flash */ -#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 -#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) - -/* SPI Config for LED Driver */ -#define SPI_DRIVER SPIDQ -#define SPI_SCK_PIN A5 -#define SPI_MOSI_PIN A7 -#define SPI_MISO_PIN A6 - -#define DRIVER_1_CS A15 -#define DRIVER_2_CS B15 -#define DRIVER_1_EN C13 -#define DRIVER_2_EN C13 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 68 -#define DRIVER_2_LED_TOTAL 54 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -#define RGB_MATRIX_CENTER { 87, 22 } - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd87a_bfg_edition/halconf.h b/keyboards/darkproject/kd87a_bfg_edition/halconf.h deleted file mode 100644 index a041a06f75bc..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/halconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next - diff --git a/keyboards/darkproject/kd87a_bfg_edition/info.json b/keyboards/darkproject/kd87a_bfg_edition/info.json deleted file mode 100644 index 68f290034178..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/info.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "keyboard_name": "KD87A_BFG_Edition", - "manufacturer": "GSKY", - "url": "", - "maintainer": "Gsky", - "usb": { - "vid": "0x342D", - "pid": "0xE393", - "device_version": "0.0.3" - }, - "layouts": { - "LAYOUT": { - "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Scrolllock", "x": 15, "y": 0 }, - { "label": "Pausebreak", "x": 16, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Insert", "x": 15.5, "y": 1 }, - { "label": "Home", "x": 16.5, "y": 1 }, - { "label": "Pageup", "x": 17.5, "y": 1 }, - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "Delete", "x": 15.5, "y": 2 }, - { "label": "End", "x": 16.5, "y": 2 }, - { "label": "Pagedown", "x": 17.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "App", "x": 12, "y": 5 }, - { "label": "Ctrl", "x": 13, "y": 5 }, - { "label": "Left", "x": 14.25, "y": 5 }, - { "label": "Down", "x": 15.25, "y": 5 }, - { "label": "Right", "x": 16.25, "y": 5 } - - ] - } - } -} diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c deleted file mode 100644 index 8b23bd2828f9..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c +++ /dev/null @@ -1,294 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include "kd87a_bfg_edition.h" - -#ifdef RGB_MATRIX_ENABLE - -const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc - - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS1_SW3, CS2_SW3, CS3_SW3}, // 14, ke0, ScrollLock - {1, CS1_SW4, CS2_SW4, CS3_SW4}, // 15, kf0, PauseBreak - - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 16, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 17, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 18, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 20, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 21, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 22, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 23, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 24, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 25, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 26, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 27, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 28, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 29, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 30, ke6, Insert - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 31, kf6, Home - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 32, kf6, Pageup - - - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 33, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 34, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 35, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 36, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 37, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 38, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 39, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 40, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 41, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 42, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 43, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 44, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 45, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 46, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 47, ke3, Delete - {1, CS4_SW6, CS5_SW6, CS6_SW6}, // 48, k06, End - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 49, k16, Pagedown - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 50, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 51, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 52, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 53, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 54, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 55, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 56, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 57, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 58, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 59, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 60, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 61, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 62, kc3, Enter - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 63, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 64, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 65, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 66, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 67, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 68, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 69, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 70, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 71, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 72, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 73, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 74, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 75, k17, Up - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 76, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 77, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 78, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 79, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 80, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 81, ka5, FN - {0, CS16_SW11, CS17_SW11, CS18_SW11}, // 82, ka5, App - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 83, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 84, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 85, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 86, k37, Right -}; - -#define __ NO_LED -//#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - -{ - { 63, __, 31, 84, 83, 86, 76, 5}, - { 34, 33, 51, 0, 64, 32, 16, 17}, - { 35, 50, 52, __, 65, 49, 1, 18}, - { 36, 3, 53, 4, 66, 75, 2, 19}, - { 37, 38, 54, 55, 67, 68, 21, 20}, - { 40, 39, 57, 56, 70, 69, 22, 23}, - { 41, 45, 58, 6, 71, 47, 28, 24}, - { 42, 7, 59, 85, 72, 48, 8, 25}, - { 43, 44, 60, 61, 82, 73, 27, 26}, - { 77, 74, 81, 78, 79, 80, 15, 13}, - { 14, 29, 46, 11, 62, 12, 9, 10}, - { __, __, __, __, __, __, __, __}, - { __, __, __, __, __, __, 30, __}, - { __, __, __, __, __, __, __, __} -}, -{ - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, SL - { 175, 0}, // 15, k56, PB - - - { 11, 11}, // 16, k01, ` - { 22, 11}, // 17, k11, 1 - { 33, 11}, // 18, k21, 2 - { 44, 11}, // 19, k31, 3 - { 55, 11}, // 20, k41, 4 - { 66, 11}, // 21, k51, 5 - { 77, 11}, // 22, k61, 6 - { 88, 11}, // 23, k71, 7 - { 99, 11}, // 24, k81, 8 - { 110, 11}, // 25, k91, 9 - { 121, 11}, // 26, ka1, 0 - { 132, 11}, // 27, kb1, - - { 143, 11}, // 28, kc1, = - { 154, 11}, // 29, kd1, Backspace - { 165, 11}, // 30, k16, Ins - { 175, 11}, // 31, k16, Home - { 185, 11}, // 32, k16, PGUP - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, Del - { 175, 22}, // 29, k16, END - { 185, 22}, // 29, k16, PGDN - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 29, k16, App - { 143, 55}, // 79, kc5, Ctrl_R - { 154, 55}, // 80, k07, Left - { 165, 55}, // 81, k27, Down - { 176, 55}, // 82, k37, Right -}, -{ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -} -}; -#endif - -#ifdef EEPROM_ENABLE - -#include "spi_master.h" - -void spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -#endif - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} -#endif - diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h deleted file mode 100644 index 9163fc43e5c0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - - -#define LAYOUT( \ - k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, Ka0, k96, \ - k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, k02, k15, \ - k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, k75, k25, \ - k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, \ - k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, \ - k06, k90, k93, k94, k95, k92, k84, k04, k03, k73, k05 \ -)\ -{\ - { k00, ___, k02, k03, k04, k05, k06, k07},\ - { k10, k11, k12, k13, k14, k15, k16, k17},\ - { k20, k21, k22, ___, k24, k25, k26, k27},\ - { k30, k31, k32, k33, k34, k35, k36, k37},\ - { k40, k41, k42, k43, k44, k45, k46, k47},\ - { k50, k51, k52, k53, k54, k55, k56, k57},\ - { k60, k61, k62, k63, k64, k65, k66, k67},\ - { k70, k71, k72, k73, k74, k75, k76, k77},\ - { k80, k81, k82, k83, k84, k85, k86, k87},\ - { k90, k91, k92, k93, k94, k95, k96, k97},\ - { Ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ - { ___, ___, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, ___, ___, kc6, ___},\ - { ___, ___, ___, ___, ___, ___, ___, ___} \ -} diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c deleted file mode 100644 index a7c288859a63..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - _BL, - _FL, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) -}; diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1cbba91b2145..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD87A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c deleted file mode 100644 index 7637b924e1a0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H -int winlockled = 1; - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, - KC_DND, - KC_SPOT, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - //add_weak_mods(MOD_BIT(KC_1)); - //tap_code16(KC_1); - //rgblight_step(); - } else { - host_consumer_send(0); - //rgblight_step(); - } - return false; /* Skip all further processing of this key */ - - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SIRI: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_consumer_send(0xCF); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_system_send(0x9B); - // rgblight_step_reverse(); - } else { - host_system_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case GUI_TOG: - if (record->event.pressed) { - - if (winlockled == 0) { - - setPinInputLow(C15); - winlockled = 1; - - } else { - - setPinInputHigh(C15); - winlockled = 0; - - } - - } - return true; /* Skip all further processing of this key */ - - default: - return true; /* Process all other keycodes normally */ - } - - -} - -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_GESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_GESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; - -void rgb_matrix_indicators_user(void) { - if (host_keyboard_led_state().caps_lock) { - setPinInputHigh (C14); - } - else { - setPinInputLow (C14); - } - - - if (IS_LAYER_ON(0)) { - setPinInputLow (C0); - } - if (IS_LAYER_ON(1)) { - setPinInputHigh (C0); - } -} \ No newline at end of file diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h deleted file mode 100644 index 440f78d2bc27..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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 - -#undef WB32_SPI_USE_QSPI -#define WB32_SPI_USE_QSPI TRUE - -#undef WB32_SPI_USE_SPIM2 -#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd87a_bfg_edition/readme.md b/keyboards/darkproject/kd87a_bfg_edition/readme.md deleted file mode 100644 index b563a84bb5c3..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# KD87A_BFG_Edition - -An 87 keys keyboard. Equipped with the WestBerry G7 microcontroller - -* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) -* Hardware Supported: KD87A_BFG_Edition -* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard1) - -Make example for this keyboard (after setting up your build environment): - - make darkproject/kd87a_bfg_edition:default - -Flashing example for this keyboard: - - make darkproject/kd87a_bfg_edition:default:flash - -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - -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). diff --git a/keyboards/darkproject/kd87a_bfg_edition/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/rules.mk deleted file mode 100644 index 2914f6ffd9c0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/rules.mk +++ /dev/null @@ -1,23 +0,0 @@ -# MCU name -MCU = WB32F3G71 - -# Bootloader selection -BOOTLOADER = wb32-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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = AW20216 -EEPROM_DRIVER = wear_leveling -WEAR_LEVELING_DRIVER = spi_flash From 5d9043db00a2ab4159c9ed399e6ab41a3d9274f9 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 7 Nov 2022 09:26:02 +0800 Subject: [PATCH 25/59] Add keyboard --- .../darkproject/kd87a_bfg_edition/config.h | 129 ++++++++ .../darkproject/kd87a_bfg_edition/halconf.h | 24 ++ .../darkproject/kd87a_bfg_edition/info.json | 110 +++++++ .../kd87a_bfg_edition/kd87a_bfg_edition.c | 294 ++++++++++++++++++ .../kd87a_bfg_edition/kd87a_bfg_edition.h | 47 +++ .../keymaps/default/keymap.c | 46 +++ .../keymaps/default/readme.md | 1 + .../kd87a_bfg_edition/keymaps/via/keymap.c | 184 +++++++++++ .../kd87a_bfg_edition/keymaps/via/rules.mk | 1 + .../darkproject/kd87a_bfg_edition/mcuconf.h | 25 ++ .../darkproject/kd87a_bfg_edition/readme.md | 23 ++ .../darkproject/kd87a_bfg_edition/rules.mk | 23 ++ 12 files changed, 907 insertions(+) create mode 100644 keyboards/darkproject/kd87a_bfg_edition/config.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/halconf.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/info.json create mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c create mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk create mode 100644 keyboards/darkproject/kd87a_bfg_edition/mcuconf.h create mode 100644 keyboards/darkproject/kd87a_bfg_edition/readme.md create mode 100644 keyboards/darkproject/kd87a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd87a_bfg_edition/config.h b/keyboards/darkproject/kd87a_bfg_edition/config.h new file mode 100644 index 000000000000..af46990b90e4 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/config.h @@ -0,0 +1,129 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +/* key matrix size */ +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 1 +#define BOOTMAGIC_LITE_COLUMN 3 + +#define TAP_CODE_DELAY 10 + +/* 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 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 68 +#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +#define RGB_MATRIX_CENTER { 87, 22 } + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd87a_bfg_edition/halconf.h b/keyboards/darkproject/kd87a_bfg_edition/halconf.h new file mode 100644 index 000000000000..a041a06f75bc --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/halconf.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/keyboards/darkproject/kd87a_bfg_edition/info.json b/keyboards/darkproject/kd87a_bfg_edition/info.json new file mode 100644 index 000000000000..68f290034178 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/info.json @@ -0,0 +1,110 @@ +{ + "keyboard_name": "KD87A_BFG_Edition", + "manufacturer": "GSKY", + "url": "", + "maintainer": "Gsky", + "usb": { + "vid": "0x342D", + "pid": "0xE393", + "device_version": "0.0.3" + }, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Scrolllock", "x": 15, "y": 0 }, + { "label": "Pausebreak", "x": 16, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Insert", "x": 15.5, "y": 1 }, + { "label": "Home", "x": 16.5, "y": 1 }, + { "label": "Pageup", "x": 17.5, "y": 1 }, + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "Delete", "x": 15.5, "y": 2 }, + { "label": "End", "x": 16.5, "y": 2 }, + { "label": "Pagedown", "x": 17.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "App", "x": 12, "y": 5 }, + { "label": "Ctrl", "x": 13, "y": 5 }, + { "label": "Left", "x": 14.25, "y": 5 }, + { "label": "Down", "x": 15.25, "y": 5 }, + { "label": "Right", "x": 16.25, "y": 5 } + + ] + } + } +} diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c new file mode 100644 index 000000000000..8b23bd2828f9 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c @@ -0,0 +1,294 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd87a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc + + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS1_SW3, CS2_SW3, CS3_SW3}, // 14, ke0, ScrollLock + {1, CS1_SW4, CS2_SW4, CS3_SW4}, // 15, kf0, PauseBreak + + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 16, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 17, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 18, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 20, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 21, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 22, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 23, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 24, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 25, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 26, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 27, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 28, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 29, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 30, ke6, Insert + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 31, kf6, Home + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 32, kf6, Pageup + + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 33, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 34, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 35, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 36, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 37, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 38, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 39, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 40, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 41, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 42, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 43, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 44, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 45, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 46, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 47, ke3, Delete + {1, CS4_SW6, CS5_SW6, CS6_SW6}, // 48, k06, End + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 49, k16, Pagedown + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 50, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 51, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 52, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 53, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 54, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 55, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 56, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 57, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 58, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 59, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 60, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 61, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 62, kc3, Enter + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 63, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 64, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 65, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 66, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 67, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 68, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 69, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 70, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 71, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 72, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 73, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 74, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 75, k17, Up + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 76, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 77, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 78, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 79, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 80, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 81, ka5, FN + {0, CS16_SW11, CS17_SW11, CS18_SW11}, // 82, ka5, App + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 83, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 84, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 85, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 86, k37, Right +}; + +#define __ NO_LED +//#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + +{ + { 63, __, 31, 84, 83, 86, 76, 5}, + { 34, 33, 51, 0, 64, 32, 16, 17}, + { 35, 50, 52, __, 65, 49, 1, 18}, + { 36, 3, 53, 4, 66, 75, 2, 19}, + { 37, 38, 54, 55, 67, 68, 21, 20}, + { 40, 39, 57, 56, 70, 69, 22, 23}, + { 41, 45, 58, 6, 71, 47, 28, 24}, + { 42, 7, 59, 85, 72, 48, 8, 25}, + { 43, 44, 60, 61, 82, 73, 27, 26}, + { 77, 74, 81, 78, 79, 80, 15, 13}, + { 14, 29, 46, 11, 62, 12, 9, 10}, + { __, __, __, __, __, __, __, __}, + { __, __, __, __, __, __, 30, __}, + { __, __, __, __, __, __, __, __} +}, +{ + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, SL + { 175, 0}, // 15, k56, PB + + + { 11, 11}, // 16, k01, ` + { 22, 11}, // 17, k11, 1 + { 33, 11}, // 18, k21, 2 + { 44, 11}, // 19, k31, 3 + { 55, 11}, // 20, k41, 4 + { 66, 11}, // 21, k51, 5 + { 77, 11}, // 22, k61, 6 + { 88, 11}, // 23, k71, 7 + { 99, 11}, // 24, k81, 8 + { 110, 11}, // 25, k91, 9 + { 121, 11}, // 26, ka1, 0 + { 132, 11}, // 27, kb1, - + { 143, 11}, // 28, kc1, = + { 154, 11}, // 29, kd1, Backspace + { 165, 11}, // 30, k16, Ins + { 175, 11}, // 31, k16, Home + { 185, 11}, // 32, k16, PGUP + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, Del + { 175, 22}, // 29, k16, END + { 185, 22}, // 29, k16, PGDN + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 29, k16, App + { 143, 55}, // 79, kc5, Ctrl_R + { 154, 55}, // 80, k07, Left + { 165, 55}, // 81, k27, Down + { 176, 55}, // 82, k37, Right +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +} +}; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif + +#ifdef ENCODER_ENABLE + +bool encoder_update_kb(uint8_t index, bool clockwise) { + + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + return true; +} +#endif + diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h new file mode 100644 index 000000000000..9163fc43e5c0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h @@ -0,0 +1,47 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +#define ___ KC_NO + + +#define LAYOUT( \ + k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, Ka0, k96, \ + k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, k02, k15, \ + k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, k75, k25, \ + k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, \ + k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, \ + k06, k90, k93, k94, k95, k92, k84, k04, k03, k73, k05 \ +)\ +{\ + { k00, ___, k02, k03, k04, k05, k06, k07},\ + { k10, k11, k12, k13, k14, k15, k16, k17},\ + { k20, k21, k22, ___, k24, k25, k26, k27},\ + { k30, k31, k32, k33, k34, k35, k36, k37},\ + { k40, k41, k42, k43, k44, k45, k46, k47},\ + { k50, k51, k52, k53, k54, k55, k56, k57},\ + { k60, k61, k62, k63, k64, k65, k66, k67},\ + { k70, k71, k72, k73, k74, k75, k76, k77},\ + { k80, k81, k82, k83, k84, k85, k86, k87},\ + { k90, k91, k92, k93, k94, k95, k96, k97},\ + { Ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ + { ___, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, ___, ___, kc6, ___},\ + { ___, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..a7c288859a63 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + _BL, + _FL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT( + QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, + _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) +}; diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1cbba91b2145 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD87A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..7637b924e1a0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,184 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H +int winlockled = 1; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); + //tap_code16(KC_1); + //rgblight_step(); + } else { + host_consumer_send(0); + //rgblight_step(); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_consumer_send(0xCF); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_system_send(0x9B); + // rgblight_step_reverse(); + } else { + host_system_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case GUI_TOG: + if (record->event.pressed) { + + if (winlockled == 0) { + + setPinInputLow(C15); + winlockled = 1; + + } else { + + setPinInputHigh(C15); + winlockled = 0; + + } + + } + return true; /* Skip all further processing of this key */ + + default: + return true; /* Process all other keycodes normally */ + } + + +} + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_GESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_GESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +void rgb_matrix_indicators_user(void) { + if (host_keyboard_led_state().caps_lock) { + setPinInputHigh (C14); + } + else { + setPinInputLow (C14); + } + + + if (IS_LAYER_ON(0)) { + setPinInputLow (C0); + } + if (IS_LAYER_ON(1)) { + setPinInputHigh (C0); + } +} \ No newline at end of file diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..440f78d2bc27 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd87a_bfg_edition/readme.md b/keyboards/darkproject/kd87a_bfg_edition/readme.md new file mode 100644 index 000000000000..b563a84bb5c3 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD87A_BFG_Edition + +An 87 keys keyboard. Equipped with the WestBerry G7 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD87A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard1) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd87a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd87a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/keyboards/darkproject/kd87a_bfg_edition/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/rules.mk new file mode 100644 index 000000000000..2914f6ffd9c0 --- /dev/null +++ b/keyboards/darkproject/kd87a_bfg_edition/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = WB32F3G71 + +# Bootloader selection +BOOTLOADER = wb32-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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = AW20216 +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash From 712df8cb261dde953c8b9fc476575e3b6c42348e Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:27:22 +0800 Subject: [PATCH 26/59] Delete keyboards/darkproject/kd87a_bfg_edition directory --- .../darkproject/kd87a_bfg_edition/config.h | 129 -------- .../darkproject/kd87a_bfg_edition/halconf.h | 24 -- .../darkproject/kd87a_bfg_edition/info.json | 110 ------- .../kd87a_bfg_edition/kd87a_bfg_edition.c | 294 ------------------ .../kd87a_bfg_edition/kd87a_bfg_edition.h | 47 --- .../keymaps/default/keymap.c | 46 --- .../keymaps/default/readme.md | 1 - .../kd87a_bfg_edition/keymaps/via/keymap.c | 184 ----------- .../kd87a_bfg_edition/keymaps/via/rules.mk | 1 - .../darkproject/kd87a_bfg_edition/mcuconf.h | 25 -- .../darkproject/kd87a_bfg_edition/readme.md | 23 -- .../darkproject/kd87a_bfg_edition/rules.mk | 23 -- 12 files changed, 907 deletions(-) delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/config.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/halconf.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/info.json delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/mcuconf.h delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/readme.md delete mode 100644 keyboards/darkproject/kd87a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd87a_bfg_edition/config.h b/keyboards/darkproject/kd87a_bfg_edition/config.h deleted file mode 100644 index af46990b90e4..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/config.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 - -/* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 1 -#define BOOTMAGIC_LITE_COLUMN 3 - -#define TAP_CODE_DELAY 10 - -/* 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 - -#define RGB_DISABLE_WHEN_USB_SUSPENDED - -/* External spi flash */ -#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 -#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) - -/* SPI Config for LED Driver */ -#define SPI_DRIVER SPIDQ -#define SPI_SCK_PIN A5 -#define SPI_MOSI_PIN A7 -#define SPI_MISO_PIN A6 - -#define DRIVER_1_CS A15 -#define DRIVER_2_CS B15 -#define DRIVER_1_EN C13 -#define DRIVER_2_EN C13 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 68 -#define DRIVER_2_LED_TOTAL 54 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -#define RGB_MATRIX_CENTER { 87, 22 } - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd87a_bfg_edition/halconf.h b/keyboards/darkproject/kd87a_bfg_edition/halconf.h deleted file mode 100644 index a041a06f75bc..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/halconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next - diff --git a/keyboards/darkproject/kd87a_bfg_edition/info.json b/keyboards/darkproject/kd87a_bfg_edition/info.json deleted file mode 100644 index 68f290034178..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/info.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "keyboard_name": "KD87A_BFG_Edition", - "manufacturer": "GSKY", - "url": "", - "maintainer": "Gsky", - "usb": { - "vid": "0x342D", - "pid": "0xE393", - "device_version": "0.0.3" - }, - "layouts": { - "LAYOUT": { - "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Scrolllock", "x": 15, "y": 0 }, - { "label": "Pausebreak", "x": 16, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Insert", "x": 15.5, "y": 1 }, - { "label": "Home", "x": 16.5, "y": 1 }, - { "label": "Pageup", "x": 17.5, "y": 1 }, - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "Delete", "x": 15.5, "y": 2 }, - { "label": "End", "x": 16.5, "y": 2 }, - { "label": "Pagedown", "x": 17.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "App", "x": 12, "y": 5 }, - { "label": "Ctrl", "x": 13, "y": 5 }, - { "label": "Left", "x": 14.25, "y": 5 }, - { "label": "Down", "x": 15.25, "y": 5 }, - { "label": "Right", "x": 16.25, "y": 5 } - - ] - } - } -} diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c deleted file mode 100644 index 8b23bd2828f9..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.c +++ /dev/null @@ -1,294 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include "kd87a_bfg_edition.h" - -#ifdef RGB_MATRIX_ENABLE - -const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc - - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS1_SW3, CS2_SW3, CS3_SW3}, // 14, ke0, ScrollLock - {1, CS1_SW4, CS2_SW4, CS3_SW4}, // 15, kf0, PauseBreak - - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 16, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 17, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 18, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 20, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 21, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 22, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 23, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 24, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 25, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 26, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 27, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 28, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 29, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 30, ke6, Insert - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 31, kf6, Home - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 32, kf6, Pageup - - - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 33, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 34, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 35, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 36, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 37, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 38, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 39, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 40, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 41, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 42, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 43, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 44, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 45, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 46, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 47, ke3, Delete - {1, CS4_SW6, CS5_SW6, CS6_SW6}, // 48, k06, End - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 49, k16, Pagedown - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 50, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 51, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 52, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 53, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 54, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 55, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 56, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 57, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 58, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 59, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 60, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 61, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 62, kc3, Enter - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 63, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 64, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 65, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 66, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 67, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 68, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 69, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 70, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 71, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 72, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 73, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 74, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 75, k17, Up - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 76, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 77, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 78, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 79, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 80, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 81, ka5, FN - {0, CS16_SW11, CS17_SW11, CS18_SW11}, // 82, ka5, App - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 83, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 84, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 85, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 86, k37, Right -}; - -#define __ NO_LED -//#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - -{ - { 63, __, 31, 84, 83, 86, 76, 5}, - { 34, 33, 51, 0, 64, 32, 16, 17}, - { 35, 50, 52, __, 65, 49, 1, 18}, - { 36, 3, 53, 4, 66, 75, 2, 19}, - { 37, 38, 54, 55, 67, 68, 21, 20}, - { 40, 39, 57, 56, 70, 69, 22, 23}, - { 41, 45, 58, 6, 71, 47, 28, 24}, - { 42, 7, 59, 85, 72, 48, 8, 25}, - { 43, 44, 60, 61, 82, 73, 27, 26}, - { 77, 74, 81, 78, 79, 80, 15, 13}, - { 14, 29, 46, 11, 62, 12, 9, 10}, - { __, __, __, __, __, __, __, __}, - { __, __, __, __, __, __, 30, __}, - { __, __, __, __, __, __, __, __} -}, -{ - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, SL - { 175, 0}, // 15, k56, PB - - - { 11, 11}, // 16, k01, ` - { 22, 11}, // 17, k11, 1 - { 33, 11}, // 18, k21, 2 - { 44, 11}, // 19, k31, 3 - { 55, 11}, // 20, k41, 4 - { 66, 11}, // 21, k51, 5 - { 77, 11}, // 22, k61, 6 - { 88, 11}, // 23, k71, 7 - { 99, 11}, // 24, k81, 8 - { 110, 11}, // 25, k91, 9 - { 121, 11}, // 26, ka1, 0 - { 132, 11}, // 27, kb1, - - { 143, 11}, // 28, kc1, = - { 154, 11}, // 29, kd1, Backspace - { 165, 11}, // 30, k16, Ins - { 175, 11}, // 31, k16, Home - { 185, 11}, // 32, k16, PGUP - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, Del - { 175, 22}, // 29, k16, END - { 185, 22}, // 29, k16, PGDN - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 29, k16, App - { 143, 55}, // 79, kc5, Ctrl_R - { 154, 55}, // 80, k07, Left - { 165, 55}, // 81, k27, Down - { 176, 55}, // 82, k37, Right -}, -{ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -} -}; -#endif - -#ifdef EEPROM_ENABLE - -#include "spi_master.h" - -void spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -#endif - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} -#endif - diff --git a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h b/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h deleted file mode 100644 index 9163fc43e5c0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/kd87a_bfg_edition.h +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - - -#define LAYOUT( \ - k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, Ka0, k96, \ - k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, k02, k15, \ - k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, k75, k25, \ - k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, \ - k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, \ - k06, k90, k93, k94, k95, k92, k84, k04, k03, k73, k05 \ -)\ -{\ - { k00, ___, k02, k03, k04, k05, k06, k07},\ - { k10, k11, k12, k13, k14, k15, k16, k17},\ - { k20, k21, k22, ___, k24, k25, k26, k27},\ - { k30, k31, k32, k33, k34, k35, k36, k37},\ - { k40, k41, k42, k43, k44, k45, k46, k47},\ - { k50, k51, k52, k53, k54, k55, k56, k57},\ - { k60, k61, k62, k63, k64, k65, k66, k67},\ - { k70, k71, k72, k73, k74, k75, k76, k77},\ - { k80, k81, k82, k83, k84, k85, k86, k87},\ - { k90, k91, k92, k93, k94, k95, k96, k97},\ - { Ka0, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ - { ___, ___, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, ___, ___, kc6, ___},\ - { ___, ___, ___, ___, ___, ___, ___, ___} \ -} diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c deleted file mode 100644 index a7c288859a63..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - _BL, - _FL, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) -}; diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1cbba91b2145..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD87A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c deleted file mode 100644 index 7637b924e1a0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H -int winlockled = 1; - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, - KC_DND, - KC_SPOT, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - //add_weak_mods(MOD_BIT(KC_1)); - //tap_code16(KC_1); - //rgblight_step(); - } else { - host_consumer_send(0); - //rgblight_step(); - } - return false; /* Skip all further processing of this key */ - - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SIRI: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_consumer_send(0xCF); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_system_send(0x9B); - // rgblight_step_reverse(); - } else { - host_system_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case GUI_TOG: - if (record->event.pressed) { - - if (winlockled == 0) { - - setPinInputLow(C15); - winlockled = 1; - - } else { - - setPinInputHigh(C15); - winlockled = 0; - - } - - } - return true; /* Skip all further processing of this key */ - - default: - return true; /* Process all other keycodes normally */ - } - - -} - -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_GESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_GESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, RGB_HUI, KC_PGUP, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, RGB_MOD, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn), KC_APP, KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; - -void rgb_matrix_indicators_user(void) { - if (host_keyboard_led_state().caps_lock) { - setPinInputHigh (C14); - } - else { - setPinInputLow (C14); - } - - - if (IS_LAYER_ON(0)) { - setPinInputLow (C0); - } - if (IS_LAYER_ON(1)) { - setPinInputHigh (C0); - } -} \ No newline at end of file diff --git a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h deleted file mode 100644 index 440f78d2bc27..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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 - -#undef WB32_SPI_USE_QSPI -#define WB32_SPI_USE_QSPI TRUE - -#undef WB32_SPI_USE_SPIM2 -#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd87a_bfg_edition/readme.md b/keyboards/darkproject/kd87a_bfg_edition/readme.md deleted file mode 100644 index b563a84bb5c3..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# KD87A_BFG_Edition - -An 87 keys keyboard. Equipped with the WestBerry G7 microcontroller - -* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) -* Hardware Supported: KD87A_BFG_Edition -* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard1) - -Make example for this keyboard (after setting up your build environment): - - make darkproject/kd87a_bfg_edition:default - -Flashing example for this keyboard: - - make darkproject/kd87a_bfg_edition:default:flash - -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - -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). diff --git a/keyboards/darkproject/kd87a_bfg_edition/rules.mk b/keyboards/darkproject/kd87a_bfg_edition/rules.mk deleted file mode 100644 index 2914f6ffd9c0..000000000000 --- a/keyboards/darkproject/kd87a_bfg_edition/rules.mk +++ /dev/null @@ -1,23 +0,0 @@ -# MCU name -MCU = WB32F3G71 - -# Bootloader selection -BOOTLOADER = wb32-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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = AW20216 -EEPROM_DRIVER = wear_leveling -WEAR_LEVELING_DRIVER = spi_flash From f7d14f224292dc6dc3d1e0b19752f9f75a33f9ef Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 7 Nov 2022 14:18:00 +0800 Subject: [PATCH 27/59] update keymap.c file --- .../keymaps/default/keymap.c | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index a7c288859a63..bb9244355eaa 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -19,28 +19,45 @@ // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. enum custom_layers { - _BL, - _FL, + Win, + Mac, + Winfn, + Macfn, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ -[_BL] = LAYOUT( - KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - QK_BOOT, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MRWD, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_HUI, RGB_HUD, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, - _______, UC_M_WI, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______) }; From fbf66d72e4de30f736a9c3a94105fc13867e87d4 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:47:04 +0800 Subject: [PATCH 28/59] update via/keymap.c, config.h and kd83a_bfg_edition.c files --- .../darkproject/kd83a_bfg_edition/config.h | 2 +- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 8 +- .../darkproject/kd83a_bfg_edition/keymap.c | 183 ++++++++++++++++++ 3 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymap.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index af46990b90e4..ca3325279418 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -68,7 +68,7 @@ #define DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 68 #define DRIVER_2_LED_TOTAL 54 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index 332cd5411a58..e68feb69e525 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -18,7 +18,7 @@ #ifdef RGB_MATRIX_ENABLE -const aw_led g_aw_leds[DRIVER_LED_TOTAL] = { +const aw_led g_aw_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location @@ -156,7 +156,7 @@ led_config_t g_led_config = { { 132, 0}, // 11, kb0, F11 { 143, 0}, // 12, kc0, F12 { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Del + { 165, 0}, // 14, k56, Home { 11, 11}, // 15, k01, ` { 22, 11}, // 16, k11, 1 @@ -172,7 +172,7 @@ led_config_t g_led_config = { { 132, 11}, // 26, kb1, - { 143, 11}, // 27, kc1, = { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Home + { 165, 11}, // 29, k16, Ins { 11, 22}, // 30, k02, Tab { 22, 22}, // 31, k12, Q @@ -188,7 +188,7 @@ led_config_t g_led_config = { { 132, 22}, // 41, kb2, [ { 143, 22}, // 42, kc2, ] { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, End + { 165, 22}, // 44, k06, Del { 11, 33}, // 45, k03, Caps Lock { 22, 33}, // 46, k13, A diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymap.c new file mode 100644 index 000000000000..d61be4d6d59b --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymap.c @@ -0,0 +1,183 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H +int winlockled = 1; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); + //tap_code16(KC_1); + //rgblight_step(); + } else { + host_consumer_send(0); + //rgblight_step(); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_consumer_send(0xCF); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + // host_consumer_send(0x2A0); + host_system_send(0x9B); + // rgblight_step_reverse(); + } else { + host_system_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + // rgblight_step_reverse(); + } else { + host_consumer_send(0); + //rgblight_step_reverse(); + } + return false; /* Skip all further processing of this key */ + + case GUI_TOG: + if (record->event.pressed) { + + if (winlockled == 0) { + + setPinInputLow(C15); + winlockled = 1; + + } else { + + setPinInputHigh(C15); + winlockled = 0; + + } + + } + return true; /* Skip all further processing of this key */ + + default: + return true; /* Process all other keycodes normally */ + } + + +} + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +bool rgb_matrix_indicators_user(void) { + if (host_keyboard_led_state().caps_lock) { + setPinInputHigh (C14); + } + else { + setPinInputLow (C14); + } + if (IS_LAYER_ON(0)) { + setPinInputLow (C0); + } + if (IS_LAYER_ON(1)) { + setPinInputHigh (C0); + } + return true; +} \ No newline at end of file From 8b0e3a298fcfedd10b280f35620fe0235b1acdcb Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:48:40 +0800 Subject: [PATCH 29/59] Delete keymap.c --- .../darkproject/kd83a_bfg_edition/keymap.c | 183 ------------------ 1 file changed, 183 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymap.c diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymap.c deleted file mode 100644 index d61be4d6d59b..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymap.c +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H -int winlockled = 1; - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, - KC_DND, - KC_SPOT, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - //add_weak_mods(MOD_BIT(KC_1)); - //tap_code16(KC_1); - //rgblight_step(); - } else { - host_consumer_send(0); - //rgblight_step(); - } - return false; /* Skip all further processing of this key */ - - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SIRI: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_consumer_send(0xCF); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_system_send(0x9B); - // rgblight_step_reverse(); - } else { - host_system_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ - - case GUI_TOG: - if (record->event.pressed) { - - if (winlockled == 0) { - - setPinInputLow(C15); - winlockled = 1; - - } else { - - setPinInputHigh(C15); - winlockled = 0; - - } - - } - return true; /* Skip all further processing of this key */ - - default: - return true; /* Process all other keycodes normally */ - } - - -} - -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; - -bool rgb_matrix_indicators_user(void) { - if (host_keyboard_led_state().caps_lock) { - setPinInputHigh (C14); - } - else { - setPinInputLow (C14); - } - if (IS_LAYER_ON(0)) { - setPinInputLow (C0); - } - if (IS_LAYER_ON(1)) { - setPinInputHigh (C0); - } - return true; -} \ No newline at end of file From 171acdf17f9065e03eee2b46c48ae5dac0c05f4f Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:51:01 +0800 Subject: [PATCH 30/59] Update via/keymap.c, config.h and kd83a_bfg_edition.c files --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 71f30cba83b9..d61be4d6d59b 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -166,7 +166,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { if (host_keyboard_led_state().caps_lock) { setPinInputHigh (C14); } @@ -179,4 +179,5 @@ void rgb_matrix_indicators_user(void) { if (IS_LAYER_ON(1)) { setPinInputHigh (C0); } + return true; } \ No newline at end of file From 9fcc0c5f902defb2aa7d59b731979d8bd957f5d2 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:00:31 +0800 Subject: [PATCH 31/59] update config.h file --- keyboards/darkproject/kd83a_bfg_edition/config.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index ca3325279418..146a57ab36b3 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -18,7 +18,7 @@ #include "config_common.h" -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 /* key matrix size */ #define MATRIX_ROWS 14 @@ -54,6 +54,8 @@ #define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 #define WEAR_LEVELING_BACKING_SIZE (8 * 1024) +#define LED_CAPS_LOCK_PIN C14 + /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 From 9665c9c636c1445762df1ba701f97dddb1d67f45 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:03:23 +0800 Subject: [PATCH 32/59] update keymap.c file --- .../kd83a_bfg_edition/keymaps/via/keymap.c | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index d61be4d6d59b..15e8fab3feb5 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -166,18 +166,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -bool rgb_matrix_indicators_user(void) { - if (host_keyboard_led_state().caps_lock) { - setPinInputHigh (C14); - } - else { - setPinInputLow (C14); - } - if (IS_LAYER_ON(0)) { +// bool rgb_matrix_indicators_user(void) { +// //if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { +// if (host_keyboard_led_state().caps_lock) { +// setPinInputHigh (C14); +// } +// else { +// setPinInputLow (C14); +// } + + +// if (IS_LAYER_ON(0)) { +// setPinInputLow (C0); +// } + + +// if (IS_LAYER_ON(1)) { +// setPinInputHigh (C0); +// } + +// return true; +// } + +layer_state_t layer_state_set_user(layer_state_t state) { + + if (IS_LAYER_ON(0)) { setPinInputLow (C0); } + if (IS_LAYER_ON(1)) { setPinInputHigh (C0); } - return true; -} \ No newline at end of file + + return state; + +}; \ No newline at end of file From ca944bda8c209219fdea7a74dc53d1bda63e62a2 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 22 Dec 2022 15:48:57 +0800 Subject: [PATCH 33/59] update keymap.c file --- .../kd83a_bfg_edition/keymaps/via/keymap.c | 73 ++++++------------- 1 file changed, 23 insertions(+), 50 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 15e8fab3feb5..785b8eddc257 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -int winlockled = 1; // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -35,7 +34,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MC: if (record->event.pressed) { - host_consumer_send(0x29F); + host_consumer_send(0x29F); + //add_weak_mods(MOD_BIT(KC_1)); //tap_code16(KC_1); //rgblight_step(); @@ -57,8 +57,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_SIRI: if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_consumer_send(0xCF); + + host_consumer_send(0xCF); // rgblight_step_reverse(); } else { host_consumer_send(0); @@ -97,30 +97,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; /* Skip all further processing of this key */ - case GUI_TOG: - if (record->event.pressed) { - - if (winlockled == 0) { - - setPinInputLow(C15); - winlockled = 1; - - } else { - - setPinInputHigh(C15); - winlockled = 0; - } - - } - return true; /* Skip all further processing of this key */ default: return true; /* Process all other keycodes normally */ } +}; - -} +void housekeeping_task_user(void) { + writePin(C15, keymap_config.no_gui); +}; + +void keyboard_pre_init_user(void) { + + setPinInputLow(C15); + writePin(C15, false); + setPinInputLow(C0); + writePin(C0, false); +}; enum custom_layers { Win, @@ -166,38 +160,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -// bool rgb_matrix_indicators_user(void) { -// //if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) { -// if (host_keyboard_led_state().caps_lock) { -// setPinInputHigh (C14); -// } -// else { -// setPinInputLow (C14); -// } - - -// if (IS_LAYER_ON(0)) { -// setPinInputLow (C0); -// } +void led_init_ports(void) { + setPinOutput(C0); + setPinOutput(C14); + setPinOutput(C15); +}; - -// if (IS_LAYER_ON(1)) { -// setPinInputHigh (C0); -// } - -// return true; -// } layer_state_t layer_state_set_user(layer_state_t state) { - if (IS_LAYER_ON(0)) { - setPinInputLow (C0); - } - - if (IS_LAYER_ON(1)) { - setPinInputHigh (C0); - } + writePin(C0, layer_state_cmp(state, 1)); return state; -}; \ No newline at end of file +}; From 91b85f55c895667c8ad0952f8f4c3e5559b4d594 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 22 Dec 2022 15:50:36 +0800 Subject: [PATCH 34/59] update config.h --- keyboards/darkproject/kd83a_bfg_edition/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 146a57ab36b3..37ec7ab5beb2 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -18,7 +18,6 @@ #include "config_common.h" -// #define DYNAMIC_KEYMAP_LAYER_COUNT 4 /* key matrix size */ #define MATRIX_ROWS 14 From de4ae9d531af69ac49c008df61fce71384569177 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Thu, 22 Dec 2022 15:51:38 +0800 Subject: [PATCH 35/59] update kd83a_bfg_edition.c --- keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index e68feb69e525..be6c2a6d5005 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -238,7 +238,7 @@ led_config_t g_led_config = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, From 3b9f4583289976405f33e8eb8db0fada13f6088f Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 16 Jan 2023 18:25:36 +0800 Subject: [PATCH 36/59] Resolved requested changes. --- .../kd83a_bfg_edition/config.h | 125 ++++++++ .../kd83a_bfg_edition/halconf.h | 24 ++ .../kd83a_bfg_edition/info.json | 112 +++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.c | 288 ++++++++++++++++++ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ++++ .../keymaps/default/keymap.c | 63 ++++ .../keymaps/default/readme.md | 1 + .../kd83a_bfg_edition/keymaps/via/keymap.c | 156 ++++++++++ .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 + .../kd83a_bfg_edition/mcuconf.h | 25 ++ .../kd83a_bfg_edition/readme.md | 23 ++ .../kd83a_bfg_edition/rules.mk | 17 ++ 12 files changed, 890 insertions(+) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h new file mode 100644 index 000000000000..9e7da1cd6322 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h @@ -0,0 +1,125 @@ +/* Copyright 2022 GSKY + * + * 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 "config_common.h" + +#define MATRIX_ROW_PINS \ + { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } +#define MATRIX_COL_PINS \ + { A0, A1, A2, A3, A4, A8, A9, A10 } + +#define ENCODERS_PAD_A \ + { C2 } +#define ENCODERS_PAD_B \ + { C3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ +#define BOOTMAGIC_LITE_ROW 1 +#define BOOTMAGIC_LITE_COLUMN 3 + +#define TAP_CODE_DELAY 10 + +/* 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 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* External spi flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +#define LED_CAPS_LOCK_PIN C14 + +/* SPI Config for LED Driver */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN A5 +#define SPI_MOSI_PIN A7 +#define SPI_MISO_PIN A6 + +#define DRIVER_1_CS A15 +#define DRIVER_2_CS B15 +#define DRIVER_1_EN C13 +#define DRIVER_2_EN C13 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 68 +#define DRIVER_2_LED_TOTAL 54 +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_HUE_BREATHING +#define ENABLE_RGB_MATRIX_HUE_PENDULUM +#define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + + +#define RGB_MATRIX_CENTER { 87, 22 } + +/* Set debounce time to 5ms */ +#define DEBOUNCE 5 + +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ +// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h new file mode 100644 index 000000000000..a041a06f75bc --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next + diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json new file mode 100644 index 000000000000..3db65aea1965 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json @@ -0,0 +1,112 @@ +{ + "keyboard_name": "KD83A_BFG_Edition", + "manufacturer": "GSKY", + "url": "", + "maintainer": "Gsky", + "usb": { + "vid": "0x342D", + "pid": "0xE392", + "device_version": "0.0.3" + }, + "processor": "WB32F3G71", + "bootloader": "wb32-dfu", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "ESC", "x": 0, "y": 0 }, + { "label": "F1", "x": 1.25, "y": 0 }, + { "label": "F2", "x": 2.25, "y": 0 }, + { "label": "F3", "x": 3.25, "y": 0 }, + { "label": "F4", "x": 4.25, "y": 0 }, + { "label": "F5", "x": 5.5, "y": 0 }, + { "label": "F6", "x": 6.5, "y": 0 }, + { "label": "F7", "x": 7.5, "y": 0 }, + { "label": "F8", "x": 8.5, "y": 0 }, + { "label": "F9", "x": 9.75, "y": 0 }, + { "label": "F10", "x": 10.75, "y": 0 }, + { "label": "F11", "x": 11.75, "y": 0 }, + { "label": "F12", "x": 12.75, "y": 0 }, + { "label": "Printscreen", "x": 14, "y": 0 }, + { "label": "Del", "x": 15.5, "y": 0 }, + { "label": "z1", "x": 16.25, "y": 0 }, + { "label": "z2", "x": 17.25, "y": 0 }, + + { "label": "`", "x": 0, "y": 1 }, + { "label": "1", "x": 1, "y": 1 }, + { "label": "2", "x": 2, "y": 1 }, + { "label": "3", "x": 3, "y": 1 }, + { "label": "4", "x": 4, "y": 1 }, + { "label": "5", "x": 5, "y": 1 }, + { "label": "6", "x": 6, "y": 1 }, + { "label": "7", "x": 7, "y": 1 }, + { "label": "8", "x": 8, "y": 1 }, + { "label": "9", "x": 9, "y": 1 }, + { "label": "0", "x": 10, "y": 1 }, + { "label": "-", "x": 11, "y": 1 }, + { "label": "=", "x": 12, "y": 1 }, + { "label": "Backspace", "x": 13, "y": 1, "w": 2}, + { "label": "Home", "x": 15.5, "y": 1 }, + + + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, + { "label": "Q", "x": 1.5, "y": 2 }, + { "label": "W", "x": 2.5, "y": 2 }, + { "label": "E", "x": 3.5, "y": 2 }, + { "label": "R", "x": 4.5, "y": 2 }, + { "label": "T", "x": 5.5, "y": 2 }, + { "label": "Y", "x": 6.5, "y": 2 }, + { "label": "U", "x": 7.5, "y": 2 }, + { "label": "I", "x": 8.5, "y": 2 }, + { "label": "O", "x": 9.5, "y": 2 }, + { "label": "P", "x": 10.5, "y": 2 }, + { "label": "[", "x": 11.5, "y": 2 }, + { "label": "]", "x": 12.5, "y": 2 }, + { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, + { "label": "End", "x": 15.5, "y": 2 }, + + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, + { "label": "A", "x": 1.75, "y": 3 }, + { "label": "S", "x": 2.75, "y": 3 }, + { "label": "D", "x": 3.75, "y": 3 }, + { "label": "F", "x": 4.75, "y": 3 }, + { "label": "G", "x": 5.75, "y": 3 }, + { "label": "H", "x": 6.75, "y": 3 }, + { "label": "J", "x": 7.75, "y": 3 }, + { "label": "K", "x": 8.75, "y": 3 }, + { "label": "L", "x": 9.75, "y": 3 }, + { "label": ";", "x": 10.75, "y": 3 }, + { "label": "'", "x": 11.75, "y": 3 }, + { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, + { "label": "PgUp", "x": 15.5, "y": 3 }, + + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, + { "label": "Z", "x": 2.25, "y": 4 }, + { "label": "X", "x": 3.25, "y": 4 }, + { "label": "C", "x": 4.25, "y": 4 }, + { "label": "V", "x": 5.25, "y": 4 }, + { "label": "B", "x": 6.25, "y": 4 }, + { "label": "N", "x": 7.25, "y": 4 }, + { "label": "M", "x": 8.25, "y": 4 }, + { "label": ",", "x": 9.25, "y": 4 }, + { "label": ".", "x": 10.25, "y": 4 }, + { "label": "/", "x": 11.25, "y": 4 }, + { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, + { "label": "Up", "x": 14.25, "y": 4 }, + { "label": "PgDn", "x": 15.5, "y": 4 }, + + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, + { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, + { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, + { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, + { "label": "Alt", "x": 10, "y": 5 }, + { "label": "FN", "x": 11, "y": 5 }, + { "label": "Ctrl", "x": 12, "y": 5 }, + { "label": "Left", "x": 13.25, "y": 5 }, + { "label": "Down", "x": 14.25, "y": 5 }, + { "label": "Right", "x": 15.25, "y": 5 } + + + ] + } + } +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c new file mode 100644 index 000000000000..be6c2a6d5005 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -0,0 +1,288 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include "kd83a_bfg_edition.h" + +#ifdef RGB_MATRIX_ENABLE + +const aw_led g_aw_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc + + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right + + {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 + {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 +}; + +#define __ NO_LED +//#define RGB_LAYOUT LAYOUT + +led_config_t g_led_config = { + +{ + { 59, __, 14, 80, 79, 82, 73, 5}, + { 31, 30, 46, 0, 60, 58, 15, 16}, + { 32, 45, 47, __, 61, 72, 1 , 17}, + { 33, 3, 48, 4, 62, 71, 2, 18}, + { 34, 35, 49, 50, 63, 64, 20, 19}, + { 37, 36, 52, 51, 66, 65, 21, 22}, + { 38, 42, 53, 6, 67, 44, 27, 23}, + { 39, 7, 54, 81, 68, __, 8, 24}, + { 40, 41, 55, 56, __, 69, 26, 25}, + { 74, 70, 78, 75, 76, 77, __, 13}, + { __, 28, 43, 11, 57, 12, 9, 10}, + { 83, __, __, __, __, __, __, __}, + { __, __, __, __, __, __, 29, __}, + { 84, __, __, __, __, __, __, __} +}, +{ + { 11, 0}, // 0, k00, Esc + { 22, 0}, // 1, k10, F1 + { 33, 0}, // 2, k20, F2 + { 44, 0}, // 3, k30, F3 + { 55, 0}, // 4, k40, F4 + { 66, 0}, // 5, k50, F5 + { 77, 0}, // 6, k60, F6 + { 88, 0}, // 7, k70, F7 + { 99, 0}, // 8, k80, F8 + { 110, 0}, // 9, k90, F9 + { 121, 0}, // 10, ka0, F10 + { 132, 0}, // 11, kb0, F11 + { 143, 0}, // 12, kc0, F12 + { 154, 0}, // 13, kd0, Printscreen + { 165, 0}, // 14, k56, Home + + { 11, 11}, // 15, k01, ` + { 22, 11}, // 16, k11, 1 + { 33, 11}, // 17, k21, 2 + { 44, 11}, // 18, k31, 3 + { 55, 11}, // 19, k41, 4 + { 66, 11}, // 20, k51, 5 + { 77, 11}, // 21, k61, 6 + { 88, 11}, // 22, k71, 7 + { 99, 11}, // 23, k81, 8 + { 110, 11}, // 24, k91, 9 + { 121, 11}, // 25, ka1, 0 + { 132, 11}, // 26, kb1, - + { 143, 11}, // 27, kc1, = + { 154, 11}, // 28, kd1, Backspace + { 165, 11}, // 29, k16, Ins + + { 11, 22}, // 30, k02, Tab + { 22, 22}, // 31, k12, Q + { 33, 22}, // 32, k22, W + { 44, 22}, // 33, k32, E + { 55, 22}, // 34, k42, R + { 66, 22}, // 35, k52, T + { 77, 22}, // 36, k62, Y + { 88, 22}, // 37, k72, U + { 99, 22}, // 38, k82, I + { 110, 22}, // 39, k92, O + { 121, 22}, // 40, ka2, P + { 132, 22}, // 41, kb2, [ + { 143, 22}, // 42, kc2, ] + { 154, 22}, // 43, kd3, "\\" + { 165, 22}, // 44, k06, Del + + { 11, 33}, // 45, k03, Caps Lock + { 22, 33}, // 46, k13, A + { 33, 33}, // 47, k23, S + { 44, 33}, // 48, k33, D + { 55, 33}, // 49, k43, F + { 66, 33}, // 50, k53, G + { 77, 33}, // 51, k63, H + { 88, 33}, // 52, k73, J + { 99, 33}, // 53, k83, K + { 110, 33}, // 54, k93, L + { 121, 33}, // 55, ka3, ; + { 132, 33}, // 56, kb3, ' + { 154, 33}, // 57, kc3, Enter + { 165, 33}, // 58, k26, PgUp + + { 11, 44}, // 59, k04, Shift_L + { 33, 44}, // 60, k24, Z + { 44, 44}, // 61, k34, X + { 55, 44}, // 62, k44, C + { 66, 44}, // 63, k54, V + { 77, 44}, // 64, k64, B + { 88, 44}, // 65, k74, N + { 99, 44}, // 66, k84, M + { 110, 44}, // 67, k94, , + { 121, 44}, // 68, ka4, . + { 132, 44}, // 69, kb4, / + { 143, 44}, // 70, kd4, Shift_R + { 154, 44}, // 70, k17, Up + { 165, 44}, // 72, k36, PgDn + + { 11, 55}, // 73, k05, Ctrl_L + { 22, 55}, // 74, k15, Win_L + { 33, 55}, // 75, k25, Alt_L + { 77, 55}, // 76, k65, Space + { 110, 55}, // 77, k95, Alt_R + { 121, 55}, // 78, ka5, FN + { 132, 55}, // 79, kc5, Ctrl_R + { 143, 55}, // 80, k07, Left + { 154, 55}, // 81, k27, Down + { 165, 55}, // 82, k37, Right + + { 0, 18}, // 83, Z1 + { 0, 24}, // 84, Z2 +}, +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, +} +}; +#endif + +#ifdef EEPROM_ENABLE + +#include "spi_master.h" + +void spi_init(void) { + static bool is_initialised = false; + if (!is_initialised) { + is_initialised = true; + + // Try releasing special pins for a short time + setPinInput(SPI_SCK_PIN); + setPinInput(SPI_MOSI_PIN); + setPinInput(SPI_MISO_PIN); + + chThdSleepMilliseconds(10); + + palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); + palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); + } +} + +#endif + +#ifdef ENCODER_ENABLE + +bool encoder_update_kb(uint8_t index, bool clockwise) { + + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + } + return true; +} +#endif + diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h new file mode 100644 index 000000000000..4e3cb0fc0374 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -0,0 +1,55 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +#define ___ KC_NO + + +// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 +// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home +// Tab Q W E R T Y U I O P [ ] \\ End +// Caps A S D F G H J K L ; ' Enter PgUp +// Sh_L Z X C V B N M , . / Sh_R Up PgDn +// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right + + +#define LAYOUT( \ + k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ + k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ + k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ + k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ + k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ + k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ +)\ +{\ + { k00, ___, k02, k03, k04, k05, k06, k07},\ + { k10, k11, k12, k13, k14, k15, k16, k17},\ + { k20, k21, k22, ___, k24, k25, k26, k27},\ + { k30, k31, k32, k33, k34, k35, k36, k37},\ + { k40, k41, k42, k43, k44, k45, k46, k47},\ + { k50, k51, k52, k53, k54, k55, k56, k57},\ + { k60, k61, k62, k63, k64, k65, k66, k67},\ + { k70, k71, k72, k73, k74, ___, k76, k77},\ + { k80, k81, k82, k83, ___, k85, k86, k87},\ + { k90, k91, k92, k93, k94, k95, ___, k97},\ + { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ + { kb0, ___, ___, ___, ___, ___, ___, ___},\ + { ___, ___, ___, ___, ___, ___, kc6, ___},\ + { kd0, ___, ___, ___, ___, ___, ___, ___} \ +} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c new file mode 100644 index 000000000000..bb9244355eaa --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md new file mode 100644 index 000000000000..1bdbac95804d --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md @@ -0,0 +1 @@ +# The Default KD83A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c new file mode 100644 index 000000000000..ba192c5848cd --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c @@ -0,0 +1,156 @@ +/* Copyright 2022 GSKY + * + * 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 . + */ + +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +enum my_keycodes { + KC_MC = SAFE_RANGE, + KC_LPAD, + KC_SIRI, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_MC: + if (record->event.pressed) { + host_consumer_send(0x29F); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_LPAD: + if (record->event.pressed) { + host_consumer_send(0x2A0); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_SIRI: + if (record->event.pressed) { + host_consumer_send(0xCF); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + host_system_send(0x9B); + } else { + host_system_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + default: + return true; /* Process all other keycodes normally */ + } +}; + +void housekeeping_task_user(void) { + writePin(C15, keymap_config.no_gui); +}; + +void keyboard_pre_init_user(void) { + + setPinInputLow(C15); + writePin(C15, false); + setPinInputLow(C0); + writePin(C0, false); +}; + +enum custom_layers { + Win, + Mac, + Winfn, + Macfn, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[Win] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Mac] = LAYOUT( + KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[Winfn] = LAYOUT( + KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +[Macfn] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, + KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +void led_init_ports(void) { + setPinOutput(C0); + setPinOutput(C14); + setPinOutput(C15); +}; + + +layer_state_t layer_state_set_user(layer_state_t state) { + + writePin(C0, layer_state_cmp(state, 1)); + + return state; + +}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk new file mode 100644 index 000000000000..1e5b99807cb7 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h new file mode 100644 index 000000000000..440f78d2bc27 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd + * + * 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 + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_SPI_USE_SPIM2 +#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md new file mode 100644 index 000000000000..83fb3e390752 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md @@ -0,0 +1,23 @@ +# KD83A_BFG_Edition + +An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller + +* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) +* Hardware Supported: KD83A_BFG_Edition +* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) + +Make example for this keyboard (after setting up your build environment): + + make darkproject/kd83a_bfg_edition:default + +Flashing example for this keyboard: + + make darkproject/kd83a_bfg_edition:default:flash + +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap + +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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk new file mode 100644 index 000000000000..59f7604bb910 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk @@ -0,0 +1,17 @@ +# 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 NKRO Rollover. +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. +AUDIO_ENABLE = no # Audio output. +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes # Enable RGB matrix effects. +RGB_MATRIX_DRIVER = AW20216 # Enable RGB matrix effects. +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash \ No newline at end of file From 2d54c2acb4b3ed4f1e7ea2f8fe159c8f9ca74803 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:01:01 +0800 Subject: [PATCH 37/59] Delete folder which was added accidentally. --- .../kd83a_bfg_edition/config.h | 125 -------- .../kd83a_bfg_edition/halconf.h | 24 -- .../kd83a_bfg_edition/info.json | 112 ------- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 288 ------------------ .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ---- .../keymaps/default/keymap.c | 63 ---- .../keymaps/default/readme.md | 1 - .../kd83a_bfg_edition/keymaps/via/keymap.c | 156 ---------- .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 - .../kd83a_bfg_edition/mcuconf.h | 25 -- .../kd83a_bfg_edition/readme.md | 23 -- .../kd83a_bfg_edition/rules.mk | 17 -- 12 files changed, 890 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h deleted file mode 100644 index 9e7da1cd6322..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/config.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "config_common.h" - -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 1 -#define BOOTMAGIC_LITE_COLUMN 3 - -#define TAP_CODE_DELAY 10 - -/* 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 - -#define RGB_DISABLE_WHEN_USB_SUSPENDED - -/* External spi flash */ -#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 -#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) - -#define LED_CAPS_LOCK_PIN C14 - -/* SPI Config for LED Driver */ -#define SPI_DRIVER SPIDQ -#define SPI_SCK_PIN A5 -#define SPI_MOSI_PIN A7 -#define SPI_MISO_PIN A6 - -#define DRIVER_1_CS A15 -#define DRIVER_2_CS B15 -#define DRIVER_1_EN C13 -#define DRIVER_2_EN C13 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 68 -#define DRIVER_2_LED_TOTAL 54 -#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -#define RGB_MATRIX_CENTER { 87, 22 } - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h deleted file mode 100644 index a041a06f75bc..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/halconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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_SPI TRUE -#define SPI_USE_WAIT TRUE -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD - -#include_next - diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json deleted file mode 100644 index 3db65aea1965..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/info.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "keyboard_name": "KD83A_BFG_Edition", - "manufacturer": "GSKY", - "url": "", - "maintainer": "Gsky", - "usb": { - "vid": "0x342D", - "pid": "0xE392", - "device_version": "0.0.3" - }, - "processor": "WB32F3G71", - "bootloader": "wb32-dfu", - "layouts": { - "LAYOUT": { - "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Del", "x": 15.5, "y": 0 }, - { "label": "z1", "x": 16.25, "y": 0 }, - { "label": "z2", "x": 17.25, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Home", "x": 15.5, "y": 1 }, - - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "End", "x": 15.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - { "label": "PgUp", "x": 15.5, "y": 3 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - { "label": "PgDn", "x": 15.5, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "Ctrl", "x": 12, "y": 5 }, - { "label": "Left", "x": 13.25, "y": 5 }, - { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 } - - - ] - } - } -} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c deleted file mode 100644 index be6c2a6d5005..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.c +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include "kd83a_bfg_edition.h" - -#ifdef RGB_MATRIX_ENABLE - -const aw_led g_aw_leds[RGB_MATRIX_LED_COUNT] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc - - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home - - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right - - {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 - {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 -}; - -#define __ NO_LED -//#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - -{ - { 59, __, 14, 80, 79, 82, 73, 5}, - { 31, 30, 46, 0, 60, 58, 15, 16}, - { 32, 45, 47, __, 61, 72, 1 , 17}, - { 33, 3, 48, 4, 62, 71, 2, 18}, - { 34, 35, 49, 50, 63, 64, 20, 19}, - { 37, 36, 52, 51, 66, 65, 21, 22}, - { 38, 42, 53, 6, 67, 44, 27, 23}, - { 39, 7, 54, 81, 68, __, 8, 24}, - { 40, 41, 55, 56, __, 69, 26, 25}, - { 74, 70, 78, 75, 76, 77, __, 13}, - { __, 28, 43, 11, 57, 12, 9, 10}, - { 83, __, __, __, __, __, __, __}, - { __, __, __, __, __, __, 29, __}, - { 84, __, __, __, __, __, __, __} -}, -{ - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Home - - { 11, 11}, // 15, k01, ` - { 22, 11}, // 16, k11, 1 - { 33, 11}, // 17, k21, 2 - { 44, 11}, // 18, k31, 3 - { 55, 11}, // 19, k41, 4 - { 66, 11}, // 20, k51, 5 - { 77, 11}, // 21, k61, 6 - { 88, 11}, // 22, k71, 7 - { 99, 11}, // 23, k81, 8 - { 110, 11}, // 24, k91, 9 - { 121, 11}, // 25, ka1, 0 - { 132, 11}, // 26, kb1, - - { 143, 11}, // 27, kc1, = - { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Ins - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, Del - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - { 165, 33}, // 58, k26, PgUp - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - { 165, 44}, // 72, k36, PgDn - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 79, kc5, Ctrl_R - { 143, 55}, // 80, k07, Left - { 154, 55}, // 81, k27, Down - { 165, 55}, // 82, k37, Right - - { 0, 18}, // 83, Z1 - { 0, 24}, // 84, Z2 -}, -{ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, -} -}; -#endif - -#ifdef EEPROM_ENABLE - -#include "spi_master.h" - -void spi_init(void) { - static bool is_initialised = false; - if (!is_initialised) { - is_initialised = true; - - // Try releasing special pins for a short time - setPinInput(SPI_SCK_PIN); - setPinInput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); - - chThdSleepMilliseconds(10); - - palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST | PAL_WB32_CURRENT_LEVEL3); - palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_OUTPUT_TYPE_PUSHPULL | PAL_OUTPUT_SPEED_HIGHEST); - } -} - -#endif - -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} -#endif - diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h deleted file mode 100644 index 4e3cb0fc0374..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/kd83a_bfg_edition.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - - -// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 -// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home -// Tab Q W E R T Y U I O P [ ] \\ End -// Caps A S D F G H J K L ; ' Enter PgUp -// Sh_L Z X C V B N M , . / Sh_R Up PgDn -// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right - - -#define LAYOUT( \ - k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ - k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ - k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ - k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ - k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ - k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ -)\ -{\ - { k00, ___, k02, k03, k04, k05, k06, k07},\ - { k10, k11, k12, k13, k14, k15, k16, k17},\ - { k20, k21, k22, ___, k24, k25, k26, k27},\ - { k30, k31, k32, k33, k34, k35, k36, k37},\ - { k40, k41, k42, k43, k44, k45, k46, k47},\ - { k50, k51, k52, k53, k54, k55, k56, k57},\ - { k60, k61, k62, k63, k64, k65, k66, k67},\ - { k70, k71, k72, k73, k74, ___, k76, k77},\ - { k80, k81, k82, k83, ___, k85, k86, k87},\ - { k90, k91, k92, k93, k94, k95, ___, k97},\ - { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ - { kb0, ___, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, ___, ___, kc6, ___},\ - { kd0, ___, ___, ___, ___, ___, ___, ___} \ -} diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c deleted file mode 100644 index bb9244355eaa..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1bdbac95804d..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD83A_BFG_Edition Layout diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c deleted file mode 100644 index ba192c5848cd..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/keymap.c +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 . - */ - -#include QMK_KEYBOARD_H - - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, - KC_DND, - KC_SPOT, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_SIRI: - if (record->event.pressed) { - host_consumer_send(0xCF); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - host_system_send(0x9B); - } else { - host_system_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - default: - return true; /* Process all other keycodes normally */ - } -}; - -void housekeeping_task_user(void) { - writePin(C15, keymap_config.no_gui); -}; - -void keyboard_pre_init_user(void) { - - setPinInputLow(C15); - writePin(C15, false); - setPinInputLow(C0); - writePin(C0, false); -}; - -enum custom_layers { - Win, - Mac, - Winfn, - Macfn, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Mac] = LAYOUT( - KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - -[Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -[Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), - -}; - -void led_init_ports(void) { - setPinOutput(C0); - setPinOutput(C14); - setPinOutput(C15); -}; - - -layer_state_t layer_state_set_user(layer_state_t state) { - - writePin(C0, layer_state_cmp(state, 1)); - - return state; - -}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk deleted file mode 100644 index 1e5b99807cb7..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/keymaps/via/rules.mk +++ /dev/null @@ -1 +0,0 @@ -VIA_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h deleted file mode 100644 index 440f78d2bc27..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/mcuconf.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2022 Westberry Technology (ChangZhou) Corp., Ltd - * - * 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 - -#undef WB32_SPI_USE_QSPI -#define WB32_SPI_USE_QSPI TRUE - -#undef WB32_SPI_USE_SPIM2 -#define WB32_SPI_USE_SPIM2 TRUE diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md deleted file mode 100644 index 83fb3e390752..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# KD83A_BFG_Edition - -An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller - -* Keyboard Maintainer: [GSKY](https://github.com/gksygithub) -* Hardware Supported: KD83A_BFG_Edition -* Hardware Availability: [GSKY GitHub](https://github.com/gksygithub/keyboard) - -Make example for this keyboard (after setting up your build environment): - - make darkproject/kd83a_bfg_edition:default - -Flashing example for this keyboard: - - make darkproject/kd83a_bfg_edition:default:flash - -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - -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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk deleted file mode 100644 index 59f7604bb910..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes # Enable RGB matrix effects. -RGB_MATRIX_DRIVER = AW20216 # Enable RGB matrix effects. -EEPROM_DRIVER = wear_leveling -WEAR_LEVELING_DRIVER = spi_flash \ No newline at end of file From 57300e8d2b43c78fbcece2d2acace1096b3214ea Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:11:13 +0800 Subject: [PATCH 38/59] Update keyboards/darkproject/kd83a_bfg_edition/config.h Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/config.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 37ec7ab5beb2..874c74f335dd 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -19,10 +19,6 @@ #include "config_common.h" -/* key matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - #define MATRIX_ROW_PINS \ { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } #define MATRIX_COL_PINS \ From 927ad23ea83d0b57d55d7f6f4e31d3a72c6b75b7 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:12:14 +0800 Subject: [PATCH 39/59] Update keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 785b8eddc257..87519721de2a 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -47,7 +47,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_LPAD: if (record->event.pressed) { - host_consumer_send(0x2A0); + host_consumer_send(0x2A0); // rgblight_step_reverse(); } else { host_consumer_send(0); From fdbb96903a68cb9d6504dc2d1a31cc061b0103f6 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:12:26 +0800 Subject: [PATCH 40/59] Update keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 87519721de2a..bc1f4f06e675 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -88,7 +88,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; /* Skip all further processing of this key */ case KC_EJ: - if (record->event.pressed) { + if (record->event.pressed) { host_consumer_send(0x0B8); // rgblight_step_reverse(); } else { From 177935c00ffeedb0c49305a3fb380e4cf9af65a7 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:05 +0800 Subject: [PATCH 41/59] Update keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index bc1f4f06e675..f615a14eaacd 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -78,7 +78,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; /* Skip all further processing of this key */ case KC_SPOT: - if (record->event.pressed) { + if (record->event.pressed) { host_consumer_send(0x221); // rgblight_step_reverse(); } else { From 0ccdcfbebd5807d146d82a75381f5481718d3fb4 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:14 +0800 Subject: [PATCH 42/59] Update keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index f615a14eaacd..3cc2224114c8 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -95,7 +95,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { host_consumer_send(0); //rgblight_step_reverse(); } - return false; /* Skip all further processing of this key */ + return false; /* Skip all further processing of this key */ From 5721c5f464172a1d9218beddfd2a2f11327706f8 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:23 +0800 Subject: [PATCH 43/59] Update keyboards/darkproject/kd83a_bfg_edition/info.json Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 9e10ee1cd4c8..ada9a73f2334 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -27,7 +27,7 @@ { "label": "Printscreen", "x": 14, "y": 0 }, { "label": "Del", "x": 15.5, "y": 0 }, { "label": "z1", "x": 16.25, "y": 0 }, - { "label": "z2", "x": 17.25, "y": 0 }, + { "label": "z2", "x": 17.25, "y": 0 }, { "label": "`", "x": 0, "y": 1 }, { "label": "1", "x": 1, "y": 1 }, From 68e72f39bf020d81d2232538f85b61d9b1ce1383 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:33 +0800 Subject: [PATCH 44/59] Update keyboards/darkproject/kd83a_bfg_edition/rules.mk Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/rules.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index 2914f6ffd9c0..261232655127 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = WB32F3G71 - -# Bootloader selection -BOOTLOADER = wb32-dfu - # Build Options # change yes to no to disable # From 9cf9f4450d79adccf368f12aaf5727e7611b14b6 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:41 +0800 Subject: [PATCH 45/59] Update keyboards/darkproject/kd83a_bfg_edition/info.json Co-authored-by: Ryan --- keyboards/darkproject/kd83a_bfg_edition/info.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index ada9a73f2334..52a87e72d48f 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -8,6 +8,8 @@ "pid": "0xE392", "device_version": "0.0.2" }, + "processor": "WB32F3G71", + "bootloader": "wb32-dfu", "layouts": { "LAYOUT": { "layout": [ From 01b9124cd2ec93fd57fa56b2ebbc409c077fc064 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:09:49 +0800 Subject: [PATCH 46/59] update info.json file --- .../darkproject/kd83a_bfg_edition/info.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 52a87e72d48f..53efa704a41e 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -6,9 +6,9 @@ "usb": { "vid": "0x342D", "pid": "0xE392", - "device_version": "0.0.2" + "device_version": "0.0.3" }, - "processor": "WB32F3G71", + "processor": "WB32FQ95", "bootloader": "wb32-dfu", "layouts": { "LAYOUT": { @@ -46,7 +46,7 @@ { "label": "=", "x": 12, "y": 1 }, { "label": "Backspace", "x": 13, "y": 1, "w": 2}, { "label": "Home", "x": 15.5, "y": 1 }, - + { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, { "label": "Q", "x": 1.5, "y": 2 }, @@ -63,7 +63,7 @@ { "label": "]", "x": 12.5, "y": 2 }, { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, { "label": "End", "x": 15.5, "y": 2 }, - + { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, { "label": "A", "x": 1.75, "y": 3 }, { "label": "S", "x": 2.75, "y": 3 }, @@ -78,7 +78,7 @@ { "label": "'", "x": 11.75, "y": 3 }, { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, { "label": "PgUp", "x": 15.5, "y": 3 }, - + { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, { "label": "Z", "x": 2.25, "y": 4 }, { "label": "X", "x": 3.25, "y": 4 }, @@ -93,7 +93,7 @@ { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, { "label": "Up", "x": 14.25, "y": 4 }, { "label": "PgDn", "x": 15.5, "y": 4 }, - + { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, @@ -104,8 +104,8 @@ { "label": "Left", "x": 13.25, "y": 5 }, { "label": "Down", "x": 14.25, "y": 5 }, { "label": "Right", "x": 15.25, "y": 5 } - - + + ] } } From d6ab5e2250bc80ae367d4d84b7768f79400df7fb Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:44:10 +0800 Subject: [PATCH 47/59] update config.h file --- keyboards/darkproject/kd83a_bfg_edition/config.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 874c74f335dd..8223641b039d 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -18,7 +18,6 @@ #include "config_common.h" - #define MATRIX_ROW_PINS \ { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } #define MATRIX_COL_PINS \ @@ -118,9 +117,3 @@ #define RGB_MATRIX_CENTER { 87, 22 } - -/* Set debounce time to 5ms */ -#define DEBOUNCE 5 - -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -// #define FORCE_NKRO From 219392e77418b0429a5d7b42f86a0c49a8c76264 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:26:53 +0800 Subject: [PATCH 48/59] Updated requested changes --- keyboards/darkproject/kd83a_bfg_edition/config.h | 6 +----- keyboards/darkproject/kd83a_bfg_edition/info.json | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 8223641b039d..791ded1c5bf5 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -16,8 +16,6 @@ #pragma once -#include "config_common.h" - #define MATRIX_ROW_PINS \ { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } #define MATRIX_COL_PINS \ @@ -27,7 +25,7 @@ { C2 } #define ENCODERS_PAD_B \ { C3 } - + /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW @@ -48,8 +46,6 @@ #define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B14 #define WEAR_LEVELING_BACKING_SIZE (8 * 1024) -#define LED_CAPS_LOCK_PIN C14 - /* SPI Config for LED Driver */ #define SPI_DRIVER SPIDQ #define SPI_SCK_PIN A5 diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index 53efa704a41e..e3ac71d90b0a 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -8,6 +8,9 @@ "pid": "0xE392", "device_version": "0.0.3" }, + "indicators": { + "caps_lock": "C14" + }, "processor": "WB32FQ95", "bootloader": "wb32-dfu", "layouts": { @@ -105,7 +108,6 @@ { "label": "Down", "x": 14.25, "y": 5 }, { "label": "Right", "x": 15.25, "y": 5 } - ] } } From 3c8d93e8fd1860b56de6e55bf395db81ca810b86 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Wed, 26 Apr 2023 15:30:26 +0800 Subject: [PATCH 49/59] update readme.md --- keyboards/darkproject/kd83a_bfg_edition/readme.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md index 83fb3e390752..9d5827b35f20 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/readme.md +++ b/keyboards/darkproject/kd83a_bfg_edition/readme.md @@ -14,10 +14,4 @@ Flashing example for this keyboard: make darkproject/kd83a_bfg_edition:default:flash -To reset the board into bootloader mode, do one of the following: - -* Hold the Reset switch mounted on the surface of the PCB while connecting the USB cable (remove the spacebar key and press and hold the pin on the right side) -* Hold the Escape key while connecting the USB cable (also erases persistent settings) -* Fn+Backslash will reset the board to bootloader mode if you have flashed the default QMK keymap - 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). From bd3cc26c473c72f358f6d72981e3e8d966eae8e8 Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Mon, 12 Jun 2023 13:56:04 +0800 Subject: [PATCH 50/59] Resolved requested changes --- .../darkproject/kd83a_bfg_edition/config.h | 28 +- .../darkproject/kd83a_bfg_edition/halconf.h | 1 - .../darkproject/kd83a_bfg_edition/info.json | 306 ++++++++++------ .../kd83a_bfg_edition/kd83a_bfg_edition.c | 332 ++++++------------ .../keymaps/default/keymap.c | 90 ++++- .../keymaps/default/rules.mk | 1 + .../kd83a_bfg_edition/keymaps/via/keymap.c | 129 ++----- .../kd83a_bfg_edition/keymaps/via/rules.mk | 1 + .../darkproject/kd83a_bfg_edition/readme.md | 10 +- .../darkproject/kd83a_bfg_edition/rules.mk | 17 +- 10 files changed, 436 insertions(+), 479 deletions(-) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/rules.mk diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index 791ded1c5bf5..f7a9acf71525 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -1,5 +1,5 @@ /* Copyright 2022 GSKY - * + * 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 @@ -16,25 +16,6 @@ #pragma once -#define MATRIX_ROW_PINS \ - { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 } -#define MATRIX_COL_PINS \ - { A0, A1, A2, A3, A4, A8, A9, A10 } - -#define ENCODERS_PAD_A \ - { C2 } -#define ENCODERS_PAD_B \ - { C3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Hold ESC on start up to clear EEPROM and boot into bootloader mode */ -#define BOOTMAGIC_LITE_ROW 1 -#define BOOTMAGIC_LITE_COLUMN 3 - -#define TAP_CODE_DELAY 10 - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ @@ -58,8 +39,8 @@ #define DRIVER_2_EN C13 #define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 68 -#define DRIVER_2_LED_TOTAL 54 +#define DRIVER_1_LED_TOTAL 66 +#define DRIVER_2_LED_TOTAL 19 #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) // RGB Matrix Animation modes. Explicitly enabled @@ -110,6 +91,3 @@ #define ENABLE_RGB_MATRIX_MULTISPLASH #define ENABLE_RGB_MATRIX_SOLID_SPLASH #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - - -#define RGB_MATRIX_CENTER { 87, 22 } diff --git a/keyboards/darkproject/kd83a_bfg_edition/halconf.h b/keyboards/darkproject/kd83a_bfg_edition/halconf.h index a041a06f75bc..8f61d3fc64ff 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/halconf.h +++ b/keyboards/darkproject/kd83a_bfg_edition/halconf.h @@ -21,4 +21,3 @@ #define SPI_SELECT_MODE SPI_SELECT_MODE_PAD #include_next - diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index e3ac71d90b0a..e442c749a1d8 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -1,113 +1,221 @@ { + "manufacturer": "Gsky", "keyboard_name": "KD83A_BFG_Edition", - "manufacturer": "GSKY", - "url": "", "maintainer": "Gsky", - "usb": { - "vid": "0x342D", - "pid": "0xE392", - "device_version": "0.0.3" + "bootloader": "wb32-dfu", + "bootmagic": { + "matrix": [1, 3] + }, + "diode_direction": "COL2ROW", + "encoder": { + "rotary": [ + {"pin_a": "C2", "pin_b": "C3"} + ] + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true }, "indicators": { "caps_lock": "C14" }, + "matrix_pins": { + "cols": ["A0", "A1", "A2", "A3", "A4", "A8", "A9", "A10"], + "rows": ["B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "B10", "B12"] + }, "processor": "WB32FQ95", - "bootloader": "wb32-dfu", + "qmk": { + "tap_keycode_delay": 10 + }, + "rgb_matrix": { + "center_point": [76, 25], + "driver": "AW20216", + "layout": [ + { "flags": 4, "matrix": [1, 3], "x": 0, "y": 0 }, + { "flags": 4, "matrix": [2, 6], "x": 20, "y": 0 }, + { "flags": 4, "matrix": [3, 6], "x": 30, "y": 0 }, + { "flags": 4, "matrix": [3, 1], "x": 40, "y": 0 }, + { "flags": 4, "matrix": [3, 3], "x": 50, "y": 0 }, + { "flags": 4, "matrix": [0, 7], "x": 60, "y": 0 }, + { "flags": 4, "matrix": [6, 3], "x": 70, "y": 0 }, + { "flags": 4, "matrix": [7, 1], "x": 80, "y": 0 }, + { "flags": 4, "matrix": [7, 6], "x": 90, "y": 0 }, + { "flags": 4, "matrix": [10, 6], "x": 100, "y": 0 }, + { "flags": 4, "matrix": [10, 7], "x": 110, "y": 0 }, + { "flags": 4, "matrix": [10, 3], "x": 120, "y": 0 }, + { "flags": 4, "matrix": [10, 5], "x": 130, "y": 0 }, + { "flags": 4, "matrix": [9, 7], "x": 140, "y": 0 }, + { "flags": 4, "matrix": [0, 2], "x": 150, "y": 0 }, + { "flags": 4, "matrix": [1, 6], "x": 0, "y": 10 }, + { "flags": 4, "matrix": [1, 7], "x": 10, "y": 10 }, + { "flags": 4, "matrix": [2, 7], "x": 20, "y": 10 }, + { "flags": 4, "matrix": [3, 7], "x": 30, "y": 10 }, + { "flags": 4, "matrix": [4, 7], "x": 40, "y": 10 }, + { "flags": 4, "matrix": [4, 6], "x": 50, "y": 10 }, + { "flags": 4, "matrix": [5, 6], "x": 60, "y": 10 }, + { "flags": 4, "matrix": [5, 7], "x": 70, "y": 10 }, + { "flags": 4, "matrix": [6, 7], "x": 80, "y": 10 }, + { "flags": 4, "matrix": [7, 7], "x": 90, "y": 10 }, + { "flags": 4, "matrix": [8, 7], "x": 100, "y": 10 }, + { "flags": 4, "matrix": [8, 6], "x": 110, "y": 10 }, + { "flags": 4, "matrix": [6, 6], "x": 120, "y": 10 }, + { "flags": 4, "matrix": [10, 1], "x": 130, "y": 10 }, + { "flags": 4, "matrix": [11, 6], "x": 150, "y": 10 }, + { "flags": 4, "matrix": [1, 1], "x": 0, "y": 20 }, + { "flags": 4, "matrix": [1, 0], "x": 15, "y": 20 }, + { "flags": 4, "matrix": [2, 0], "x": 25, "y": 20 }, + { "flags": 4, "matrix": [3, 0], "x": 35, "y": 20 }, + { "flags": 4, "matrix": [4, 0], "x": 45, "y": 20 }, + { "flags": 4, "matrix": [4, 1], "x": 55, "y": 20 }, + { "flags": 4, "matrix": [5, 1], "x": 65, "y": 20 }, + { "flags": 4, "matrix": [5, 0], "x": 75, "y": 20 }, + { "flags": 4, "matrix": [6, 0], "x": 85, "y": 20 }, + { "flags": 4, "matrix": [7, 0], "x": 95, "y": 20 }, + { "flags": 4, "matrix": [8, 0], "x": 105, "y": 20 }, + { "flags": 4, "matrix": [8, 1], "x": 115, "y": 20 }, + { "flags": 4, "matrix": [6, 1], "x": 125, "y": 20 }, + { "flags": 4, "matrix": [10, 2], "x": 135, "y": 20 }, + { "flags": 4, "matrix": [6, 5], "x": 150, "y": 20 }, + { "flags": 4, "matrix": [2, 1], "x": 0, "y": 30 }, + { "flags": 4, "matrix": [1, 2], "x": 17, "y": 30 }, + { "flags": 8, "matrix": [2, 2], "x": 27, "y": 30 }, + { "flags": 4, "matrix": [3, 2], "x": 37, "y": 30 }, + { "flags": 4, "matrix": [4, 2], "x": 47, "y": 30 }, + { "flags": 4, "matrix": [4, 3], "x": 57, "y": 30 }, + { "flags": 4, "matrix": [5, 3], "x": 67, "y": 30 }, + { "flags": 4, "matrix": [5, 2], "x": 77, "y": 30 }, + { "flags": 4, "matrix": [6, 2], "x": 87, "y": 30 }, + { "flags": 4, "matrix": [7, 2], "x": 97, "y": 30 }, + { "flags": 4, "matrix": [8, 2], "x": 107, "y": 30 }, + { "flags": 4, "matrix": [8, 3], "x": 117, "y": 30 }, + { "flags": 4, "matrix": [10, 4], "x": 127, "y": 30 }, + { "flags": 4, "matrix": [1, 5], "x": 150, "y": 30 }, + { "flags": 4, "matrix": [0, 0], "x": 0, "y": 40 }, + { "flags": 4, "matrix": [1, 4], "x": 22, "y": 40 }, + { "flags": 4, "matrix": [2, 4], "x": 32, "y": 40 }, + { "flags": 4, "matrix": [3, 4], "x": 42, "y": 40 }, + { "flags": 4, "matrix": [4, 4], "x": 52, "y": 40 }, + { "flags": 4, "matrix": [4, 5], "x": 62, "y": 40 }, + { "flags": 4, "matrix": [5, 5], "x": 72, "y": 40 }, + { "flags": 4, "matrix": [5, 4], "x": 82, "y": 40 }, + { "flags": 4, "matrix": [6, 4], "x": 92, "y": 40 }, + { "flags": 4, "matrix": [7, 4], "x": 102, "y": 40 }, + { "flags": 4, "matrix": [8, 5], "x": 112, "y": 40 }, + { "flags": 4, "matrix": [9, 1], "x": 122, "y": 40 }, + { "flags": 4, "matrix": [3, 5], "x": 140, "y": 40 }, + { "flags": 4, "matrix": [2, 5], "x": 150, "y": 40 }, + { "flags": 4, "matrix": [0, 6], "x": 0, "y": 50 }, + { "flags": 4, "matrix": [9, 0], "x": 12, "y": 50 }, + { "flags": 4, "matrix": [9, 3], "x": 25, "y": 50 }, + { "flags": 4, "matrix": [9, 4], "x": 37, "y": 50 }, + { "flags": 4, "matrix": [9, 5], "x": 100, "y": 50 }, + { "flags": 4, "matrix": [9, 2], "x": 110, "y": 50 }, + { "flags": 4, "matrix": [0, 4], "x": 120, "y": 50 }, + { "flags": 4, "matrix": [0, 3], "x": 130, "y": 50 }, + { "flags": 4, "matrix": [7, 3], "x": 140, "y": 50 }, + { "flags": 4, "matrix": [0, 5], "x": 150, "y": 50 }, + { "flags": 4, "matrix": [11, 0], "x": 0, "y": 1 }, + { "flags": 4, "matrix": [11, 1], "x": 0, "y": 2 } + ] + }, + "url": "", + "usb": { + "device_version": "0.0.3", + "pid": "0xE392", + "vid": "0x342D" + }, "layouts": { "LAYOUT": { "layout": [ - { "label": "ESC", "x": 0, "y": 0 }, - { "label": "F1", "x": 1.25, "y": 0 }, - { "label": "F2", "x": 2.25, "y": 0 }, - { "label": "F3", "x": 3.25, "y": 0 }, - { "label": "F4", "x": 4.25, "y": 0 }, - { "label": "F5", "x": 5.5, "y": 0 }, - { "label": "F6", "x": 6.5, "y": 0 }, - { "label": "F7", "x": 7.5, "y": 0 }, - { "label": "F8", "x": 8.5, "y": 0 }, - { "label": "F9", "x": 9.75, "y": 0 }, - { "label": "F10", "x": 10.75, "y": 0 }, - { "label": "F11", "x": 11.75, "y": 0 }, - { "label": "F12", "x": 12.75, "y": 0 }, - { "label": "Printscreen", "x": 14, "y": 0 }, - { "label": "Del", "x": 15.5, "y": 0 }, - { "label": "z1", "x": 16.25, "y": 0 }, - { "label": "z2", "x": 17.25, "y": 0 }, - - { "label": "`", "x": 0, "y": 1 }, - { "label": "1", "x": 1, "y": 1 }, - { "label": "2", "x": 2, "y": 1 }, - { "label": "3", "x": 3, "y": 1 }, - { "label": "4", "x": 4, "y": 1 }, - { "label": "5", "x": 5, "y": 1 }, - { "label": "6", "x": 6, "y": 1 }, - { "label": "7", "x": 7, "y": 1 }, - { "label": "8", "x": 8, "y": 1 }, - { "label": "9", "x": 9, "y": 1 }, - { "label": "0", "x": 10, "y": 1 }, - { "label": "-", "x": 11, "y": 1 }, - { "label": "=", "x": 12, "y": 1 }, - { "label": "Backspace", "x": 13, "y": 1, "w": 2}, - { "label": "Home", "x": 15.5, "y": 1 }, - - - { "label": "Tab", "x": 0, "y": 2, "w": 1.5}, - { "label": "Q", "x": 1.5, "y": 2 }, - { "label": "W", "x": 2.5, "y": 2 }, - { "label": "E", "x": 3.5, "y": 2 }, - { "label": "R", "x": 4.5, "y": 2 }, - { "label": "T", "x": 5.5, "y": 2 }, - { "label": "Y", "x": 6.5, "y": 2 }, - { "label": "U", "x": 7.5, "y": 2 }, - { "label": "I", "x": 8.5, "y": 2 }, - { "label": "O", "x": 9.5, "y": 2 }, - { "label": "P", "x": 10.5, "y": 2 }, - { "label": "[", "x": 11.5, "y": 2 }, - { "label": "]", "x": 12.5, "y": 2 }, - { "label": "\\", "x": 13.5, "y": 2 , "w": 1.25}, - { "label": "End", "x": 15.5, "y": 2 }, - - { "label": "Caps Lock", "x": 0, "y": 3, "w": 1.75}, - { "label": "A", "x": 1.75, "y": 3 }, - { "label": "S", "x": 2.75, "y": 3 }, - { "label": "D", "x": 3.75, "y": 3 }, - { "label": "F", "x": 4.75, "y": 3 }, - { "label": "G", "x": 5.75, "y": 3 }, - { "label": "H", "x": 6.75, "y": 3 }, - { "label": "J", "x": 7.75, "y": 3 }, - { "label": "K", "x": 8.75, "y": 3 }, - { "label": "L", "x": 9.75, "y": 3 }, - { "label": ";", "x": 10.75, "y": 3 }, - { "label": "'", "x": 11.75, "y": 3 }, - { "label": "Enter", "x": 12.75, "y": 3, "w": 2.25 }, - { "label": "PgUp", "x": 15.5, "y": 3 }, - - { "label": "Shift", "x": 0, "y": 4, "w": 2.25}, - { "label": "Z", "x": 2.25, "y": 4 }, - { "label": "X", "x": 3.25, "y": 4 }, - { "label": "C", "x": 4.25, "y": 4 }, - { "label": "V", "x": 5.25, "y": 4 }, - { "label": "B", "x": 6.25, "y": 4 }, - { "label": "N", "x": 7.25, "y": 4 }, - { "label": "M", "x": 8.25, "y": 4 }, - { "label": ",", "x": 9.25, "y": 4 }, - { "label": ".", "x": 10.25, "y": 4 }, - { "label": "/", "x": 11.25, "y": 4 }, - { "label": "Shift", "x": 12.25, "y": 4, "w": 1.75}, - { "label": "Up", "x": 14.25, "y": 4 }, - { "label": "PgDn", "x": 15.5, "y": 4 }, - - { "label": "Ctrl", "x": 0, "y": 5, "w": 1.25}, - { "label": "Win", "x": 1.25, "y": 5, "w": 1.25}, - { "label": "Alt", "x": 2.5, "y": 5, "w": 1.25}, - { "label": "Space", "x": 3.75, "y": 5, "w": 6.25}, - { "label": "Alt", "x": 10, "y": 5 }, - { "label": "FN", "x": 11, "y": 5 }, - { "label": "Ctrl", "x": 12, "y": 5 }, - { "label": "Left", "x": 13.25, "y": 5 }, - { "label": "Down", "x": 14.25, "y": 5 }, - { "label": "Right", "x": 15.25, "y": 5 } - + { "label": "ESC", "matrix": [1, 3], "x": 0, "y": 0 }, + { "label": "F1", "matrix": [2, 6], "x": 2, "y": 0 }, + { "label": "F2", "matrix": [3, 6], "x": 3, "y": 0 }, + { "label": "F3", "matrix": [3, 1], "x": 4, "y": 0 }, + { "label": "F4", "matrix": [3, 3], "x": 5, "y": 0 }, + { "label": "F5", "matrix": [0, 7], "x": 6, "y": 0 }, + { "label": "F6", "matrix": [6, 3], "x": 7, "y": 0 }, + { "label": "F7", "matrix": [7, 1], "x": 8, "y": 0 }, + { "label": "F8", "matrix": [7, 6], "x": 9, "y": 0 }, + { "label": "F9", "matrix": [10, 6], "x": 10, "y": 0 }, + { "label": "F10", "matrix": [10, 7], "x": 11, "y": 0 }, + { "label": "F11", "matrix": [10, 3], "x": 12, "y": 0 }, + { "label": "F12", "matrix": [10, 5], "x": 13, "y": 0 }, + { "label": "Printscreen", "matrix": [9, 7], "x": 14, "y": 0 }, + { "label": "Del", "matrix": [0, 2], "x": 15, "y": 0 }, + { "label": "`", "matrix": [1, 6], "x": 0, "y": 1 }, + { "label": "1", "matrix": [1, 7], "x": 1, "y": 1 }, + { "label": "2", "matrix": [2, 7], "x": 2, "y": 1 }, + { "label": "3", "matrix": [3, 7], "x": 3, "y": 1 }, + { "label": "4", "matrix": [4, 7], "x": 4, "y": 1 }, + { "label": "5", "matrix": [4, 6], "x": 5, "y": 1 }, + { "label": "6", "matrix": [5, 6], "x": 6, "y": 1 }, + { "label": "7", "matrix": [5, 7], "x": 7, "y": 1 }, + { "label": "8", "matrix": [6, 7], "x": 8, "y": 1 }, + { "label": "9", "matrix": [7, 7], "x": 9, "y": 1 }, + { "label": "0", "matrix": [8, 7], "x": 10, "y": 1 }, + { "label": "-", "matrix": [8, 6], "x": 11, "y": 1 }, + { "label": "=", "matrix": [6, 6], "x": 12, "y": 1 }, + { "label": "Backspace", "matrix": [10, 1], "w": 2, "x": 13, "y": 1 }, + { "label": "Home", "matrix": [11, 6], "x": 15, "y": 1 }, + { "label": "Tab", "matrix": [1, 1], "w": 1.5, "x": 0, "y": 2 }, + { "label": "Q", "matrix": [1, 0], "x": 1.5, "y": 2 }, + { "label": "W", "matrix": [2, 0], "x": 2.5, "y": 2 }, + { "label": "E", "matrix": [3, 0], "x": 3.5, "y": 2 }, + { "label": "R", "matrix": [4, 0], "x": 4.5, "y": 2 }, + { "label": "T", "matrix": [4, 1], "x": 5.5, "y": 2 }, + { "label": "Y", "matrix": [5, 1], "x": 6.5, "y": 2 }, + { "label": "U", "matrix": [5, 0], "x": 7.5, "y": 2 }, + { "label": "I", "matrix": [6, 0], "x": 8.5, "y": 2 }, + { "label": "O", "matrix": [7, 0], "x": 9.5, "y": 2 }, + { "label": "P", "matrix": [8, 0], "x": 10.5, "y": 2 }, + { "label": "[", "matrix": [8, 1], "x": 11.5, "y": 2 }, + { "label": "]", "matrix": [6, 1], "x": 12.5, "y": 2 }, + { "label": "\\", "matrix": [10, 2], "w": 1.5, "x": 13.5, "y": 2 }, + { "label": "End", "matrix": [6, 5], "x": 15, "y": 2 }, + { "label": "Caps Lock", "matrix": [2, 1], "w": 1.75, "x": 0, "y": 3 }, + { "label": "A", "matrix": [1, 2], "x": 1.75, "y": 3 }, + { "label": "S", "matrix": [2, 2], "x": 2.75, "y": 3 }, + { "label": "D", "matrix": [3, 2], "x": 3.75, "y": 3 }, + { "label": "F", "matrix": [4, 2], "x": 4.75, "y": 3 }, + { "label": "G", "matrix": [4, 3], "x": 5.75, "y": 3 }, + { "label": "H", "matrix": [5, 3], "x": 6.75, "y": 3 }, + { "label": "J", "matrix": [5, 2], "x": 7.75, "y": 3 }, + { "label": "K", "matrix": [6, 2], "x": 8.75, "y": 3 }, + { "label": "L", "matrix": [7, 2], "x": 9.75, "y": 3 }, + { "label": ";", "matrix": [8, 2], "x": 10.75, "y": 3 }, + { "label": "'", "matrix": [8, 3], "x": 11.75, "y": 3 }, + { "label": "Enter", "matrix": [10, 4], "w": 2.25, "x": 12.75, "y": 3 }, + { "label": "PgUp", "matrix": [1, 5], "x": 15, "y": 3 }, + { "label": "Shift", "matrix": [0, 0], "w": 2.25, "x": 0, "y": 4 }, + { "label": "Z", "matrix": [1, 4], "x": 2.25, "y": 4 }, + { "label": "X", "matrix": [2, 4], "x": 3.25, "y": 4 }, + { "label": "C", "matrix": [3, 4], "x": 4.25, "y": 4 }, + { "label": "V", "matrix": [4, 4], "x": 5.25, "y": 4 }, + { "label": "B", "matrix": [4, 5], "x": 6.25, "y": 4 }, + { "label": "N", "matrix": [5, 5], "x": 7.25, "y": 4 }, + { "label": "M", "matrix": [5, 4], "x": 8.25, "y": 4 }, + { "label": ",", "matrix": [6, 4], "x": 9.25, "y": 4 }, + { "label": ".", "matrix": [7, 4], "x": 10.25, "y": 4 }, + { "label": "/", "matrix": [8, 5], "x": 11.25, "y": 4 }, + { "label": "Shift", "matrix": [9, 1], "w": 1.75, "x": 12.25, "y": 4 }, + { "label": "Up", "matrix": [3, 5], "x": 14, "y": 4 }, + { "label": "PgDn", "matrix": [2, 5], "x": 15, "y": 4 }, + { "label": "Ctrl", "matrix": [0, 6], "w": 1.25, "x": 0, "y": 5 }, + { "label": "Win", "matrix": [9, 0], "w": 1.25, "x": 1.25, "y": 5 }, + { "label": "Alt", "matrix": [9, 3], "w": 1.25, "x": 2.5, "y": 5 }, + { "label": "Space", "matrix": [9, 4], "w": 6.25, "x": 3.75, "y": 5 }, + { "label": "Alt", "matrix": [9, 5], "x": 10, "y": 5 }, + { "label": "FN", "matrix": [9, 2], "x": 11, "y": 5 }, + { "label": "Ctrl", "matrix": [0, 4], "x": 12, "y": 5 }, + { "label": "Left", "matrix": [0, 3], "x": 13, "y": 5 }, + { "label": "Down", "matrix": [7, 3], "x": 14, "y": 5 }, + { "label": "Right", "matrix": [0, 5], "x": 15, "y": 5 } ] } } diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index be6c2a6d5005..a41ae6f4efd9 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "kd83a_bfg_edition.h" +#include "quantum.h" #ifdef RGB_MATRIX_ENABLE @@ -26,224 +26,100 @@ const aw_led g_aw_leds[RGB_MATRIX_LED_COUNT] = { * | | | B location * | | | | */ //{0, CS1_SW4, CS2_SW4, CS3_SW4}, // 0, k00, Esc - - {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 0, k00, Esc - {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 1, k10, F1 - {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 2, k20, F2 - {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 3, k30, F3 - {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 4, k40, F4 - {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 5, k50, F5 - {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 6, k60, F6 - {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 7, k70, F7 - {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 8, k80, F8 - {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 9, k90, F9 - {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 10, ka0, F10 - {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 11, kb0, F11 - {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 12, kc0, F12 - {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 13, kd0, Printscreen - {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 14, k56, Del - - {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 15, k01, ` - {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 16, k11, 1 - {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 17, k21, 2 - {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 18, k31, 3 - {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 19, k41, 4 - {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 20, k51, 5 - {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 21, k61, 6 - {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 22, k71, 7 - {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 23, k81, 8 - {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 24, k91, 9 - {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 25, ka1, 0 - {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 26, kb1, - - {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 27, kc1, = - {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 28, kd1, Backspace - {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 29, k16, Home - {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 30, k02, Tab - {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 31, k12, Q - {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 32, k22, W - {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 33, k32, E - {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 34, k42, R - {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 35, k52, T - {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 36, k62, Y - {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 37, k72, U - {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 38, k82, I - {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 39, k92, O - {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 40, ka2, P - {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 41, kb2, [ - {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 42, kc2, ] - {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 43, kd3, "\\" - {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 44, k06, End - - {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 45, k03, Caps Lock - {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 46, k13, A - {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 47, k23, S - {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 48, k33, D - {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 49, k43, F - {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 50, k53, G - {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 51, k63, H - {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 52, k73, J - {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 53, k83, K - {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 54, k93, L - {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 55, ka3, ; - {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 56, kb3, ' - {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 57, kc3, Enter - {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 58, k26, PgUp - - {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 59, k04, Shift_L - {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 60, k24, Z - {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 61, k34, X - {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 62, k44, C - {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 63, k54, V - {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 64, k64, B - {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 65, k74, N - {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 66, k84, M - {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 67, k94, , - {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 68, ka4, . - {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 69, kb4, / - {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 70, kd4, Shift_R - {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 71, k17, Up - {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 72, k36, PgDn - - {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 73, k05, Ctrl_L - {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 74, k15, Win_L - {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 75, k25, Alt_L - {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 76, k65, Space - {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 77, k95, Alt_R - {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 78, ka5, FN - {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 79, kc5, Ctrl_R - {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 80, k07, Left - {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 81, k27, Down - {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 82, k37, Right - - {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 83, Z1 - {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 84, Z2 + {0, CS1_SW1, CS2_SW1, CS3_SW1}, // 1, k13, Esc + {0, CS1_SW2, CS2_SW2, CS3_SW2}, // 2, k26, F1 + {0, CS1_SW3, CS2_SW3, CS3_SW3}, // 3, k36, F2 + {0, CS1_SW4, CS2_SW4, CS3_SW4}, // 4, k31, F3 + {0, CS1_SW5, CS2_SW5, CS3_SW5}, // 5, k33, F4 + {0, CS1_SW6, CS2_SW6, CS3_SW6}, // 6, k07, F5 + {0, CS1_SW7, CS2_SW7, CS3_SW7}, // 7, k63, F6 + {0, CS1_SW8, CS2_SW8, CS3_SW8}, // 8, k71, F7 + {0, CS1_SW9, CS2_SW9, CS3_SW9}, // 9, k76, F8 + {0, CS1_SW10, CS2_SW10, CS3_SW10}, // 10, ka6, F9 + {0, CS1_SW11, CS2_SW11, CS3_SW11}, // 11, ka7, F10 + {0, CS1_SW12, CS2_SW12, CS3_SW12}, // 12, ka3, F11 + {1, CS1_SW1, CS2_SW1, CS3_SW1}, // 13, ka5, F12 + {1, CS4_SW2, CS5_SW2, CS6_SW2}, // 14, k97, Printscreen + {1, CS4_SW5, CS5_SW5, CS6_SW5}, // 15, k02, Del + + {0, CS4_SW1, CS5_SW1, CS6_SW1}, // 16, k16, ` + {0, CS4_SW2, CS5_SW2, CS6_SW2}, // 17, k17, 1 + {0, CS4_SW3, CS5_SW3, CS6_SW3}, // 18, k27, 2 + {0, CS4_SW4, CS5_SW4, CS6_SW4}, // 19, k37, 3 + {0, CS4_SW5, CS5_SW5, CS6_SW5}, // 20, k47, 4 + {0, CS4_SW6, CS5_SW6, CS6_SW6}, // 21, k46, 5 + {0, CS4_SW7, CS5_SW7, CS6_SW7}, // 22, k56, 6 + {0, CS4_SW8, CS5_SW8, CS6_SW8}, // 23, k57, 7 + {0, CS4_SW9, CS5_SW9, CS6_SW9}, // 24, k67, 8 + {0, CS4_SW10, CS5_SW10, CS6_SW10}, // 25, k77, 9 + {0, CS4_SW11, CS5_SW11, CS6_SW11}, // 26, k87, 0 + {0, CS4_SW12, CS5_SW12, CS6_SW12}, // 27, k86, - + {1, CS1_SW5, CS2_SW5, CS3_SW5}, // 28, k66, = + {1, CS1_SW7, CS2_SW7, CS3_SW7}, // 29, ka1, Backspace + {1, CS1_SW2, CS2_SW2, CS3_SW2}, // 30, kc6, Home + + {0, CS7_SW1, CS8_SW1, CS9_SW1}, // 31, k11, Tab + {0, CS7_SW2, CS8_SW2, CS9_SW2}, // 32, k10, Q + {0, CS7_SW3, CS8_SW3, CS9_SW3}, // 33, k20, W + {0, CS7_SW4, CS8_SW4, CS9_SW4}, // 34, k30, E + {0, CS7_SW5, CS8_SW5, CS9_SW5}, // 35, k40, R + {0, CS7_SW6, CS8_SW6, CS9_SW6}, // 36, k41, T + {0, CS7_SW7, CS8_SW7, CS9_SW7}, // 37, k51, Y + {0, CS7_SW8, CS8_SW8, CS9_SW8}, // 38, k50, U + {0, CS7_SW9, CS8_SW9, CS9_SW9}, // 39, k60, I + {0, CS7_SW10, CS8_SW10, CS9_SW10}, // 40, k70, O + {0, CS7_SW11, CS8_SW11, CS9_SW11}, // 41, k80, P + {0, CS7_SW12, CS8_SW12, CS9_SW12}, // 42, k81, [ + {1, CS1_SW8, CS2_SW8, CS3_SW8}, // 43, k61, ] + {1, CS1_SW9, CS2_SW9, CS3_SW9}, // 44, ka2, "\\" + {1, CS4_SW3, CS5_SW3, CS6_SW3}, // 45, k65, End + + {0, CS10_SW1, CS11_SW1, CS12_SW1}, // 46, k21, Caps Lock + {0, CS10_SW2, CS11_SW2, CS12_SW2}, // 47, k12, A + {0, CS10_SW3, CS11_SW3, CS12_SW3}, // 48, k22, S + {0, CS10_SW4, CS11_SW4, CS12_SW4}, // 49, k32, D + {0, CS10_SW5, CS11_SW5, CS12_SW5}, // 50, k42, F + {0, CS10_SW6, CS11_SW6, CS12_SW6}, // 51, k43, G + {0, CS10_SW7, CS11_SW7, CS12_SW7}, // 52, k53, H + {0, CS10_SW8, CS11_SW8, CS12_SW8}, // 53, k52, J + {0, CS10_SW9, CS11_SW9, CS12_SW9}, // 54, k62, K + {0, CS10_SW10, CS11_SW10, CS12_SW10}, // 55, k72, L + {0, CS10_SW11, CS11_SW11, CS12_SW11}, // 56, k82, ; + {0, CS10_SW12, CS11_SW12, CS12_SW12}, // 57, k83, ' + {1, CS1_SW11, CS2_SW11, CS3_SW11}, // 58, ka4, Enter + {1, CS4_SW4, CS5_SW4, CS6_SW4}, // 59, k15, PgUp + + {0, CS13_SW1, CS14_SW1, CS15_SW1}, // 60, k00, Shift_L + {0, CS13_SW2, CS14_SW2, CS15_SW2}, // 61, k14, Z + {0, CS13_SW3, CS14_SW3, CS15_SW3}, // 62, k24, X + {0, CS13_SW4, CS14_SW4, CS15_SW4}, // 63, k34, C + {0, CS13_SW5, CS14_SW5, CS15_SW5}, // 64, k44, V + {0, CS13_SW6, CS14_SW6, CS15_SW6}, // 65, k45, B + {0, CS13_SW7, CS14_SW7, CS15_SW7}, // 66, k55, N + {0, CS13_SW8, CS14_SW8, CS15_SW8}, // 67, k54, M + {0, CS13_SW9, CS14_SW9, CS15_SW9}, // 68, k64, , + {0, CS13_SW10, CS14_SW10, CS15_SW10}, // 69, k74, . + {0, CS13_SW11, CS14_SW11, CS15_SW11}, // 70, k85, / + {1, CS4_SW8, CS5_SW8, CS6_SW8}, // 71, k91, Shift_R + {1, CS4_SW9, CS5_SW9, CS6_SW9}, // 72, k35, Up + {1, CS4_SW7, CS5_SW7, CS6_SW7}, // 73, k25, PgDn + + {0, CS16_SW1, CS17_SW1, CS18_SW1}, // 74, k06, Ctrl_L + {0, CS16_SW2, CS17_SW2, CS18_SW2}, // 75, k90, Win_L + {0, CS16_SW3, CS17_SW3, CS18_SW3}, // 76, k93, Alt_L + {0, CS16_SW6, CS17_SW6, CS18_SW6}, // 77, k94, Space + {0, CS16_SW9, CS17_SW9, CS18_SW9}, // 78, k95, Alt_R + {0, CS16_SW10, CS17_SW10, CS18_SW10}, // 79, k92, FN + {0, CS16_SW12, CS17_SW12, CS18_SW12}, // 80, k04, Ctrl_R + {1, CS4_SW10, CS5_SW10, CS6_SW10}, // 81, k03, Left + {1, CS4_SW11, CS5_SW11, CS6_SW11}, // 82, k73, Down + {1, CS10_SW5, CS11_SW5, CS12_SW5}, // 83, k05, Right + + {1, CS10_SW10, CS11_SW10, CS12_SW10}, // 84, kb0, Z1 + {1, CS10_SW11, CS11_SW11, CS12_SW11}, // 85, kb1, Z2 }; -#define __ NO_LED -//#define RGB_LAYOUT LAYOUT - -led_config_t g_led_config = { - -{ - { 59, __, 14, 80, 79, 82, 73, 5}, - { 31, 30, 46, 0, 60, 58, 15, 16}, - { 32, 45, 47, __, 61, 72, 1 , 17}, - { 33, 3, 48, 4, 62, 71, 2, 18}, - { 34, 35, 49, 50, 63, 64, 20, 19}, - { 37, 36, 52, 51, 66, 65, 21, 22}, - { 38, 42, 53, 6, 67, 44, 27, 23}, - { 39, 7, 54, 81, 68, __, 8, 24}, - { 40, 41, 55, 56, __, 69, 26, 25}, - { 74, 70, 78, 75, 76, 77, __, 13}, - { __, 28, 43, 11, 57, 12, 9, 10}, - { 83, __, __, __, __, __, __, __}, - { __, __, __, __, __, __, 29, __}, - { 84, __, __, __, __, __, __, __} -}, -{ - { 11, 0}, // 0, k00, Esc - { 22, 0}, // 1, k10, F1 - { 33, 0}, // 2, k20, F2 - { 44, 0}, // 3, k30, F3 - { 55, 0}, // 4, k40, F4 - { 66, 0}, // 5, k50, F5 - { 77, 0}, // 6, k60, F6 - { 88, 0}, // 7, k70, F7 - { 99, 0}, // 8, k80, F8 - { 110, 0}, // 9, k90, F9 - { 121, 0}, // 10, ka0, F10 - { 132, 0}, // 11, kb0, F11 - { 143, 0}, // 12, kc0, F12 - { 154, 0}, // 13, kd0, Printscreen - { 165, 0}, // 14, k56, Home - - { 11, 11}, // 15, k01, ` - { 22, 11}, // 16, k11, 1 - { 33, 11}, // 17, k21, 2 - { 44, 11}, // 18, k31, 3 - { 55, 11}, // 19, k41, 4 - { 66, 11}, // 20, k51, 5 - { 77, 11}, // 21, k61, 6 - { 88, 11}, // 22, k71, 7 - { 99, 11}, // 23, k81, 8 - { 110, 11}, // 24, k91, 9 - { 121, 11}, // 25, ka1, 0 - { 132, 11}, // 26, kb1, - - { 143, 11}, // 27, kc1, = - { 154, 11}, // 28, kd1, Backspace - { 165, 11}, // 29, k16, Ins - - { 11, 22}, // 30, k02, Tab - { 22, 22}, // 31, k12, Q - { 33, 22}, // 32, k22, W - { 44, 22}, // 33, k32, E - { 55, 22}, // 34, k42, R - { 66, 22}, // 35, k52, T - { 77, 22}, // 36, k62, Y - { 88, 22}, // 37, k72, U - { 99, 22}, // 38, k82, I - { 110, 22}, // 39, k92, O - { 121, 22}, // 40, ka2, P - { 132, 22}, // 41, kb2, [ - { 143, 22}, // 42, kc2, ] - { 154, 22}, // 43, kd3, "\\" - { 165, 22}, // 44, k06, Del - - { 11, 33}, // 45, k03, Caps Lock - { 22, 33}, // 46, k13, A - { 33, 33}, // 47, k23, S - { 44, 33}, // 48, k33, D - { 55, 33}, // 49, k43, F - { 66, 33}, // 50, k53, G - { 77, 33}, // 51, k63, H - { 88, 33}, // 52, k73, J - { 99, 33}, // 53, k83, K - { 110, 33}, // 54, k93, L - { 121, 33}, // 55, ka3, ; - { 132, 33}, // 56, kb3, ' - { 154, 33}, // 57, kc3, Enter - { 165, 33}, // 58, k26, PgUp - - { 11, 44}, // 59, k04, Shift_L - { 33, 44}, // 60, k24, Z - { 44, 44}, // 61, k34, X - { 55, 44}, // 62, k44, C - { 66, 44}, // 63, k54, V - { 77, 44}, // 64, k64, B - { 88, 44}, // 65, k74, N - { 99, 44}, // 66, k84, M - { 110, 44}, // 67, k94, , - { 121, 44}, // 68, ka4, . - { 132, 44}, // 69, kb4, / - { 143, 44}, // 70, kd4, Shift_R - { 154, 44}, // 70, k17, Up - { 165, 44}, // 72, k36, PgDn - - { 11, 55}, // 73, k05, Ctrl_L - { 22, 55}, // 74, k15, Win_L - { 33, 55}, // 75, k25, Alt_L - { 77, 55}, // 76, k65, Space - { 110, 55}, // 77, k95, Alt_R - { 121, 55}, // 78, ka5, FN - { 132, 55}, // 79, kc5, Ctrl_R - { 143, 55}, // 80, k07, Left - { 154, 55}, // 81, k27, Down - { 165, 55}, // 82, k37, Right - - { 0, 18}, // 83, Z1 - { 0, 24}, // 84, Z2 -}, -{ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, -} -}; #endif #ifdef EEPROM_ENABLE @@ -270,19 +146,11 @@ void spi_init(void) { #endif -#ifdef ENCODER_ENABLE - -bool encoder_update_kb(uint8_t index, bool clockwise) { - - if (!encoder_update_user(index, clockwise)) { return false; } - if (index == 0) { - if (clockwise) { - tap_code(KC_VOLD); - } else { - tap_code(KC_VOLU); - } - } - return true; -} -#endif - +void keyboard_pre_init_kb(void) { + setPinOutput(C0); + setPinOutput(C15); + keyboard_pre_init_user(); +}; +void housekeeping_task_kb(void) { + writePin(C15, keymap_config.no_gui); +}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index bb9244355eaa..13242cdfff7a 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -18,6 +18,54 @@ // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. + +enum my_keycodes { + KC_SIRI = QK_USER, + KC_DND, + KC_SPOT, + KC_EJ, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_SIRI: + if (record->event.pressed) { + host_consumer_send(0xCF); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_DND: + if (record->event.pressed) { + host_system_send(0x9B); + } else { + host_system_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_SPOT: + if (record->event.pressed) { + host_consumer_send(0x221); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + + case KC_EJ: + if (record->event.pressed) { + host_consumer_send(0x0B8); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + default: + return true; /* Process all other keycodes normally */ + } +}; + enum custom_layers { Win, Mac, @@ -29,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ [Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, @@ -37,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [Mac] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, @@ -45,19 +93,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + QK_BOOT, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, RGB_MOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, + KC_TRNS, KC_TRNS, TO(Win), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(Mac), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, + KC_TRNS, GUI_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_VAD, RGB_SPI), [Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RGB_MOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, + KC_TRNS, KC_TRNS, TO(Win), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(Mac), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_VAD, RGB_SPI), + +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } +}; +#endif +layer_state_t layer_state_set_user(layer_state_t state) { + writePin(C0, layer_state_cmp(state, 1)); + return state; }; diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/rules.mk new file mode 100644 index 000000000000..ee325681483f --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 3cc2224114c8..13242cdfff7a 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -16,106 +16,56 @@ #include QMK_KEYBOARD_H - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. + enum my_keycodes { - KC_MC = SAFE_RANGE, - KC_LPAD, - KC_SIRI, + KC_SIRI = QK_USER, KC_DND, KC_SPOT, KC_EJ, }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_MC: - if (record->event.pressed) { - host_consumer_send(0x29F); - - //add_weak_mods(MOD_BIT(KC_1)); - //tap_code16(KC_1); - //rgblight_step(); - } else { - host_consumer_send(0); - //rgblight_step(); - } - return false; /* Skip all further processing of this key */ - case KC_LPAD: - if (record->event.pressed) { - host_consumer_send(0x2A0); - // rgblight_step_reverse(); - } else { - host_consumer_send(0); - //rgblight_step_reverse(); - } - return false; /* Skip all further processing of this key */ + switch (keycode) { - case KC_SIRI: + case KC_SIRI: if (record->event.pressed) { - - host_consumer_send(0xCF); - // rgblight_step_reverse(); + host_consumer_send(0xCF); } else { host_consumer_send(0); - //rgblight_step_reverse(); } return false; /* Skip all further processing of this key */ case KC_DND: if (record->event.pressed) { - // host_consumer_send(0x2A0); - host_system_send(0x9B); - // rgblight_step_reverse(); + host_system_send(0x9B); } else { - host_system_send(0); - //rgblight_step_reverse(); + host_system_send(0); } return false; /* Skip all further processing of this key */ case KC_SPOT: if (record->event.pressed) { - host_consumer_send(0x221); - // rgblight_step_reverse(); + host_consumer_send(0x221); } else { host_consumer_send(0); - //rgblight_step_reverse(); } - return false; /* Skip all further processing of this key */ + return false; /* Skip all further processing of this key */ case KC_EJ: if (record->event.pressed) { - host_consumer_send(0x0B8); - // rgblight_step_reverse(); + host_consumer_send(0x0B8); } else { host_consumer_send(0); - //rgblight_step_reverse(); } return false; /* Skip all further processing of this key */ - - - default: return true; /* Process all other keycodes normally */ } }; -void housekeeping_task_user(void) { - writePin(C15, keymap_config.no_gui); -}; - -void keyboard_pre_init_user(void) { - - setPinInputLow(C15); - writePin(C15, false); - setPinInputLow(C0); - writePin(C0, false); -}; - enum custom_layers { Win, Mac, @@ -127,50 +77,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: Base Layer (Default Layer) */ [Win] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [Mac] = LAYOUT( - KC_ESC, KC_BRID, KC_BRIU, KC_MC, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_SIRI, KC_F5, KC_F6, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_DEL, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Macfn),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [Winfn] = LAYOUT( - KC_ESC, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, GUI_TOG, KC_LALT, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + QK_BOOT, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, RGB_MOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, + KC_TRNS, KC_TRNS, TO(Win), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(Mac), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, + KC_TRNS, GUI_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_VAD, RGB_SPI), [Macfn] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, RGB_MOD, _______, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, RGB_HUI, - KC_TAB, KC_Q, TO(Win), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, TO(Mac), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, RGB_VAI, KC_PGDN, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(Winfn),KC_RCTL, RGB_SPD, RGB_VAD, RGB_SPI), + QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RGB_MOD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUI, + KC_TRNS, KC_TRNS, TO(Win), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TO(Mac), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPD, RGB_VAD, RGB_SPI), }; -void led_init_ports(void) { - setPinOutput(C0); - setPinOutput(C14); - setPinOutput(C15); +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } }; - +#endif layer_state_t layer_state_set_user(layer_state_t state) { - writePin(C0, layer_state_cmp(state, 1)); - return state; - }; diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk index 1e5b99807cb7..f1adcab005e8 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/rules.mk @@ -1 +1,2 @@ VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md index 9d5827b35f20..ca718509f0cb 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/readme.md +++ b/keyboards/darkproject/kd83a_bfg_edition/readme.md @@ -1,6 +1,6 @@ -# KD83A_BFG_Edition +# kd83a_bfg_edition -An 83 keys keyboard. Equipped with the WestBerry G7 ARM Cortex-M4 microcontroller +An 83 keys keyboard, Equipped with the WestBerry Q95 microcontroller. * Keyboard Maintainer: [GSKY](https://github.com/gksygithub) * Hardware Supported: KD83A_BFG_Edition @@ -14,4 +14,10 @@ Flashing example for this keyboard: make darkproject/kd83a_bfg_edition:default:flash +To reset the board into bootloader mode, do one of the following: + +* Hold the Reset switch mounted on the surface of the PCB back side after the USB cable is connected +* Hold the Escape key while connecting the USB cable (also erases persistent settings) +* Fn+ESC will reset the board to bootloader mode + 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). diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index 261232655127..b35c510d7693 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -1,17 +1,2 @@ -# 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 NKRO Rollover. -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality. -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow. -AUDIO_ENABLE = no # Audio output. -ENCODER_ENABLE = yes -RGB_MATRIX_ENABLE = yes -RGB_MATRIX_DRIVER = AW20216 EEPROM_DRIVER = wear_leveling -WEAR_LEVELING_DRIVER = spi_flash +WEAR_LEVELING_DRIVER = spi_flash \ No newline at end of file From e0ad10afca89e9d8d8226b39a23dcb0e9e6aaaad Mon Sep 17 00:00:00 2001 From: gksygithub <106651989+gksygithub@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:01:11 +0800 Subject: [PATCH 51/59] Update info.json file --- .../darkproject/kd83a_bfg_edition/config.h | 49 ------------------- .../darkproject/kd83a_bfg_edition/info.json | 45 +++++++++++++++++ 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/config.h b/keyboards/darkproject/kd83a_bfg_edition/config.h index f7a9acf71525..9cf993b8613c 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/config.h +++ b/keyboards/darkproject/kd83a_bfg_edition/config.h @@ -42,52 +42,3 @@ #define DRIVER_1_LED_TOTAL 66 #define DRIVER_2_LED_TOTAL 19 #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) - -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_ALPHAS_MODS -#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_BAND_SAT -#define ENABLE_RGB_MATRIX_BAND_VAL -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS -#define ENABLE_RGB_MATRIX_RAINDROPS -#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -#define ENABLE_RGB_MATRIX_HUE_BREATHING -#define ENABLE_RGB_MATRIX_HUE_PENDULUM -#define ENABLE_RGB_MATRIX_HUE_WAVE -#define ENABLE_RGB_MATRIX_PIXEL_RAIN -#define ENABLE_RGB_MATRIX_PIXEL_FLOW -#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -#define ENABLE_RGB_MATRIX_SPLASH -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define ENABLE_RGB_MATRIX_SOLID_SPLASH -#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index e442c749a1d8..c8be808ac3c9 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -34,6 +34,51 @@ "tap_keycode_delay": 10 }, "rgb_matrix": { + "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, + "typing_heatmap": true, + "digital_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 + }, "center_point": [76, 25], "driver": "AW20216", "layout": [ From 43daae8253c02e53328dcb11c7d1b46694c8f4e6 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:03:36 +0800 Subject: [PATCH 52/59] Delete kd83a_bfg_edition.h --- .../kd83a_bfg_edition/kd83a_bfg_edition.h | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h deleted file mode 100644 index 4e3cb0fc0374..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2022 GSKY - * - * 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 "quantum.h" - -#define ___ KC_NO - - -// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 Prt Del Z1 Z2 -// ` 1 2 3 4 5 6 7 8 9 0 - = BSpc Home -// Tab Q W E R T Y U I O P [ ] \\ End -// Caps A S D F G H J K L ; ' Enter PgUp -// Sh_L Z X C V B N M , . / Sh_R Up PgDn -// Ct_L Win_L Alt_L SPACE Alt_R FN Ct_R Left Down Right - - -#define LAYOUT( \ - k13, k26, k36, k31, k33, k07, k63, k71, k76, ka6, ka7, ka3, ka5, k97, k02, kb0, kd0, \ - k16, k17, k27, k37, k47, k46, k56, k57, k67, k77, k87, k86, k66, ka1, kc6, \ - k11, k10, k20, k30, k40, k41, k51, k50, k60, k70, k80, k81, k61, ka2, k65, \ - k21, k12, k22, k32, k42, k43, k53, k52, k62, k72, k82, k83, ka4, k15, \ - k00, k14, k24, k34, k44, k45, k55, k54, k64, k74, k85, k91, k35, k25, \ - k06, k90, k93, k94, k95, k92, k04, k03, k73, k05 \ -)\ -{\ - { k00, ___, k02, k03, k04, k05, k06, k07},\ - { k10, k11, k12, k13, k14, k15, k16, k17},\ - { k20, k21, k22, ___, k24, k25, k26, k27},\ - { k30, k31, k32, k33, k34, k35, k36, k37},\ - { k40, k41, k42, k43, k44, k45, k46, k47},\ - { k50, k51, k52, k53, k54, k55, k56, k57},\ - { k60, k61, k62, k63, k64, k65, k66, k67},\ - { k70, k71, k72, k73, k74, ___, k76, k77},\ - { k80, k81, k82, k83, ___, k85, k86, k87},\ - { k90, k91, k92, k93, k94, k95, ___, k97},\ - { ___, ka1, ka2, ka3, ka4, ka5, ka6, ka7},\ - { kb0, ___, ___, ___, ___, ___, ___, ___},\ - { ___, ___, ___, ___, ___, ___, kc6, ___},\ - { kd0, ___, ___, ___, ___, ___, ___, ___} \ -} From 2047564b99a36fbda5b36d6c845551f047f0cf25 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:41:26 +0800 Subject: [PATCH 53/59] Delete readme.md in default folder --- .../darkproject/kd83a_bfg_edition/keymaps/default/readme.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md deleted file mode 100644 index 1bdbac95804d..000000000000 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The Default KD83A_BFG_Edition Layout From d0adec0037a4f5f86528a3faadfc0771ad1c3d25 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:34:20 +0800 Subject: [PATCH 54/59] Update info.json file From f23bb58a71dcb1ec69d6740f8db01599328b8462 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:37:16 +0800 Subject: [PATCH 55/59] update info.json --- keyboards/darkproject/kd83a_bfg_edition/info.json | 5 ++++- keyboards/darkproject/kd83a_bfg_edition/rules.mk | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/info.json b/keyboards/darkproject/kd83a_bfg_edition/info.json index c8be808ac3c9..5795c11cca35 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/info.json +++ b/keyboards/darkproject/kd83a_bfg_edition/info.json @@ -80,7 +80,7 @@ "solid_multisplash": true }, "center_point": [76, 25], - "driver": "AW20216", + "driver": "aw20216", "layout": [ { "flags": 4, "matrix": [1, 3], "x": 0, "y": 0 }, { "flags": 4, "matrix": [2, 6], "x": 20, "y": 0 }, @@ -175,6 +175,9 @@ "pid": "0xE392", "vid": "0x342D" }, + "eeprom": { + "driver": "wear_leveling" + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/darkproject/kd83a_bfg_edition/rules.mk b/keyboards/darkproject/kd83a_bfg_edition/rules.mk index b35c510d7693..07eb511a199b 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/rules.mk +++ b/keyboards/darkproject/kd83a_bfg_edition/rules.mk @@ -1,2 +1 @@ -EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = spi_flash \ No newline at end of file From fa7ad621b0fdcc50398cef1b98693665cab9d837 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:31:44 +0800 Subject: [PATCH 56/59] Updated changes --- .../darkproject/kd83a_bfg_edition/keymaps/via/keymap.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 13242cdfff7a..79d0e1e8e7f7 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -22,7 +22,6 @@ enum my_keycodes { KC_SIRI = QK_USER, KC_DND, - KC_SPOT, KC_EJ, }; @@ -46,14 +45,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; /* Skip all further processing of this key */ - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - case KC_EJ: if (record->event.pressed) { host_consumer_send(0x0B8); From 18e411b0e86e0e54a69120d2de6e68ff6f74e7e6 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:27:13 +0800 Subject: [PATCH 57/59] Updated changes --- .../kd83a_bfg_edition/keymaps/default/keymap.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index 13242cdfff7a..79d0e1e8e7f7 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -22,7 +22,6 @@ enum my_keycodes { KC_SIRI = QK_USER, KC_DND, - KC_SPOT, KC_EJ, }; @@ -46,14 +45,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; /* Skip all further processing of this key */ - case KC_SPOT: - if (record->event.pressed) { - host_consumer_send(0x221); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - case KC_EJ: if (record->event.pressed) { host_consumer_send(0x0B8); From 4c9debeaf8562539f4a2e7d6413c1e77c37b4498 Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:01:20 +0800 Subject: [PATCH 58/59] Resolved requested changes --- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 18 ++++++++- .../kd83a_bfg_edition/kd83a_bfg_edition.h | 22 +++++++++++ .../keymaps/default/keymap.c | 38 ------------------- .../kd83a_bfg_edition/keymaps/via/keymap.c | 38 ------------------- 4 files changed, 39 insertions(+), 77 deletions(-) create mode 100644 keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index a41ae6f4efd9..1d8a7d55891a 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "quantum.h" +#include "kd83a_bfg_edition.h" #ifdef RGB_MATRIX_ENABLE @@ -154,3 +154,19 @@ void keyboard_pre_init_kb(void) { void housekeeping_task_kb(void) { writePin(C15, keymap_config.no_gui); }; + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + + case KC_SIRI: + if (record->event.pressed) { + host_consumer_send(0xCF); + } else { + host_consumer_send(0); + } + return false; /* Skip all further processing of this key */ + default: + return true; /* Process all other keycodes normally */ + } +}; \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h new file mode 100644 index 000000000000..e2c656eb0eb2 --- /dev/null +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.h @@ -0,0 +1,22 @@ +/* Copyright 2022 GSKY + * + * 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 "quantum.h" + +enum keyboard_keycodes { + KC_SIRI = QK_KB_0 +}; diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c index 79d0e1e8e7f7..78324c69426b 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/default/keymap.c @@ -19,44 +19,6 @@ // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_SIRI = QK_USER, - KC_DND, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_SIRI: - if (record->event.pressed) { - host_consumer_send(0xCF); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - host_system_send(0x9B); - } else { - host_system_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - default: - return true; /* Process all other keycodes normally */ - } -}; - enum custom_layers { Win, Mac, diff --git a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c index 79d0e1e8e7f7..78324c69426b 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c +++ b/keyboards/darkproject/kd83a_bfg_edition/keymaps/via/keymap.c @@ -19,44 +19,6 @@ // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. -enum my_keycodes { - KC_SIRI = QK_USER, - KC_DND, - KC_EJ, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - switch (keycode) { - - case KC_SIRI: - if (record->event.pressed) { - host_consumer_send(0xCF); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_DND: - if (record->event.pressed) { - host_system_send(0x9B); - } else { - host_system_send(0); - } - return false; /* Skip all further processing of this key */ - - case KC_EJ: - if (record->event.pressed) { - host_consumer_send(0x0B8); - } else { - host_consumer_send(0); - } - return false; /* Skip all further processing of this key */ - default: - return true; /* Process all other keycodes normally */ - } -}; - enum custom_layers { Win, Mac, From 430a6896ca5725a476793c3da6940dbfeeb347ee Mon Sep 17 00:00:00 2001 From: gskygithub <106651989+gskygithub@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:16:37 +0800 Subject: [PATCH 59/59] Resolved requested changes --- .../kd83a_bfg_edition/kd83a_bfg_edition.c | 20 +++++++++++++++++-- .../darkproject/kd83a_bfg_edition/readme.md | 2 ++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c index 1d8a7d55891a..e78de78bf80b 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c +++ b/keyboards/darkproject/kd83a_bfg_edition/kd83a_bfg_edition.c @@ -156,7 +156,9 @@ void housekeeping_task_kb(void) { }; bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - + if (!process_record_user(keycode, record)) { + return false; + } switch (keycode) { case KC_SIRI: @@ -169,4 +171,18 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { default: return true; /* Process all other keycodes normally */ } -}; \ No newline at end of file +}; + +#if defined(ENCODER_ENABLE) +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return false; +}; +#endif \ No newline at end of file diff --git a/keyboards/darkproject/kd83a_bfg_edition/readme.md b/keyboards/darkproject/kd83a_bfg_edition/readme.md index ca718509f0cb..96826c0c1b0c 100644 --- a/keyboards/darkproject/kd83a_bfg_edition/readme.md +++ b/keyboards/darkproject/kd83a_bfg_edition/readme.md @@ -1,4 +1,6 @@ # kd83a_bfg_edition +![KD83A_BFG_EDITION](https://imgur.com/UXuXerrh.png) +![KD83A_BFG_EDITION](https://imgur.com/Dn852gEh.png) An 83 keys keyboard, Equipped with the WestBerry Q95 microcontroller.