Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keyboard] Add Erdnuss 65 #20202

Merged
merged 20 commits into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modified part of the code
  • Loading branch information
ctt-t committed Feb 18, 2023
commit 705035c375487150587588f2bc67b01e40cc0b61
25 changes: 0 additions & 25 deletions keyboards/citrus/erdnuss65/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,9 @@

#include "config_common.h"

/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15

#define MATRIX_ROW_PINS { B10, B1, B0, A7, A6 }
#define MATRIX_COL_PINS { B12, B14, B15, A8, B13, B7, B8, B9, A1, A2, A0, A3, A4, A5, B11 }

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

// The pin connected to the data pin of the LEDs
#define RGB_DI_PIN A15
#define RGBLIGHT_LAYERS//允许您定义可打开或关闭的照明层。非常适合显示当前键盘层或大写锁定状态。
#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF//如果已定义,则即使 RGB 光源处于关闭状态,也会显示照明图层。
#ifdef RGB_DI_PIN
// The number of LEDs connected
#define RGBLED_NUM 1
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 200

#endif

#define FORCE_NKRO

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE//尝试使开关状态与键盘指示灯状态保持一致
Expand Down
22 changes: 21 additions & 1 deletion keyboards/citrus/erdnuss65/erdnuss65.c
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
#include "erdnuss65.h"
#include "erdnuss65.h"
ctt-t marked this conversation as resolved.
Show resolved Hide resolved

//Initialize all RGB indicators to 'off'
__attribute__((weak))
void keyboard_post_init_user(void) {
rgblight_setrgb_at(0, 0, 0, 0);
}

