Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add split vik cirque shield #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions boards/shields/vik_cirque_spi_split/vik_cirque_spi_split.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/ {
split_inputs {
#address-cells = <1>;
#size-cells = <0>;

glidepoint_split: glidepoint_split@0 {
compatible = "zmk,input-split";
reg = <0>;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
file_format: "1"
id: vik_cirque_spi_split
name: vik_cirque_spi_split
type: shield
url: https://github.com/sadekbaroudi/vik/
siblings:
- vik_cirque_split_split_central
- vik_cirque_split_split_peripheral
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "../vik_shield_dts_preprocess.h"
#include "vik_cirque_spi_split.dtsi"

#include <dt-bindings/zmk/input_transform.h>
#include <dt-bindings/input/input-event-codes.h>

/ {
glidepoint_input_listener: glidepoint_input {
compatible = "zmk,input-listener";
device = <&glidepoint_split>;

// input-processors = <&xy_transform (INPUT_TRANSFORM_XY_SWAP | INPUT_TRANSFORM_X_INVERT | INPUT_TRANSFORM_Y_INVERT) &xy_scaler 3 2>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_SPI=y
CONFIG_ZMK_MOUSE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include "../vik_shield_dts_preprocess.h"
#include "vik_cirque_spi_split.dtsi"

#include <input/processors.dtsi>
#include <dt-bindings/zmk/input_transform.h>
#include <dt-bindings/input/input-event-codes.h>

&vik_spi {
status = "okay";
cs-gpios = VIK_SPI_CS_PREFIX_PROCESSED <&vik_conn 6 GPIO_ACTIVE_LOW>;

glidepoint: glidepoint@VIK_SPI_REG_START {
compatible = "cirque,pinnacle";
reg = <VIK_SPI_REG_START>;
spi-max-frequency = <1000000>;
status = "okay";
dr-gpios = <&vik_conn 5 (GPIO_ACTIVE_HIGH)>; // DR pin on cirque is always &vik_conn 5

sensitivity = "1x";
};
};

&glidepoint_split {
device = <&glidepoint>;
// Input processors that are run before event data is sent
// to the central. Mostly useful for orientation fix ups.
input-processors = <&zip_xy_transform (INPUT_TRANSFORM_XY_SWAP | INPUT_TRANSFORM_X_INVERT | INPUT_TRANSFORM_Y_INVERT)>;
};