From 2cb32328b636be32e74786694a4d791548e08d1a Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 7 Jun 2019 13:42:40 -0700 Subject: [PATCH] [Keyboard] New Keyboard(s): Red Scarf II+ RS68 and RS78 (#6084) * martenwuut's original code commit * delete random directory that is the same as the parent directory * get this compiling * update readmes * add manufacturer * fix up the keymap error and replace KC_A with KC_1 * add verc support which is basically just at trimmed down verb * update keymap readme to specify which redscarf it is * add parent level readme * fix grammar * fix up readmes and put in alternative name for PCBs * add configurator support for the ver.c pcb * add configurator support for Ver.B (RS78) pcb * add iso support for Ver.C (RS68) * change DEBOUNCING_DELAY to just DEBOUNCE * remove K2C to fit the default layouts * fix keymap * fixup configurator layout with split backspace --- keyboards/redscarf_iiplus/readme.md | 14 + keyboards/redscarf_iiplus/verb/config.h | 252 +++++++++++ keyboards/redscarf_iiplus/verb/info.json | 16 + .../verb/keymaps/default/keymap.c | 27 ++ .../verb/keymaps/default/readme.md | 1 + keyboards/redscarf_iiplus/verb/matrix.c | 391 ++++++++++++++++++ keyboards/redscarf_iiplus/verb/readme.md | 23 ++ keyboards/redscarf_iiplus/verb/rules.mk | 83 ++++ keyboards/redscarf_iiplus/verb/verb.c | 51 +++ keyboards/redscarf_iiplus/verb/verb.h | 59 +++ keyboards/redscarf_iiplus/verc/config.h | 252 +++++++++++ keyboards/redscarf_iiplus/verc/info.json | 16 + .../verc/keymaps/default/keymap.c | 35 ++ .../verc/keymaps/default/readme.md | 1 + keyboards/redscarf_iiplus/verc/matrix.c | 391 ++++++++++++++++++ keyboards/redscarf_iiplus/verc/readme.md | 23 ++ keyboards/redscarf_iiplus/verc/rules.mk | 85 ++++ keyboards/redscarf_iiplus/verc/verc.c | 51 +++ keyboards/redscarf_iiplus/verc/verc.h | 61 +++ 19 files changed, 1832 insertions(+) create mode 100644 keyboards/redscarf_iiplus/readme.md create mode 100755 keyboards/redscarf_iiplus/verb/config.h create mode 100644 keyboards/redscarf_iiplus/verb/info.json create mode 100755 keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c create mode 100755 keyboards/redscarf_iiplus/verb/keymaps/default/readme.md create mode 100755 keyboards/redscarf_iiplus/verb/matrix.c create mode 100755 keyboards/redscarf_iiplus/verb/readme.md create mode 100755 keyboards/redscarf_iiplus/verb/rules.mk create mode 100755 keyboards/redscarf_iiplus/verb/verb.c create mode 100755 keyboards/redscarf_iiplus/verb/verb.h create mode 100755 keyboards/redscarf_iiplus/verc/config.h create mode 100644 keyboards/redscarf_iiplus/verc/info.json create mode 100755 keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c create mode 100755 keyboards/redscarf_iiplus/verc/keymaps/default/readme.md create mode 100755 keyboards/redscarf_iiplus/verc/matrix.c create mode 100755 keyboards/redscarf_iiplus/verc/readme.md create mode 100755 keyboards/redscarf_iiplus/verc/rules.mk create mode 100755 keyboards/redscarf_iiplus/verc/verc.c create mode 100755 keyboards/redscarf_iiplus/verc/verc.h diff --git a/keyboards/redscarf_iiplus/readme.md b/keyboards/redscarf_iiplus/readme.md new file mode 100644 index 000000000..fd67fb8df --- /dev/null +++ b/keyboards/redscarf_iiplus/readme.md @@ -0,0 +1,14 @@ +# Red Scarf II+ + +The Red Scarf II+ is an improved version of the Red Scarf II and is available in four different sizes. + +Ver A (RS Model F): 60% + Numpad on right, and Macro Keys on the left. +Ver B (RS78): 65% + Macro Keys on the left. +Ver C (RS68): 65%. +Ver D (RS77): 60% + Numpad on right. + +For more information please consult [Geekhack](https://geekhack.org/index.php?topic=74400.0) + +The Red Scarf II+ utilizes the same switch matrix across all its different versions. Therefore, firmware created for one will work on another. The caveat is that if you flash firmware built for the smaller boards onto a larger one, you will lose functionality of those extra keys. If you flash firmware built for a larger board onto a smaller one, the keys will operate normally. + +At this time, only the Ver B and the Ver C have been confirmed working with QMK. diff --git a/keyboards/redscarf_iiplus/verb/config.h b/keyboards/redscarf_iiplus/verb/config.h new file mode 100755 index 000000000..3fecdcac3 --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/config.h @@ -0,0 +1,252 @@ +/* +Copyright 2019 Maarten Dekkers + +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 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RedScarf +#define PRODUCT RedScarfII+ +#define DESCRIPTION QMK Firmware for the RedScarf II+ + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + + +/* + * 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 { } +#define MATRIX_COL_PINS { F4, F1, F0, B3, D0, D1, D4, D5, D6, D7, F7, F6, D2, D3, B6 } +#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 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #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 + +/* number of backlight levels */ + +/* 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 userful 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/redscarf_iiplus/verb/info.json b/keyboards/redscarf_iiplus/verb/info.json new file mode 100644 index 000000000..8466063fc --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Red Scarf II+ Ver.B (RS78)", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 5, + "layouts": { + "LAYOUT_78_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":8.25, "y":0}, {"x":9.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2.25, "y":1, "w":1.5}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":15.75, "y":1, "w":1.5}, {"x":17.25, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2.25, "y":2, "w":1.75}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2, "w":2.25}, {"x":17.25, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2.25, "y":3, "w":2.25}, {"x":4.5, "y":3}, {"x":5.5, "y":3}, {"x":6.5, "y":3}, {"x":7.5, "y":3}, {"x":8.5, "y":3}, {"x":9.5, "y":3}, {"x":10.5, "y":3}, {"x":11.5, "y":3}, {"x":12.5, "y":3}, {"x":13.5, "y":3}, {"x":14.5, "y":3, "w":1.75}, {"x":16.25, "y":3}, {"x":17.25, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":1.25}, {"x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"x":12.25, "y":4}, {"x":13.25, "y":4}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}, {"x":17.25, "y":4}] + }, + + "LAYOUT_78_iso": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":8.25, "y":0}, {"x":9.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2.25, "y":1, "w":1.5}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":7.75, "y":1}, {"x":8.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":16, "y":1, "w":1.25, "h":2}, {"x":17.25, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2.25, "y":2, "w":1.75}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":17.25, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2.25, "y":3, "w":1.25}, {"x":3.5, "y":3}, {"x":4.5, "y":3}, {"x":5.5, "y":3}, {"x":6.5, "y":3}, {"x":7.5, "y":3}, {"x":8.5, "y":3}, {"x":9.5, "y":3}, {"x":10.5, "y":3}, {"x":11.5, "y":3}, {"x":12.5, "y":3}, {"x":13.5, "y":3}, {"x":14.5, "y":3, "w":1.75}, {"x":16.25, "y":3}, {"x":17.25, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":1.25}, {"x":4.75, "y":4, "w":1.25}, {"x":6, "y":4, "w":6.25}, {"x":12.25, "y":4}, {"x":13.25, "y":4}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}, {"x":17.25, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c b/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c new file mode 100755 index 000000000..eea39a33b --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/keymaps/default/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2019 Maarten Dekkers + * + * 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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_78_ansi( + KC_F1, KC_F2, KC_ESC, 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_GRV, KC_INS, + KC_F3, KC_F4, 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_F5, KC_F6, 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_ENT, KC_PGUP, + KC_F7, KC_F8, KC_LSFT, 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_PGDN, + KC_F9, RESET, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ) +}; diff --git a/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md b/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md new file mode 100755 index 000000000..b7324c518 --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Red Scarf II+ ver B. \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verb/matrix.c b/keyboards/redscarf_iiplus/verb/matrix.c new file mode 100755 index 000000000..54b0f3a9a --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/matrix.c @@ -0,0 +1,391 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +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 +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +// static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + * + * 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 "verb.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void led_init_ports(void) { + setPinOutput(C7); + setPinOutput(E6); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/redscarf_iiplus/verb/verb.h b/keyboards/redscarf_iiplus/verb/verb.h new file mode 100755 index 000000000..d86a6c4c6 --- /dev/null +++ b/keyboards/redscarf_iiplus/verb/verb.h @@ -0,0 +1,59 @@ +/* Copyright 2019 Maarten Dekkers + * + * 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 XXX KC_NO + +/* 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_78_ansi( \ + K51, K52, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2C, K0E, \ + K53, K54, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K55, K56, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K57, K58, K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K59, K5A, K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, XXX, XXX, XXX } \ +} +#define LAYOUT_78_iso( \ + K51, K52, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2C, K0E, \ + K53, K54, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K55, K56, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, K2E, \ + K57, K58, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K59, K5A, K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, XXX, XXX, XXX, XXX } \ +} diff --git a/keyboards/redscarf_iiplus/verc/config.h b/keyboards/redscarf_iiplus/verc/config.h new file mode 100755 index 000000000..3fecdcac3 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/config.h @@ -0,0 +1,252 @@ +/* +Copyright 2019 Maarten Dekkers + +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 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RedScarf +#define PRODUCT RedScarfII+ +#define DESCRIPTION QMK Firmware for the RedScarf II+ + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + + +/* + * 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 { } +#define MATRIX_COL_PINS { F4, F1, F0, B3, D0, D1, D4, D5, D6, D7, F7, F6, D2, D3, B6 } +#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 + +#define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #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 + +/* number of backlight levels */ + +/* 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 userful 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +/* defined by default; to change, uncomment and set to the combination you want */ +// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP H +//#define MAGIC_KEY_HELP_ALT SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER0_ALT GRAVE +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_BOOTLOADER_ALT ESC +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_EEPROM_CLEAR BSPACE +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/redscarf_iiplus/verc/info.json b/keyboards/redscarf_iiplus/verc/info.json new file mode 100644 index 000000000..210b399ba --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Red Scarf II+ Ver.C (RS68)", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_65_iso": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c b/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c new file mode 100755 index 000000000..aad191328 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/keymaps/default/keymap.c @@ -0,0 +1,35 @@ +/* Copyright 2019 Maarten Dekkers + * + * 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 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_65_ansi( + KC_ESC, 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT_65_ansi( + RESET, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md b/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md new file mode 100755 index 000000000..c792f1d12 --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Red Scarf II+ ver C \ No newline at end of file diff --git a/keyboards/redscarf_iiplus/verc/matrix.c b/keyboards/redscarf_iiplus/verc/matrix.c new file mode 100755 index 000000000..54b0f3a9a --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/matrix.c @@ -0,0 +1,391 @@ +/* +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar + +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 +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "debounce.h" +#include "quantum.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#ifdef MATRIX_MASKED + extern const matrix_row_t matrix_mask[]; +#endif + +#ifdef DIRECT_PINS +static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS; +#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) +// static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values +static matrix_row_t matrix[MATRIX_ROWS]; //debounced values + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +//Deprecated. +bool matrix_is_modified(void) +{ + if (debounce_active()) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + * + * 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 "verc.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); + led_init_ports(); +} + +void led_init_ports(void) { + setPinOutput(C7); + setPinOutput(E6); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + writePinLow(C7); + } else { + writePinHigh(C7); + } + + if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { + writePinLow(E6); + } else { + writePinHigh(E6); + } + + led_set_user(usb_led); +} diff --git a/keyboards/redscarf_iiplus/verc/verc.h b/keyboards/redscarf_iiplus/verc/verc.h new file mode 100755 index 000000000..6da76134d --- /dev/null +++ b/keyboards/redscarf_iiplus/verc/verc.h @@ -0,0 +1,61 @@ +/* Copyright 2019 Maarten Dekkers + * + * 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 XXX KC_NO + +/* 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_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \ +} + +#define LAYOUT_65_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K49, K4A, K4B, K47, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, K49, K4A, K4B, K4C, K4D, K4E }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX } \ +} +