Эх сурвалжийг харах

[Keyboard] Add Yugo-M Controller (#10389)

* Created folder structure and blank files

* Update the yugo_m initial blank files

* Add yugo_m default keymap

* Update yugo_m info.json

* Fix yugo_m keymap.c

* keymap.c update

* Changed subfolder name

* File names

* Fixed lock LEDs problem

* Returned old subfolder name; LEDs fix

* Activated anti-ghosting feature in config.h

* Update readme.md

* Changed LAYOUT to LAYOUT_all

* Updated keymap.c

* corrected LAYOUT to LAYOUT_all in info.json

* Rewritten readme.md according to the template

* Removed backslashes from keymap.c

* Fixed readme.md

* Fixed readme.md again

* Tidying up readme.md

* Tidying up comments and readme.md

* Removed a line from rules.mk

* Update keyboards/yugo_m/model_m_101/model_m_101.h

Co-authored-by: Joel Challis <git@zvecr.com>

* Removed chconf, halconf, mcuconf

* Updated LED control

* Update keyboards/yugo_m/model_m_101/rules.mk

Co-authored-by: Joel Challis <git@zvecr.com>

* Update keyboards/yugo_m/model_m_101/config.h

Co-authored-by: Joel Challis <git@zvecr.com>

* Update keyboards/yugo_m/model_m_101/config.h

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/yugo_m/model_m_101/config.h

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/yugo_m/model_m_101/model_m_101.c

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Update keyboards/yugo_m/readme.md

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>

* Updated readme.md, there was an outdated info

* Update keyboards/yugo_m/model_m_101/keymaps/default/keymap.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update keyboards/yugo_m/model_m_101/keymaps/default/keymap.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update keyboards/yugo_m/model_m_101/model_m_101.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update keyboards/yugo_m/model_m_101/model_m_101.c

Co-authored-by: Joel Challis <git@zvecr.com>

Co-authored-by: Nidzo Tomic <tomicn8@hotmail.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
tomic1785 4 жил өмнө
parent
commit
edebe56f6b

+ 100 - 0
keyboards/yugo_m/model_m_101/config.h

@@ -0,0 +1,100 @@
+/*
+Copyright 2020 Nidzo Tomic <tomicn8@hotmail.com>
+
+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      0x8E81  // Yugo-M
+#define DEVICE_VER      0x0001
+#define MANUFACTURER    IBM
+#define PRODUCT         Yugo-M (Model M replacement controller)
+/* key matrix size */
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 16
+
+/*
+ * 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 { B8, B7, B6, B5, B4, B3, A15, A14 }
+#define MATRIX_COL_PINS { A9, A8, B15, B14, B13, B12, B11, B10, B2, B1, B0, A7, A6, A5, A4, A3 }
+#define UNUSED_PINS { A0, A1, A2, A10, A13, B9, C13, C14, C15 }
+
+
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION ROW2COL
+
+/* define if matrix has ghost */
+#define MATRIX_HAS_GHOST
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed (5 is default) */
+#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
+
+
+/*
+ * 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
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 8 - 0
keyboards/yugo_m/model_m_101/info.json


+ 45 - 0
keyboards/yugo_m/model_m_101/keymaps/default/keymap.c

@@ -0,0 +1,45 @@
+/* Copyright 2020 Nidzo Tomic <tomicn8@hotmail.com>
+ *
+ * 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
+
+enum keyboard_layers {
+    _BL, // Base Layer
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Layer 0: Default Layer
+     * ,-------------------------------------------------------------------------------------------------.
+     * |Esc|   | F1| F2| F3| F4| | F5| F6| F7| F8| | F9|F10|F11|F12|    |PSc|ScL| Ps|                    |
+     * |                                                                                                 |
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    BSp|    |Ins|Hom|PgU|    |Num|  /|  *|  -|
+     * |-----------------------------------------------------------|    |-----------|    |---------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|    |Del|End|PgD|    |  7|  8|  9|   |
+     * |-----------------------------------------------------------|                     |-----------|   |
+     * |CapsLk|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|Ent |                     |  4|  5|  6|  +|
+     * |-----------------------------------------------------------|                     |---------------|
+     * |Shift|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift    |        | Up|        |  1|  2|  3|   |
+     * |-----------------------------------------------------------|        |---|        |-----------|   |
+     * |Ctrl |   |Alt  |           Space          |Alt Gr|   |Ctrl |    | Lt| Dn| Rt|    |      0|  ,|Ent|
+     * `-------------------------------------------------------------------------------------------------'
+     */
+    [_BL] = LAYOUT_all(
+      KC_ESC,           KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,    KC_PSCR, KC_SLCK, KC_PAUS,
+      KC_GRV,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSPC,   KC_INS,  KC_HOME, KC_PGUP,   KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
+      KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSLS,   KC_DEL,  KC_END,  KC_PGDN,   KC_P7,   KC_P8,   KC_P9,   KC_PPLS,
+      KC_CAPS, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,                                 KC_P4,   KC_P5,   KC_P6,
+      KC_LSFT, KC_NUBS, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT,            KC_UP,              KC_P1,   KC_P2,   KC_P3,   KC_PENT,
+      KC_LCTL,          KC_LALT,                            KC_SPC,                                      KC_RALT,          KC_RCTL,   KC_LEFT, KC_DOWN, KC_RGHT,   KC_P0,            KC_PDOT),
+};

+ 1 - 0
keyboards/yugo_m/model_m_101/keymaps/default/readme.md

@@ -0,0 +1 @@
+# The default keymap for 101/102 key keyboards. 

