diff options
64 files changed, 2236 insertions, 8 deletions
diff --git a/docs/feature_pointing_device.md b/docs/feature_pointing_device.md index 61d76cfc2a..bd7fb36589 100644 --- a/docs/feature_pointing_device.md +++ b/docs/feature_pointing_device.md @@ -150,7 +150,8 @@ The PMW 3360 is an SPI driven optical sensor, that uses a built in IR LED for su |`PMW3360_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` | |`PMW3360_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` | |`PMW3360_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ | -|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 127 degrees directly in the sensor. | `0` | +|`PMW3360_LIFTOFF_DISTANCE` | (Optional) Sets the lift off distance at run time | `0x02` | +|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 30 degrees directly in the sensor. | `0` | The CPI range is 100-12000, in increments of 100. Defaults to 1600 CPI. diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 80852fd62c..c378bdf750 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -186,6 +186,8 @@ bool pmw3360_init(void) { spi_write_adv(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127)); + spi_write_adv(REG_Lift_Config, PMW3360_LIFTOFF_DISTANCE); + bool init_success = pmw3360_check_signature(); writePinLow(PMW3360_CS_PIN); diff --git a/drivers/sensors/pmw3360.h b/drivers/sensors/pmw3360.h index 7b2bef5b80..9aa8e13f8e 100644 --- a/drivers/sensors/pmw3360.h +++ b/drivers/sensors/pmw3360.h @@ -46,6 +46,10 @@ # endif #endif +#ifndef PMW3360_LIFTOFF_DISTANCE +# define PMW3360_LIFTOFF_DISTANCE 0x02 +#endif + #ifndef ROTATIONAL_TRANSFORM_ANGLE # define ROTATIONAL_TRANSFORM_ANGLE 0x00 #endif diff --git a/keyboards/kprepublic/bm60hsrgb/readme.md b/keyboards/kprepublic/bm60hsrgb/readme.md index bbb6ba45a1..1f0f13ae28 100644 --- a/keyboards/kprepublic/bm60hsrgb/readme.md +++ b/keyboards/kprepublic/bm60hsrgb/readme.md @@ -2,12 +2,15 @@ A 60% hotswap inswitch RGB keyboard from KP Republic. -* Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) * Hardware Supported: BM60HSRGB * Hardware Availability: [KP Republic](https://kprepublic.com/products/bm60-rgb-60-gh60-hot-swappable-pcb-programmed-qmk-firmware-type-c) Make example for this keyboard (after setting up your build environment): - make kprepublic/bm60hsrgb/rev1:default + for rev1: make kprepublic/bm60hsrgb/rev1:default + for rev2: make kprepublic/bm60hsrgb/rev2:default + +To see which revision you have, look at the PCB. If it says bm60v2 on it, it's rev2. Otherwise it's rev1 + 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/kprepublic/bm60hsrgb/keymaps/default/keymap.c b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/default/keymap.c index e8be1cccf6..e8be1cccf6 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/default/keymap.c +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/default/keymap.c diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/default/readme.md b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/default/readme.md index d45609f3d7..d45609f3d7 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/default/readme.md +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/default/readme.md diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/jbradforddillon/keymap.c b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/jbradforddillon/keymap.c index c43365356e..c43365356e 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/jbradforddillon/keymap.c +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/jbradforddillon/keymap.c diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/jbradforddillon/readme.md b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/jbradforddillon/readme.md index aa2009e1e8..aa2009e1e8 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/jbradforddillon/readme.md +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/jbradforddillon/readme.md diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/via/keymap.c b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/keymap.c index da2f6e8ced..da2f6e8ced 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/via/keymap.c +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/keymap.c diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/via/readme.md b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/readme.md index 9335f2cab0..9335f2cab0 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/via/readme.md +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/readme.md diff --git a/keyboards/kprepublic/bm60hsrgb/keymaps/via/rules.mk b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/rules.mk index 036bd6d1c3..036bd6d1c3 100644 --- a/keyboards/kprepublic/bm60hsrgb/keymaps/via/rules.mk +++ b/keyboards/kprepublic/bm60hsrgb/rev1/keymaps/via/rules.mk diff --git a/keyboards/kprepublic/bm60hsrgb/rev1/readme.md b/keyboards/kprepublic/bm60hsrgb/rev1/readme.md new file mode 100644 index 0000000000..bdc0380129 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb/rev1/readme.md @@ -0,0 +1,13 @@ +# BM60HSRGB + +A 60% hotswap inswitch RGB keyboard from KP Republic. + +* Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +* Hardware Supported: BM60HSRGB/rev1 +* Hardware Availability: [KP Republic](https://kprepublic.com/products/bm60-rgb-60-gh60-hot-swappable-pcb-programmed-qmk-firmware-type-c) + +Make example for this keyboard (after setting up your build environment): + + make kprepublic/bm60hsrgb/rev1:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/config.h b/keyboards/kprepublic/bm60hsrgb/rev2/config.h new file mode 100644 index 0000000000..e25f0ad489 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb/rev2/config.h @@ -0,0 +1,139 @@ +/* Copyright 2021 bdtc123 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4B50 +#define PRODUCT_ID 0x1121 +#define DEVICE_VER 0x0002 +#define MANUFACTURER KP Republic +#define PRODUCT BM60V2 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * 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 { E6, D2, D3, D5, F6 } +#define MATRIX_COL_PINS { B2, B3, B7, B0, B1, F7, D4, D6, D7, B4, B5, B6, C6, C7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION ROW2COL +#define USB_POLLING_INTERVAL_MS 1 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 3 + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +//rgb light setting +#define RGBLIGHT_LIMIT_VAL 150 +#define RGBLED_NUM 6 +#define RGB_DI_PIN F0 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_MOOD +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended +#define DRIVER_ADDR_1 0b1010000 + +#define RGB_MATRIX_KEYPRESSES +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +#define ENABLE_RGB_MATRIX_ALPHAS_MODS +#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +#define ENABLE_RGB_MATRIX_BAND_VAL +#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +#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_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 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 63 +//#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + +#if defined(RGB_MATRIX_ENABLE) && defined(RGBLIGHT_ENABLE) + #define RGB_MATRIX_DISABLE_KEYCODES +#endif + +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 + +#define ISSI_LED_TOTAL DRIVER_1_LED_TOTAL + +// Underglow LEDs are WS2812, but someone might want to use RGBLIGHT for them; +// don't use those LEDs in RGB Matrix in that case. +#ifdef RGBLIGHT_ENABLE +# define WS2812_LED_TOTAL 0 +#else +# define WS2812_LED_TOTAL 6 +#endif + +#define DRIVER_LED_TOTAL (ISSI_LED_TOTAL + WS2812_LED_TOTAL) + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif + diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/info.json b/keyboards/kprepublic/bm60hsrgb/rev2/info.json new file mode 100644 index 0000000000..51a6fbc880 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb/rev2/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "bm60v2", + "url": "", + "maintainer": "kp republic", + "layouts": { + "LAYOUT": { + "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":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":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":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, "w":1.75}, + {"x":13, "y":3}, + {"x":14, "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} + ] + } + } +} diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/default/keymap.c b/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/default/keymap.c new file mode 100644 index 0000000000..58828d5181 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +/* Copyright 2021 bdtc123 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/via/keymap.c b/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/via/keymap.c new file mode 100644 index 0000000000..cca11326d0 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb/rev2/keymaps/via/keymap.c @@ -0,0 +1,47 @@ +/* Copyright 2021 bdtc123 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_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_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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [1] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, |