Skip to content

Commit

Permalink
bastardkb: restructure folder hierarchy ahead of supporting other ada…
Browse files Browse the repository at this point in the history
…pters/mcus

Upcoming support for the following (adapter, mcu) pairs will be
submitted in follow-up PRs:

- `v2/elitec`
- `v2/stemcell`
- `blackpill`

This PR contains the following changes:

- Move previous implementation to an inner `v1/elitec` folder
- Move keyboard USB IDs and strings to data driven
- Update headers to update maintainers list
- Run `qmk format-c`
  • Loading branch information
0xcharly committed Apr 3, 2022
1 parent 61bd613 commit a35881d
Show file tree
Hide file tree
Showing 35 changed files with 508 additions and 425 deletions.
42 changes: 6 additions & 36 deletions keyboards/bastardkb/charybdis/3x5/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,25 @@

#pragma once

#define VENDOR_ID 0xA8F8
#define PRODUCT_ID 0x1832
#define DEVICE_VER 0x0001
#define MANUFACTURER Bastard Keyboards
#define PRODUCT Charybdis Nano
#include "config_common.h"

/* Key matrix configuration. */

// Rows are doubled-up.
#define MATRIX_ROWS 8
#define MATRIX_ROWS 8 // Rows are doubled-up.
#define MATRIX_COLS 5

// Wiring configuration for each half.
#define MATRIX_ROW_PINS \
{ B7, C6, D4, B5 }
#define MATRIX_COL_PINS \
{ C7, F0, D7, E6, B4 }

#define MATRIX_ROW_PINS_RIGHT \
{ F0, C6, D4, B5 }
#define MATRIX_COL_PINS_RIGHT \
{ C7, B7, D7, E6, B4 }

#define DIODE_DIRECTION ROW2COL

/* Handedness. */
#define MASTER_RIGHT

/* Bootmagic Lite configuration. */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0
#define BOOTMAGIC_LITE_ROW_RIGHT 4
#define BOOTMAGIC_LITE_COLUMN_RIGHT 0

/* serial.c configuration (for split keyboard) */
#define SOFT_SERIAL_PIN D2
/* Disable action features. */
#define NO_ACTION_MACRO // Disable old-style macro handling.
#define NO_ACTION_FUNCTION // Disable old-style function handling.

/* Set 0 if debouncing isn't needed. */
#define DEBOUNCE 5

/* PMW3360 settings. */
#define PMW3360_CS_PIN B0

// Trackball angle adjustment.
/* Trackball angle adjustment. */
#define ROTATIONAL_TRANSFORM_ANGLE -25

/* RGB settings. */

#define RGB_DI_PIN D3
#define RGBLED_NUM 35
#define RGBLED_SPLIT \
{ 18, 17 }
Expand Down
7 changes: 4 additions & 3 deletions keyboards/bastardkb/charybdis/3x5/info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"keyboard_name": "Charybdis Nano",
"url": "https://www.bastardkb.com",
"maintainer": "Quentin Lebastard",
"url": "https://bastardkb.com/charybdis-nano",
"usb": {
"pid": "0x1832",
},
"layouts": {
"LAYOUT_charybdis_3x5": {
"layout": [
Expand Down
42 changes: 42 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/v1/elitec/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

/* Key matrix configuration. */
#define MATRIX_ROW_PINS \
{ B7, C6, D4, B5 }
#define MATRIX_COL_PINS \
{ C7, F0, D7, E6, B4 }

#define MATRIX_ROW_PINS_RIGHT \
{ F0, C6, D4, B5 }
#define MATRIX_COL_PINS_RIGHT \
{ C7, B7, D7, E6, B4 }

/* Handedness. */
#define MASTER_RIGHT

/* serial.c configuration (for split keyboard). */
#define SOFT_SERIAL_PIN D2

/* RGB settings. */
#define RGB_DI_PIN D3

/* PMW3360 settings. */
#define PMW3360_CS_PIN B0
20 changes: 20 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/v1/elitec/elitec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publicw License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "3x5.h"
6 changes: 6 additions & 0 deletions keyboards/bastardkb/charybdis/3x5/v1/elitec/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"keyboard_name": "Charybdis Nano (3x5) Elite-C",
"usb": {
"device_version": "1.0.0",
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ RGBLIGHT_SUPPORTED = yes # RGB underglow is supported, but not enabled by def
RGB_MATRIX_ENABLE = yes # Enable keyboard RGB matrix functionality
RGB_MATRIX_DRIVER = WS2812

# Enable link-time optimization by default. The Charybdis packs a lot of
# features (RGB, Via, trackball) in a small atmega32u4 package.
LTO_ENABLE = yes

# Charybdis nano is a split 3x5 keyboard with a maximum of 3 thumb keys (2 on
# the trackball side).
SPLIT_KEYBOARD = yes
Expand All @@ -36,3 +32,7 @@ POINTING_DEVICE_ENABLE = yes # Enable trackball
POINTING_DEVICE_DRIVER = pmw3360
# https://qmk.fm/changes/2018-11-16-use-a-single-endpoint-for-hid-reports
MOUSE_SHARED_EP = no # Unify multiple HID interfaces into a single Endpoint

# Enable link-time optimization by default. The Charybdis packs a lot of
# features (RGB, Via, trackball) in a small atmega32u4 package.
LTO_ENABLE = yes
45 changes: 9 additions & 36 deletions keyboards/bastardkb/charybdis/4x6/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,25 @@

#pragma once

#define VENDOR_ID 0xA8F8
#define PRODUCT_ID 0x1833
#define DEVICE_VER 0x0001
#define MANUFACTURER Bastard Keyboards
#define PRODUCT Charybdis
#include "config_common.h"

/* Key matrix configuration. */

// Rows are doubled-up.
#define MATRIX_ROWS 10
#define MATRIX_ROWS 10 // Rows are doubled-up.
#define MATRIX_COLS 6

// Wiring configuration for each half.
#define MATRIX_ROW_PINS \
{ F1, B7, C6, D4, B5 }
#define MATRIX_COL_PINS \
{ D5, C7, F0, D7, E6, B4 }

#define MATRIX_ROW_PINS_RIGHT \
{ D5, F0, C6, D4, B5 }
#define MATRIX_COL_PINS_RIGHT \
{ F1, C7, B7, D7, E6, B4 }

#define DIODE_DIRECTION ROW2COL

#define ROTATIONAL_TRANSFORM_ANGLE -25

/* Handedness. */
#define MASTER_RIGHT

/* Bootmagic Lite configuration. */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0
#define BOOTMAGIC_LITE_ROW_RIGHT 5
#define BOOTMAGIC_LITE_COLUMN_RIGHT 0
/* Disable action features. */
#define NO_ACTION_MACRO // Disable old-style macro handling.
#define NO_ACTION_FUNCTION // Disable old-style function handling.

/* serial.c configuration (for split keyboard) */
#define SOFT_SERIAL_PIN D2

/* Set 0 if debouncing isn't needed */
/* Set 0 if debouncing isn't needed. */
#define DEBOUNCE 5

/* PMW3360 settings. */
#define PMW3360_CS_PIN B0
/* Trackball angle adjustment. */
#define ROTATIONAL_TRANSFORM_ANGLE -25

#define RGB_DI_PIN D3
/* RGB settings. */
#define RGBLED_NUM 56
#define RGBLED_SPLIT \
{ 29, 27 }
Expand Down
7 changes: 4 additions & 3 deletions keyboards/bastardkb/charybdis/4x6/info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"keyboard_name": "Charybdis",
"url": "https://www.bastardkb.com",
"maintainer": "Quentin Lebastard",
"url": "https://bastardkb.com/charybdis",
"usb": {
"pid": "0x1833",
},
"layouts": {
"LAYOUT_charybdis_4x6": {
"layout": [
Expand Down
42 changes: 42 additions & 0 deletions keyboards/bastardkb/charybdis/4x6/v1/elitec/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

/* Key matrix configuration. */
#define MATRIX_ROW_PINS \
{ F1, B7, C6, D4, B5 }
#define MATRIX_COL_PINS \
{ D5, C7, F0, D7, E6, B4 }

#define MATRIX_ROW_PINS_RIGHT \
{ D5, F0, C6, D4, B5 }
#define MATRIX_COL_PINS_RIGHT \
{ F1, C7, B7, D7, E6, B4 }

/* Handedness. */
#define MASTER_RIGHT

/* serial.c configuration (for split keyboard). */
#define SOFT_SERIAL_PIN D2

/* RGB settings. */
#define RGB_DI_PIN D3

/* PMW3360 settings. */
#define PMW3360_CS_PIN B0
20 changes: 20 additions & 0 deletions keyboards/bastardkb/charybdis/4x6/v1/elitec/elitec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publicw License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "4x6.h"
6 changes: 6 additions & 0 deletions keyboards/bastardkb/charybdis/4x6/v1/elitec/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"keyboard_name": "Charybdis (4x6) Elite-C",
"usb": {
"device_version": "1.0.0",
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ RGBLIGHT_SUPPORTED = yes # RGB underglow is supported, but not enabled by def
RGB_MATRIX_ENABLE = yes # Enable keyboard RGB matrix functionality
RGB_MATRIX_DRIVER = WS2812

# Enable link-time optimization by default. The Charybdis packs a lot of
# features (RGB, Via, trackball) in a small atmega32u4 package.
LTO_ENABLE = yes

# Charybdis is a split 4x6 keyboard with a maximum of 5 thumb keys (3 on the
# trackball side).
SPLIT_KEYBOARD = yes
Expand All @@ -35,3 +31,7 @@ POINTING_DEVICE_ENABLE = yes # Enable trackball
POINTING_DEVICE_DRIVER = pmw3360
# https://qmk.fm/changes/2018-11-16-use-a-single-endpoint-for-hid-reports
MOUSE_SHARED_EP = no # Unify multiple HID interfaces into a single Endpoint

# Enable link-time optimization by default. The Charybdis packs a lot of
# features (RGB, Via, trackball) in a small atmega32u4 package.
LTO_ENABLE = yes
Loading

0 comments on commit a35881d

Please sign in to comment.