~ruther/qmk_firmware

604fca4aa9eff07254a91b21625bfe736f323002 — FREEWING.JP 3 years ago 2ad8826
[Keyboard] bstk100 handwired (#14158)

* General: Initial commit for bstk100

* bstk100 custom keyboard firmware

* fix Bootloader section

* fix  "Pad 0" key twice

* delete via config

* fix readme.md key layout

* add via keymap

* fix readme.md info

* remove keymap.json

* Suggested change readme.md

* moved to handwired folder

* fix readme.md for handwired

* fix info.json

* Suggested change readme.md

* Update keyboards/handwired/bstk100/rules.mk

fix requested changes

* Update keyboards/handwired/bstk100/rules.mk

fix requested changes

* Update keyboards/handwired/bstk100/info.json

* Update keyboards/handwired/bstk100/rules.mk
A keyboards/handwired/bstk100/bstk100.c => keyboards/handwired/bstk100/bstk100.c +18 -0
@@ 0,0 1,18 @@
/* Copyright 2021 FREE WING,Y.Sakamoto
 * http://www.neko.ne.jp/~freewing/
 *
 * 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/>.
 */

#include "bstk100.h"

A keyboards/handwired/bstk100/bstk100.h => keyboards/handwired/bstk100/bstk100.h +43 -0
@@ 0,0 1,43 @@
/* Copyright 2021 FREE WING,Y.Sakamoto
 * http://www.neko.ne.jp/~freewing/
 *
 * 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

#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, \
    k34, k03, k02, k13, \
    k10, k11, k12, k01, \
    k20, k21, k22, k23, \
    k30, k31, k32, k33, \
    k40, k41, k43 \
) { \
    { k00, k01, k02,   k03, KC_NO }, \
    { k10, k11, k12,   k13, KC_NO }, \
    { k20, k21, k22,   k23, KC_NO }, \
    { k30, k31, k32,   k33, k34   }, \
    { k40, k41, KC_NO, k43, KC_NO }  \
}

A keyboards/handwired/bstk100/config.h => keyboards/handwired/bstk100/config.h +156 -0
@@ 0,0 1,156 @@
/*
Copyright 2021 FREE WING,Y.Sakamoto
http://www.neko.ne.jp/~freewing/

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

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID    0xFEED
#define PRODUCT_ID   0xB100
#define DEVICE_VER   0x0001
#define MANUFACTURER FREE WING
#define PRODUCT      bstk100

/* key matrix size */
#define MATRIX_ROWS 5
#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)
 *
 */
#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 }
#define MATRIX_COL_PINS { B5, B4, E6, D7, C6 }
#define UNUSED_PINS

/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW

/*
 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
 */
#define SOFT_SERIAL_PIN D0  // or D1, D2, D3, E6

// The state of the indicator pins when the LED is "on" - 1 for high
#define LED_PIN_ON_STATE 0

#define LED_NUM_LOCK_PIN D4
#define LED_CAPS_LOCK_PIN D5
#define LED_SCROLL_LOCK_PIN B0
//#define LED_COMPOSE_PIN B3
//#define LED_KANA_PIN B4

//#define BACKLIGHT_PIN B7
//#define BACKLIGHT_LEVELS 3
//#define BACKLIGHT_BREATHING

//#define RGB_DI_PIN E2
//#ifdef RGB_DI_PIN
//#    define RGBLED_NUM 16
//#    define RGBLIGHT_HUE_STEP 8
//#    define RGBLIGHT_SAT_STEP 8
//#    define RGBLIGHT_VAL_STEP 8
//#    define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
//#    define RGBLIGHT_SLEEP  /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
//#    define RGBLIGHT_ANIMATIONS
/*== or choose animations ==*/
//#    define RGBLIGHT_EFFECT_BREATHING
//#    define RGBLIGHT_EFFECT_RAINBOW_MOOD
//#    define RGBLIGHT_EFFECT_RAINBOW_SWIRL
//#    define RGBLIGHT_EFFECT_SNAKE
//#    define RGBLIGHT_EFFECT_KNIGHT
//#    define RGBLIGHT_EFFECT_CHRISTMAS
//#    define RGBLIGHT_EFFECT_STATIC_GRADIENT
//#    define RGBLIGHT_EFFECT_RGB_TEST
//#    define RGBLIGHT_EFFECT_ALTERNATING
/*== customize breathing effect ==*/
/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
//#    define RGBLIGHT_BREATHE_TABLE_SIZE 256      // 256(default) or 128 or 64
/*==== use exp() and sin() ====*/
//#    define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85  // 1 to 2.7
//#    define RGBLIGHT_EFFECT_BREATHE_MAX    255   // 0 to 255
//#endif

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

/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST

/* 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

/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
 * This is useful for the Windows task manager shortcut (ctrl+shift+esc).
 */
//#define GRAVE_ESC_CTRL_OVERRIDE

/*
 * Force NKRO
 *
 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
 * makefile for this to work.)
 *
 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
 * until the next keyboard reset.
 *
 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
 * fully operational during normal computer usage.
 *
 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
 * power-up.
 *
 */
//#define FORCE_NKRO

/*
 * Feature disable options
 *  These options are also useful to firmware size reduction.
 */

/* disable debug print */
//#define NO_DEBUG

/* disable print */
//#define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION

/* Bootmagic Lite key configuration */
//#define BOOTMAGIC_LITE_ROW 0
//#define BOOTMAGIC_LITE_COLUMN 0

A keyboards/handwired/bstk100/info.json => keyboards/handwired/bstk100/info.json +36 -0
@@ 0,0 1,36 @@
{
    "keyboard_name": "bstk100",
    "url": "http://www.neko.ne.jp/~freewing/",
    "maintainer": "FREE WING",
    "layouts": {
        "LAYOUT": {
            "layout": [
                {"label": "k00", "x": 0, "y": 0},

                {"label": "k34", "x": 0, "y": 1},
                {"label": "k03", "x": 1, "y": 1},
                {"label": "k02", "x": 2, "y": 1},
                {"label": "k13", "x": 3, "y": 1},

                {"label": "k10", "x": 0, "y": 2},
                {"label": "k11", "x": 1, "y": 2},
                {"label": "k12", "x": 2, "y": 2},
                {"label": "k01", "x": 3, "y": 2},

                {"label": "k20", "x": 0, "y": 3},
                {"label": "k21", "x": 1, "y": 3},
                {"label": "k22", "x": 2, "y": 3},
                {"label": "k23", "x": 3, "y": 3},

                {"label": "k30", "x": 0, "y": 4},
                {"label": "k31", "x": 1, "y": 4},
                {"label": "k32", "x": 2, "y": 4},
                {"label": "k33", "x": 3, "y": 4, "h": 2},

                {"label": "k40", "x": 0, "y": 5},
                {"label": "k41", "x": 1, "y": 5},
                {"label": "k43", "x": 2, "y": 5}
            ]
        }
    }
}

A keyboards/handwired/bstk100/keymaps/default/keymap.c => keyboards/handwired/bstk100/keymaps/default/keymap.c +53 -0
@@ 0,0 1,53 @@
/* Copyright 2021 FREE WING,Y.Sakamoto
 * http://www.neko.ne.jp/~freewing/
 *
 * 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/>.
 */
#include QMK_KEYBOARD_H

// Defines names for use in layer keycodes and the keymap
enum layer_names {
    _BASE
};

// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
    QMK00 = SAFE_RANGE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [_BASE] = LAYOUT(
        KC_NLCK,
        KC_TAB, KC_PSLS, KC_PAST, KC_BSPC,
        KC_P7,  KC_P8,   KC_P9,   KC_PMNS,
        KC_P4,  KC_P5,   KC_P6,   KC_PPLS,
        KC_P1,  KC_P2,   KC_P3,   KC_PENT,
        KC_P0,  QMK00,   KC_PDOT
    )
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {
        case QMK00:
            if (record->event.pressed) {
                // when keycode QMK00 is pressed
                SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0));
            } else {
                // when keycode QMK00 is released
            }
            break;
    }
    return true;
}

