Difference between revisions of "Matrix - 2'8 SPI TFT"

From FriendlyELEC WiKi
Jump to: navigation, search
Line 1: Line 1:
 
[[Matrix - SPI TFT/zh|查看中文]]
 
[[Matrix - SPI TFT/zh|查看中文]]
  
==介绍==
+
==Introduction==
 
[[File:Matrix-SPI_TFT.png|thumb|]]
 
[[File:Matrix-SPI_TFT.png|thumb|]]
 
*
 
*
==特性==
+
==Features==
* PCB尺寸(mm):
+
* PCB dimension(mm):
 
[[File:Matrix-SPI_TFT_PCB.png|frameless|400px|]]
 
[[File:Matrix-SPI_TFT_PCB.png|frameless|400px|]]
  
* 引脚说明:
+
* Pin Description:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|名称 || 描述
+
|Pin || Description
 
|-
 
|-
 
| ||  
 
| ||  
Line 17: Line 17:
 
|}
 
|}
  
==工作原理==
+
==Basic Device Operation==
  
==下载Matrix源码==
+
==Download Matrix Source Code==
Matrix配件相关的代码是完全开源的,统一由一个仓库进行管理:git://github.com/friendlyarm/matrix.git <br>
+
All the matrix modules' code samples are open source. They are maintained on GitHub - git://github.com/friendlyarm/matrix.git <br>
该仓库里不同的分支代表着Matrix配件所支持的不同开发板。<br>
+
Each branch in this hub contains the matrix modules' code samples for a board that the matrix modules can work with。<br>
* nanopi分支包含了Matrix对NanoPi的支持;
+
* The nanopi branch contains the matrix modules' code samples for the NanoPi
* tiny4412分支包含了Matrix对Tiny4412的支持;
+
* the tiny4412 branch contains the matrix modules' code samples for the Tiny4412
* raspberrypi分支包含了Matrix对RaspberryPi的支持;
+
* the raspberrypi branch contains the matrix modules' code samples for the RaspberryPi
  
在主机PC上安装git,以Ubuntu14.04为例
+
Please follow the steps below to get the source code: <br>
 +
Install the git utility on a PC running Ubuntu14.04
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ sudo apt-get install git
 
$ sudo apt-get install git
 
</syntaxhighlight>
 
</syntaxhighlight>
  
克隆Matrix配件代码仓库
+
Clone the matrix code from GitHub
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ git clone git://github.com/friendlyarm/matrix.git
 
$ git clone git://github.com/friendlyarm/matrix.git
 
</syntaxhighlight>
 
</syntaxhighlight>
克隆完成后会得到一个matrix目录,里面存放着所有Matrix配件的代码。
+
If this is successful a "matrix" directory will be generated, which will contain all the matrix modules' code samples.
  
==与NanoPi连接使用==
+
==Connect to NanoPi==
===准备工作===
+
===Preparations===
在NanoPi上运行Debian系统,然后在主机PC上安装并使用相应的编译器。参考wiki:[[NanoPi/zh|NanoPi]] <br>
+
Please install a Debian on a NanoPi and an appropriate cross compiler on a PC. Please refer to wiki:[[NanoPi/zh|NanoPi]] <br>
注意:必须使用nanopi-v4.1.y-matrix分支编译出来的内核。<br>
+
Compile a NanoPi kernel. Note: please use the kernel's source code from the nanopi-v4.1.y-matrix branch. <br>
下载NanoPi内核源代码并编译
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ git clone https://github.com/friendlyarm/linux-4.x.y.git
 
$ git clone https://github.com/friendlyarm/linux-4.x.y.git

Revision as of 07:39, 30 September 2015

查看中文

1 Introduction

2 Features

  • PCB dimension(mm):

File:Matrix-SPI TFT PCB.png

  • Pin Description:
Pin Description

3 Basic Device Operation

4 Download Matrix Source Code

All the matrix modules' code samples are open source. They are maintained on GitHub - git://github.com/friendlyarm/matrix.git
Each branch in this hub contains the matrix modules' code samples for a board that the matrix modules can work with。

  • The nanopi branch contains the matrix modules' code samples for the NanoPi
  • the tiny4412 branch contains the matrix modules' code samples for the Tiny4412
  • the raspberrypi branch contains the matrix modules' code samples for the RaspberryPi

Please follow the steps below to get the source code:
Install the git utility on a PC running Ubuntu14.04

$ sudo apt-get install git

Clone the matrix code from GitHub

$ git clone git://github.com/friendlyarm/matrix.git

If this is successful a "matrix" directory will be generated, which will contain all the matrix modules' code samples.

5 Connect to NanoPi

5.1 Preparations

Please install a Debian on a NanoPi and an appropriate cross compiler on a PC. Please refer to wiki:NanoPi
Compile a NanoPi kernel. Note: please use the kernel's source code from the nanopi-v4.1.y-matrix branch.

$ git clone https://github.com/friendlyarm/linux-4.x.y.git
$ cd linux-4.x.y
$ git checkout nanopi-v4.1.y-matrix
$ make nanopi_defconfig
$ touch .scmversion
$ make

5.2 硬件连接

参考下图连接模块Matrix-SPI_TFT和NanoPi
Matrix-SPI_TFT_nanopi

连接说明:

Matrix-SPI_TFT NanoPi

5.3 加载驱动模块

启动NanoPi,在其Debian的shell终端上加载芯片对应的驱动模块

$ modprobe fbtft_device name=matrix-spi_tft gpios=dc:161,reset:162,cs:163
$ modprobe matrix_ads7846

模块fbtft_device是芯片ili9341的驱动,模块matrix_ads7846是芯片xpt2046的驱动

5.4 安装软件包

在NanoPi的shell终端上安装软件包qtembedded和matrix-tslib

$ apt-get update
$ apt-get install qtembedded
$ apt-get install matrix-tslib

qtembedded是qt相关的库,matrix-tslib则用于触摸屏校准。

5.5 运行测试程序

启动Qt应用程序

$ . /usr/bin/matrix-setqt4env
$ /usr/local/Trolltech/QtEmbedded-4.8.5-arm/examples/tetrix -qws

matrix-setqt4env用于设置环境变量,第一次运行该脚本时,会出现触摸校准的界面,根据提示点击5个点后完成校准。 tetrix是一个qt4编写俄罗斯方块小游戏,点击start按钮后就可以开始娱乐了。

6 与Tiny4412连接使用

7 与RaspberryPi连接使用

8 与Arduino连接使用

9 相关资料