pcduino 觸屏 支持

聲明:轉載請註明出處 http://blog.csdn.net/laotie1015
前提:pc已經配置好交叉編譯器
  如果沒有配置,參考http://www.oschina.net/question/1174645_120733

一、購買的觸屏
地址:http://item.taobao.com/item.htm?id=18527409945


把觸摸屏安裝好。

二、編譯pcduino內核,觸屏驅動打開
Linux對觸摸屏的驅動已經很完善,購買的觸摸屏也是linux支持的,但是pcduino內核沒有打開這一項,所以我們要將內核中觸屏打開並重新編譯內核。步驟如下:
1、先切換到準備存放內核源代碼的目錄,從Github下載kernel源代碼文件:
$ git clone https://github.com/pcduino/kernel.git
如果沒有安裝git,先安裝git:
sudo apt-get install git
注意:
    此步驟只下載了搭建環境。
    其他子模塊可在這裏下載:https://github.com/linux-sunxi/.
    第一次在kernel/ directory 下運行“make”的時候,子模塊的源文件將被下載(如果在運行“make”之前子模塊沒有被下載的話)。

2、編譯Kernel 鏡像
(1)make
如果沒有安裝ncurses庫的,先安裝
sudo apt-get install libncurses5-dev
在kernel/ directory 下運行“make” ( 不要在kernel/linux-sunxi directory 編譯源文件).


    1)、$ cd kernel/
    2)、$ make
注意:
A) 此時如果沒有下載其他模塊會自動下載
B) 如果出現No package 'libusb-1.0' found,安裝一下
sudo apt-get install libusb-1.0
配置內核
make  linux-config

進入Device Drivers ---》

進入Input device support --->

進入Touchscreens --->

使用空格鍵 將USB Touchscreen Driver打上 * 號,我們用的驅動是eGalax, eTurboTouch CT-410/510/700 device support如上圖,然後退出保存

拷貝.config
cp build/sun4i_defconfig-linux/.config patch/linux-sunxi/arch/arm/configs/sun4i_defconfig
編譯 make linux
等待編譯完成

三、給pcduino換內核
1、編譯出uImage拷貝到pcduino上
2、掛在/dev/nanda:
      mount /dev/nanda /boot
3、備份uImage
      cp /boot/uImage /home/uImage.old
4、將新內核放入/dev/nanda
      cp /**/uImage /boot/uImage
重啓 reboot

四、校準觸摸屏
到現在pcduino已經支持這塊觸摸屏了,我們可以試一試在屏幕上點擊幾下,鼠標會不會有反應,有則驅動成功了,如果沒有請檢查中間那個步驟做錯了。
每一塊觸摸屏不是拿來就能正常使用的,需要校準,我們使用的工具是xinput_calibrator

1、安裝觸屏校準工具 xinput_calibrator步驟:
    a、下載源碼
            http://www.freedesktop.org/wiki/Software/xinput_calibrator/
    b、安裝 pkg-config和xorg-dev,不然不能成功配置編譯
apt-get install pkg-config
apt-get install xorg-dev
    c、配置 ./configure
    d、make
    e、將編譯出來的程序拷貝到/usr/bin目錄下
cp /你的路徑/xinput_calibrator-0.7.5/src/xinput_calibrator /usr/bin/

2、修改/etc/X11/xorg.conf中
    Section "Screen"
        Identifier      "Mali Screen"
        Device          "Mali FBDEV"
        Monitor         "Monitor0"
        SubSection "Display"
                Depth   24
                Modes "800x600-60"   ——》原來是1280x720
        EndSubSection
EndSection

3、運行xinput_calibrator校準
校準完會有以下提示
Calibrating EVDEV driver for "eGalax Inc. USB TouchController" id=7
    current calibration values (from XInput): min_x=96, max_x=1946 and min_y=1610, max_y=166

Doing dynamic recalibration:
    Setting new calibration data: 99, 1941, 1617, 169

--> Making the calibration permanent <--
  copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'
Section "InputClass"
    Identifier    "calibration"
    MatchProduct    "eGalax Inc. USB TouchController"
    Option    "Calibration"    "96 1947 1612 163"
EndSection
拷貝
Section "InputClass"
    Identifier    "calibration"
    MatchProduct    "eGalax Inc. USB TouchController"
    Option    "Calibration"    "96 1947 1612 163"
EndSection

添加到/etc/X11/xorg.conf中,這樣就保存了觸屏的配置了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章