Skip to content

TFT Command Line Tool for Raspberry Pi/Orange Pi

Notifications You must be signed in to change notification settings

hilam8899/wiringpi-tft-tool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wiringpi-tft-tool

TFT Command Line Tool for Raspberry Pi/Orange Pi

You can operate from command line.
You can show any text string.
You can choose BCM2835 library/WiringPi(WiringOp) library.

I tested these TFT.

SPI 128x128 ST7735
SPI 128x160 ST7735
SPI 240x320 ILI9340
SPI 240x320 ILI9341

8bit Parallel 240x320 ILI9325
8bit Parallel 240x400 ILI9327
8bit Parallel 240x320 ILI9341
8bit Parallel 240x320 ILI9342
8bit Parallel 320x480 ILI9481
8bit Parallel 240x320 SPFD5408
8bit Parallel 240x320 S6D1121
8bit Parallel 240x320 R61505U
8bit Parallel 240x400 R61509V
8bit Parallel 240x320 ST7781


Left to Right
2.2 inch SPI 240x320 ILI9340
1.44 inch SPI 128x128 ST7735
1.8 inch SPI 128x160 ST7735

spi-tft-display-1

spi-tft-display-2

spi-tft-display-3


From Left Top to Right Buttom.
2.4 inch 8Bit Parallel 240x320 ILI9341
3.5 inch 8Bit Parallel 320x480 ILI9181
2.4 inch 8Bit Parallel 240x320 ILI9325
3.6 inch 8Bit Parallel 240x400 ILI9327

8bit-tft-1


Wirering for SPI TFT

TFT Rpi/OPI
MISO -- N/C
LED -- 3.3V
SCK -- Pin#23(SPI SCLK)
MOSI -- Pin#19(SPI MOSI)
RS -- Pin#3(*)
RST -- Pin#5(*)
CS -- Pin#24(SPI CE0)(**)
GND -- GND
VCC -- 3.3V

*You can change any pin.
**You can choose CE0 or CE1.
Pin define is "spi.conf".

Note:
Opi have only 1 SPI.
OPi-PC have CE0 and GPIO8.
OPi ZERO have CE1 and GPIO8.


Wirering for 8bit Parallel TFT

TFT Rpi/Opi
LCD_RST -- Pin#7
LCD_CS -- Pin#3
LCD_RS -- Pin#5
LCD_WR -- Pin#26
LCD_RD -- Pin#28
LCD_D0 -- Pin#29
LCD_D1 -- Pin#31
LCD_D2 -- Pin#33
LCD_D3 -- Pin#35
LCD_D4 -- Pin#37
LCD_D5 -- Pin#32
LCD_D6 -- Pin#36
LCD_D7 -- Pin#38
5V -- 5V(*)
3.3V -- 3.3V(*)
GND -- GND

*When a regulator(It's often AMS1117) is mounted on the back, it's operated 5V.
*When a regulator is NOT mounted on the back, it's operated 3.3V.

You can change any pin.
Pin define is "pin.conf".


Build for SPI TFT using BCM2835 library

RPi Only, Very fast

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.42.tar.gz   
tar zxvf bcm2835-1.42.tar.gz   
cd bcm2835-1.42   
./configure   
make   
sudo make check   
sudo make install   
cd $HOME   
git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c spilib.c -lbcm2835 -lm -lpthread -DSPI -DBCM   

Build for SPI TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c spilib.c -lwiringPi -lm -lpthread -DSPI -DWPI

Build for 8bit Parallel ILI9325 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DILI9325   

Build for 8bit Parallel ILI9327 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DILI9327   

Build for 8bit Parallel ILI9341 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DILI9341   

Build for 8bit Parallel ILI9342 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DILI9342   

Build for 8bit Parallel ILI9481 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DILI9481   

Build for 8bit Parallel SPFD5408 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DSPFD5408   

Build for 8bit Parallel S6D1121 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DS6D1121   

Build for 8bit Parallel R61505U TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DR61505U   

Build for 8bit Parallel R61509V TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DR61509V   

Build for 8bit Parallel ST7781 TFT using WiringPi/WiringOp library

Both of RPi/OPi

git clone https://github.com/nopnop2002/wiringpi-tft-tool   
cd wiringpi-tft-tool   
cc -o tft tft.c fontx.c 8bitlib.c -lwiringPi -lm -lpthread -DST7781   

How to use

At first, edit "tft.conf".
Set your TFT's resolution.

If you use SPI TFT, check "spi.conf".
Set your pin assignment.

If you use 8bit Parallel TFT, check "pin.conf".
Set your pin assignment.


Command line parameters

s : show display(must root or sudo)
r : remove all string +n String : String for #n line
-n : delete #n line
Fn : set fore ground color for #n line
Bn : set back ground color for #n line
B0 : set base color(Default is WHITE)
+U n : Set underline mode #n Line
-U n : Unset underline mode #n Line
+L : Scroll Up 1Line
-L : Scroll Down 1Line
Pn n : Set start colum n to line#n
16 : draw 16 dot fonts
24 : draw 24 dot fonts
32 : draw 32 dot fonts
R0 : set angle 0
R90 : set angle 0
R180 : set angle 0
R270 : set angle 0
M : show build model
P : show pin assignment


Start Demo

chmod 777 test.sh
./test.sh


OrangePi
tft-opi

RaspberryPi
tft-rpi

About

TFT Command Line Tool for Raspberry Pi/Orange Pi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.1%
  • Shell 1.9%