From bd74e5913c4d733945702ecf36b693fc68352d5e Mon Sep 17 00:00:00 2001 From: Dicko Date: Wed, 12 Oct 2022 07:51:09 +0700 Subject: [PATCH 1/2] [Keyboard] Support for dumbpad_v3x (#261) * feat: support for imchipwood's dumbpad/v3x * feat: removed vial insecure * fix: added unlock combo definition * fix: encoder keymap update for default and deveth0 --- keyboards/dumbpad/v3x/config.h | 84 ++++++++++++ keyboards/dumbpad/v3x/info.json | 18 +++ .../dumbpad/v3x/keymaps/default/keymap.c | 66 ++++++++++ .../dumbpad/v3x/keymaps/deveth0/keymap.c | 89 +++++++++++++ keyboards/dumbpad/v3x/keymaps/vial/config.h | 8 ++ keyboards/dumbpad/v3x/keymaps/vial/keymap.c | 66 ++++++++++ keyboards/dumbpad/v3x/keymaps/vial/rules.mk | 11 ++ keyboards/dumbpad/v3x/keymaps/vial/vial.json | 41 ++++++ keyboards/dumbpad/v3x/readme.md | 27 ++++ keyboards/dumbpad/v3x/rules.mk | 24 ++++ keyboards/dumbpad/v3x/v3x.c | 121 ++++++++++++++++++ keyboards/dumbpad/v3x/v3x.h | 33 +++++ 12 files changed, 588 insertions(+) create mode 100644 keyboards/dumbpad/v3x/config.h create mode 100644 keyboards/dumbpad/v3x/info.json create mode 100644 keyboards/dumbpad/v3x/keymaps/default/keymap.c create mode 100644 keyboards/dumbpad/v3x/keymaps/deveth0/keymap.c create mode 100644 keyboards/dumbpad/v3x/keymaps/vial/config.h create mode 100644 keyboards/dumbpad/v3x/keymaps/vial/keymap.c create mode 100644 keyboards/dumbpad/v3x/keymaps/vial/rules.mk create mode 100644 keyboards/dumbpad/v3x/keymaps/vial/vial.json create mode 100644 keyboards/dumbpad/v3x/readme.md create mode 100644 keyboards/dumbpad/v3x/rules.mk create mode 100644 keyboards/dumbpad/v3x/v3x.c create mode 100644 keyboards/dumbpad/v3x/v3x.h diff --git a/keyboards/dumbpad/v3x/config.h b/keyboards/dumbpad/v3x/config.h new file mode 100644 index 00000000000..c64409c9677 --- /dev/null +++ b/keyboards/dumbpad/v3x/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2022 imchipwood && deveth0 + +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" + + +/* Column/Row IO definitions */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 5 +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } +#define UNUSED_PINS + +/* Single rotary encoder */ +#define ENCODERS_PAD_A { B2 } +#define ENCODERS_PAD_B { D4 } + +/* Onboard LEDs */ +#define LED_00 B1 +#define LED_01 B3 +#define LED_02 B6 + +/* Bootmagic - hold down rotary encoder pushbutton while plugging in to enter bootloader */ +#define BOOTMAGIC_LITE_ROW 3 +#define BOOTMAGIC_LITE_COLUMN 0 + +#define RGB_DI_PIN D1 +#define DRIVER_LED_TOTAL 16 + +// Cleanup RGB +#ifdef RGB_MATRIX_ENABLE + +#define RGB_DISABLE_TIMEOUT 300000 // 5 minutes (5 * 60 * 1000ms) +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Heatmap, Rain +#define RGB_MATRIX_KEYPRESSES + +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_SAT +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +#define ENABLE_RGB_MATRIX_PIXEL_FLOW +#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#endif diff --git a/keyboards/dumbpad/v3x/info.json b/keyboards/dumbpad/v3x/info.json new file mode 100644 index 00000000000..f29108fb391 --- /dev/null +++ b/keyboards/dumbpad/v3x/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "dumbpad/v3x", + "url": "https://www.github.com/imchipwood/dumbpad", + "maintainer": "imchipwood", + "usb": { + "device_version": "0.1.0" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/dumbpad/v3x/keymaps/default/keymap.c b/keyboards/dumbpad/v3x/keymaps/default/keymap.c new file mode 100644 index 00000000000..1838b797835 --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* +Copyright 2022 imchipwood && deveth0 + +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 + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + BASE LAYER - Num Pad + /-----------------------------------------------------` + | | 7 | 8 | 9 | - | + | |---------|---------|---------|---------| + | | 4 | 5 | 6 | + | + | |---------|---------|---------|---------| + | | 1 | 2 | 3 | * | + |-------------|---------|---------|---------|---------| + | Mute | TT(1) | 0 | | Enter | + \-----------------------------------------------------' + */ + [0] = LAYOUT( + KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PAST, + KC_MUTE, TT(1), KC_P0, _______, KC_ENTER + ), + /* + SUB LAYER - RGB controls, Modes on encoder + /-----------------------------------------------------` + | | On/Off | Bright- | Bright+ | Reset | + | |---------|---------|---------|---------| + | | | Hue- | Hue+ | | + | |---------|---------|---------|---------| + | | | Sat- | Sat+ | | + |-------------|---------|---------|---------|---------| + | | TT(1) | Effect- | Effect+ | | + \-----------------------------------------------------' + */ + [1] = LAYOUT( + RGB_TOG, RGB_VAD, RGB_VAI, RESET, + KC_NO, RGB_HUD, RGB_HUI, KC_NO, + KC_NO, RGB_SAD, RGB_SAI, KC_NO, + KC_NO, _______, RGB_SPD, RGB_SPI, KC_NO + ), +}; +// clang-format on + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) }, +}; +#endif diff --git a/keyboards/dumbpad/v3x/keymaps/deveth0/keymap.c b/keyboards/dumbpad/v3x/keymaps/deveth0/keymap.c new file mode 100644 index 00000000000..5d0bd11c5ae --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/deveth0/keymap.c @@ -0,0 +1,89 @@ +/* +Copyright 2022 imchipwood && deveth0 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define MUTE_HOLD_DELAY 400 +static uint16_t mute_hold_timer = 0; + +enum custom_keycodes { + MUTE_TEAMS = SAFE_RANGE, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + BASE LAYER - Media Controls + /------------------------------------------------------------------------------------` + | | Media Prev | Media Pause | Media Next | | + | |--------------------|-------------------|------------------|---------| + | | Teams - Mute | | | | + | |--------------------|-------------------|------------------|---------| + | | | | | | + |-------------|--------------------|-------------------|------------------|---------| + | Mute | TT(1) | | | Enter | + \------------------------------------------------------------------------------------' + */ + [0] = LAYOUT( + KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + MUTE_TEAMS, KC_NO, KC_NO, KC_NO, + KC_MUTE, TT(1), KC_NO, KC_NO, KC_NO + ), + /* + SUB LAYER - RGB controls, Modes on encoder + /-----------------------------------------------------` + | | On/Off | Bright- | Bright+ | Reset | + | |---------|---------|---------|---------| + | | | Hue- | Hue+ | | + | |---------|---------|---------|---------| + | | | Sat- | Sat+ | | + |-------------|---------|---------|---------|---------| + | | TT(1) | Effect- | Effect+ | | + \-----------------------------------------------------' + */ + [1] = LAYOUT( + RGB_TOG, RGB_VAD, RGB_VAI, RESET, + KC_NO, RGB_HUD, RGB_HUI, KC_NO, + KC_NO, RGB_SAD, RGB_SAI, KC_NO, + KC_NO, _______, RGB_SPD, RGB_SPI, KC_NO + ), +}; +// clang-format on + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // props to https://www.reddit.com/r/olkb/comments/oewbr2/comment/h49z38r + switch (keycode) { + case MUTE_TEAMS: + if (record->event.pressed) { // when keycode MUTE_TEAMS is pressed + mute_hold_timer = timer_read(); // mark the time the key was pressed + tap_code16(LCTL(LSFT(KC_M))); // tap Ctrl + Shift + M (mute shortcut) + } else { // when keycode MUTE_TEAMS is released + if (timer_elapsed(mute_hold_timer) > MUTE_HOLD_DELAY) // if held longer than MUTE_HOLD_DELAY + tap_code16(LCTL(LSFT(KC_M))); // tap the mute shortcut again + } // otherwise do nothing + break; + } + return true; +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) }, +}; +#endif diff --git a/keyboards/dumbpad/v3x/keymaps/vial/config.h b/keyboards/dumbpad/v3x/keymaps/vial/config.h new file mode 100644 index 00000000000..764507bd583 --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/vial/config.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0xBD, 0x22, 0x15, 0x2D, 0xD8, 0x7E, 0x59, 0xA1} + +#define VIAL_UNLOCK_COMBO_ROWS { 1, 2 } +#define VIAL_UNLOCK_COMBO_COLS { 1, 1 } diff --git a/keyboards/dumbpad/v3x/keymaps/vial/keymap.c b/keyboards/dumbpad/v3x/keymaps/vial/keymap.c new file mode 100644 index 00000000000..1838b797835 --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/vial/keymap.c @@ -0,0 +1,66 @@ +/* +Copyright 2022 imchipwood && deveth0 + +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 + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + BASE LAYER - Num Pad + /-----------------------------------------------------` + | | 7 | 8 | 9 | - | + | |---------|---------|---------|---------| + | | 4 | 5 | 6 | + | + | |---------|---------|---------|---------| + | | 1 | 2 | 3 | * | + |-------------|---------|---------|---------|---------| + | Mute | TT(1) | 0 | | Enter | + \-----------------------------------------------------' + */ + [0] = LAYOUT( + KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PAST, + KC_MUTE, TT(1), KC_P0, _______, KC_ENTER + ), + /* + SUB LAYER - RGB controls, Modes on encoder + /-----------------------------------------------------` + | | On/Off | Bright- | Bright+ | Reset | + | |---------|---------|---------|---------| + | | | Hue- | Hue+ | | + | |---------|---------|---------|---------| + | | | Sat- | Sat+ | | + |-------------|---------|---------|---------|---------| + | | TT(1) | Effect- | Effect+ | | + \-----------------------------------------------------' + */ + [1] = LAYOUT( + RGB_TOG, RGB_VAD, RGB_VAI, RESET, + KC_NO, RGB_HUD, RGB_HUI, KC_NO, + KC_NO, RGB_SAD, RGB_SAI, KC_NO, + KC_NO, _______, RGB_SPD, RGB_SPI, KC_NO + ), +}; +// clang-format on + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD) }, +}; +#endif diff --git a/keyboards/dumbpad/v3x/keymaps/vial/rules.mk b/keyboards/dumbpad/v3x/keymaps/vial/rules.mk new file mode 100644 index 00000000000..f2cca64908a --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/vial/rules.mk @@ -0,0 +1,11 @@ +VIA_ENABLE = yes + +VIAL_ENABLE = yes +VIALRGB_ENABLE = yes + +# Firmware Optimization +LTO_ENABLE = yes +QMK_SETTINGS = no +TAP_DANCE_ENABLE = no +COMBO_ENABLE = no +KEY_OVERRIDE_ENABLE = no diff --git a/keyboards/dumbpad/v3x/keymaps/vial/vial.json b/keyboards/dumbpad/v3x/keymaps/vial/vial.json new file mode 100644 index 00000000000..883ceac1661 --- /dev/null +++ b/keyboards/dumbpad/v3x/keymaps/vial/vial.json @@ -0,0 +1,41 @@ +{ + "name": "dumbpad", + "vendorId": "0xDEAF", + "productId": "0x0913", + "lighting": "vialrgb", + "matrix": { "rows": 4, "cols": 5 }, + "layouts": { + "keymap": [ + ["0,0\n\n\n\n\n\n\n\n\ne", "0,1\n\n\n\n\n\n\n\n\ne"], + [ + { + "y": 0.25, + "x": 1 + }, + "0,1", + "0,2", + "0,3", + "0,4" + ], + [ + { + "x": 1 + }, + "1,1", + "1,2", + "1,3", + "1,4" + ], + [ + { + "x": 1 + }, + "2,1", + "2,2", + "2,3", + "2,4" + ], + ["3,0", "3,1", "3,2", "3,3", "3,4"] + ] + } +} diff --git a/keyboards/dumbpad/v3x/readme.md b/keyboards/dumbpad/v3x/readme.md new file mode 100644 index 00000000000..96b05379461 --- /dev/null +++ b/keyboards/dumbpad/v3x/readme.md @@ -0,0 +1,27 @@ +# dumbpad v3.x - rgb & hotswap + +![dumbpad](https://i.imgur.com/ND03FiFl.png) + +A 4x4 numpad/macropad with a rotary encoder to the left of the bottom row of keys. + +- Keyboard Maintainer: [imchipwood](https://github.com/imchipwood) // [deveth0](https://github.com/deveth0) +- Hardware repository: [dumbpad on github](https://github.com/imchipwood/dumbpad) +- PCB Revisions Supported: v3.1 + +Make example for this keyboard (after setting up your build environment): + + make dumbpad/v3x:default + +Flashing example for this keyboard: + + make dumbpad/v3x:default:flash + +## Bootloader + +Enter the bootloader in 3 ways: + +- **Bootmagic reset**: Hold down the encoder and plug in the keyboard +- **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +- **Keycode in layout**: Press the key mapped to `RESET` if it is available + +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/dumbpad/v3x/rules.mk b/keyboards/dumbpad/v3x/rules.mk new file mode 100644 index 00000000000..7ee2c89e234 --- /dev/null +++ b/keyboards/dumbpad/v3x/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # 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 + +ENCODER_ENABLE = yes +ENCODER_MAP_ENABLE = yes + +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 diff --git a/keyboards/dumbpad/v3x/v3x.c b/keyboards/dumbpad/v3x/v3x.c new file mode 100644 index 00000000000..4a8ba12c470 --- /dev/null +++ b/keyboards/dumbpad/v3x/v3x.c @@ -0,0 +1,121 @@ +/* Copyright 2022 imchipwood && deveth0 + * + * 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 "v3x.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = {{// Key Matrix to LED Index + {NO_LED, 0, 1, 2, 3}, + {NO_LED, 7, 6, 5, 4}, + {NO_LED, 8, 9, 10, 11}, + {NO_LED, 15, 14, 13, 12}}, + {// LED Index to Physical Position + {0, 0}, + {75, 0}, + {149, 0}, + {224, 0}, + + {224, 21}, + {149, 21}, + {75, 21}, + {0, 21}, + + {0, 43}, + {75, 43}, + {149, 43}, + {224, 43}, + + {224, 64}, + {149, 64}, + {75, 64}, + {0, 64}}, + {// LED Index to Flag + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}}; +#endif + +void keyboard_pre_init_kb(void) { + // Set LED IO as outputs + setPinOutput(LED_00); + setPinOutput(LED_01); + setPinOutput(LED_02); + keyboard_pre_init_user(); +} + +void shutdown_user() { + // Shutdown LEDs + writePinLow(LED_00); + writePinLow(LED_01); + writePinLow(LED_02); +} + +layer_state_t layer_state_set_kb(layer_state_t state) { + // Layer LEDs act as binary indication of current layer + uint8_t layer = get_highest_layer(state); + writePin(LED_00, layer & 0b1); + writePin(LED_01, (layer >> 1) & 0b1); + uprintf("%d string", layer); + return layer_state_set_user(state); +} + +// 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 + uint8_t led_delay_ms = 80; + for (int i = 0; i < 2; i++) { + writePinHigh(LED_00); + writePinHigh(LED_01); + writePinHigh(LED_02); + wait_ms(led_delay_ms); + writePinLow(LED_00); + writePinLow(LED_01); + writePinLow(LED_02); + if (i < 1) { + wait_ms(led_delay_ms); + } + } + + matrix_init_user(); +} + +bool led_update_kb(led_t led_state) { + if (!led_update_user(led_state)) return false; + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + writePin(LED_02, !led_state.num_lock); + return true; +} + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { + return false; + } + switch (get_highest_layer(layer_state)) { + case 0: + // main layer, volume + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + } + return true; +} +#endif diff --git a/keyboards/dumbpad/v3x/v3x.h b/keyboards/dumbpad/v3x/v3x.h new file mode 100644 index 00000000000..f939b6a5947 --- /dev/null +++ b/keyboards/dumbpad/v3x/v3x.h @@ -0,0 +1,33 @@ +/* Copyright 2022 imchipwood && deveth0 + * + * 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( \ + k01, k02, k03, k04, \ + k11, k12, k13, k14, \ + k21, k22, k23, k24, \ + k30, k31, k32, k33, k34 \ +) \ +{ \ + { KC_NO, k01, k02, k03, k04 }, \ + { KC_NO, k11, k12, k13, k14 }, \ + { KC_NO, k21, k22, k23, k24 }, \ + { k30, k31, k32, k33, k34 }, \ +} From 56d651511d5d09e4dceb00567c1f33a5dee25d80 Mon Sep 17 00:00:00 2001 From: Controller Works <103382872+controller-works@users.noreply.github.com> Date: Fri, 14 Oct 2022 17:13:46 -0400 Subject: [PATCH 2/2] Add mini42 (#262) * Porting the mini42 to Vial for the first time. * adding LTO_ENABLE=yes * Tweaking Via(l) settings * Set Via to v2 with lighting control disabled * Adding GPL copyright notices to files * Tidying things for a PR * Fix formatting of json file. * Updating files from QMK main * Updated readme for vial build Co-authored-by: kevinmgee --- keyboards/controllerworks/mini42/config.h | 69 ++++++++ keyboards/controllerworks/mini42/halconf.h | 22 +++ keyboards/controllerworks/mini42/info.json | 165 ++++++++++++++++++ .../mini42/keymaps/default/config.h | 79 +++++++++ .../mini42/keymaps/default/keymap.c | 68 ++++++++ .../mini42/keymaps/vial/config.h | 87 +++++++++ .../mini42/keymaps/vial/keymap.c | 68 ++++++++ .../mini42/keymaps/vial/rules.mk | 3 + .../mini42/keymaps/vial/vial.json | 41 +++++ keyboards/controllerworks/mini42/mcuconf.h | 23 +++ keyboards/controllerworks/mini42/mini42.c | 82 +++++++++ keyboards/controllerworks/mini42/mini42.h | 20 +++ keyboards/controllerworks/mini42/readme.md | 77 ++++++++ keyboards/controllerworks/mini42/rules.mk | 3 + 14 files changed, 807 insertions(+) create mode 100644 keyboards/controllerworks/mini42/config.h create mode 100644 keyboards/controllerworks/mini42/halconf.h create mode 100644 keyboards/controllerworks/mini42/info.json create mode 100644 keyboards/controllerworks/mini42/keymaps/default/config.h create mode 100644 keyboards/controllerworks/mini42/keymaps/default/keymap.c create mode 100644 keyboards/controllerworks/mini42/keymaps/vial/config.h create mode 100644 keyboards/controllerworks/mini42/keymaps/vial/keymap.c create mode 100644 keyboards/controllerworks/mini42/keymaps/vial/rules.mk create mode 100644 keyboards/controllerworks/mini42/keymaps/vial/vial.json create mode 100644 keyboards/controllerworks/mini42/mcuconf.h create mode 100644 keyboards/controllerworks/mini42/mini42.c create mode 100644 keyboards/controllerworks/mini42/mini42.h create mode 100644 keyboards/controllerworks/mini42/readme.md create mode 100644 keyboards/controllerworks/mini42/rules.mk diff --git a/keyboards/controllerworks/mini42/config.h b/keyboards/controllerworks/mini42/config.h new file mode 100644 index 00000000000..a56fa70402c --- /dev/null +++ b/keyboards/controllerworks/mini42/config.h @@ -0,0 +1,69 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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" + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +/* #define DEBOUNCE 5 */ + +#define WS2812_PIO_USE_PIO1 +#define RGBLED_NUM 54 +#define DRIVER_LED_TOTAL RGBLED_NUM +#define RGB_MATRIX_SPLIT \ + { 27, 27 } + +#define SPLIT_TRANSPORT_MIRROR +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_MODS_ENABLE + +#undef I2C_DRIVER +#define I2C_DRIVER I2CD1 +#undef I2C1_SCL_PIN +#define I2C1_SCL_PIN GP25 +#undef I2C1_SDA_PIN +#define I2C1_SDA_PIN GP24 + +/* #define EE_HANDS */ +/* #define MASTER_LEFT */ +/* #define MASTER_RIGHT */ + +/* Top left key on left half */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 +/* Top right key on right half */ +#define BOOTMAGIC_LITE_ROW_RIGHT 0 +#define BOOTMAGIC_LITE_COLUMN_RIGHT 0 +/* + * 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 + + diff --git a/keyboards/controllerworks/mini42/halconf.h b/keyboards/controllerworks/mini42/halconf.h new file mode 100644 index 00000000000..1664802d6c8 --- /dev/null +++ b/keyboards/controllerworks/mini42/halconf.h @@ -0,0 +1,22 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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 + +#define HAL_USE_I2C TRUE + +#include_next "halconf.h" diff --git a/keyboards/controllerworks/mini42/info.json b/keyboards/controllerworks/mini42/info.json new file mode 100644 index 00000000000..1e0527be020 --- /dev/null +++ b/keyboards/controllerworks/mini42/info.json @@ -0,0 +1,165 @@ +{ + "manufacturer": "Controller Works", + "keyboard_name": "mini42", + "maintainer": "controller-works", + "processor": "RP2040", + "url": "https://controller.works/products/mini42-low-profile-ergonomic-keyboard", + "tags": ["split", "RP2040", "choc v1", "choc spaced" ], + "usb": { + "device_version": "1.0.0", + "pid": "0x0003", + "vid": "0x4357" + }, + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "build": { + "lto":true + }, + "matrix_pins": { + "direct": [ + ["GP2", "GP3", "GP4","GP5", "GP6", "GP7"], + ["GP8", "GP9", "GP10", "GP11", "GP12", "GP13"], + ["GP14", "GP15", "GP16", "GP17", "GP18", "GP19"], + ["GP20", "GP21", "GP22", null, null, null] + ] + }, + "rgblight": { + "pin": "GP0" + }, + "split": { + "enabled": true, + "main": "left", + "matrix_pins": { + "right": { + "direct": [ + ["GP7", "GP6", "GP5","GP4", "GP3", "GP2"], + ["GP13", "GP12", "GP11", "GP10", "GP9", "GP8"], + ["GP19", "GP18", "GP17", "GP16", "GP15", "GP14"], + ["GP22", "GP21", "GP20", null, null, null] + ] + } + }, + "soft_serial_pin": "GP1", + "transport": { + "protocol": "serial" + } + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true, + "oled": true + }, + "rgb_matrix": { + "driver": "WS2812", + "layout": [ + { "flags": 2, "x": 75, "y": 4 }, + { "flags": 2, "x": 40, "y": 2 }, + { "flags": 2, "x": 8, "y": 8 }, + { "flags": 2, "x": 8, "y": 43 }, + { "flags": 2, "x": 49, "y": 51 }, + { "flags": 2, "x": 95, "y": 55 }, + { "flags": 1, "matrix": [3, 2], "x": 92, "y": 64 }, + { "flags": 4, "matrix": [2, 5], "x": 82, "y": 39 }, + { "flags": 4, "matrix": [1, 5], "x": 82, "y": 22 }, + { "flags": 4, "matrix": [0, 5], "x": 82, "y": 5 }, + { "flags": 4, "matrix": [0, 4], "x": 65, "y": 2 }, + { "flags": 4, "matrix": [1, 4], "x": 65, "y": 14 }, + { "flags": 4, "matrix": [2, 4], "x": 65, "y": 37 }, + { "flags": 1, "matrix": [3, 1], "x": 78, "y": 58 }, + { "flags": 1, "matrix": [3, 0], "x": 58, "y": 55 }, + { "flags": 4, "matrix": [2, 3], "x": 49, "y": 34 }, + { "flags": 4, "matrix": [1, 3], "x": 49, "y": 17 }, + { "flags": 4, "matrix": [0, 3], "x": 49, "y": 0 }, + { "flags": 4, "matrix": [0, 2], "x": 33, "y": 2 }, + { "flags": 4, "matrix": [1, 2], "x": 33, "y": 19 }, + { "flags": 4, "matrix": [2, 2], "x": 33, "y": 37 }, + { "flags": 4, "matrix": [2, 1], "x": 16, "y": 41 }, + { "flags": 4, "matrix": [1, 1], "x": 16, "y": 24 }, + { "flags": 4, "matrix": [0, 1], "x": 16, "y": 7 }, + { "flags": 1, "matrix": [0, 0], "x": 0, "y": 7 }, + { "flags": 1, "matrix": [1, 0], "x": 17, "y": 24 }, + { "flags": 1, "matrix": [2, 0], "x": 34, "y": 41 }, + { "flags": 2, "x": 149, "y": 4 }, + { "flags": 2, "x": 184, "y": 2 }, + { "flags": 2, "x": 216, "y": 8 }, + { "flags": 2, "x": 216, "y": 43 }, + { "flags": 2, "x": 175, "y": 51 }, + { "flags": 2, "x": 129, "y": 55 }, + { "flags": 1, "matrix": [7, 0], "x": 132, "y": 64 }, + { "flags": 4, "matrix": [6, 0], "x": 142, "y": 39 }, + { "flags": 4, "matrix": [5, 0], "x": 142, "y": 22 }, + { "flags": 4, "matrix": [4, 0], "x": 142, "y": 5 }, + { "flags": 4, "matrix": [4, 1], "x": 159, "y": 2 }, + { "flags": 4, "matrix": [5, 1], "x": 159, "y": 19 }, + { "flags": 4, "matrix": [6, 1], "x": 159, "y": 37 }, + { "flags": 1, "matrix": [7, 1], "x": 146, "y": 58 }, + { "flags": 1, "matrix": [7, 2], "x": 166, "y": 55 }, + { "flags": 4, "matrix": [6, 2], "x": 175, "y": 34 }, + { "flags": 4, "matrix": [5, 2], "x": 175, "y": 17 }, + { "flags": 4, "matrix": [4, 2], "x": 175, "y": 0 }, + { "flags": 4, "matrix": [4, 3], "x": 191, "y": 2 }, + { "flags": 4, "matrix": [5, 3], "x": 191, "y": 19 }, + { "flags": 4, "matrix": [6, 3], "x": 191, "y": 37 }, + { "flags": 4, "matrix": [6, 4], "x": 208, "y": 41 }, + { "flags": 4, "matrix": [5, 4], "x": 208, "y": 24 }, + { "flags": 4, "matrix": [4, 4], "x": 208, "y": 7 }, + { "flags": 1, "matrix": [4, 5], "x": 224, "y": 7 }, + { "flags": 1, "matrix": [5, 5], "x": 224, "y": 24 }, + { "flags": 1, "matrix": [6, 5], "x": 224, "y": 41 } + ] + }, + "community_layouts": ["split_3x6_3"], + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + { "matrix": [0, 0], "x": 0, "y": 0.25 }, + { "matrix": [0, 1], "x": 1, "y": 0.25 }, + { "matrix": [0, 2], "x": 2, "y": 0.125 }, + { "matrix": [0, 3], "x": 3, "y": 0 }, + { "matrix": [0, 4], "x": 4, "y": 0.125 }, + { "matrix": [0, 5], "x": 5, "y": 0.25 }, + { "matrix": [4, 0], "x": 8, "y": 0.25 }, + { "matrix": [4, 1], "x": 9, "y": 0.125 }, + { "matrix": [4, 2], "x": 10, "y": 0 }, + { "matrix": [4, 3], "x": 11, "y": 0.125 }, + { "matrix": [4, 4], "x": 12, "y": 0.25 }, + { "matrix": [4, 5], "x": 13, "y": 0.25 }, + { "matrix": [1, 0], "x": 0, "y": 1.25 }, + { "matrix": [1, 1], "x": 1, "y": 1.25 }, + { "matrix": [1, 2], "x": 2, "y": 1.125 }, + { "matrix": [1, 3], "x": 3, "y": 1 }, + { "matrix": [1, 4], "x": 4, "y": 1.125 }, + { "matrix": [1, 5], "x": 5, "y": 1.25 }, + { "matrix": [5, 0], "x": 8, "y": 1.25 }, + { "matrix": [5, 1], "x": 9, "y": 1.125 }, + { "matrix": [5, 2], "x": 10, "y": 1 }, + { "matrix": [5, 3], "x": 11, "y": 1.125 }, + { "matrix": [5, 4], "x": 12, "y": 1.25 }, + { "matrix": [5, 5], "x": 13, "y": 1.25 }, + { "matrix": [2, 0], "x": 0, "y": 2.25 }, + { "matrix": [2, 1], "x": 1, "y": 2.25 }, + { "matrix": [2, 2], "x": 2, "y": 2.125 }, + { "matrix": [2, 3], "x": 3, "y": 2 }, + { "matrix": [2, 4], "x": 4, "y": 2.125 }, + { "matrix": [2, 5], "x": 5, "y": 2.25 }, + { "matrix": [6, 0], "x": 8, "y": 2.25 }, + { "matrix": [6, 1], "x": 9, "y": 2.125 }, + { "matrix": [6, 2], "x": 10, "y": 2 }, + { "matrix": [6, 3], "x": 11, "y": 2.125 }, + { "matrix": [6, 4], "x": 12, "y": 2.25 }, + { "matrix": [6, 5], "x": 13, "y": 2.25 }, + { "matrix": [3, 0], "x": 3.5, "y": 3.25 }, + { "matrix": [3, 1], "x": 4.5, "y": 3.5 }, + { "matrix": [3, 2], "x": 5.5, "y": 3.75, "h":1.5 }, + { "matrix": [7, 0], "x": 7.5, "y": 3.75, "h":1.5 }, + { "matrix": [7, 1], "x": 8.5, "y": 3.5 }, + { "matrix": [7, 2], "x": 9.5, "y": 3.25 } + ] + } + } +} diff --git a/keyboards/controllerworks/mini42/keymaps/default/config.h b/keyboards/controllerworks/mini42/keymaps/default/config.h new file mode 100644 index 00000000000..e1d162ef3ee --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/default/config.h @@ -0,0 +1,79 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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 +#ifdef RGB_MATRIX_ENABLE +//# define SPLIT_TRANSPORT_MIRROR +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 8 +# define RGB_MATRIX_SPD_STEP 10 + +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/keymaps/default/keymap.c b/keyboards/controllerworks/mini42/keymaps/default/keymap.c new file mode 100644 index 00000000000..af9a62b4004 --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_RALT + //`--------------------------' `--------------------------' + + ), + + [1] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, KC_ESC, KC_ENT, MO(3), KC_RALT + //`--------------------------' `--------------------------' + ), + + [2] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, MO(3), KC_ESC, KC_DEL, _______, KC_RALT + //`--------------------------' `--------------------------' + ), + + [3] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NUM, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT + //`--------------------------' `--------------------------' + ) +}; diff --git a/keyboards/controllerworks/mini42/keymaps/vial/config.h b/keyboards/controllerworks/mini42/keymaps/vial/config.h new file mode 100644 index 00000000000..709e2edecac --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/vial/config.h @@ -0,0 +1,87 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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 + +#define VIAL_KEYBOARD_UID {0x08, 0xE9, 0xFB, 0x54, 0x10, 0x3E, 0xE0, 0x63} +#define VIAL_UNLOCK_COMBO_ROWS { 0, 1 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 0 } + +#ifdef RGB_MATRIX_ENABLE +# define RGBLED_NUM 54 // Number of LEDs +# define DRIVER_LED_TOTAL RGBLED_NUM +# define RGB_MATRIX_SPLIT \ + { 27, 27 } +//# define SPLIT_TRANSPORT_MIRROR +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 8 +# define RGB_MATRIX_SPD_STEP 10 + +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif diff --git a/keyboards/controllerworks/mini42/keymaps/vial/keymap.c b/keyboards/controllerworks/mini42/keymaps/vial/keymap.c new file mode 100644 index 00000000000..af9a62b4004 --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/vial/keymap.c @@ -0,0 +1,68 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_RALT + //`--------------------------' `--------------------------' + + ), + + [1] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, KC_ESC, KC_ENT, MO(3), KC_RALT + //`--------------------------' `--------------------------' + ), + + [2] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, MO(3), KC_ESC, KC_DEL, _______, KC_RALT + //`--------------------------' `--------------------------' + ), + + [3] = LAYOUT_split_3x6_3( + //,-----------------------------------------------------. ,-----------------------------------------------------. + QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NUM, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT + //`--------------------------' `--------------------------' + ) +}; diff --git a/keyboards/controllerworks/mini42/keymaps/vial/rules.mk b/keyboards/controllerworks/mini42/keymaps/vial/rules.mk new file mode 100644 index 00000000000..31bb6d699f9 --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/vial/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes +VIALRGB_ENABLE = yes \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/keymaps/vial/vial.json b/keyboards/controllerworks/mini42/keymaps/vial/vial.json new file mode 100644 index 00000000000..7cf00ec0592 --- /dev/null +++ b/keyboards/controllerworks/mini42/keymaps/vial/vial.json @@ -0,0 +1,41 @@ +{ + "name": "Controller Works mini42", + "vendorId": "0x4357", + "productId": "0x0003", + "lighting":"vialrgb", + "keycodes": [ + "qmk_lighting" + ], + "menus": [ + "qmk_rgb_matrix" + ], + "matrix": { + "rows": 8, + "cols": 6 + }, + "layouts": { + "keymap": + [ + [{"x": 3},"0,3",{"x": 11},"4,2"], + [{"y": -0.86,"x": 2},"0,2",{"x": 1},"0,4",{"x": 9},"4,1",{"x": 1},"4,3"], + [{"y": -0.8600000000000001,"x": 5},"0,5",{"x": 7},"4,0"], + [{"y": -0.8600000000000001,"c": "#aaaaaa"},"0,0"], + [{"y": -1,"x": 1,"c": "#cccccc"},"0,1"], + [{"y": -1,"x": 17},"4,4"], + [{"y": -1,"x": 18,"c": "#aaaaaa"},"4,5"], + [{"y": -0.41999999999999993,"x": 3,"c": "#cccccc"},"1,3",{"x": 11},"5,2"], + [{"y": -0.8600000000000001,"x": 2},"1,2",{"x": 1},"1,4",{"x": 9},"5,1",{"x": 1},"5,3"], + [{"y": -0.8599999999999997,"x": 5},"1,5",{"x": 7},"5,0"], + [{"y": -0.8600000000000003,"c": "#aaaaaa"},"1,0",{"c": "#cccccc"},"1,1",{"x": 15},"5,4",{"c": "#aaaaaa"},"5,5"], + [{"y": -0.41999999999999993,"x": 3,"c": "#cccccc"},"2,3",{"x": 11},"6,2"], + [{"y": -0.8599999999999999,"x": 2},"2,2",{"x": 1},"2,4",{"x": 9},"6,1",{"x": 1},"6,3"], + [{"y": -0.8600000000000003,"x": 5},"2,5",{"x": 7},"6,0"], + [{"y": -0.8599999999999999,"c": "#aaaaaa"},"2,0",{"c": "#cccccc"},"2,1",{"x": 15},"6,4",{"c": "#aaaaaa"},"6,5"], + [{"y": -0.17999999999999972,"x": 3.5},"3,0",{"x": 10},"7,2"], + [{"r": 15,"rx": 5.25,"ry": 3.9,"y": -0.5,"x": -0.5},"3,1"], + [{"r": 30,"rx": 6.75,"ry": 4.36,"y": -0.7500000000000004,"x": -0.75,"h": 1.5},"3,2"], + [{"r": -30,"rx": 12,"y": -0.7500000000000004,"h": 1.5},"7,0"], + [{"r": -15,"rx": 13.75,"ry": 3.9,"y": -0.5,"x": -0.5},"7,1"] + ] + } + } \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/mcuconf.h b/keyboards/controllerworks/mini42/mcuconf.h new file mode 100644 index 00000000000..7f0840c7a7d --- /dev/null +++ b/keyboards/controllerworks/mini42/mcuconf.h @@ -0,0 +1,23 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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_next "mcuconf.h" + +#undef RP_I2C_USE_I2C0 +#define RP_I2C_USE_I2C0 TRUE \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/mini42.c b/keyboards/controllerworks/mini42/mini42.c new file mode 100644 index 00000000000..cc6397fa11e --- /dev/null +++ b/keyboards/controllerworks/mini42/mini42.c @@ -0,0 +1,82 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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 "mini42.h" + +#ifdef OLED_ENABLE + +static void render_logo(void) { + static const char PROGMEM raw_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0,128,192, 96, 48, 24, 12,254,254, 0, 0, 0, 0, 0, 0, 48, 24, 12, 6, 6, 6, 6, 6, 6, 12, 24,240,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248,252, 6, 3, 3, 3, 3, 7,254,252, 6, 3, 3, 3, 3, 6,252,248, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0,248,252, 6, 3, 3, 3, 3, 3, 3, 6,252,248, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 24, 28, 30, 27, 25, 24, 24, 24, 24, 24,255,255, 24, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,192, 96, 48, 24, 15, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127, 0, 0, 0, 0, 0, 0, 96,112,120,108,102, 99, 97, 96, 96, 96, 96, 96, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(raw_logo, sizeof(raw_logo)); +} + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; // flips the display 180 degrees if offhand + } + + return rotation; +} + +bool render_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("BASE\n"), false); + break; + case 1: + oled_write_P(PSTR("LOWER\n"), false); + break; + case 2: + oled_write_P(PSTR("RAISE\n"), false); + break; + case 3: + oled_write_P(PSTR("ADJUST\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + return false; +} + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + if (is_keyboard_master()) { + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_logo(); // Renders a static logo + oled_scroll_left(); // Turns on scrolling + } + return false; +} + +#endif \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/mini42.h b/keyboards/controllerworks/mini42/mini42.h new file mode 100644 index 00000000000..8155798246f --- /dev/null +++ b/keyboards/controllerworks/mini42/mini42.h @@ -0,0 +1,20 @@ +/* + * Copyright 2022 Kevin Gee + * + * 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" diff --git a/keyboards/controllerworks/mini42/readme.md b/keyboards/controllerworks/mini42/readme.md new file mode 100644 index 00000000000..119979a13f4 --- /dev/null +++ b/keyboards/controllerworks/mini42/readme.md @@ -0,0 +1,77 @@ +# mini42 + +![mini42](https://i.imgur.com/xrSKhqRh.png) +![mini42PCB](https://i.imgur.com/R7u1KB8h.png) + +*A pre-built, low profile, split mechanical keyboard based on the RP2040 processor* + +* Keyboard Maintainer: [Kevin Gee](https://github.com/controller-works) +* Hardware Supported: *mini42 split ergonomic keyboard* +* Hardware Availability: *https://controller.works/products/mini42-low-profile-ergonomic-keyboard* Hardware is available as pre-built units only. + +Make example for this keyboard (after setting up your build environment): + +```sh + make controllerworks/mini42:vial +``` + +Flashing example for this keyboard: + +```sh + make controllerworks/mini42:vial: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). + +## Features +- Highly integrated design with microcontroller, USB and TRRS connectors, and OLED all integrated on the main board with no secondary modules +- RP2040 processor by Raspberry Pi Foundation running at 130 MHz with 16MB flash memory +- CNC milled aluminum case with only 8mm thickness +- "PCB art" shine through back plate with gold surface finish +- 128x32 OLED on each keyboard half +- 42 per-key RGB LEDs and 12 backlight RGB LEDS are individually addressable +- ESD and over-current protection on USB and TRRS connectors +- Reset and boot tactile switches +- USB C host connection +- Hot swap connectors for Kailh Chocolate PG1350 switches +- Chocolate key spacing (18mm horizontal x 17mm vertical) +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the upper left key on the left hand keyboard half or the upper right key on the right hand keyboard half while plugging in USB +* **Physical reset button**: Press the RST button twice, rapidly +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available + +## Pin Assignment +| Name | Pin | Left Row | Left Column | Right Row | **Right Column | +|--------|------|-----------|-------------|-----------|--------------| +| LED | GP0 | | | | | +| DATA | GP1 | | | | | +| DATA2* | GP28 | | | | | +| KEY0 | GP2 | 0 | 0 | 4 | 0 | +| KEY1 | GP3 | 0 | 1 | 4 | 1 | +| KEY2 | GP4 | 0 | 2 | 4 | 2 | +| KEY3 | GP5 | 0 | 3 | 4 | 3 | +| KEY4 | GP6 | 0 | 4 | 4 | 4 | +| KEY5 | GP7 | 0 | 5 | 4 | 5 | +| KEY6 | GP8 | 1 | 0 | 5 | 0 | +| KEY7 | GP9 | 1 | 1 | 5 | 1 | +| KEY8 | GP10 | 1 | 2 | 5 | 2 | +| KEY9 | GP11 | 1 | 3 | 5 | 3 | +| KEY10 | GP12 | 1 | 4 | 5 | 4 | +| KEY11 | GP13 | 1 | 5 | 5 | 5 | +| KEY12 | GP14 | 2 | 0 | 6 | 0 | +| KEY13 | GP15 | 2 | 1 | 6 | 1 | +| KEY14 | GP16 | 2 | 2 | 6 | 2 | +| KEY15 | GP17 | 2 | 3 | 6 | 3 | +| KEY16 | GP18 | 2 | 4 | 6 | 4 | +| KEY17 | GP19 | 2 | 5 | 6 | 5 | +| KEY18 | GP20 | 3 | 0 | 7 | 0 | +| KEY19 | GP21 | 3 | 1 | 7 | 1 | +| KEY20 | GP22 | 3 | 2 | 7 | 2 | +| SDA | GP24 | | | | | +| SCL | GP25 | | | | | + +\*DATA2 on production units, not connected on prototype units + +\** Right Column numbers run right (pinky position) to left (thumb position) \ No newline at end of file diff --git a/keyboards/controllerworks/mini42/rules.mk b/keyboards/controllerworks/mini42/rules.mk new file mode 100644 index 00000000000..6e32bfc897e --- /dev/null +++ b/keyboards/controllerworks/mini42/rules.mk @@ -0,0 +1,3 @@ +SERIAL_DRIVER = vendor +WS2812_DRIVER = vendor +OLED_DRIVER = SSD1306