summaryrefslogtreecommitdiff
path: root/app/boards/arm/ferris/ferris_rev02.dts
blob: 848760fa757aedc321761413d68773ddf215c1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
 * Copyright (c) 2020 The ZMK Contributors
 *
 * SPDX-License-Identifier: MIT
 */

/dts-v1/;
#include <st/f0/stm32f072Xb.dtsi>
#include <st/f0/stm32f072v(8-b)tx-pinctrl.dtsi>

#include <dt-bindings/zmk/matrix_transform.h>

/ {
	model = "Ferris rev0.2";
	compatible = "ferris,rev02", "st,stm32f072";

	chosen {
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zmk,kscan = &kscan;
		zmk,matrix_transform = &transform;
		/* TODO: Enable once we support the IC for underglow
		zmk,underglow = &led_strip;
		 */
	};

	transform: transform {
		compatible = "zmk,matrix-transform";
		rows = <4>;
		columns = <10>;

		map = <
		RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4)     RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9)
		RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4)     RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9)
		RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4)     RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
		RC(3,3)  RC(3,4)     RC(3,5) RC(3,6)
		>;
	};

	kscan: kscan {
		compatible = "zmk,kscan-composite";
		label = "KSCAN";
		rows = <4>;
		columns = <10>;

		left {
			kscan = <&kscan_left>;
		};

		right {
			kscan = <&kscan_right>;
			column-offset = <5>;
		};
	};

	kscan_left: kscan_left {
		compatible = "zmk,kscan-gpio-matrix";
		label = "KSCAN_LEFT";

		diode-direction = "col2row";

		col-gpios
		= <&gpiob 8 (GPIO_ACTIVE_HIGH)>
		, <&gpiob 4 (GPIO_ACTIVE_HIGH)>
		, <&gpiob 3 (GPIO_ACTIVE_HIGH)>
		, <&gpioa 15 (GPIO_ACTIVE_HIGH)>
		, <&gpioa 14 (GPIO_ACTIVE_HIGH)>
		;
		row-gpios
		= <&gpiob 7  (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
		, <&gpiob 6  (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
		, <&gpiob 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
		, <&gpioa 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
		;
	};

	kscan_right: kscan_right {
		compatible = "zmk,kscan-gpio-matrix";
		label = "KSCAN_RIGHT";

		diode-direction = "row2col";

		col-gpios
		= <&right_io 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
		, <&right_io 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
		, <&right_io 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
		, <&right_io 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
		, <&right_io 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
		;
		row-gpios
		= <&right_io 8  (GPIO_ACTIVE_LOW)>
		, <&right_io 9  (GPIO_ACTIVE_LOW)>
		, <&right_io 10 (GPIO_ACTIVE_LOW)>
		, <&right_io 11 (GPIO_ACTIVE_LOW)>
		;
	};
};

&i2c2 {
	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
	status = "okay";
	clock-frequency = <I2C_BITRATE_FAST>;

	right_io: mcp23017@20 {
		compatible = "microchip,mcp23017";
		status = "okay";
		gpio-controller;
		reg = <0x20>;
		label = "RIGHT_IO";
		#gpio-cells = <2>;
		ngpios = <16>;
	};
};

&usb {
	status = "okay";
};

&rtc {
	status = "okay";
};

&flash0 {
	/*
	 * For more information, see:
	 * http: //docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
	 */
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		/* Set 6Kb of storage at the end of the 128Kb of flash */
		storage_partition: partition@3e800 {
			label = "storage";
			reg = <0x0001e800 0x00001800>;
		};
	};
};