A keyboards/handwired/bstk100/keymaps/default/readme.md => keyboards/handwired/bstk100/keymaps/default/readme.md +26 -0
@@ 0,0 1,26 @@
# The default keymap for bstk100

```
                (LED)
               +----+
               +NumL+
               +----+

+----+----+----+----+
|Tab | /  | *  |Back|
|    |    |    | Spc|
+----+----+----+----+
|7   |8   |9   |-   |
|Home|Up  |PgUp|    |
+----+----+----+----+
|4   |5   |6   |+   |
|Left|    |Righ|    |
+----+----+----+----+
|1   |2   |3   |    |
| End|Down|PgDn|Ent |
+----+----+----|    |
|0   |00  |.   |    |
| Ins|    | Del|    |
+----+----+----+----+
```


A keyboards/handwired/bstk100/keymaps/via/keymap.c => keyboards/handwired/bstk100/keymaps/via/keymap.c +53 -0
@@ 0,0 1,53 @@
/* Copyright 2021 FREE WING,Y.Sakamoto
 * http://www.neko.ne.jp/~freewing/
 *
 * 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/>.
 */
#include QMK_KEYBOARD_H

// Defines names for use in layer keycodes and the keymap
enum layer_names {
    _BASE
};

// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
    QMK00 = SAFE_RANGE
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Base */
    [_BASE] = LAYOUT(
        KC_NLCK,
        KC_TAB, KC_PSLS, KC_PAST, KC_BSPC,
        KC_P7,  KC_P8,   KC_P9,   KC_PMNS,
        KC_P4,  KC_P5,   KC_P6,   KC_PPLS,
        KC_P1,  KC_P2,   KC_P3,   KC_PENT,
        KC_P0,  QMK00,   KC_PDOT
    )
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {
        case QMK00:
            if (record->event.pressed) {
                // when keycode QMK00 is pressed
                SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0));
            } else {
                // when keycode QMK00 is released
            }
            break;
    }
    return true;
}

