您尚未登录。

楼主 #1 2020-05-03 12:22:32

raspberryman
会员
注册时间: 2019-12-27
已发帖子: 503
积分: 465

请问A33可以通过1-wire 接 18b20这种经典的温度传感器吗?

这是我网上找到的dts配置:

http://www.bonebrews.com/temperature-monitoring-with-the-ds18b20-on-a-beaglebone-black/

/dts-v1/;
// magic:               0xd00dfeed
// totalsize:           0x31f (799)
// off_dt_struct:       0x38
// off_dt_strings:      0x2b4
// off_mem_rsvmap:      0x28
// version:             17
// last_comp_version:   16
// boot_cpuid_phys:     0x0
// size_dt_strings:     0x6b
// size_dt_struct:      0x27c

/ {
    compatible = "allwinner,sun50i-h5";
    fragment@0 {
        target = <0xffffffff>;
        __overlay__ {
            w1_pins {
                pins = "PD14";
                function = "gpio_in";
                linux,phandle = <0x00000001>;
                phandle = <0x00000001>;
            };
        };
    };
    fragment@1 {
        target-path = "/";
        __overlay__ {
            onewire@0 {
                compatible = "w1-gpio";
                pinctrl-names = "default";
                pinctrl-0 = <0x00000001>;
                gpios = <0xffffffff 0x00000003 0x0000000e 0x00000000>;
                status = "okay";
            };
        };
    };
    __symbols__ {
        w1_pins = "/fragment@0/__overlay__/w1_pins";
    };
    __fixups__ {
        pio = "/fragment@0:target:0", "/fragment@1/__overlay__/onewire@0:gpios:0";
    };
    __local_fixups__ {
        fragment@1 {
            __overlay__ {
                onewire@0 {
                    pinctrl-0 = <0x00000000>;
                };
            };
        };
    };
};

https://forum.armbian.com/topic/6859-ds18b20-temperature-sensor-1-wire-fex/

/dts-v1/;
// magic:               0xd00dfeed
// totalsize:           0x31f (799)
// off_dt_struct:       0x38
// off_dt_strings:      0x2b4
// off_mem_rsvmap:      0x28
// version:             17
// last_comp_version:   16
// boot_cpuid_phys:     0x0
// size_dt_strings:     0x6b
// size_dt_struct:      0x27c

/ {
    compatible = "allwinner,sun50i-h5";
    fragment@0 {
        target = <0xffffffff>;
        __overlay__ {
            w1_pins {
                pins = "PD14";
                function = "gpio_in";
                linux,phandle = <0x00000001>;
                phandle = <0x00000001>;
            };
        };
    };
    fragment@1 {
        target-path = "/";
        __overlay__ {
            onewire@0 {
                compatible = "w1-gpio";
                pinctrl-names = "default";
                pinctrl-0 = <0x00000001>;
                gpios = <0xffffffff 0x00000003 0x0000000e 0x00000000>;
                status = "okay";
            };
        };
    };
    __symbols__ {
        w1_pins = "/fragment@0/__overlay__/w1_pins";
    };
    __fixups__ {
        pio = "/fragment@0:target:0", "/fragment@1/__overlay__/onewire@0:gpios:0";
    };
    __local_fixups__ {
        fragment@1 {
            __overlay__ {
                onewire@0 {
                    pinctrl-0 = <0x00000000>;
                };
            };
        };
    };
};

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn