Matrix - 2'8 SPI TFT
Contents
1 Introduction
2 Features
- PCB dimension(mm):
- 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 Hardware Connection
Please refer to the following connection diagram to connect the Matrix-SPI_TFT to the NanoPi
Matrix-SPI_TFT_nanopi
Connection Details:
Matrix-SPI_TFT | NanoPi |
5.3 Load Driver
Power on the NanoPi and run the following command in Debian's terminal to load drivers:
$ modprobe fbtft_device name=matrix-spi_tft gpios=dc:161,reset:162,cs:163 $ modprobe matrix_ads7846
The "fbtft_device" module is the driver for the ili9341 chip and the "matrix_ads7846" module is the driver for the xpt2046 chip.
5.4 Install Package
Please run the following commands in Debian's terminal to install "qtembedded" and "matrix-tslib"
$ apt-get update $ apt-get install qtembedded $ apt-get install matrix-tslib
The "qtembedded" library is what qt applications rely on and the "matrix-tslib" library is what screen calibration relies on.
5.5 运行测试程序
启动Qt应用程序
$ . /usr/bin/matrix-setqt4env $ /usr/local/Trolltech/QtEmbedded-4.8.5-arm/examples/tetrix -qws
matrix-setqt4env用于设置环境变量,第一次运行该脚本时,会出现触摸校准的界面,根据提示点击5个点后完成校准。 tetrix是一个qt4编写俄罗斯方块小游戏,点击start按钮后就可以开始娱乐了。