tslib 移植 相關整理

2021-06-12 21:49:45 字數 3190 閱讀 2356

tslib的打補丁、編譯、安裝可參見博文:

按照上文中的步驟編譯前,要注意先設定cc等環境變數,不然編譯完後執行時會出現./ts_calibrate: line 1: syntax error :」(」 unexpected. 這樣的錯誤。這一點上文中沒有強調,我就犯了這樣的錯誤。

大概就是這幾項:

export path=$path:交叉工具鏈路徑/bin

export cc=arm-linux-gcc

export cxx=arm-linux-g++

編譯安裝好後,按照上文說的,在自動生成的ts.conf檔案開頭加上一句:module_raw one_wire_ts_input。這只後,剩下的就是設定環境變數了。我設定的方式跟上文中的不太一樣,被作者注釋掉的那些環境變數我都加上了。

export tslib_root=*********    (這些***都按照自己的情況修改)

export tslib_calibfile=*********

export tslib_conffile=*********

export tslib_plugindir=*********

export tslib_consoledevice=none

export tslib_fbdevice=/dev/fb0

export tslib_tsdevice=/dev/touchscreen-1wire

export ld_library_path=$ld_library_path:$tslib_root/lib

export path=$tslib_root/bin:$path

這樣設定好後,我這裡還要多設定乙個環境變數,qws_mouse_proto,否則qt程式還是不能接受觸控螢幕輸入。

" " 這篇博文裡,有下面這樣幾句話,對配置環境變數qws_mouse_proto有點用:

「qws_mouse_proto是滑鼠的設定,tslib表示使用tslib型別滑鼠,即觸控螢幕,/dev/input/event表示觸控螢幕對應的裝置節點,要與移植tslib時設定的環境變數tslib_tsdevice一致。如果想要同時支援usb滑鼠,設定如下:

export qws_mouse_proto="tslib:/dev/input/event0 intellimouse:/dev/input/mouse0"

」目前我的環境變數是這樣設定的(編譯好的tslib包我直接放到了/usr/local下面,並改名為 tslib_myown,因為友善的系統上已經有現成的tslib了,改下名字以區分開):

#! /bin/sh

export tslib_root=/usr/local/tslib-myown    #tslib的根目錄。這個不是必須的,tslib的相關檔案可以分散放開,但最好別這樣做,不易管理。

export tslib_calibfile=$tslib_root/etc/pointercal    #校準結果檔案。安裝好tslib,執行ts_calibrate校準後,這個檔案儲存了校準資訊,是以後系統計算觸點座標要用到的引數。

export tslib_conffile=$tslib_root/etc/ts.conf        #tslib的配置檔案

export tslib_plugindir=$tslib_root/lib/ts    #tslib的外掛程式目錄

export tslib_consoledevice=none        #

export tslib_fbdevice=/dev/fb0        # 對應的幀緩衝裝置

export tslib_tsdevice=/dev/touchscreen-1wire    #觸控螢幕的裝置節點

export ld_library_path=$ld_library_path:$tslib_root/lib        

export path=$tslib_root/bin:$path

#export qws_mouse_proto="tslib mouseman:/dev/input/mice"

#export qws_mouse_proto="tslib :/dev/input/mouse0"

export qws_mouse_proto="intellimouse:/dev/input/event0 tslib :/dev/touchscreen-1wire"    #滑鼠協議    

這樣設定之後,觸控螢幕可以用了,但原來可以使用的滑鼠,現在卻也不能用了,即使我在qws_mouse_proto裡設定了intellimouse(如最後一行所示),也不行。現在還不清楚到底為何,等以後搞定了再回來補充上。

附加:1.

關於如何指定顯示效果(如旋轉螢幕),在剛才提到的博文中,有這樣一段,以後可能會用到。

「qws_display

指定顯示形式和framebuffer

。格式如下

:export qws_display="[:]

[:]"

的有效引數是linuxfb, qvfb, vnc, transformed, multi 和 keys identifying custom drivers

,的引數通常是用來區分是否是相同的顯示屏和是否支援多顯示屏

,這裡設定為0。

驅動詳細選項

可用的描述

mmwidth=

linuxfb, qvfb

螢幕的物理寬度 (通常是按解析度計算).

mmheight=

linuxfb, qvfb

螢幕的物理寬度 (通常是按解析度計算).

vnc, transformed, multi

指定乙個子驅動.

transformed

螢幕的旋轉

角度x的有效值為90

,180

,270.

mmwith和mmheight的值的大小與qt應用程式在lcd上顯示的字型和控制項大小有關係。

vnc, transformed和multi screen drivers都依賴子驅動. 指定乙個驅動的一般方法如下:

export qws_display="[:][:]

[:]如果想要在原來設定的基礎上把螢幕旋轉90度,引數值設定如下:

qws_display=

transformed

:rot90:

linuxfb:mmwidth95:mmheight54:0

」2.  qws_mouse_proto環境變數的設定規則,參見:

如果這個鏈結失效,來這裡看:

tslib移植總結

一編譯 用的是ts1.0的版本 export cc arm linux gcc export path usr local arm 2.95.3 bin path autogen.sh 為防止出現undefined reference to rpl malloc 錯誤,採取以下措施 echo ac ...

tslib移植和測試

2.解壓 tar jxvf tslib 1.4.tar.bz 3.配置 cd tslib autogen.sh 如果出錯請看下面解決辦法 echo ac cv func malloc 0 nonnull yes arm linux.cache mkdir opt tslib 建立這個目錄是把qt安裝...

tslib1 4移植與使用

一.首先在ubuntu中安裝以下工具包 sudo apt get install autoconf sudo apt get install automake sudo apt get install libtool 二.編譯 tar xzf tslib 1.4.tar.gz cd tslib ex...