diff --git a/keyboards/dlip/haritev2/config.h b/keyboards/dlip/haritev2/config.h new file mode 100644 index 0000000000..119ba7cbac --- /dev/null +++ b/keyboards/dlip/haritev2/config.h @@ -0,0 +1,20 @@ +// Copyright 2024 Dane Lipscombe (@dlip) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1500U + +#define SERIAL_USART_FULL_DUPLEX +#define SERIAL_USART_TX_PIN GP1 +#define SERIAL_USART_RX_PIN GP0 +#define SERIAL_USART_PIN_SWAP + +#define EE_HANDS + +#define SPI_DRIVER SPID0 +#define SPI_SCK_PIN GP2 +#define SPI_MOSI_PIN GP3 +#define SPI_MISO_PIN GP4 +#define POINTING_DEVICE_CS_PIN GP5 diff --git a/keyboards/dlip/haritev2/dual_cirque/config.h b/keyboards/dlip/haritev2/dual_cirque/config.h new file mode 100644 index 0000000000..ad92aaa9ad --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/config.h @@ -0,0 +1,11 @@ +// Copyright 2024 Dane Lipscombe (@dlip) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_COMBINED +#define POINTING_DEVICE_ROTATION_90 +#define POINTING_DEVICE_ROTATION_90_RIGHT +#define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE +#define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE diff --git a/keyboards/dlip/haritev2/dual_cirque/keyboard.json b/keyboards/dlip/haritev2/dual_cirque/keyboard.json new file mode 100644 index 0000000000..2224a5d894 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keyboard.json @@ -0,0 +1,5 @@ +{ + "features": { + "pointing_device": true + } +} diff --git a/keyboards/dlip/haritev2/dual_cirque/keymaps/default/keymap.c b/keyboards/dlip/haritev2/dual_cirque/keymaps/default/keymap.c new file mode 100644 index 0000000000..3e23d4b088 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keymaps/default/keymap.c @@ -0,0 +1,19 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split_5x6( + KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, + + KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D, + + KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D + ) +}; diff --git a/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/config.h b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/config.h new file mode 100644 index 0000000000..cf1f123e93 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/config.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0xC5, 0xE2, 0xC7, 0xBD, 0x68, 0xC9, 0x59, 0xB7} +#define VIAL_UNLOCK_COMBO_ROWS { 1, 1 } +#define VIAL_UNLOCK_COMBO_COLS { 1, 2 } diff --git a/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/keymap.c b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/keymap.c new file mode 100644 index 0000000000..410372a270 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/keymap.c @@ -0,0 +1,47 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split_5x6( + KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, KC_D, + + KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D, + + KC_U, KC_U, + KC_L, KC_C, KC_R, KC_L, KC_C, KC_R, + KC_D, KC_D + ) +}; + +// Modify these values to adjust the scrolling speed +#define SCROLL_DIVISOR_H 12.0 +#define SCROLL_DIVISOR_V 12.0 + +// Variables to store accumulated scroll values +float scroll_accumulated_h = 0; +float scroll_accumulated_v = 0; + +// Function to handle mouse reports and perform drag scrolling +report_mouse_t pointing_device_task_combined_user(report_mouse_t left_report, report_mouse_t right_report) { + // Calculate and accumulate scroll values based on mouse movement and divisors + scroll_accumulated_h += (float)left_report.x / SCROLL_DIVISOR_H; + scroll_accumulated_v += (float)-left_report.y / SCROLL_DIVISOR_V; + + // Assign integer parts of accumulated scroll values to the mouse report + left_report.h = (int8_t)scroll_accumulated_h; + left_report.v = (int8_t)scroll_accumulated_v; + + // Update accumulated scroll values by subtracting the integer parts + scroll_accumulated_h -= (int8_t)scroll_accumulated_h; + scroll_accumulated_v -= (int8_t)scroll_accumulated_v; + + // Clear the X and Y values of the mouse report + left_report.x = 0; + left_report.y = 0; + return pointing_device_combine_reports(left_report, right_report); +} diff --git a/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/rules.mk b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/rules.mk new file mode 100644 index 0000000000..4f7618e9b2 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes diff --git a/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/vial.json b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/vial.json new file mode 100644 index 0000000000..e675023629 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/keymaps/vial/vial.json @@ -0,0 +1,198 @@ +{ + "name": "Harite v2", + "vendorId": "0x444C", + "productId": "0x4832", + "matrix": { + "rows": 10, + "cols": 6 + }, + "layouts": { + "keymap": [ + [ + { + "x": 1 + }, + "0,0", + { + "x": 3 + }, + "0,1", + { + "x": 3 + }, + "0,2", + { + "x": 3 + }, + "0,3", + { + "x": 4 + }, + "8,3", + { + "x": 3 + }, + "8,2", + { + "x": 3 + }, + "8,1", + { + "x": 3 + }, + "8,0" + ], + [ + "2,0", + "1,0", + "3,0", + { + "x": 1 + }, + "2,1", + "1,1", + "3,1", + { + "x": 1 + }, + "2,2", + "1,2", + "3,2", + { + "x": 1 + }, + "2,3", + "1,3", + "3,3", + { + "x": 2 + }, + "5,3", + "6,3", + "9,3", + { + "x": 1 + }, + "5,2", + "6,2", + "9,2", + { + "x": 1 + }, + "5,1", + "6,1", + "9,1", + { + "x": 1 + }, + "5,0", + "6,0", + "9,0" + ], + [ + { + "x": 1 + }, + "4,0", + { + "x": 3 + }, + "4,1", + { + "x": 3 + }, + "4,2", + { + "x": 3 + }, + "4,3", + { + "x": 4 + }, + "7,3", + { + "x": 3 + }, + "7,2", + { + "x": 3 + }, + "7,1", + { + "x": 3 + }, + "7,0" + ], + [ + { + "y": 1, + "x": 13 + }, + "0,4", + { + "x": 4 + }, + "5,4" + ], + [ + { + "x": 12 + }, + "2,4", + "1,4", + "3,4", + { + "x": 2 + }, + "7,4", + "6,4", + "8,4" + ], + [ + { + "x": 13 + }, + "4,4", + { + "x": 4 + }, + "9,4" + ], + [ + { + "y": 1, + "x": 13 + }, + "0,5", + { + "x": 4 + }, + "5,5" + ], + [ + { + "x": 12 + }, + "2,5", + "1,5", + "3,5", + { + "x": 2 + }, + "7,5", + "6,5", + "8,5" + ], + [ + { + "x": 13 + }, + "4,5", + { + "x": 4 + }, + "9,5" + ] + ] + } +} diff --git a/keyboards/dlip/haritev2/dual_cirque/readme.md b/keyboards/dlip/haritev2/dual_cirque/readme.md new file mode 100644 index 0000000000..17c540b1c9 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/readme.md @@ -0,0 +1,39 @@ +# Harite v2 (Cirque trackpad version) + +5 way switch directional keyboard + +![Harite-v2](https://i.imgur.com/v8kUtL3.jpeg) + +* Keyboard Maintainer: [Dane Lipscombe](https://github.com/dlip) +* Hardware Supported: Harite v2 (Cirque trackpad version) +* Hardware Availability: + +Make example for this keyboard (after setting up your build environment): + +```bash +make dlip/haritev2/dual_cirque:default +``` + +Flashing example for this keyboard: + +```bash +# For the left half... +make dlip/haritev2/dual_cirque:default:uf2-split-left +# or the qmk cli equivalent: +qmk flash -kb dlip/haritev2/dual_cirque --keymap default -bl uf2-split-left + +# For the right half... +make dlip/haritev2/dual_cirque:default:uf2-split-right +# or the qmk cli equivalent: +qmk flash -kb dlip/haritev2/dual_cirque --keymap default -bl uf2-split-right +``` + +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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) 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 `QK_BOOT` if it is available diff --git a/keyboards/dlip/haritev2/dual_cirque/rules.mk b/keyboards/dlip/haritev2/dual_cirque/rules.mk new file mode 100644 index 0000000000..fb5d649735 --- /dev/null +++ b/keyboards/dlip/haritev2/dual_cirque/rules.mk @@ -0,0 +1 @@ +POINTING_DEVICE_DRIVER = cirque_pinnacle_spi diff --git a/keyboards/dlip/haritev2/halconf.h b/keyboards/dlip/haritev2/halconf.h new file mode 100644 index 0000000000..102ec51a6b --- /dev/null +++ b/keyboards/dlip/haritev2/halconf.h @@ -0,0 +1,7 @@ +// Copyright 2023 Dane Lipscombe (@dlip) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define HAL_USE_SPI TRUE + +#include_next diff --git a/keyboards/dlip/haritev2/info.json b/keyboards/dlip/haritev2/info.json new file mode 100644 index 0000000000..b7e12b89d5 --- /dev/null +++ b/keyboards/dlip/haritev2/info.json @@ -0,0 +1,95 @@ +{ + "manufacturer": "Dane Lipscombe", + "keyboard_name": "haritev2", + "maintainer": "dlip", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["GP11", "GP12", "GP13", "GP14", "GP15", "GP26"], + "rows": ["GP6", "GP7", "GP8", "GP9", "GP10"] + }, + "processor": "RP2040", + "split": { + "enabled": true, + "serial": { + "driver": "vendor" + } + }, + "usb": { + "device_version": "1.0.0", + "pid": "0x4832", + "vid": "0x444C" + }, + "layouts": { + "LAYOUT_split_5x6": { + "layout": [ + {"label": "lpu", "matrix": [0, 0], "x": 1, "y": 0}, + {"label": "lru", "matrix": [0, 1], "x": 5, "y": 0}, + {"label": "lmu", "matrix": [0, 2], "x": 9, "y": 0}, + {"label": "liu", "matrix": [0, 3], "x": 13, "y": 0}, + {"label": "riu", "matrix": [8, 3], "x": 21, "y": 0}, + {"label": "rmu", "matrix": [8, 2], "x": 25, "y": 0}, + {"label": "rru", "matrix": [8, 1], "x": 29, "y": 0}, + {"label": "rpu", "matrix": [8, 0], "x": 33, "y": 0}, + {"label": "lpl", "matrix": [2, 0], "x": 0, "y": 1}, + {"label": "lpc", "matrix": [1, 0], "x": 1, "y": 1}, + {"label": "lpr", "matrix": [3, 0], "x": 2, "y": 1}, + {"label": "lrl", "matrix": [2, 1], "x": 4, "y": 1}, + {"label": "lrc", "matrix": [1, 1], "x": 5, "y": 1}, + {"label": "lrr", "matrix": [3, 1], "x": 6, "y": 1}, + {"label": "lml", "matrix": [2, 2], "x": 8, "y": 1}, + {"label": "lmc", "matrix": [1, 2], "x": 9, "y": 1}, + {"label": "lmr", "matrix": [3, 2], "x": 10, "y": 1}, + {"label": "lil", "matrix": [2, 3], "x": 12, "y": 1}, + {"label": "lic", "matrix": [1, 3], "x": 13, "y": 1}, + {"label": "lir", "matrix": [3, 3], "x": 14, "y": 1}, + {"label": "ril", "matrix": [5, 3], "x": 20, "y": 1}, + {"label": "ric", "matrix": [6, 3], "x": 21, "y": 1}, + {"label": "rir", "matrix": [9, 3], "x": 22, "y": 1}, + {"label": "rml", "matrix": [5, 2], "x": 24, "y": 1}, + {"label": "rmc", "matrix": [6, 2], "x": 25, "y": 1}, + {"label": "rmr", "matrix": [9, 2], "x": 26, "y": 1}, + {"label": "rrl", "matrix": [5, 1], "x": 28, "y": 1}, + {"label": "rrc", "matrix": [6, 1], "x": 29, "y": 1}, + {"label": "rrr", "matrix": [9, 1], "x": 30, "y": 1}, + {"label": "rpl", "matrix": [5, 0], "x": 32, "y": 1}, + {"label": "rpc", "matrix": [6, 0], "x": 33, "y": 1}, + {"label": "rpr", "matrix": [9, 0], "x": 34, "y": 1}, + {"label": "lpd", "matrix": [4, 0], "x": 1, "y": 2}, + {"label": "lrd", "matrix": [4, 1], "x": 5, "y": 2}, + {"label": "lmd", "matrix": [4, 2], "x": 9, "y": 2}, + {"label": "lid", "matrix": [4, 3], "x": 13, "y": 2}, + {"label": "rid", "matrix": [7, 3], "x": 21, "y": 2}, + {"label": "rmd", "matrix": [7, 2], "x": 25, "y": 2}, + {"label": "rrd", "matrix": [7, 1], "x": 29, "y": 2}, + {"label": "rpd", "matrix": [7, 0], "x": 33, "y": 2}, + {"label": "ltu", "matrix": [0, 4], "x": 13, "y": 3}, + {"label": "rtu", "matrix": [5, 4], "x": 21, "y": 3}, + {"label": "ltl", "matrix": [2, 4], "x": 12, "y": 4}, + {"label": "ltc", "matrix": [1, 4], "x": 13, "y": 4}, + {"label": "ltr", "matrix": [3, 4], "x": 14, "y": 4}, + {"label": "rtl", "matrix": [7, 4], "x": 20, "y": 4}, + {"label": "rtc", "matrix": [6, 4], "x": 21, "y": 4}, + {"label": "rtr", "matrix": [8, 4], "x": 22, "y": 4}, + {"label": "ltd", "matrix": [4, 4], "x": 13, "y": 5}, + {"label": "rtd", "matrix": [9, 4], "x": 21, "y": 5}, + {"label": "lt2u", "matrix": [0, 5], "x": 13, "y": 6}, + {"label": "rt2u", "matrix": [5, 5], "x": 21, "y": 6}, + {"label": "lt2l", "matrix": [2, 5], "x": 12, "y": 7}, + {"label": "lt2c", "matrix": [1, 5], "x": 13, "y": 7}, + {"label": "lt2r", "matrix": [3, 5], "x": 14, "y": 7}, + {"label": "rt2l", "matrix": [7, 5], "x": 20, "y": 7}, + {"label": "rt2c", "matrix": [6, 5], "x": 21, "y": 7}, + {"label": "rt2r", "matrix": [8, 5], "x": 22, "y": 7}, + {"label": "lt2d", "matrix": [4, 5], "x": 13, "y": 8}, + {"label": "rt2d", "matrix": [9, 5], "x": 21, "y": 8} + ] + } + } +} diff --git a/keyboards/dlip/haritev2/mcuconf.h b/keyboards/dlip/haritev2/mcuconf.h new file mode 100644 index 0000000000..62375dc72c --- /dev/null +++ b/keyboards/dlip/haritev2/mcuconf.h @@ -0,0 +1,7 @@ +// Copyright 2023 Dane Lipscombe (@dlip) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include_next +#undef RP_SPI_USE_SPI0 +#define RP_SPI_USE_SPI0 TRUE