Skip to content

Commit

Permalink
add cirque on peripheral side
Browse files Browse the repository at this point in the history
  • Loading branch information
mike1808 committed Jun 24, 2024
1 parent ca72b13 commit 5f67067
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 62 deletions.
10 changes: 6 additions & 4 deletions config/boards/shields/hillside_view/hillside_view.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Set Bluetooth to max power
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

# Enable displays
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n
# # Enable displays
# CONFIG_ZMK_DISPLAY=y
# CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n

# Enable encoders
# CONFIG_EC11=y
Expand All @@ -17,9 +17,11 @@ CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n
# CONFIG_ZMK_RGB_UNDERGLOW_BRT_START=60
# CONFIG_ZMK_RGB_UNDERGLOW_ON_START=y


CONFIG_ZMK_MOUSE=y

CONFIG_I2C=y
CONFIG_PINNACLE=y
CONFIG_NFCT_PINS_AS_GPIOS=y
CONFIG_ZMK_MOUSE=y
CONFIG_INPUT=y
CONFIG_INPUT_PINNACLE=y
39 changes: 29 additions & 10 deletions config/boards/shields/hillside_view/hillside_view.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,35 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC
};

&i2c0 {
status = "disabled";
glidepoint: glidepoint@2a {
compatible = "cirque,pinnacle";
reg = <0x2a>;
status = "disabled";
glidepoint: glidepoint@2a {
compatible = "cirque,pinnacle";
reg = <0x2a>;
status = "disabled";
dr-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH)>;

sensitivity = "5x";
// sleep;
// no-taps;
};
dr-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH)>;

sensitivity = "1x";
// sleep;
// no-taps;
};
};

/ {
/* assign `input-listener` to all pointing devices */
/* &glidepoint0 on central, &glidepoint1 on peripheral */
tpad_central_listener {
compatible = "zmk,input-listener";
device = <&glidepoint>;
};

tpad_peripheral_listener {
compatible = "zmk,input-listener";
device = <&glidepoint_virtual>;
y-invert;
// xy-swap;
// x-invert;
scale-multiplier = <3>;
};
};

nice_view_spi: &spi1 {
Expand All @@ -183,8 +200,10 @@ nice_view_spi: &spi1 {
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
status = "disabled";

nice_view: ls0xx@0 {
status = "disabled";
compatible = "sharp,ls0xx";
spi-max-frequency = <1000000>;
reg = <0>;
Expand Down
5 changes: 5 additions & 0 deletions config/boards/shields/hillside_view/hillside_view_left.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# # Enable displays
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE=n
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y

CONFIG_ZMK_MOUSE=y
CONFIG_INPUT=y
CONFIG_GPIO=y
Expand Down
42 changes: 22 additions & 20 deletions config/boards/shields/hillside_view/hillside_view_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
;
};

&left_encoder {
status = "okay";
a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
};
// &left_encoder {
// status = "okay";
// a-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
// b-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
// };

&chosen {
zephyr,display = &nice_view;
Expand All @@ -36,21 +36,23 @@
status = "okay";
};

&i2c0 {
status = "okay";
glidepoint: glidepoint@2a {
status = "okay";
};
};

/ {
tpad0: tpad0 {
compatible = "zmk,input-listener";

device = <&glidepoint>;
// xy-swap;
// y-invert;
// x-invert;
};
/* define virtual input, will be resurrected for emitting input event */
/* NOTE: set `device = <&glidepoint1>` in `zmk,input-listener` */
glidepoint_virtual: virtual_input {
compatible = "zmk,virtual-input";
};

/* for central side, define (relay-channel)-to-(virtual-input) mapping */
input_relay_config_102 {
compatible = "zmk,split-peripheral-input-relay";

/* channel id, used to filter incoming input event from split peripheral */
/* NOTE: should matching relay-channel on peripheral overlay */
relay-channel = <102>;

/* virtual input device on central, which used to emit input event as an agent device */
device = <&glidepoint_virtual>;
};
};

25 changes: 9 additions & 16 deletions config/boards/shields/hillside_view/hillside_view_right.conf
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
##### Point Devices ####
# CONFIG_ZMK_PD_DEDICATED_WORK_QUEUE_PRIORITY=2
# CONFIG_ZMK_TRACKBALL_POLL_DURATION=8

# CONFIG_ZMK_MOUSE=n
# CONFIG_ZMK_MOUSE_TICK_DURATION=10
# CONFIG_ZMK_MOUSE_WORK_QUEUE_DEDICATED=y
# CONFIG_ZMK_MOUSE_DEDICATED_THREAD_PRIORITY=1
CONFIG_ZMK_MOUSE=y
CONFIG_INPUT=y
CONFIG_GPIO=y

CONFIG_I2C=y
CONFIG_PINCTRL=y
CONFIG_INPUT_PINNACLE=y

# CONFIG_ZMK_USB_LOGGING=y

# CONFIG_PMW3610=n
# CONFIG_PMW3610_CPI=3000
# CONFIG_PMW3610_CPI_DIVIDOR=1
# CONFIG_PMW3610_ORIENTATION_90=y
# CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=100
# CONFIG_PMW3610_REST2_SAMPLE_TIME_MS=200
# CONFIG_PMW3610_REST3_SAMPLE_TIME_MS=250
# CONFIG_PMW3610_RUN_DOWNSHIFT_TIME_MS=500
# CONFIG_PMW3610_REST1_DOWNSHIFT_TIME_MS=5000
# CONFIG_PMW3610_REST2_DOWNSHIFT_TIME_MS=30000

### Low latency Bluetooth for point devoce ###
# CONFIG_BT_PERIPHERAL_PREF_MAX_INT=9
Expand Down
49 changes: 38 additions & 11 deletions config/boards/shields/hillside_view/hillside_view_right.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
;
};

&right_encoder {
status = "okay";
};
// &right_encoder {
// status = "okay";
// };

// trackball bus
/* &spi0 { */
Expand All @@ -40,15 +40,42 @@
/* }; */


&chosen {
zephyr,display = &nice_view;
};
// &chosen {
// zephyr,display = &nice_view;
// };

&nice_view_spi {
status = "okay";
};
// &nice_view_spi {
// status = "okay";
// };

// &nice_view {
// status = "okay";
// };

&nice_view {
status = "okay";
&i2c0 {
status = "okay";
glidepoint0: glidepoint@2a {
status = "okay";
};
};

/ {
/* THIS only makes keymap binding happy, nothing happens on peripheral side */
glidepoint_virtual: virtual_input {
compatible = "zmk,virtual-input";
};

input_relay_config_102 {
compatible = "zmk,split-peripheral-input-relay";

/* peripheral side input device, used to... */
/* - be intecepted on peripheral; */
/* - and then, be resurrected as `zmk,virtual-device` on central; */
device = <&glidepoint>;

/* channel id, used to be be transfered along with all input events. */
/* NOTE 1: pick any 8bit integer. (1 - 255) */
/* TE 2: should matching relay-channel on central overlay */
relay-channel = <102>;
};
};
1 change: 0 additions & 1 deletion config/hillside_view.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

CONFIG_ZMK_KEYBOARD_NAME="Mikael HSV"
CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED=y

CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

Expand Down

0 comments on commit 5f67067

Please sign in to comment.