-
Notifications
You must be signed in to change notification settings - Fork 7
/
tagtagtag-ears-overlay.dts
56 lines (53 loc) · 1.88 KB
/
tagtagtag-ears-overlay.dts
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
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target = <&gpio>;
__overlay__ {
gpio_encoder_left_pin: gpio_encoder_left_pin@24 {
brcm,pins = <24>;
brcm,function = <0>; // in
};
gpio_encoder_right_pin: gpio_encoder_right_pin@23 {
brcm,pins = <23>;
brcm,function = <0>; // in
};
// left: when looking at the rabbit (matching hardware spec)
// forward: for the rabbit's left ear (right), counter-clock-wise
// for the rabbit's right ear (left below), clock-wise
gpio_motor_left_forward_pin: gpio_motor_left_forward_pin@12 {
brcm,pins = <12>;
brcm,function = <1>; // out
};
gpio_motor_left_backward_pin: gpio_motor_left_backward_pin@11 {
brcm,pins = <11>;
brcm,function = <1>; // out
};
gpio_motor_right_forward_pin: gpio_motor_right_forward_pin@10 {
brcm,pins = <10>;
brcm,function = <1>; // out
};
gpio_motor_right_backward_pin: gpio_motor_right_backward_pin@9 {
brcm,pins = <9>;
brcm,function = <1>; // out
};
};
};
fragment@1 {
target-path="/";
__overlay__ {
tagtagtag_ears: tagtagtag-ears {
compatible = "linux,tagtagtag-ears";
left-encoder-gpio = <&gpio 24 0>;
left-motor-gpios = <&gpio 12 0 &gpio 11 0>;
right-encoder-gpio = <&gpio 23 0>;
right-motor-gpios = <&gpio 10 0 &gpio 9 0>;
// Declare a single pinctrl state (referencing the one declared above) and name it
// default, so it is activated automatically.
pinctrl-names = "default";
pinctrl-0 = <&gpio_encoder_left_pin &gpio_motor_left_forward_pin &gpio_motor_left_backward_pin &gpio_encoder_right_pin &gpio_motor_right_forward_pin &gpio_motor_right_backward_pin>;
};
};
};
};