时间有限写的简单点主要是代码,不明白的留言
first
编辑dts文件如下
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "BB-W1";
version = "00A0";
/* state the resources this cape uses */
exclusive-use =
/* the pin header uses */
"P9.22",
/* the hardware IP uses */
"gpio0_2";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
dallas_w1_pins: pinmux_dallas_w1_pins {
pinctrl-single,pins = < 0x150 0x37 >;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&dallas_w1_pins>;
status = "okay";
gpios = <&gpio1 2 0>;
};
};
};
};
编译之