您尚未登录。

楼主 #1 2018-12-07 14:36:35

john78
会员
注册时间: 2018-07-19
已发帖子: 219
积分: 167

V3S littlevgl 触摸 问题

电阻屏NS2009
tslib OK,ts_calibrate,ts_test可以正常运行。
littlevgl demo可以正常显示,但是,触摸 错误输出“ input input1: Poll touch data failed: ”

    lv_indev_drv_t indev_drv;
     lv_indev_drv_init(&indev_drv);          /*Basic initialization*/
     evdev_init();
     indev_drv.type = LV_INDEV_TYPE_POINTER; /*See below.*/
     indev_drv.read =  evdev_read;            /*See below.*/
     lv_indev_drv_register(&indev_drv);      /*Register the driver in LittlevGL*/
。。。
/*Handle LitlevGL tasks (tickless mode)*/
    while(1) {
        lv_tick_inc(5);
        lv_task_handler();
        usleep(5000);
    }

哪里配置还有问题

/*-------------------------------------------------
* Mouse or touchpad as evdev interface (for Linux based systems)
*------------------------------------------------*/
#ifndef USE_EVDEV
#define USE_EVDEV           1
#endif
#if USE_EVDEV
#define EVDEV_NAME   "/dev/input/event1"        /*You can use the "evtest" Linux tool to get the list of devices and test them*/
#define EVDEV_SWAP_AXES         0               /*Swap the x and y axes of the touchscreen*/

#define EVDEV_SCALE             0               /* Scale input, e.g. if touchscreen resolution does not match display resolution */
#if EVDEV_SCALE
#define EVDEV_SCALE_HOR_RES     (800)     /* Horizontal resolution of touchscreen */
#define EVDEV_SCALE_VER_RES     (480)        /* Vertical resolution of touchscreen */
#endif  /*EVDEV_SCALE*/

#define EVDEV_CALIBRATE         0               /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
#if EVDEV_CALIBRATE
#define EVDEV_HOR_MIN   3800                    /*If EVDEV_XXX_MIN > EVDEV_XXX_MAX the XXX axis is automatically inverted*/
#define EVDEV_HOR_MAX   200
#define EVDEV_VER_MIN   200
#define EVDEV_VER_MAX   3800
#endif  /*EVDEV_SCALE*/
#endif  /*USE_EVDEV*/

最近编辑记录 john78 (2018-12-07 14:37:14)

离线

#2 2018-12-07 15:01:53

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

Re: V3S littlevgl 触摸 问题

https://github.com/qq516333132/f1c100s_linux/blob/zero-4.13.y/drivers/input/touchscreen/ns2009.c


static void ns2009_ts_poll(struct input_polled_dev *dev)
{
    struct ns2009_data *data = dev->private;
    int ret;

    ret = ns2009_ts_report(data);
    if (ret)
        dev_err(&dev->input->dev, "Poll touch data failed: %d\n", ret);
}

没事没事, 只是 ns2009 驱动读到某次数据异常而已。





离线

楼主 #3 2018-12-07 15:05:32

john78
会员
注册时间: 2018-07-19
已发帖子: 219
积分: 167

Re: V3S littlevgl 触摸 问题

但是触摸不对啊,和画面对不上?
另外,这个怎么使用 tslib校准好的数据? /dev/input/event1--这个输出已经校准了吗?

离线

#4 2018-12-07 15:09:07

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

Re: V3S littlevgl 触摸 问题

你需要tslib, 这个可以校正,并且有各种滤波算法。





离线

楼主 #5 2018-12-07 15:17:28

john78
会员
注册时间: 2018-07-19
已发帖子: 219
积分: 167

Re: V3S littlevgl 触摸 问题

tslib OK,ts_calibrate,ts_test可以正常运行。

这个需要怎么在LitlevGL中调用?

离线

#6 2018-12-07 15:24:45

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

Re: V3S littlevgl 触摸 问题

john78 说:

tslib OK,ts_calibrate,ts_test可以正常运行。

这个需要怎么在LitlevGL中调用?

把ts_test 整合到 lvgl





离线

页脚

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

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