+ 35 - 0
keyboards/yugo_m/model_m_101/model_m_101.c

@@ -0,0 +1,35 @@
+/* Copyright 2020 Nidzo Tomic <tomicn8@hotmail.com>
+ *
+ * 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 "model_m_101.h"
+
+void keyboard_pre_init_kb(void) {
+  // Set our LED pins as output
+  setPinOutput(A2);
+  setPinOutput(A1);
+  setPinOutput(A0);
+  
+  keyboard_pre_init_user();
+}
+
+bool led_update_kb(led_t led_state) {
+    bool res = led_update_user(led_state);
+    if(res) {
+        writePin(A2, !led_state.num_lock);
+        writePin(A1, !led_state.caps_lock);
+        writePin(A0, !led_state.scroll_lock);
+    }
+    return res;
+}

+ 45 - 0
keyboards/yugo_m/model_m_101/model_m_101.h

@@ -0,0 +1,45 @@
+/* Copyright 2020 Nidzo Tomic <tomicn8@hotmail.com>
+ *
+ * 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 a shortcut to help you visually see your layout.
+ * The first section contains "names" for physical keys of the keyboard
+ * and defines their position on the board.
+ * The second section defines position of the keys on the switch matrix
+ * (where COLUMNS and ROWS crosses). */
+
+#define LAYOUT_all( \
+    K5A,      K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M,   K5N, K5O, K5P, \
+    \
+    K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N,   K4O, K4P, K4Q,   K4R, K4S, K4T, K4U, \
+    K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N,   K3O, K3P, K3Q,   K3R, K3S, K3T, K3U, \
+    K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N,                    K2O, K2P, K2Q, \
+    K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L,      K1M,        K1N,        K1O, K1P, K1Q, K1R, \
+    K0A,      K0B,                K0C,                     K0D,      K0E,   K0F, K0G, K0H,   K0I,      K0J \
+) \
+{ \
+/* 00 */ { KC_NO, KC_NO, K5A,   K1B,   K5E,   K2F, K5F,   K2G, K5G,   KC_NO, K2L,   KC_NO, K0I, K0J, K1N,   K0B   }, \
+/* 01 */ { KC_NO, K1A,   K3A,   K2A,   K5D,   K3F, K4N,   K3G, K3M,   K5H,   K3L,   K2O,   K2P, K2Q, KC_NO, KC_NO }, \
+/* 02 */ { K0A,   KC_NO, K4A,   K5B,   K5C,   K4F, K5J,   K4G, K4M,   K5I,   K4L,   K3O,   K4O, K4Q, K4P,   KC_NO }, \
+/* 03 */ { KC_NO, KC_NO, K4B,   K4C,   K4D,   K4E, K5K,   K4H, K4I,   K4J,   K4K,   K5L,   K5M, K3Q, K3P,   K5N   }, \
+/* 04 */ { KC_NO, KC_NO, K3B,   K3C,   K3D,   K3E, KC_NO, K3H, K3I,   K3J,   K3K,   K3R,   K3S, K3T, K3U,   K5O   }, \
+/* 05 */ { KC_NO, KC_NO, K2B,   K2C,   K2D,   K2E, K3N,   K2H, K2I,   K2J,   K2K,   K1O,   K1P, K1Q, K1R,   KC_NO }, \
+/* 06 */ { K0E,   K1M,   K1C,   K1D,   K1E,   K1F, K2N,   K1I, K1J,   K1K,   K2M,   K4R,   K4S, K4T, K5P,   KC_NO }, \
+/* 07 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1G, K0C,   K1H, KC_NO, KC_NO, K1L,   K0G,   K0H, K4U, K0F,   K0D   }, \
+}
+/*         0      1      2      3      4      5    6      7    8      9      A      B      C    D    E      F       */

+ 17 - 0
keyboards/yugo_m/model_m_101/readme.md

@@ -0,0 +1,17 @@
+# Yugo-M
+
+![Yugo-M](https://raw.githubusercontent.com/tomic1785/Yugo-M-controller-project/master/Pictures/rev_09b.jpg)
+
+A drop-in replacement controller PCB for IBM Model M keyboards, based on the STM32 MCU. [More info on the Yugo-M project repository](https://github.com/tomic1785/Yugo-M-controller-project)
+
+* Keyboard Maintainer: [Nidzo Tomic](https://github.com/tomic1785)
+* Hardware Supported: Yugo-M PCB
+    * Rev 0.9b
+    * Rev 1.1b
+* Hardware Availability: [Check out the project repository](https://github.com/tomic1785/Yugo-M-controller-project)
+
+Make example for this keyboard (after setting up your build environment):
+
+    make yugo_m/model_m_101: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).

+ 19 - 0
keyboards/yugo_m/model_m_101/rules.mk

@@ -0,0 +1,19 @@
+# MCU name
+MCU = STM32F303
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE = lite     # Virtual DIP switch configuration
+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
+BLUETOOTH_ENABLE = no       # Enable Bluetooth
+AUDIO_ENABLE = no           # Audio output

+ 11 - 0
keyboards/yugo_m/readme.md

@@ -0,0 +1,11 @@
+# Yugo-M - An STM32-based IBM Model M controller
+
+A drop-in replacement controller PCB for IBM Model M keyboards. 
+Currently available only for 101/102 key keyboards. 
+
+* Keyboard Maintainer: [Nidzo Tomic](https://github.com/tomic1785)
+* Hardware Supported: Yugo-M PCB
+  * Rev 0.9b
+  * Rev 1.1b
+
+For more info visit the project repository: [Yugo-M-controller-project](https://github.com/tomic1785/Yugo-M-controller-project)

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно