From 6776703d8fb376dad07196450f576c62c73c9365 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Wed, 20 Nov 2019 16:38:51 -0800 Subject: [PATCH] Postage Board MCU (#7424) * Postage Board MCU * Fix keymap * Postage mini * Update readme * R2 * Update readme * flip * better image of r1 * Add a DEFAULT_FOLDER to keep zed and ci happy * Update keyboards/handwired/postageboard/readme.md Co-Authored-By: fauxpark * Update keyboards/handwired/postageboard/readme.md Co-Authored-By: fauxpark * Fix keyboard name --- keyboards/handwired/postageboard/config.h | 21 +++++++ .../postageboard/keymaps/default/keymap.c | 51 ++++++++++++++++ .../postageboard/keymaps/default/readme.md | 1 + .../handwired/postageboard/mini/config.h | 61 +++++++++++++++++++ keyboards/handwired/postageboard/mini/mini.c | 18 ++++++ keyboards/handwired/postageboard/mini/mini.h | 34 +++++++++++ .../handwired/postageboard/mini/rules.mk | 29 +++++++++ .../handwired/postageboard/postageboard.c | 1 + .../handwired/postageboard/postageboard.h | 26 ++++++++ keyboards/handwired/postageboard/r1/config.h | 61 +++++++++++++++++++ keyboards/handwired/postageboard/r1/r1.c | 18 ++++++ keyboards/handwired/postageboard/r1/r1.h | 34 +++++++++++ keyboards/handwired/postageboard/r1/rules.mk | 29 +++++++++ keyboards/handwired/postageboard/readme.md | 25 ++++++++ keyboards/handwired/postageboard/rules.mk | 1 + 15 files changed, 410 insertions(+) create mode 100644 keyboards/handwired/postageboard/config.h create mode 100644 keyboards/handwired/postageboard/keymaps/default/keymap.c create mode 100644 keyboards/handwired/postageboard/keymaps/default/readme.md create mode 100644 keyboards/handwired/postageboard/mini/config.h create mode 100644 keyboards/handwired/postageboard/mini/mini.c create mode 100644 keyboards/handwired/postageboard/mini/mini.h create mode 100644 keyboards/handwired/postageboard/mini/rules.mk create mode 100644 keyboards/handwired/postageboard/postageboard.c create mode 100644 keyboards/handwired/postageboard/postageboard.h create mode 100644 keyboards/handwired/postageboard/r1/config.h create mode 100644 keyboards/handwired/postageboard/r1/r1.c create mode 100644 keyboards/handwired/postageboard/r1/r1.h create mode 100644 keyboards/handwired/postageboard/r1/rules.mk create mode 100644 keyboards/handwired/postageboard/readme.md create mode 100644 keyboards/handwired/postageboard/rules.mk diff --git a/keyboards/handwired/postageboard/config.h b/keyboards/handwired/postageboard/config.h new file mode 100644 index 00000000000..417cc9901c1 --- /dev/null +++ b/keyboards/handwired/postageboard/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2019 Yan-Fa Li + +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" + diff --git a/keyboards/handwired/postageboard/keymaps/default/keymap.c b/keyboards/handwired/postageboard/keymaps/default/keymap.c new file mode 100644 index 00000000000..a42697a9b1d --- /dev/null +++ b/keyboards/handwired/postageboard/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN +}; + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKURL = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base */ + [_BASE] = LAYOUT( + KC_A, KC_1, MO(_FN) + ), + [_FN] = LAYOUT( + RESET, QMKURL, _______ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/handwired/postageboard/keymaps/default/readme.md b/keyboards/handwired/postageboard/keymaps/default/readme.md new file mode 100644 index 00000000000..c166556a852 --- /dev/null +++ b/keyboards/handwired/postageboard/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for PostageBoard diff --git a/keyboards/handwired/postageboard/mini/config.h b/keyboards/handwired/postageboard/mini/config.h new file mode 100644 index 00000000000..ac7d468855c --- /dev/null +++ b/keyboards/handwired/postageboard/mini/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2019 Yan-Fa Li + +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 0xFEED +#define PRODUCT_ID 0xB07D +#define DEVICE_VER 0x0002 +#define MANUFACTURER LifeIsOnTheWire +#define PRODUCT PostageBoard +#define DESCRIPTION "A Handwire Controller Board Round 2" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 3 + +/* + * 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) + * + */ +#define MATRIX_ROW_PINS { D5 } +#define MATRIX_COL_PINS { E6, B3, B7 } +#define UNUSED_PINS { D0, D1, D2, D3, D4, D6, D7, B4, B5, B6, C6, C7, B2, B1, B0, F7, F6, F5, F4, F1, F0 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* 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 + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/postageboard/mini/mini.c b/keyboards/handwired/postageboard/mini/mini.c new file mode 100644 index 00000000000..381ad975f03 --- /dev/null +++ b/keyboards/handwired/postageboard/mini/mini.c @@ -0,0 +1,18 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 "mini.h" + diff --git a/keyboards/handwired/postageboard/mini/mini.h b/keyboards/handwired/postageboard/mini/mini.h new file mode 100644 index 00000000000..28ee58ef13e --- /dev/null +++ b/keyboards/handwired/postageboard/mini/mini.h @@ -0,0 +1,34 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 is 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( \ + k00, k01, k02 \ +) \ +{ \ + { k00, k01, k02 } \ +} diff --git a/keyboards/handwired/postageboard/mini/rules.mk b/keyboards/handwired/postageboard/mini/rules.mk new file mode 100644 index 00000000000..96e8e574cfd --- /dev/null +++ b/keyboards/handwired/postageboard/mini/rules.mk @@ -0,0 +1,29 @@ +# 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 = atmel-dfu + +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # 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 = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +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 diff --git a/keyboards/handwired/postageboard/postageboard.c b/keyboards/handwired/postageboard/postageboard.c new file mode 100644 index 00000000000..005ce313dfd --- /dev/null +++ b/keyboards/handwired/postageboard/postageboard.c @@ -0,0 +1 @@ +#include "postageboard.h" diff --git a/keyboards/handwired/postageboard/postageboard.h b/keyboards/handwired/postageboard/postageboard.h new file mode 100644 index 00000000000..5bd9ceee5af --- /dev/null +++ b/keyboards/handwired/postageboard/postageboard.h @@ -0,0 +1,26 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 LAYOUT( \ + k00, k01, k02 \ +) \ +{ \ + { k00, k01, k02 } \ +} diff --git a/keyboards/handwired/postageboard/r1/config.h b/keyboards/handwired/postageboard/r1/config.h new file mode 100644 index 00000000000..435e87fa1b2 --- /dev/null +++ b/keyboards/handwired/postageboard/r1/config.h @@ -0,0 +1,61 @@ +/* +Copyright 2019 Yan-Fa Li + +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 0xFEED +#define PRODUCT_ID 0xB07D +#define DEVICE_VER 0x0001 +#define MANUFACTURER LifeIsOnTheWire +#define PRODUCT PostageBoard +#define DESCRIPTION "A Handwire Controller Board" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 3 + +/* + * 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) + * + */ +#define MATRIX_ROW_PINS { B6 } +#define MATRIX_COL_PINS { B7, C6, C7 } +#define UNUSED_PINS { D4, D6, D7, B4, B5, D5, D3, D2, D1, D0, B2, B3, F0, F1, F4, F5, F6, F7, E6, B0, B1 } + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* 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 + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/postageboard/r1/r1.c b/keyboards/handwired/postageboard/r1/r1.c new file mode 100644 index 00000000000..e87edc145b6 --- /dev/null +++ b/keyboards/handwired/postageboard/r1/r1.c @@ -0,0 +1,18 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 "r1.h" + diff --git a/keyboards/handwired/postageboard/r1/r1.h b/keyboards/handwired/postageboard/r1/r1.h new file mode 100644 index 00000000000..28ee58ef13e --- /dev/null +++ b/keyboards/handwired/postageboard/r1/r1.h @@ -0,0 +1,34 @@ +/* Copyright 2019 Yan-Fa Li + * + * 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 is 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( \ + k00, k01, k02 \ +) \ +{ \ + { k00, k01, k02 } \ +} diff --git a/keyboards/handwired/postageboard/r1/rules.mk b/keyboards/handwired/postageboard/r1/rules.mk new file mode 100644 index 00000000000..96e8e574cfd --- /dev/null +++ b/keyboards/handwired/postageboard/r1/rules.mk @@ -0,0 +1,29 @@ +# 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 = atmel-dfu + +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # 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 = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +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 diff --git a/keyboards/handwired/postageboard/readme.md b/keyboards/handwired/postageboard/readme.md new file mode 100644 index 00000000000..db9d0d11c56 --- /dev/null +++ b/keyboards/handwired/postageboard/readme.md @@ -0,0 +1,25 @@ +# Postage Board + +### Round 1 +![PostageBoard](https://cdn.shopify.com/s/files/1/1851/5125/products/image_db6a6d1c-01d8-4263-b148-136292425b6a_530x@2x.jpg?v=1540240631) + +### Round 2: Mini version +![PostageBoard](https://cdn.shopify.com/s/files/1/1851/5125/products/image_94eb103e-07f9-437f-b661-0909247cd766_1024x1024@2x.jpg?v=1574211602) + +The Postage board is a controller board meant to aid people in making a hand wired keyboard. Controller boards are essentially the brain of the keyboard. It is similar to the common Teensy 2.0, and also the Pro Micro. + +However, neither the Teensy, nor the Pro Micro are designed for keyboards specifically. They are just general Arduino-like boards meant for a variety of DIY projects. The Postage Board is designed for mechanical keyboards specifically, and thus the process of assembling your keyboard is easier, and the final product is more refined. + +* Keyboard Maintainer: [LifeIsOnTheWire](https://github.com/LifeIsOnTheWire/Postage-Board) +* Hardware Supported: Available at GB +* Hardware Availability: Available at GB + +Make example for this keyboard (after setting up your build environment): + + make handwired/postageboard/r1:default + +or + + make handwired/postageboard/mini: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/postageboard/rules.mk b/keyboards/handwired/postageboard/rules.mk new file mode 100644 index 00000000000..a7fcf6bea67 --- /dev/null +++ b/keyboards/handwired/postageboard/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER=handwired/postageboard/mini