Skip to content

Commit

Permalink
feat(board): sensortest
Browse files Browse the repository at this point in the history
  • Loading branch information
burkfers committed Jun 6, 2024
1 parent 2f5a615 commit bc634dc
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/boards/shields/sensortest/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if SHIELD_SENSORTEST

config ZMK_KEYBOARD_NAME
default "Sensortest"

endif
2 changes: 2 additions & 0 deletions config/boards/shields/sensortest/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_SENSORTEST
def_bool $(shields_list_contains,sensortest)
48 changes: 48 additions & 0 deletions config/boards/shields/sensortest/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
&pinctrl {
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 7)>;
};
};

spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 6)>,
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
<NRF_PSEL(SPIM_MISO, 0, 7)>;
low-power-enable;
};
};
};

&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&pro_micro 8 GPIO_ACTIVE_LOW>;

trackball: trackball@0 {
status = "okay";
compatible = "pixart,pmw3610";
reg = <0>;
spi-max-frequency = <2000000>;
irq-gpios = <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

/* optional features */
// snipe-layers = <1>;
// scroll-layers = <2 3>;
// automouse-layer = <4>;
};
};

/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&trackball>;

};
};
4 changes: 4 additions & 0 deletions config/boards/shields/sensortest/sensortest.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_ZMK_MOUSE=y
CONFIG_PMW3610=y
30 changes: 30 additions & 0 deletions config/boards/shields/sensortest/sensortest.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <1>;
rows = <1>;
map = <
RC(0,0)
> ;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
wakeup-source;
};

bootloader_key: bootloader_key {
compatible = "zmk,boot-magic-key";
key-position = <0>;
jump-to-bootloader;
status = "okay";
};
};
14 changes: 14 additions & 0 deletions config/boards/shields/sensortest/sensortest.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <
&kp Q
>;
};
};
};
11 changes: 11 additions & 0 deletions config/boards/shields/sensortest/sensortest.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "sensortest.dtsi"

&kscan0 {
row-gpios
= <&pro_micro 10 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>
;

col-gpios
= <&pro_micro 16 GPIO_ACTIVE_HIGH>
;
};

0 comments on commit bc634dc

Please sign in to comment.