From 2e96609b58c2c049249289614061249a36e2ffa6 Mon Sep 17 00:00:00 2001 From: merlin04 Date: Mon, 17 Feb 2020 16:19:34 -0800 Subject: [PATCH 1/5] Add handwired BDN9-BLE --- keyboards/handwired/bdn9_ble/bdn9_ble.c | 1 + keyboards/handwired/bdn9_ble/bdn9_ble.h | 37 +++++++++++++ keyboards/handwired/bdn9_ble/config.h | 52 +++++++++++++++++++ keyboards/handwired/bdn9_ble/info.json | 22 ++++++++ .../bdn9_ble/keymaps/default/keymap.c | 50 ++++++++++++++++++ keyboards/handwired/bdn9_ble/readme.md | 14 +++++ keyboards/handwired/bdn9_ble/rules.mk | 35 +++++++++++++ 7 files changed, 211 insertions(+) create mode 100644 keyboards/handwired/bdn9_ble/bdn9_ble.c create mode 100644 keyboards/handwired/bdn9_ble/bdn9_ble.h create mode 100644 keyboards/handwired/bdn9_ble/config.h create mode 100644 keyboards/handwired/bdn9_ble/info.json create mode 100644 keyboards/handwired/bdn9_ble/keymaps/default/keymap.c create mode 100644 keyboards/handwired/bdn9_ble/readme.md create mode 100644 keyboards/handwired/bdn9_ble/rules.mk diff --git a/keyboards/handwired/bdn9_ble/bdn9_ble.c b/keyboards/handwired/bdn9_ble/bdn9_ble.c new file mode 100644 index 000000000000..75fe7fff7188 --- /dev/null +++ b/keyboards/handwired/bdn9_ble/bdn9_ble.c @@ -0,0 +1 @@ +#include "bdn9_ble.h" diff --git a/keyboards/handwired/bdn9_ble/bdn9_ble.h b/keyboards/handwired/bdn9_ble/bdn9_ble.h new file mode 100644 index 000000000000..8a4511326476 --- /dev/null +++ b/keyboards/handwired/bdn9_ble/bdn9_ble.h @@ -0,0 +1,37 @@ +/* Copyright 2019 Danny Nguyen + * + * 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" + +/* 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. + */ +#define LAYOUT( \ + KA1, KA2, KA3, \ + KB1, KB2, KB3, \ + KC1, KC2, KC3 \ +) \ +{ \ + { KA1, KA2, KA3 }, \ + { KB1, KB2, KB3 }, \ + { KC1, KC2, KC3 } \ +} diff --git a/keyboards/handwired/bdn9_ble/config.h b/keyboards/handwired/bdn9_ble/config.h new file mode 100644 index 000000000000..8db9253dd459 --- /dev/null +++ b/keyboards/handwired/bdn9_ble/config.h @@ -0,0 +1,52 @@ +/* +Copyright 2019 Danny Nguyen + +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 0xCB10 +#define PRODUCT_ID 0x1134 +#define DEVICE_VER 0x0100 +#define MANUFACTURER KeyPCB/Keebio +#define PRODUCT BDN9-BLE +#define DESCRIPTION 3x3 Bluetooth Macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* Keyboard Matrix Assignments */ +#define DIRECT_PINS { \ + { D1, D0, C6 }, \ + { D7, B5, B6 }, \ + { B7, D6, F7 } \ +} + +#define BACKLIGHT_PIN F6 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 +#define BACKLIGHT_ON_STATE 1 + +/* 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 diff --git a/keyboards/handwired/bdn9_ble/info.json b/keyboards/handwired/bdn9_ble/info.json new file mode 100644 index 000000000000..49bf627197fa --- /dev/null +++ b/keyboards/handwired/bdn9_ble/info.json @@ -0,0 +1,22 @@ +{ + "keyboard_name": "KeyPCB/Keeb.io BDN9-BLE", + "url": "", + "maintainer": "merlin04", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, + {"x":1, "y":0}, + {"x":2, "y":0}, + {"x":0, "y":1}, + {"x":1, "y":1}, + {"x":2, "y":1}, + {"x":0, "y":2}, + {"x":1, "y":2}, + {"x":2, "y":2} + ] + } + } +} diff --git a/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c b/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c new file mode 100644 index 000000000000..889c39de467b --- /dev/null +++ b/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2019 Danny Nguyen + * + * 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 + +#define ______ KC_TRNS + +// Enable test mode, which sets the keys to letters A-I. +//#define TESTMODE + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + #ifndef TESTMODE + // MEH - hold down ctrl, alt, shift, and press key + [0] = LAYOUT( + MEH(KC_1), MEH(KC_2), MEH(KC_3), + MEH(KC_4), MEH(KC_5), MEH(KC_6), + MEH(KC_7), MEH(KC_8), LT(1, MEH(KC_9)) + ), + #else + [0] = LAYOUT( + KC_A, KC_B, KC_C, + KC_D, KC_E, KC_F, + KC_G, KC_H, KC_I + ), + #endif + /* + * ------------------------------------------------------------------------ + * | | Automatic BLE output detection | Reset | + * | Backlight Step | Use USB port for output | | + * | Backlight Tgl | Use Bluetooth for output | (currently pressed) | + * ------------------------------------------------------------------------ + */ + [1] = LAYOUT( + ______, OUT_AUTO, RESET, + BL_STEP, OUT_USB, ______, + BL_TOGG, OUT_BT, ______ + ) +}; diff --git a/keyboards/handwired/bdn9_ble/readme.md b/keyboards/handwired/bdn9_ble/readme.md new file mode 100644 index 000000000000..07bb81b7903b --- /dev/null +++ b/keyboards/handwired/bdn9_ble/readme.md @@ -0,0 +1,14 @@ +# BDN9-BLE + +![BDN9](https://cdn.shopify.com/s/files/1/1851/5125/products/image_bd8d9423-950e-4aad-bea5-665d896f879a_530x@2x.jpg?v=1547909493) + +A handwired modified version of the Keebio BDN9 macropad to support BLE through the Adafruit Feather 32u4 Bluefruit LE. + +Keyboard Maintainer: [merlin04/KeyPCB](https://github.com/merlin04) +Hardware Supported: Adafruit Feather 32u4 Bluefruit LE + +Make example for this keyboard (after setting up your build environment): + + make handwired/bdn9-ble:default + +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/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk new file mode 100644 index 000000000000..b847b0f839c4 --- /dev/null +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -0,0 +1,35 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = caterina +F_CPU = 8000000 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = no # Unicode +BLUETOOTH = AdafruitBLE # Enable Bluetooth +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs +ENCODER_ENABLE = no From fc53fa955dc144e9258f3524d65ffe033a22e482 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Mon, 17 Feb 2020 17:18:01 -0800 Subject: [PATCH 2/5] Apply suggestions from code review Co-Authored-By: Ryan --- keyboards/handwired/bdn9_ble/keymaps/default/keymap.c | 7 +++---- keyboards/handwired/bdn9_ble/readme.md | 4 ++-- keyboards/handwired/bdn9_ble/rules.mk | 3 +++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c b/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c index 889c39de467b..40684214677a 100644 --- a/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c +++ b/keyboards/handwired/bdn9_ble/keymaps/default/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#define ______ KC_TRNS // Enable test mode, which sets the keys to letters A-I. //#define TESTMODE @@ -43,8 +42,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ------------------------------------------------------------------------ */ [1] = LAYOUT( - ______, OUT_AUTO, RESET, - BL_STEP, OUT_USB, ______, - BL_TOGG, OUT_BT, ______ + _______, OUT_AUTO, RESET, + BL_STEP, OUT_USB, _______, + BL_TOGG, OUT_BT, _______ ) }; diff --git a/keyboards/handwired/bdn9_ble/readme.md b/keyboards/handwired/bdn9_ble/readme.md index 07bb81b7903b..c4e5679ce4ef 100644 --- a/keyboards/handwired/bdn9_ble/readme.md +++ b/keyboards/handwired/bdn9_ble/readme.md @@ -4,8 +4,8 @@ A handwired modified version of the Keebio BDN9 macropad to support BLE through the Adafruit Feather 32u4 Bluefruit LE. -Keyboard Maintainer: [merlin04/KeyPCB](https://github.com/merlin04) -Hardware Supported: Adafruit Feather 32u4 Bluefruit LE +* Keyboard Maintainer: [merlin04/KeyPCB](https://github.com/merlin04) +* Hardware Supported: Adafruit Feather 32u4 Bluefruit LE Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index b847b0f839c4..93322ce64c85 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -1,6 +1,9 @@ # MCU name MCU = atmega32u4 +# Processor frequency +F_CPU = 8000000 + # Bootloader selection # Teensy halfkay # Pro Micro caterina From fe03a8fd71954dc7a6f943a3ebcd867e1fe62ec3 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Mon, 17 Feb 2020 18:58:54 -0800 Subject: [PATCH 3/5] Update keyboards/handwired/bdn9_ble/rules.mk Co-Authored-By: Ryan --- keyboards/handwired/bdn9_ble/rules.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index 93322ce64c85..ffa4765c8b05 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -13,7 +13,6 @@ F_CPU = 8000000 # ATmega32A bootloadHID # ATmega328P USBasp BOOTLOADER = caterina -F_CPU = 8000000 # Build Options # change yes to no to disable From 707a7d5344e01b084ba2da7bfd4c754f2040a1a3 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Tue, 18 Feb 2020 09:50:28 -0800 Subject: [PATCH 4/5] Update keyboards/handwired/bdn9_ble/rules.mk Co-Authored-By: Ryan --- keyboards/handwired/bdn9_ble/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index ffa4765c8b05..4fabf1c89d0a 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -26,7 +26,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration 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 = yes # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support UNICODE_ENABLE = no # Unicode From 3a4325e485fd6a012ff3583f812fbfe56d4441d7 Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Tue, 18 Feb 2020 21:50:42 -0800 Subject: [PATCH 5/5] Update keyboards/handwired/bdn9_ble/readme.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> --- keyboards/handwired/bdn9_ble/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/handwired/bdn9_ble/readme.md b/keyboards/handwired/bdn9_ble/readme.md index c4e5679ce4ef..eaeab59ad87b 100644 --- a/keyboards/handwired/bdn9_ble/readme.md +++ b/keyboards/handwired/bdn9_ble/readme.md @@ -9,6 +9,6 @@ A handwired modified version of the Keebio BDN9 macropad to support BLE through Make example for this keyboard (after setting up your build environment): - make handwired/bdn9-ble:default + make handwired/bdn9_ble:default 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).