A keyboards/handwired/bstk100/keymaps/via/readme.md => keyboards/handwired/bstk100/keymaps/via/readme.md +26 -0
@@ 0,0 1,26 @@
# The default keymap for bstk100

```
                (LED)
               +----+
               +NumL+
               +----+

+----+----+----+----+
|Tab | /  | *  |Back|
|    |    |    | Spc|
+----+----+----+----+
|7   |8   |9   |-   |
|Home|Up  |PgUp|    |
+----+----+----+----+
|4   |5   |6   |+   |
|Left|    |Righ|    |
+----+----+----+----+
|1   |2   |3   |    |
| End|Down|PgDn|Ent |
+----+----+----|    |
|0   |00  |.   |    |
| Ins|    | Del|    |
+----+----+----+----+
```


A keyboards/handwired/bstk100/keymaps/via/rules.mk => keyboards/handwired/bstk100/keymaps/via/rules.mk +1 -0
@@ 0,0 1,1 @@
VIA_ENABLE = yes

A keyboards/handwired/bstk100/readme.md => keyboards/handwired/bstk100/readme.md +35 -0
@@ 0,0 1,35 @@
# bstk100

BUFFALO USB 10-Key keyboard BSTK100 modification by Pro Micro and QMK firmware .  
see [[FREE WING HOME PAGE]](http://www.neko.ne.jp/~freewing/) for more detail .  

![bstk100](https://i.imgur.com/9s5kxSB.jpeg)
![bstk100](https://i.imgur.com/rsilkiy.jpeg)
![bstk100](https://i.imgur.com/TuQlxat.jpeg)
![bstk100](https://i.imgur.com/w0g6Qlz.jpeg)
![bstk100](https://i.imgur.com/ORgbBQh.jpeg)
![bstk100](https://i.imgur.com/1MDm3zt.png)

* Keyboard Maintainer: [FREE WING GitHub](https://github.com/FREEWING-JP/qmk_firmware)
* Hardware Supported: Pro Micro ATmega32U4 5V/16MHz
* Hardware Availability: [BUFFALO USB 10-Key keyboard BSTK100BK](https://amzn.to/389GGtP), [Pro Micro ATmega32U4 5V/16MHz](https://amzn.to/3jePZPi)

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

    make handwired/bstk100:default

Enable VIA feature in QMK

    make handwired/bstk100:via

Flashing example for this keyboard:

    make handwired/bstk100: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 one way:

* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead

A keyboards/handwired/bstk100/rules.mk => keyboards/handwired/bstk100/rules.mk +18 -0
@@ 0,0 1,18 @@
# 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
NKRO_ENABLE = no            # Enable N-Key Rollover
BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
AUDIO_ENABLE = no           # Audio output