您尚未登录。

楼主 #1 2019-11-15 14:50:35

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

设备树里的地址是怎么确定的

比如以下设备树中,gt911为何要两个,地址0x5d 和 0x14是怎么确定的,为什么是0x5d和0x14?
&i2c0 {
        pinctrl-0 = <&i2c0_pins>;
        pinctrl-names = "default";
        status = "okay";

        gt9115d: touchscreen@5d {
                compatible = "goodix,gt911";
                reg = <0x5d>;
                interrupt-parent = <&pio>;
                interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>; /* (PE3) */
                pinctrl-names = "default";
                pinctrl-0 = <&ts_reset_pin>;
                irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* (PE3) */
                reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST (PE9) */
                touchscreen-swapped-x-y;
        };

        gt91114: touchscreen@14 {
                compatible = "goodix,gt911";
                reg = <0x14>;
                interrupt-parent = <&pio>;
                interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>; /* (PE3) */
                pinctrl-names = "default";
                pinctrl-0 = <&ts_reset_pin>;
                irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* (PE3) */
                reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST (PE9) */
                touchscreen-swapped-x-y;
        };
};

再比如以下设备树,0x48,0x40,0x4a 是怎么来的,还有一个i2c0可以同时接三个设备吗

&i2c0 {
         status = "okay";

         ns2009: ns2009@48 {
                 compatible = "nsiway,ns2009";
                 reg = <0x48>;
         };
         sht21: sht21@40 {
                 compatible = "sht21";
                 reg = <0x40>;
         };
         atmel_mxt_ts@4a {
                 compatible = "atmel,atmel_mxt_ts";
                 reg = <0x4a>;
                 /*interrupt-parent = <&pio>;
                 interrupts = <6 5 IRQ_TYPE_LEVEL_LOW>;*/ //省引脚,使用轮训方式
         };
};

离线

#2 2019-11-15 14:52:23

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,244
积分: 9197

Re: 设备树里的地址是怎么确定的

gt911 有点特别,可能需要时序初始化确定i2c地址,如果不初始化地址处于不确定状态,你翻一下 xm1994 的帖子。





离线

楼主 #3 2019-11-15 15:27:34

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: 设备树里的地址是怎么确定的

晕哥,0x48,0x40,0x4a 这些地址是怎么来的

离线

#4 2019-11-15 15:28:58

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,244
积分: 9197

Re: 设备树里的地址是怎么确定的

gt911 等芯片手册上面有。





离线

楼主 #5 2019-11-16 23:18:05

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: 设备树里的地址是怎么确定的

晕哥 说:

gt911 等芯片手册上面有。

懂了,多谢

离线

页脚

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

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