From 546e6a15dcad55e2b370dddf417d83ae88e87217 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Wed, 27 Oct 2021 23:02:21 +0800 Subject: [PATCH] [Keyboard] Cradio keyboard (#14946) Co-authored-by: Ryan Co-authored-by: filterpaper --- keyboards/cradio/config.h | 83 +++++++++++++++++++++++ keyboards/cradio/cradio.c | 20 ++++++ keyboards/cradio/cradio.h | 50 ++++++++++++++ keyboards/cradio/info.json | 52 ++++++++++++++ keyboards/cradio/keymaps/default/keymap.c | 51 ++++++++++++++ keyboards/cradio/readme.md | 33 +++++++++ keyboards/cradio/rules.mk | 23 +++++++ 7 files changed, 312 insertions(+) create mode 100644 keyboards/cradio/config.h create mode 100644 keyboards/cradio/cradio.c create mode 100644 keyboards/cradio/cradio.h create mode 100644 keyboards/cradio/info.json create mode 100644 keyboards/cradio/keymaps/default/keymap.c create mode 100644 keyboards/cradio/readme.md create mode 100644 keyboards/cradio/rules.mk diff --git a/keyboards/cradio/config.h b/keyboards/cradio/config.h new file mode 100644 index 0000000000..2d76de6a8e --- /dev/null +++ b/keyboards/cradio/config.h @@ -0,0 +1,83 @@ +/* Copyright 2018-2021 + * ENDO Katsuhiro + * David Philip Barr <@davidphilipbarr> + * Pierre Chevalier + * + * 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 VENDOR_ID 0xC88B +#define PRODUCT_ID 0x3988 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DPB +#define PRODUCT Cradio + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * NO_DIODE = switches are directly connected to AVR pins + * +*/ +#define DIRECT_PINS { \ + { E6, F7, F6, F5, F4 }, \ + { B1, B3, B2, B6, D3 }, \ + { D1, D0, D4, C6, D7 }, \ + { B4, B5, NO_PIN, NO_PIN, NO_PIN } \ +} + +#define DIRECT_PINS_RIGHT { \ + { F4, F5, F6, F7, E6 }, \ + { D3, B6, B2, B3, B1 }, \ + { D7, C6, D4, D0, D1 }, \ + { B5, B4, NO_PIN, NO_PIN, NO_PIN } \ +} + +#define UNUSED_PINS + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* 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 + +/* Serial settings */ +#define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D2 + +/* Split handedness */ +#define EE_HANDS + +/* Top left key on left half */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 +/* Top right key on right half */ +#define BOOTMAGIC_LITE_ROW_RIGHT 4 +#define BOOTMAGIC_LITE_COLUMN_RIGHT 4 diff --git a/keyboards/cradio/cradio.c b/keyboards/cradio/cradio.c new file mode 100644 index 0000000000..6ef9381223 --- /dev/null +++ b/keyboards/cradio/cradio.c @@ -0,0 +1,20 @@ +/* Copyright 2018-2021 + * ENDO Katsuhiro + * David Philip Barr <@davidphilipbarr> + * Pierre Chevalier + * + * 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 "cradio.h" diff --git a/keyboards/cradio/cradio.h b/keyboards/cradio/cradio.h new file mode 100644 index 0000000000..29e81ef9b8 --- /dev/null +++ b/keyboards/cradio/cradio.h @@ -0,0 +1,50 @@ +/* Copyright 2018-2021 + * ENDO Katsuhiro + * David Philip Barr <@davidphilipbarr> + * Pierre Chevalier + * + * 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 "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// readability +#define ___ KC_NO + +#define LAYOUT( \ + L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, \ + L06, L07, L08, L09, L10, R06, R07, R08, R09, R10, \ + L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, \ + L16, L17, R16, R17 \ + ) \ + { \ + { L01, L02, L03, L04, L05 }, \ + { L06, L07, L08, L09, L10 }, \ + { L11, L12, L13, L14, L15 }, \ + { L16, L17, ___, ___, ___ }, \ + { R01, R02, R03, R04, R05 }, \ + { R06, R07, R08, R09, R10 }, \ + { R11, R12, R13, R14, R15 }, \ + { R16, R17, ___, ___, ___ } \ + } + diff --git a/keyboards/cradio/info.json b/keyboards/cradio/info.json new file mode 100644 index 0000000000..77b611f325 --- /dev/null +++ b/keyboards/cradio/info.json @@ -0,0 +1,52 @@ +{ + "keyboard_name": "Cradio", + "url": "https://github.com/davidphilipbarr/Sweep", + "maintainer": "@davidphilipbarr", + "layouts": { + "LAYOUT": { + "layout": [ + {"x": 0, "y": 0.93}, + {"x": 1, "y": 0.31}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0.28}, + {"x": 4, "y": 0.42}, + + {"x": 7, "y": 0.42}, + {"x": 8, "y": 0.28}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0.31}, + {"x": 11, "y": 0.93}, + + {"x": 0, "y": 1.93}, + {"x": 1, "y": 1.31}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1.28}, + {"x": 4, "y": 1.42}, + + {"x": 7, "y": 1.42}, + {"x": 8, "y": 1.28}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1.31}, + {"x": 11, "y": 1.93}, + + {"x": 0, "y": 2.93}, + {"x": 1, "y": 2.31}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2.28}, + {"x": 4, "y": 2.42}, + + {"x": 7, "y": 2.42}, + {"x": 8, "y": 2.28}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2.31}, + {"x": 11, "y": 2.93}, + + {"x": 3.5, "y": 3.75}, + {"x": 4.5, "y": 4}, + + {"x": 6.5, "y": 4}, + {"x": 7.5, "y": 3.75} + ] + } + } +} diff --git a/keyboards/cradio/keymaps/default/keymap.c b/keyboards/cradio/keymaps/default/keymap.c new file mode 100644 index 0000000000..bb7e2d35e6 --- /dev/null +++ b/keyboards/cradio/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2018-2021 + * ENDO Katsuhiro + * David Philip Barr <@davidphilipbarr> + * Pierre Chevalier + * + * 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 + +/* Base layer 0 layout uses home row mods. See the following guide for details: + * https://precondition.github.io/home-row-mods + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + SFT_T(KC_A),ALT_T(KC_S),CTL_T(KC_D),GUI_T(KC_F), KC_G, KC_H, GUI_T(KC_J),CTL_T(KC_K),ALT_T(KC_L),SFT_T(KC_SCLN), + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + LT(2,KC_TAB), KC_ENT, KC_SPC, LT(1,KC_BSPC) + ), + [1] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_VOLU, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_DQUO, + _______, KC_4, KC_5, KC_6, KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, + KC_CAPS, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, + MO(3), KC_GESC, _______, _______ + ), + [2] = LAYOUT( + _______, KC_LBRC, KC_LCBR, KC_RCBR, _______, KC_CIRC, KC_LPRN, KC_RPRN, KC_RBRC, KC_TILD, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_AMPR, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + _______, _______, _______, _______, _______, KC_ASTR, KC_UNDS, KC_PLUS, KC_PIPE, _______, + _______, _______, KC_DEL, MO(3) + ), + [3] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F10, _______, KC_WH_U, KC_WH_D, _______, RESET, + _______, KC_F4, KC_F5, KC_F6, KC_F11, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_INS, + _______, KC_F7, KC_F8, KC_F9, KC_F12, _______, KC_BTN1, KC_BTN2, _______, _______, + _______, _______, _______, _______ + ) +}; diff --git a/keyboards/cradio/readme.md b/keyboards/cradio/readme.md new file mode 100644 index 0000000000..b8520a366b --- /dev/null +++ b/keyboards/cradio/readme.md @@ -0,0 +1,33 @@ +# Cradio keyboards + +![Cradio](https://github.com/davidphilipbarr/hypergolic/raw/main/hypergarlic/ht.png) + +Cradio are low-profile 34-key split-keyboards designed by [@davidphilipbarr](https://github.com/davidphilipbarr), with no diodes and direct micro-controller pin wiring. + +## Keyboard Info + +* Keyboard Maintainer: [davidphilipbarr](https://github.com/davidphilipbarr) +* Hardware Supported: + * [Sweep](https://github.com/davidphilipbarr/Sweep) + * [Hypergarlic](https://github.com/davidphilipbarr/hypergolic/tree/main/hypergarlic) + * Variants of the same 34-key direct pin PCB +* Hardware Availability: PCBs can be printed with gerber files from the repository + +Make examples for this keyboard (after setting up your build environment): + + make cradio:default + +Firmware uses `EE_HANDS` split handedness by default. Each halve should be flashed once with the following: + + make cradio:default:dfu-split-left + make cradio:default:dfu-split-right + +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 top left key on the left half (or the top right right key on the right half) and plug in the controller on that side. +* **Physical reset button**: Briefly press the reset button soldered on the PCB. +* **Keycode in layout**: Press the key mapped to `RESET` if it is configured. diff --git a/keyboards/cradio/rules.mk b/keyboards/cradio/rules.mk new file mode 100644 index 0000000000..437ca573d7 --- /dev/null +++ b/keyboards/cradio/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +UNICODE_ENABLE = yes # Unicode +AUDIO_ENABLE = no # Audio output +SPLIT_KEYBOARD = yes # Use shared split_common code