Difference between revisions of "Template:S5Pxx18-SPI-2.8TFT/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(Created page with "===Under S5P4418 & Linux-3.4 Kernel=== Note: the following method only applies for the Matrix-2'8_SPI_Key_TFT-1512 model. To test a Matrix-2'8_SPI_Key_TFT-1706(silkscreen T28-...")
 
Line 1: Line 1:
===Under S5P4418 & Linux-3.4 Kernel===
+
===S5P4418配合Linux-3.4内核===
Note: the following method only applies for the Matrix-2'8_SPI_Key_TFT-1512 model. To test a Matrix-2'8_SPI_Key_TFT-1706(silkscreen T28-02 1706) you need to make changes in the S5P4418's kernel file /drivers/char/matrix_ads7846.c.
+
注意: 以下测试方法用于测试Matrix-2'8_SPI_Key_TFT-1512版本的硬件,对于Matrix-2'8_SPI_Key_TFT-1706(丝印T28-02 1706)硬件,请自行修改s5p4418内核驱动./drivers/char/matrix_ads7846.c,才能支持使用触摸功能。
<!---
+
 
===Under H3 & Linux-3.4 Kernel/S5P4418 & Linux-3.4 Kernel===
+
====在Ubuntu-Core上运行Qt程序====
--->
+
由于Ubuntu-Core系统带有Qt环境,我们可以在该系统上运行一个简单且带图形界面的Qt程序。<br>
====Run Qt Programs on Ubuntu-Core====
+
启动开发板并运行Ubuntu-Core系统,进入系统后克隆Matrix代码仓库:
FriendlyElec's Ubuntu-Core supports Qt. Users can run a Qt application by following the steps below.<br>
+
Boot Ubuntu-Core on a board and clone the Matrix code samples:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ apt-get update && apt-get install git
 
$ apt-get update && apt-get install git
 
$ git clone https://github.com/friendlyarm/matrix.git
 
$ git clone https://github.com/friendlyarm/matrix.git
 
</syntaxhighlight>
 
</syntaxhighlight>
After it is done a "matrix" directory will be generated.
+
克隆完成后会得到一个名为matrix的目录。
  
Compile and Run Qt Test Program:
+
编译并运行Qt测试程序:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd matrix/demo/nanopi-status
 
cd matrix/demo/nanopi-status
Line 19: Line 17:
 
./run.sh /dev/fb-st7789s
 
./run.sh /dev/fb-st7789s
 
</syntaxhighlight>
 
</syntaxhighlight>
The nanopi-status is a simple Qt program which shows system information. Here is what you expect to observe:<br>
+
nanopi-status是一个简单的Qt程序,可用于显示系统的基本信息,效果如下:<br>
 
[[File:st7789s-status.png|frameless|600px|st7789s-status]]<br>
 
[[File:st7789s-status.png|frameless|600px|st7789s-status]]<br>
The run.sh script will load TFT's driver and run the Qt program. After the driver is successfully loaded a device node /dev/fb-st7789s will be generated. You can check whether or not the driver is loaded successfully by running the following commands
+
脚本run.sh会先加载tft屏的驱动模块然后运行Qt程序,驱动模块加载成功后会生成设备节点/dev/fb-st7789s,下列命令可以确定驱动模块是否成功加载:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
lsmod
 
lsmod
Line 27: Line 25:
 
fbtft_device          29235  0
 
fbtft_device          29235  0
 
</syntaxhighlight>
 
</syntaxhighlight>
After the TFT's driver is loaded you can enable the TFT by running the following commands
+
在确定tft驱动模块已加载的前提下,运行下列命令可以显示三原色:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd matrix/demo/matrix-lcdtest
 
cd matrix/demo/matrix-lcdtest
Line 34: Line 32:
 
./matrix-lcdtest
 
./matrix-lcdtest
 
</syntaxhighlight>
 
</syntaxhighlight>
You will watch the display.
+
三原色可以呈现出屏幕的最佳显示效果。
 +
 
 +
====在2.8寸屏上显示Debian桌面====
 +
对于支持Debian系统的开发板,用户可以通过下列操作将Debian的桌面显示在2.8寸屏上。<br>
  
====Display Debian GUI on 2.8"LCD====
+
启动开发板并运行Debian系统,进入系统后克隆Matrix代码仓库:
Boot your ARM board with Debian and and launch the Debian GUI by running the following commands:<br>
+
After Debian is loaded clone the matrix code samples:
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ apt-get update && apt-get install git
 
$ apt-get update && apt-get install git
 
$ git clone https://github.com/friendlyarm/matrix.git
 
$ git clone https://github.com/friendlyarm/matrix.git
 
</syntaxhighlight>
 
</syntaxhighlight>
After it is done a "matrix" directory will be generated.
+
克隆完成后会得到一个名为matrix的目录。
  
For H3 based boards you need to change the X11 configuration file as follows:
+
对于H3系列的开发板,需要先修改X11的配置文件:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ vi /etc/X11/xorg.conf
 
$ vi /etc/X11/xorg.conf
 
</syntaxhighlight>
 
</syntaxhighlight>
Change "/dev/fb0" to "/dev/fb-st7789s".
+
将字样“/dev/fb0”修改为“/dev/fb-st7789s”。
  
Launch the Debian GUI by running the following commands:
+
执行下列命令在2.8寸屏上启动Debian桌面:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ cd matrix/demo/nanopi-status/
 
$ cd matrix/demo/nanopi-status/
 
$ ./display-debian.sh /dev/fb-st7789s
 
$ ./display-debian.sh /dev/fb-st7789s
 
</syntaxhighlight>
 
</syntaxhighlight>
Calibrate the screen by following the four points' movement:<br>
+
用触摸笔在屏幕上点击4个点完成校准并进入Debian桌面,效果如下:<br>
 
[[File:fbtft-debian.png|frameless|600px|fbtft-debian]]
 
[[File:fbtft-debian.png|frameless|600px|fbtft-debian]]
  
After calibration is done you will see the following system information:
+
完成触摸校准后终端会有类似如下的打印信息:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
Section "InputClass"  
 
Section "InputClass"  
Line 68: Line 67:
 
EndSection  
 
EndSection  
 
</syntaxhighlight>
 
</syntaxhighlight>
Copy and paste the information to the "/usr/share/X11/xorg.conf.d/99-calibration.conf" file, save it and this will be used as your calibration data when you reboot your board.<br>
+
将上述内容手动保存在/usr/share/X11/xorg.conf.d/99-calibration.conf中,以后就再也无需进行校准了。<br>

Revision as of 09:35, 14 December 2017

1 S5P4418配合Linux-3.4内核

注意: 以下测试方法用于测试Matrix-2'8_SPI_Key_TFT-1512版本的硬件,对于Matrix-2'8_SPI_Key_TFT-1706(丝印T28-02 1706)硬件,请自行修改s5p4418内核驱动./drivers/char/matrix_ads7846.c,才能支持使用触摸功能。

1.1 在Ubuntu-Core上运行Qt程序

由于Ubuntu-Core系统带有Qt环境,我们可以在该系统上运行一个简单且带图形界面的Qt程序。
启动开发板并运行Ubuntu-Core系统,进入系统后克隆Matrix代码仓库:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

克隆完成后会得到一个名为matrix的目录。

编译并运行Qt测试程序:

cd matrix/demo/nanopi-status
./build.sh
./run.sh /dev/fb-st7789s

nanopi-status是一个简单的Qt程序,可用于显示系统的基本信息,效果如下:
st7789s-status
脚本run.sh会先加载tft屏的驱动模块然后运行Qt程序,驱动模块加载成功后会生成设备节点/dev/fb-st7789s,下列命令可以确定驱动模块是否成功加载:

lsmod
Module                  Size  Used by
fbtft_device           29235  0

在确定tft驱动模块已加载的前提下,运行下列命令可以显示三原色:

cd matrix/demo/matrix-lcdtest
make
export LCDSET_FB_DEV=/dev/fb-st7789s
./matrix-lcdtest

三原色可以呈现出屏幕的最佳显示效果。

1.2 在2.8寸屏上显示Debian桌面

对于支持Debian系统的开发板,用户可以通过下列操作将Debian的桌面显示在2.8寸屏上。

启动开发板并运行Debian系统,进入系统后克隆Matrix代码仓库:

$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git

克隆完成后会得到一个名为matrix的目录。

对于H3系列的开发板,需要先修改X11的配置文件:

$ vi /etc/X11/xorg.conf

将字样“/dev/fb0”修改为“/dev/fb-st7789s”。

执行下列命令在2.8寸屏上启动Debian桌面:

$ cd matrix/demo/nanopi-status/
$ ./display-debian.sh /dev/fb-st7789s

用触摸笔在屏幕上点击4个点完成校准并进入Debian桌面,效果如下:
fbtft-debian

完成触摸校准后终端会有类似如下的打印信息:

Section "InputClass" 
        Identifier      "calibration" 
        MatchProduct    "ADS7846 Touchscreen" 
        Option  "Calibration"   "196 3825 3887 358" 
        Option  "SwapAxes"      "0" 
EndSection

将上述内容手动保存在/usr/share/X11/xorg.conf.d/99-calibration.conf中,以后就再也无需进行校准了。