AM437X移植ads7846有中断,没事件,急急急在线等 - AM437x - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3636|回复: 4

[已解决] AM437X移植ads7846有中断,没事件,急急急在线等

[复制链接]

1

主题

3

帖子

31

积分

新手上路

Rank: 1

积分
31
发表于 2019-5-24 10:11:10 | 显示全部楼层 |阅读模式
root@am437x-evm:/dev/input# cat /proc/interrupts
.....
97:       1107  48322000.gpio   7 Edge      ads7846
root@am437x-evm:/dev/input# cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="ADS7846 Touchscreen"
P: Phys=spi1.0/input0
S: Sysfs=/devices/platform/44000000.ocp/481a2000.spi/spi_master/spi1/spi1.0/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

root@am437x-evm:/dev/input# cat event0

触摸屏幕,没有任何打印。。。。。。。。。。。。。。。。。。




回复

使用道具 举报

36

主题

526

帖子

7568

积分

创龙

Rank: 8Rank: 8

积分
7568
发表于 2019-5-24 11:37:24 | 显示全部楼层
您好,
  1.请确认设备树文件已配置好Pinmux和节点。2.确认设备树文件已替换成功。
  3.查看在文件系统/dev/input/目录下有没有产生eventX的节点。
    再执行od -x /dev/input/eventX ,然后触摸LCD看是否有打印东西。有打印信息就表示配置正常。
回复 支持 反对

使用道具 举报

1

主题

3

帖子

31

积分

新手上路

Rank: 1

积分
31
 楼主| 发表于 2019-5-24 13:48:35 | 显示全部楼层
梁工您好
dts文件相关部分:
ads7846reg: ads7846-reg {   /* 4 line touch screen driver */
        compatible = "regulator-fixed";
        regulator-name = "ads7846-reg";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
    };

#if 0
    pixcir_ts_pins: pixcir_ts_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa64, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi2_d0.gpio3_22 */
        >;
    };
#endif

    spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
            AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
            AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
            AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
        >;
    };

    ads7846_pins: ads7846_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
        >;
    };

&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>;

    ads7846@0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ads7846_pins>;

        compatible = "ti,ads7846";
        vcc-supply = <&ads7846reg>;

        reg = <0>;            /* CS0 */
        spi-max-frequency = <1500000>;

        interrupt-parent = <&gpio5>;
        interrupts = <7 0>;        /* gpio5_7 */
        pendown-gpio = <&gpio5 7 0>;

        ti,x-min = /bits/ 16 <0x0>;
        ti,x-max = /bits/ 16 <0x0fff>;
        ti,y-min = /bits/ 16 <0x0>;
        ti,y-max = /bits/ 16 <0x0fff>;

        ti,x-plate-ohms = /bits/ 16 <180>;
        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max = /bits/ 16 <10>;
        ti,debounce-tol = /bits/ 16 <30>;
        ti,debounce-rep = /bits/ 16 <1>;

        ti,settle-delay-usec = /bits/ 16 <150>;
        ti,keep-vref-on = <1>;

        linux,wakeup;
    };
};

   

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

1

主题

3

帖子

31

积分

新手上路

Rank: 1

积分
31
 楼主| 发表于 2019-5-28 14:16:11 | 显示全部楼层
梁淑怡-Tronlong 发表于 2019-5-24 11:37
您好,
  1.请确认设备树文件已配置好Pinmux和节点。2.确认设备树文件已替换成功。
  3.查看在文件系统/dev ...

梁工您好
dts文件相关部分:
ads7846reg: ads7846-reg {   /* 4 line touch screen driver */
        compatible = "regulator-fixed";
        regulator-name = "ads7846-reg";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
    };

#if 0
    pixcir_ts_pins: pixcir_ts_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa64, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi2_d0.gpio3_22 */
        >;
    };
#endif

    spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
            AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
            AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
            AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
        >;
    };

    ads7846_pins: ads7846_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
        >;
    };

&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>;

    ads7846@0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ads7846_pins>;

        compatible = "ti,ads7846";
        vcc-supply = <&ads7846reg>;

        reg = <0>;            /* CS0 */
        spi-max-frequency = <1500000>;

        interrupt-parent = <&gpio5>;
        interrupts = <7 0>;        /* gpio5_7 */
        pendown-gpio = <&gpio5 7 0>;

        ti,x-min = /bits/ 16 <0x0>;
        ti,x-max = /bits/ 16 <0x0fff>;
        ti,y-min = /bits/ 16 <0x0>;
        ti,y-max = /bits/ 16 <0x0fff>;

        ti,x-plate-ohms = /bits/ 16 <180>;
        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max = /bits/ 16 <10>;
        ti,debounce-tol = /bits/ 16 <30>;
        ti,debounce-rep = /bits/ 16 <1>;

        ti,settle-delay-usec = /bits/ 16 <150>;
        ti,keep-vref-on = <1>;

        linux,wakeup;
    };
};
回复 支持 反对

使用道具 举报

44

主题

368

帖子

2894

积分

创龙

Rank: 8Rank: 8

积分
2894
发表于 2019-6-4 21:38:28 | 显示全部楼层
Dear ,

         根据您的实际调试情况,需要修改设备树配置

ti,x-plate-ohms = / bits / 16 <180>;
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|嵌入式开发者社区 ( 粤ICP备15055271号

GMT+8, 2024-3-28 21:27 , Processed in 0.038681 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

快速回复 返回顶部 返回列表