diff options
author | TurboMech <sarmstrong240@gmail.com> | 2018-01-03 05:48:09 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-01-03 10:32:53 -0500 |
commit | 9cb1d36974b7ea4c380c0b7818812f6f5aae56c1 (patch) | |
tree | 161b1b36ac787aed9f7c7959dd756315c435dcbc | |
parent | 0a5d302622b440183fbb42593fd07c4da11abba3 (diff) |
Added Mechmini 2.0 to Mechmini keyboard folder
This creates a v1 and v2 subproject. V1 retains all the same implementations of the bootmapper-ported Mechmnini 1 including #2196. V2 adds the Mechmini 2.0 kayboard support (I know it took me way to long to get it a pull request in).
All readme's updated to reflect compiling the two seperate keyboards. Simply either `make mechmini/v1:default` or `make mechmini/v2:defualt`. Utilizing the rules.mk using `make mechmini:default` will automatically create the Mechmini 2 default keymap as this is the current version and has a much wider user base.
27 files changed, 1163 insertions, 214 deletions
diff --git a/keyboards/mechmini/config.h b/keyboards/mechmini/config.h index 6a4523f85e..98c9fb6510 100644 --- a/keyboards/mechmini/config.h +++ b/keyboards/mechmini/config.h @@ -1,45 +1,28 @@ -/* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. +/* Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + * Copyright 2018 TurboMech /u/TurboMech <discord> @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + #include "config_common.h" #ifndef CONFIG_H #define CONFIG_H -#define VENDOR_ID 0x20A0 -#define PRODUCT_ID 0x422D -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. -#define MANUFACTURER winkeyless.kr -#define PRODUCT mechmini - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 15 - -#define NO_UART 1 - -/* RGB underglow */ -// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. -// The same pin is used on the JJ40, at least. -#define RGBLED_NUM 16 -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN E2 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define MANUFACTURER MECHKEYS +#define PRODUCT Mechmini +#define DESCRIPTION 40% modular keyboard #endif diff --git a/keyboards/mechmini/mechmini.c b/keyboards/mechmini/mechmini.c index 9897da099f..46e29ba3e9 100644 --- a/keyboards/mechmini/mechmini.c +++ b/keyboards/mechmini/mechmini.c @@ -1,46 +1,17 @@ -/* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. +/* Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + * Copyright 2018 TurboMech /u/TurboMech <discord> @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "mechmini.h" -#include <avr/pgmspace.h> - -#include "action_layer.h" -#include "i2c.h" -#include "quantum.h" - -#include "rgblight.h" - -// custom RGB driver -extern rgblight_config_t rgblight_config; -void rgblight_set(void) { - if (!rgblight_config.enable) { - for (uint8_t i = 0; i < RGBLED_NUM; i++) { - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - } - } - - i2c_init(); - i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { - rgblight_task(); - /* add other tasks to be done on each matrix scan */ -} diff --git a/keyboards/mechmini/mechmini.h b/keyboards/mechmini/mechmini.h index 2890fad7ad..637021cd20 100644 --- a/keyboards/mechmini/mechmini.h +++ b/keyboards/mechmini/mechmini.h @@ -1,42 +1,30 @@ -/* -Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. +/* Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + * Copyright 2018 TurboMech /u/TurboMech <discord> @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MECHMINI_H #define MECHMINI_H -#include "keycode.h" -#include "action.h" #include "quantum.h" -#define KEYMAP( \ - K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, \ - K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, \ - K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, \ - K00, K10, K20, K56, K57, KB0, KC0, K66 \ -) \ -{ \ - { K00, K10, K20, K56, KC_NO, K57, KC_NO, KC_NO, KB0, KC0, K66, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} +#ifdef KEYBOARD_mechmini_v1 + #include "v1.h" +#endif + +#ifdef KEYBOARD_mechmini_v2 + #include "v2.h" +#endif #endif diff --git a/keyboards/mechmini/readme.md b/keyboards/mechmini/readme.md index ef0602297c..56dd81a244 100644 --- a/keyboards/mechmini/readme.md +++ b/keyboards/mechmini/readme.md @@ -1,13 +1,17 @@ -mechmini +Mechmini ======== -A compact ortholinear/staggered keyboard. +A 40% compact ortholinear/staggered keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: mechmini PCB -Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0-pcb +Version 1 was originally bootmapper (ps2avrGB) and can be ported to QMK following the v1 readme (../mechmini/v1/readme.md). This version is no longer in production. -Make example for this keyboard (after setting up your build environment): +Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: QMK Community (version 1) & [TurboMech](https://github.com/TurboMech) (version 2 - aka Mechmini 2.0) +Hardware Supported: Mechmini keyboard +Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space) - please see v1 readme for v1 make instructions: make mechmini:default @@ -15,50 +19,6 @@ See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) ## Mechmini Notes -Note that this is a complete replacement for the firmware, so you won't be -using Bootmapper Client to change any keyboard settings, since not all the -USB report options are supported. - -## Installing - -First, install the requirements. These commands are for OSX, but all you -need is the AVR toolchain and `bootloadHID` for flashing: - -``` -$ brew cask install crosspack-avr -$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -``` - -In order to use the `./program` script, which can reboot the board into -the bootloader, you'll need Python 2 with PyUSB installed: - -``` -$ pip install pyusb -``` - -Then, with the keyboard plugged in, simply run this command from the -`qmk_firmware` directory: - -``` -$ make mechmini:program -``` - -If you prefer, you can just build it and flash the firmware directly with -`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it -in the bootloader: - -``` -$ make mechmini -$ bootloadHID -r mechmini_default.hex -``` - -## Troubleshooting +There are 2 versions of the Mechmini keyboard. Please read the readme for the version you have for make instructions. -From my experience, it's really hard to brick these boards. But these -tricks have been useful when it got stuck in a weird scenario. -1. Try plugging the board in while pressing `L_Ctrl`. This will force it - to boot only the bootloader without loading the firmware. Once this is - done, just reflash the board with the original firmware. -2. Sometimes USB hubs can act weird, so try connecting the board directly - to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/mechmini/rules.mk b/keyboards/mechmini/rules.mk index ed55ae1c43..71dae51277 100644 --- a/keyboards/mechmini/rules.mk +++ b/keyboards/mechmini/rules.mk @@ -1,50 +1 @@ -# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# MCU name -MCU = atmega32a -PROTOCOL = VUSB - -# unsupported features for now -NO_UART = yes -NO_SUSPEND_POWER_DOWN = yes - -# processor frequency -F_CPU = 12000000 - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. -BOOTLOADER = atmel-dfu - -# build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes -EXTRAKEY_ENABLE = yes -CONSOLE_ENABLE = yes -COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGBLIGHT_CUSTOM_DRIVER = yes - -OPT_DEFS = -DDEBUG_LEVEL=0 - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC = matrix.c i2c.c - -# programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
\ No newline at end of file +DEFAULT_FOLDER = mechmini/v2 diff --git a/keyboards/mechmini/v1/README.md b/keyboards/mechmini/v1/README.md new file mode 100644 index 0000000000..9f44a9c2cd --- /dev/null +++ b/keyboards/mechmini/v1/README.md @@ -0,0 +1,83 @@ +Mechmini V1 +=========== + +A 40% ortholinear/staggered keyboard, that was originally bootmapper and can be ported to QMK following this readme. This version is no longer in production [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: QMK Community +Hardware Supported: Mechmini 1 PCB +Hardware Availability: Version 1 (Bootmapper) no longer in production [MECHKEYS](https://mechkeys.ca) + +Make example for this keyboard (after setting up your build environment): + + make mechmini/v1:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +## Mechmini Notes + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +## Installing + +First, install the requirements. These commands are for OSX, but all you +need is the AVR toolchain and `bootloadHID` for flashing: + +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +``` + +In order to use the `./program` script, which can reboot the board into +the bootloader, you'll need Python 2 with PyUSB installed: + +``` +$ pip install pyusb +``` + +Then, with the keyboard plugged in, simply run this command from the +`qmk_firmware` directory: + +``` +$ make mechmini:program +``` + +If you prefer, you can just build it and flash the firmware directly with +`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it +in the bootloader: + +``` +$ make mechmini +$ bootloadHID -r mechmini_default.hex +``` + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while pressing `L_Ctrl`. This will force it + to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. +3. If errors happen with +`./tmk_core/common/avr/suspend.c` it is likely you implemented a RGB underglow sleep setting previously. Simply comment out the following code found under `void suspend_wakeup_init(void)`: +``` +ifdef RGBLIGHT_ANIMATIONS + rgblight_timer_enable(); + _delay_ms(50); + rgblight_set(); +#endif +``` +So that the resulting code should know reflect: +``` +/*#ifdef RGBLIGHT_ANIMATIONS + rgblight_timer_enable(); + _delay_ms(50); + rgblight_set(); +#endif*/ +``` + + diff --git a/keyboards/mechmini/v1/config.h b/keyboards/mechmini/v1/config.h new file mode 100644 index 0000000000..1f46451f99 --- /dev/null +++ b/keyboards/mechmini/v1/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V1_CONFIG_H +#define V1_CONFIG_H + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define DEVICE_VER 0x0001 +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER MECHKEYS +#define PRODUCT Mechmini +#define DESCRIPTION 40% modular keyboard + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define NO_UART 1 + +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN E2 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/mechmini/i2c.c b/keyboards/mechmini/v1/i2c.c index c27f3e3d17..c27f3e3d17 100644 --- a/keyboards/mechmini/i2c.c +++ b/keyboards/mechmini/v1/i2c.c diff --git a/keyboards/mechmini/i2c.h b/keyboards/mechmini/v1/i2c.h index 194a82cab8..194a82cab8 100644 --- a/keyboards/mechmini/i2c.h +++ b/keyboards/mechmini/v1/i2c.h diff --git a/keyboards/mechmini/keymaps/default/keymap.c b/keyboards/mechmini/v1/keymaps/default/keymap.c index 4a0a4dc0a6..4a0a4dc0a6 100644 --- a/keyboards/mechmini/keymaps/default/keymap.c +++ b/keyboards/mechmini/v1/keymaps/default/keymap.c diff --git a/keyboards/mechmini/matrix.c b/keyboards/mechmini/v1/matrix.c index 140026013f..140026013f 100644 --- a/keyboards/mechmini/matrix.c +++ b/keyboards/mechmini/v1/matrix.c diff --git a/keyboards/mechmini/v1/rules.mk b/keyboards/mechmini/v1/rules.mk new file mode 100644 index 0000000000..11bd8955f3 --- /dev/null +++ b/keyboards/mechmini/v1/rules.mk @@ -0,0 +1,50 @@ +# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = atmel-dfu + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/mechmini/usbconfig.h b/keyboards/mechmini/v1/usbconfig.h index d2d848fcdc..d2d848fcdc 100644 --- a/keyboards/mechmini/usbconfig.h +++ b/keyboards/mechmini/v1/usbconfig.h diff --git a/keyboards/mechmini/v1/v1.c b/keyboards/mechmini/v1/v1.c new file mode 100644 index 0000000000..24c74c6cfd --- /dev/null +++ b/keyboards/mechmini/v1/v1.c @@ -0,0 +1,44 @@ +/* +Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "v1.h" +#include <avr/pgmspace.h> +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" +#include "rgblight.h" + +// custom RGB driver +extern rgblight_config_t rgblight_config; +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + rgblight_task(); + /* add other tasks to be done on each matrix scan */ +} diff --git a/keyboards/mechmini/v1/v1.h b/keyboards/mechmini/v1/v1.h new file mode 100644 index 0000000000..501bd89c59 --- /dev/null +++ b/keyboards/mechmini/v1/v1.h @@ -0,0 +1,43 @@ +/* +Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef V1_H +#define V2_H + +#include "../mechmini.h" +#include "keycode.h" +#include "action.h" +#include "quantum.h" + +#define KEYMAP( \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, \ + K00, K10, K20, K56, K57, KB0, KC0, K66 \ +) \ +{ \ + { K00, K10, K20, K56, KC_NO, K57, KC_NO, KC_NO, KB0, KC0, K66, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/mechmini/v2/README.md b/keyboards/mechmini/v2/README.md new file mode 100644 index 0000000000..e1efc9904d --- /dev/null +++ b/keyboards/mechmini/v2/README.md @@ -0,0 +1,20 @@ +Mechmini 2.0 +============ + +A 40% compact ortholinear/staggered keyboard. + +Version 2 (Mechmini 2.0) was shipped powered by QMK [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) +Hardware Supported: Mechmini 2.0 keyboard +Hardware Availability: https://mechkeys.ca/collections/keyboards/products/mechmini-2-0 + +Make example for this keyboard (after setting up your build environment), this will make the Mechmini 2.0 default keymap (split space): + + make mechmini/v2:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +## Mechmini Notes + +There are 2 versions of the Mechmini keyboard. Please read the readme for the version you have for make instructions. diff --git a/keyboards/mechmini/v2/config.h b/keyboards/mechmini/v2/config.h new file mode 100755 index 0000000000..58c751e0f8 --- /dev/null +++ b/keyboards/mechmini/v2/config.h @@ -0,0 +1,77 @@ +/* Copyright 2018 TurboMech /u/TurboMech <discord> @A9entOran9e#6134 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + *This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ +#ifndef V2_CONFIG_H +#define V2_CONFIG_H + +#include "config_common.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA40 +#define DEVICE_VER 0x0002 +#define MANUFACTURER MECHKEYS +#undef PRODUCT +#define PRODUCT Mechmini 2 +#undef DESCRIPTION +#define DESCRIPTION 40% modular keyboard + +/* key matrix size */ +#undef MATRIX_COLS +#undef MATRIX_ROWS +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B3, B1, B0, D5, B7, C7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c b/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c new file mode 100644 index 0000000000..1b09833314 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/2u_space_ortho/keymap.c @@ -0,0 +1,124 @@ +#include "mechmini.h" + +#define _BL 0 +#define _FN1 1 +#define _FN2 2 + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = KEYMAP_2U_SPACE_ORTHO( + F(0), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, 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, KC_ENT, + KC_CAPS, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2) |