Skip to content

Commit 60bbcab

Browse files
committed
support oled
1 parent a6acd33 commit 60bbcab

File tree

3 files changed

+24
-60
lines changed

3 files changed

+24
-60
lines changed

build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
---
1515
include:
1616
- board: nice_nano_v2
17-
shield: cygnus_central_dongle
17+
shield: cygnus_central_dongle dongle_display
1818
snippet: studio-rpc-usb-uart
1919
cmake-args: -DCONFIG_ZMK_STUDIO=y -DCONFIG_ZMK_STUDIO_LOCKING=n
2020
artifact-name: cygnus_central_dongle

config/boards/shields/cygnus/cygnus_central_dongle.conf

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ CONFIG_BT_MAX_PAIRED=5
99
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2
1010

1111
# display
12-
CONFIG_ZMK_DISPLAY=n
13-
CONFIG_ZMK_IDLE_TIMEOUT=60000
12+
CONFIG_ZMK_DISPLAY=y
1413
CONFIG_BT_BAS=n
1514
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
1615

config/boards/shields/cygnus/cygnus_central_dongle.overlay

+22-57
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#define SCROLLER 1
1212
#define MOUSE 4
1313

14+
/ {
15+
chosen {
16+
zephyr,display = &oled;
17+
};
18+
};
19+
1420
&default_transform {
1521
col-offset = <12>;
1622
};
@@ -25,25 +31,6 @@
2531
;
2632
};
2733

28-
&pinctrl {
29-
spi1_default: spi1_default {
30-
group1 {
31-
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
32-
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
33-
<NRF_PSEL(SPIM_MISO, 0, 11)>;
34-
};
35-
};
36-
37-
spi1_sleep: spi1_sleep {
38-
group1 {
39-
psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
40-
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
41-
<NRF_PSEL(SPIM_MISO, 0, 11)>;
42-
low-power-enable;
43-
};
44-
};
45-
};
46-
4734
&uart0 {
4835
status = "disabled";
4936
};
@@ -53,43 +40,21 @@ zephyr_udc0: &usbd {
5340
status = "okay";
5441
};
5542

56-
&spi1 {
57-
compatible = "nordic,nrf-spim";
43+
44+
&pro_micro_i2c {
5845
status = "okay";
59-
pinctrl-0 = <&spi1_default>;
60-
pinctrl-1 = <&spi1_sleep>;
61-
pinctrl-names = "default", "sleep";
62-
cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
63-
pd0: pd@0 {
64-
compatible = "pixart,pmw3610";
65-
status = "okay";
66-
label = "TRACKBALL0";
67-
reg = <0>;
68-
spi-max-frequency = <4000000>;
69-
irq-gpios = <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
70-
cpi = <600>;
71-
evt-type = <INPUT_EV_REL>;
72-
x-input-code = <INPUT_REL_X>;
73-
y-input-code = <INPUT_REL_Y>;
46+
oled: sh1106@3c {
47+
compatible = "sinowealth,sh1106";
48+
reg = <0x3c>;
49+
width = <129>;
50+
height = <64>;
51+
segment-offset = <1>;
52+
page-offset = <0>;
53+
display-offset = <0>;
54+
multiplex-ratio = <63>;
55+
segment-remap;
56+
com-invdir;
57+
inversion-on;
58+
prechargep = <0x22>;
7459
};
75-
};
76-
77-
/ {
78-
trackball_listener: trackball_listener {
79-
compatible = "zmk,input-listener";
80-
status = "okay";
81-
device = <&pd0>;
82-
scroller {
83-
layers = <SCROLLER>;
84-
input-processors =
85-
<&zip_xy_transform INPUT_TRANSFORM_Y_INVERT>,
86-
<&zip_xy_scaler 1 50>,
87-
<&zip_xy_to_scroll_mapper>;
88-
};
89-
90-
snipe {
91-
layers = <MOUSE>;
92-
input-processors = <&zip_xy_scaler 1 3>;
93-
};
94-
};
95-
};
60+
};

0 commit comments

Comments
 (0)