ILI9225 SPI TFT Library for RaspberryPi/OrangePi
ILI9225 SPI TFT Library for RaspberryPi/OrangePi.
This library can show a chart to ILI9225 SPI TFT.
Wirering
TFT | Rpi/Opi | |
---|---|---|
CS | -- | Pin#24(SPI CE0) |
RST | -- | Pin#5(*) |
DC | -- | Pin#3(*) |
SDA | -- | Pin#19(SPI MOSI) |
CLK | -- | Pin#23(SPI SCLK) |
GND | -- | GND |
5V | -- | 5V |
(*) This is default. If you want to use other pin, You have to change this.
#define D_C 2 // GPIO2(Pin#3)
#define RST 3 // GPIO3(Pin#5)
build with bcm2835 library (very fast)
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.56.tar.gz
tar zxvf bcm2835-1.56.tar.gz
cd bcm2835-1.56
./configure
make
sudo make check
sudo make install
cd $HOME
* This tool require 1.56 or later. * Because this tool uses bcm2835_spi_write.
git clone https://github.com/nopnop2002/Raspberry-ili9225spi
cd Raspberry-ili9225spi
cc -o demo demo.c fontx.c ili9225.c -lbcm2835 -lm -lpthread
sudo ./demo
ColorBarTest elapsed time[ms]=61
ArrowTest elapsed time[ms]=71
LineTest elapsed time[ms]=133
CircleTest elapsed time[ms]=127
RoundRectTest elapsed time[ms]=123
DirectionTest elapsed time[ms]=70
HorizontalTest elapsed time[ms]=101
VerticalTest elapsed time[ms]=99
FillRectTest elapsed time[ms]=129
ColorTest elapsed time[ms]=122
build with wiringPi library (very slow)
git clone https://github.com/nopnop2002/Raspberry-ili9225spi
cd Raspberry-ili9225spi
cc -o demo demo.c fontx.c ili9225.c -lwiringPi -lm -lpthread -DWPI
sudo ./demo
ColorBarTest elapsed time[ms]=140
ArrowTest elapsed time[ms]=536
LineTest elapsed time[ms]=3157
CircleTest elapsed time[ms]=2764
RoundRectTest elapsed time[ms]=2746
DirectionTest elapsed time[ms]=480
HorizontalTest elapsed time[ms]=1399
VerticalTest elapsed time[ms]=1314
FillRectTest elapsed time[ms]=776
ColorTest elapsed time[ms]=278