//Indicator light function
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
// writePin(A15, !led_state.caps_lock); //Un-comment this line to enable in-switch capslock indicator
if (led_state.caps_lock) {
rgblight_setrgb_at(255, 255, 255, 0); //white
} else {
rgblight_setrgb_at(0, 0, 0, 0);
}
}
return res;
}
123 changes: 52 additions & 71 deletions keyboards/citrus/erdnuss65/info.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,64 @@
{
"keyboard_name": "Erdnuss65",
"manufacturer": "Citrus Lab",
"url":"https://qmk.fm/keyboards/",
"processor": "STM32F103",
"bootloader": "stm32duino",
"maintainer": "ctt",
"usb": {
"vid": "0xCC12",
"pid": "0x1209",
"device_version": "0.0.1"
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "K00 (B10,B12)", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "K01 (B10,B14)", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "K02 (B10,B15)", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "K03 (B10,A8)", "matrix": [0, 3], "x": 3, "y": 0},
{"label": "K04 (B10,B13)", "matrix": [0, 4], "x": 4, "y": 0},
{"label": "K05 (B10,B7)", "matrix": [0, 5], "x": 5, "y": 0},
{"label": "K06 (B10,B8)", "matrix": [0, 6], "x": 6, "y": 0},
{"label": "K07 (B10,B9)", "matrix": [0, 7], "x": 7, "y": 0},
{"label": "K08 (B10,A1)", "matrix": [0, 8], "x": 8, "y": 0},
{"label": "K09 (B10,A2)", "matrix": [0, 9], "x": 9, "y": 0},
{"label": "K0A (B10,A0)", "matrix": [0, 10], "x": 10, "y": 0},
{"label": "K0B (B10,A3)", "matrix": [0, 11], "x": 11, "y": 0},
{"label": "K0C (B10,A4)", "matrix": [0, 12], "x": 12, "y": 0},
{"label": "K0D (B10,A5)", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
{"label": "K0E (B10,B11)", "matrix": [0, 14], "x": 15, "y": 0},
{"label": "K10 (B1,B12)", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
{"label": "K11 (B1,B14)", "matrix": [1, 1], "x": 1.5, "y": 1},
{"label": "K12 (B1,B15)", "matrix": [1, 2], "x": 2.5, "y": 1},
{"label": "K13 (B1,A8)", "matrix": [1, 3], "x": 3.5, "y": 1},
{"label": "K14 (B1,B13)", "matrix": [1, 4], "x": 4.5, "y": 1},
{"label": "K15 (B1,B7)", "matrix": [1, 5], "x": 5.5, "y": 1},
{"label": "K16 (B1,B8)", "matrix": [1, 6], "x": 6.5, "y": 1},
{"label": "K17 (B1,B9)", "matrix": [1, 7], "x": 7.5, "y": 1},
{"label": "K18 (B1,A1)", "matrix": [1, 8], "x": 8.5, "y": 1},
{"label": "K19 (B1,A2)", "matrix": [1, 9], "x": 9.5, "y": 1},
{"label": "K1A (B1,A0)", "matrix": [1, 10], "x": 10.5, "y": 1},
{"label": "K1B (B1,A3)", "matrix": [1, 11], "x": 11.5, "y": 1},
{"label": "K1C (B1,A4)", "matrix": [1, 12], "x": 12.5, "y": 1},
{"label": "K1D (B1,A5)", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
{"label": "K1E (B1,B11)", "matrix": [1, 14], "x": 15, "y": 1},
{"label": "K20 (B0,B12)", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.25},
{"label": "K21 (B0,B14)", "matrix": [2, 1], "x": 1.75, "y": 2},
{"label": "K22 (B0,B15)", "matrix": [2, 2], "x": 2.75, "y": 2},
{"label": "K23 (B0,A8)", "matrix": [2, 3], "x": 3.75, "y": 2},
{"label": "K24 (B0,B13)", "matrix": [2, 4], "x": 4.75, "y": 2},
{"label": "K25 (B0,B7)", "matrix": [2, 5], "x": 5.75, "y": 2},
{"label": "K26 (B0,B8)", "matrix": [2, 6], "x": 6.75, "y": 2},
{"label": "K27 (B0,B9)", "matrix": [2, 7], "x": 7.75, "y": 2},
{"label": "K28 (B0,A1)", "matrix": [2, 8], "x": 8.75, "y": 2},
{"label": "K29 (B0,A2)", "matrix": [2, 9], "x": 9.75, "y": 2},
{"label": "K2A (B0,A0)", "matrix": [2, 10], "x": 10.75, "y": 2},
{"label": "K2B (B0,A3)", "matrix": [2, 11], "x": 11.75, "y": 2},
{"label": "K2D (B0,A5)", "matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25},
{"label": "K2E (B0,B11)", "matrix": [2, 14], "x": 15, "y": 2},
{"label": "K30 (A7,B12)", "matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
{"label": "K31 (A7,B14)", "matrix": [3, 1], "x": 2.25, "y": 3},
{"label": "K32 (A7,B15)", "matrix": [3, 2], "x": 3.25, "y": 3},
{"label": "K33 (A7,A8)", "matrix": [3, 3], "x": 4.25, "y": 3},
{"label": "K34 (A7,B13)", "matrix": [3, 4], "x": 5.25, "y": 3},
{"label": "K35 (A7,B7)", "matrix": [3, 5], "x": 6.25, "y": 3},
{"label": "K36 (A7,B8)", "matrix": [3, 6], "x": 7.25, "y": 3},
{"label": "K37 (A7,B9)", "matrix": [3, 7], "x": 8.25, "y": 3},
{"label": "K38 (A7,A1)", "matrix": [3, 8], "x": 9.25, "y": 3},
{"label": "K39 (A7,A2)", "matrix": [3, 9], "x": 10.25, "y": 3},
{"label": "K3A (A7,A0)", "matrix": [3, 10], "x": 11.25, "y": 3},
{"label": "K3C (A7,A4)", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75},
{"label": "K3D (A7,A5)", "matrix": [3, 13], "x": 14, "y": 3},
{"label": "K3E (A7,B11)", "matrix": [3, 14], "x": 15, "y": 3},
{"label": "K40 (A6,B12)", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.5},
{"label": "K41 (A6,B14)", "matrix": [4, 1], "x": 1.5, "y": 4},
{"label": "K42 (A6,B15)", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.5},
{"label": "K43 (A6,A8)", "matrix": [4, 3], "x": 4, "y": 4, "w": 7},
{"label": "K4A (A6,A0)", "matrix": [4, 10], "x": 11, "y": 4, "w": 1.5},
{"label": "K4C (A6,A4)", "matrix": [4, 12], "x": 13, "y": 4},
{"label": "K4D (A6,A5)", "matrix": [4, 13], "x": 14, "y": 4},
{"label": "K4E (A6,B11)", "matrix": [4, 14], "x": 15, "y": 4}
]

"matrix_pins": {
"rows": [
"B10",
"B1",
"B0",
"A7",
"A6"],
"cols": [
"B12",
"B14",
"B15",
"A8",
"B13", "B7",
"B8",
"B9",
"A1",
"A2",
"A0",
"A3",
"A4",
"A5",
"B11"]
},

"diode_direction": "COL2ROW",

"debounce": 5,

ctt-t marked this conversation as resolved.
Show resolved Hide resolved
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"console": false,
"command": false,
"nkro": true,
"backlight": false,
"rgblight": true,
"audio": false
},
"rgblight": {
"pin": "A15",
"led_count": 1,
"hue_steps": 8,
"saturation_steps": 8,
"brightness_steps": 8,
"max_brightness": 200,
"sleep": true,
"animations": {
"all": false
ctt-t marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
41 changes: 41 additions & 0 deletions keyboards/citrus/erdnuss65/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2023 Citrus Lab
// SPDX-License-Identifier: GPL-2.0
#include QMK_KEYBOARD_H

#define XXX KC_NO

ctt-t marked this conversation as resolved.
Show resolved Hide resolved
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[0] = LAYOUT(
KC_ESC, 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_LSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
),

[1] = LAYOUT(
KC_GRV, 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_MPRV,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, RESET, KC_MNXT,
_______, _______, _______, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, KC_HOME,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MYCM, KC_VOLU, KC_END,
_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_MPLY
),

[3] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),

[4] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______
),

};
17 changes: 1 addition & 16 deletions keyboards/citrus/erdnuss65/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______
),

};
const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{0,1, HSV_WHITE}
);
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
my_capslock_layer
);

void keyboard_post_init_user(void) {
// Enable the LED layers
rgblight_layers = my_rgb_layers;
}
bool led_update_user(led_t led_state) {
rgblight_set_layer_state(0, led_state.caps_lock);
return true;
}
};
35 changes: 24 additions & 11 deletions keyboards/citrus/erdnuss65/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<!-- Copyright 2020 QMK
# Erdnuss65

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. -->
*A short description of the keyboard/project*

* Keyboard Maintainer: [Citrus Lab](https://github.com/ctt-t)
* Hardware Supported: *The PCBs, controllers supported*
* Hardware Availability: *Links to where you can find this hardware*

Make example for this keyboard (after setting up your build environment):

make citrus/erdnuss65:default

Flashing example for this keyboard:

make citrus/erdnuss65:default:flash

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

## Bootloader

Enter the bootloader in 3 ways:

* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
22 changes: 1 addition & 21 deletions keyboards/citrus/erdnuss65/rules.mk
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
# MCU name 主控型号
MCU = STM32F103

# Bootloader selection
BOOTLOADER = stm32duino

# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
KEYBOARD_SHARED_EP =no
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
2 changes: 2 additions & 0 deletions keyboards/citrus/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Citrus Lab
QMK folders for PCB commissions.