nopnop2002 / raspberry-ili9325 Goto Github PK
View Code? Open in Web Editor NEWParallel TFT Shield Library for wiringPi
Parallel TFT Shield Library for wiringPi
where did you get this init code?
init=\ -1,0x00E3,0x3008,-1,0x00E7,0x0012,-1,0x00EF,0x1231,\ -1,0x0001,0x0100,-1,0x0002,0x0700,-1,0x0003,0x1030,\ -1,0x0004,0x0000,-1,0x0008,0x0207,-1,0x0009,0x0000,\ -1,0x000A,0x0000,-1,0x000C,0x0000,-1,0x000D,0x0000,\ -1,0x000F,0x0000,-1,0x0010,0x0000,-1,0x0011,0x0007,\ -1,0x0012,0x0000,-1,0x0013,0x0000,-2,200,\ -1,0x0010,0x1690,-1,0x0011,0x0223,-2,50,\ -1,0x0012,0x000D,-2,50,-1,0x0013,0x1200,\ -1,0x0029,0x000A,-1,0x002B,0x000C,-2,50,\ -1,0x0020,0x0000,-1,0x0021,0x0000,-1,0x0030,0x0000,\ -1,0x0031,0x0506,-1,0x0032,0x0104,-1,0x0035,0x0207,\ -1,0x0036,0x000F,-1,0x0037,0x0306,-1,0x0038,0x0102,\ -1,0x0039,0x0707,-1,0x003C,0x0702,-1,0x003D,0x1604,\ -1,0x0050,0x0000,-1,0x0051,0x00EF,-1,0x0052,0x0000,\ -1,0x0053,0x013F,-1,0x0060,0xA700,-1,0x0061,0x0001,\ -1,0x006A,0x0000,-1,0x0080,0x0000,-1,0x0081,0x0000,\ -1,0x0082,0x0000,-1,0x0083,0x0000,-1,0x0084,0x0000,\ -1,0x0085,0x0000,-1,0x0090,0x0010,-1,0x0092,0x0600,\ -1,0x0007,0x0133,-3
ive been trying for 3 days to get this screen to work when i first use the commands for modprobe it will turn the screen black (but its always black) and then it will just flash ... i suspect the init codes are wrong or i have an ili 9325 (C) or (D) which are newer revisions that have different init sequences.i also cant figure out how this init sequecen works how does the system know which part of the variables is the command and which is the data...
Im getting a problem with wiringpi. It says it cant be found, and its not installed on my pi 3. I cant install it.
This is the error i get.
make ILI9341
cc -c -o driver/ili9225.o driver/ili9225.c
cc -c -o driver/ili9320.o driver/ili9320.c
cc -c -o driver/ili9325.o driver/ili9325.c
cc -c -o driver/ili9327.o driver/ili9327.c
cc -c -o driver/ili9341.o driver/ili9341.c
cc -c -o driver/ili9342.o driver/ili9342.c
cc -c -o driver/ili9481.o driver/ili9481.c
cc -c -o driver/ili9486.o driver/ili9486.c
cc -c -o driver/ili9488.o driver/ili9488.c
cc -c -o driver/lgdp4532.o driver/lgdp4532.c
cc -c -o driver/r61509.o driver/r61509.c
cc -c -o driver/s6d1121.o driver/s6d1121.c
cc -c -o driver/st7781.o driver/st7781.c
ar crv driver.a driver/ili9225.o driver/ili9320.o driver/ili9325.o driver/ili9327.o driver/ili9341.o driver/ili9342.o driver/ili9481.o driver/ili9486.o driver/ili9488.o driver/lgdp4532.o driver/r61509.o driver/s6d1121.o driver/st7781.o
a - driver/ili9225.o
a - driver/ili9320.o
a - driver/ili9325.o
a - driver/ili9327.o
a - driver/ili9341.o
a - driver/ili9342.o
a - driver/ili9481.o
a - driver/ili9486.o
a - driver/ili9488.o
a - driver/lgdp4532.o
a - driver/r61509.o
a - driver/s6d1121.o
a - driver/st7781.o
driver.a make success
cc -c -o tjpgd2/decode_jpeg.o tjpgd2/decode_jpeg.c
cc -c -o tjpgd2/tjpgd.o tjpgd2/tjpgd.c
ar crv jpeg.a tjpgd2/decode_jpeg.o tjpgd2/tjpgd.o
a - tjpgd2/decode_jpeg.o
a - tjpgd2/tjpgd.o
jpeg.a make success
cc -c -o pngle/decode_png.o pngle/decode_png.c
cc -c -o pngle/miniz.o pngle/miniz.c
cc -c -o pngle/pngle.o pngle/pngle.c
ar crv png.a pngle/decode_png.o pngle/miniz.o pngle/pngle.o
a - pngle/decode_png.o
a - pngle/miniz.o
a - pngle/pngle.o
png.a make success
cc -o demo demo.c fontx.c tft_lib.c driver.a jpeg.a png.a -lwiringPi -lm -lpthread -DILI9341
demo.c:10:10: fatal error: wiringPi.h: No such file or directory
10 | #include <wiringPi.h>
| ^~~~~~~~~~~~
compilation terminated.
tft_lib.c:6:10: fatal error: wiringPi.h: No such file or directory
6 | #include <wiringPi.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:58: ILI9341] Error 1
src/ili9340.c:659:25: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
if (h == (ph-2) & _FONT_UNDER_LINE_)
~~~~~~~~~~~~^
src/ili9340.c:659:25: note: place parentheses around the '==' expression to silence this warning
if (h == (ph-2) & _FONT_UNDER_LINE_)
^
( )
src/ili9340.c:659:25: note: place parentheses around the & expression to evaluate it first
if (h == (ph-2) & _FONT_UNDER_LINE_)
^
( )
src/ili9340.c:661:25: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
if (h == (ph-1) & _FONT_UNDER_LINE_)
~~~~~~~~~~~~^
src/ili9340.c:661:25: note: place parentheses around the '==' expression to silence this warning
if (h == (ph-1) & _FONT_UNDER_LINE_)
^
( )
src/ili9340.c:661:25: note: place parentheses around the & expression to evaluate it first
if (h == (ph-1) & _FONT_UNDER_LINE_)
^
( )
src/ili9340.c:626:14: error: variable 'yss' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
} else if (_FONT_DIRECTION_ == 3) {
^~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:641:8: note: uninitialized use occurs here
yy = yss;
^~~
src/ili9340.c:626:10: note: remove the 'if' if its condition is always true
} else if (_FONT_DIRECTION_ == 3) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:593:20: note: initialize the variable 'yss' to silence this warning
uint16_t xss, yss;
^
= 0
src/ili9340.c:626:14: error: variable 'xss' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
} else if (_FONT_DIRECTION_ == 3) {
^~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:642:8: note: uninitialized use occurs here
xx = xss;
^~~
src/ili9340.c:626:10: note: remove the 'if' if its condition is always true
} else if (_FONT_DIRECTION_ == 3) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:593:15: note: initialize the variable 'xss' to silence this warning
uint16_t xss, yss;
^
= 0
src/ili9340.c:702:35: error: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
spos = String2SJIS(utfs, strlen(utfs), sjis, 64);
^~~~
/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t strlen(const char *__s);
^
src/ili9340.c:719:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
}
^
6 errors generated.
Micro py
Hello,
I have successfully run the draw and demo binaries, with ILI9341. At least that's what it says my driver is.
When I try to compile/build the draw, and demo binaries using:
cc -o demo demo.c fontx.c tft_lib.c driver/.c -lwiringPi -lm -lpthread -DILI9341 -DP16BIT
cc -o draw draw.c fontx.c tft_lib.c driver/.c -lwiringPi -lm -lpthread -DILI9341 -DP16BIT
I get following errors:
/usr/bin/ld: /tmp/ccJhYeNu.o: in function
JPEGTest': demo.c:(.text+0x1990): undefined reference to
decode_image'
/usr/bin/ld: demo.c:(.text+0x1b74): undefined reference torelease_image' /usr/bin/ld: /tmp/ccJhYeNu.o: in function
PNGTest':
demo.c:(.text+0x1cac): undefined reference topngle_new' /usr/bin/ld: demo.c:(.text+0x1cbc): undefined reference to
pngle_set_init_callback'
/usr/bin/ld: demo.c:(.text+0x1cc8): undefined reference topngle_set_draw_callback' /usr/bin/ld: demo.c:(.text+0x1cd4): undefined reference to
pngle_set_done_callback'
/usr/bin/ld: demo.c:(.text+0x1cec): undefined reference topngle_set_display_gamma' /usr/bin/ld: demo.c:(.text+0x1d6c): undefined reference to
pngle_feed'
/usr/bin/ld: demo.c:(.text+0x1d84): undefined reference topngle_error' /usr/bin/ld: demo.c:(.text+0x2050): undefined reference to
pngle_destroy'
/usr/bin/ld: demo.c:(.text+0x20a4): undefined reference topng_init' /usr/bin/ld: demo.c:(.text+0x20a8): undefined reference to
png_draw'
/usr/bin/ld: demo.c:(.text+0x20ac): undefined reference to `png_finish'
collect2: error: ld returned 1 exit status
Am I missing something, is it still needed if the binaries provided in the repo are working already?
thank you
Hi,
can you please add a FrameBuffer Setting To ILI9486 to the wiki?
Thanks
Hi.. thanks for awsome library... i have test your library and its work... but i have an issue that the color doesnt show correctly, maybe because i have 16bit data bus (16 pin paralel data) but the library implement just 8 bit data bus (8 pin parallel data). If you have any spare time please add support for 16bit data so the color can show correctly... thanks
Hello,
Firstly, thank you for making this possible and sharing it; I've struggled to gather knowledge on how to make my display work with a Raspberry Pi for long time now.
I was able to run through most of the demo/examples you provided, successfully, apart from the last one with the touch screen.
My issue currently is that I cannot get input from the touch screen. I have compiled the touch binary with the 8BIT parameter, and when I run it, it displays the numbers, but that is pretty much all I can do with it;
I see that in touch.c there is a pin defined for pen input on GPIO 6; I don't understand how that works, or where the input will come from, because my TFT screen does not have a separate pin for the PEN (I have the 8bit parallel version).
Because I have redefined the pins I'm using, I changed the pin in the touch.c file to an "empty" one, like it was initially (or that's how I'm reading it).
Here's my git diff output, to help you understand what I changed:
RST=7
CS=8
RS=9
-WR=11
+WR=5
-RD=31
+RD=6
D0=21
D1=22
D2=23
D3=24
D4=25
-D5=26
+D5=27
-D6=27
+D6=28
-D7=28
+D7=29
#If your TFT is 8 bit Parallel,A definition after this isn't used.
D8=2
D9=3
diff --git a/touch.c b/touch.c
index b559ffb..5eec9ab 100644
--- a/touch.c
+++ b/touch.c
@@ -12,8 +12,8 @@#define SPI_CHANNEL 0 // /dev/spidev0.0
//#define SPI_CHANNEL 1 // /dev/spidev0.1
-#define GPIO_PEN 6
+#define GPIO_PEN 26
-#define DEBUG 0
+#define DEBUG 1
This is the TFT Screen I am using: elegoo 2.8"TFT Touch Screen
Thank you kindly for your effort and feedback, and for making this possible!
Much appreciated!
Stay safe and healthy,
ciobania
Good afternoon, there is a problem again. I can't make a screen with a framebuffer to display the retropie image there.
I followed the instructions from the wiki (https://github.com/nopnop2002/Raspberry-ili9325/wiki/FrameBuffer-Setting-to-ILI9341), but the output is.
I installed the driver according to these instructions, but it didn't work either https://wasa-labo.com/wp/
have kernel: 5.10.103
display ILI9341 and 26 pins raspberry
Hello nopnop2002,
I have been trying to find a way to get my 3.5" ili9486 8 Bit Parallel display to work with my Raspberry Pi. The closest I have been to succeeding is with the drivers I have found in your Raspberry-ili9325.
I initially tried running my screen as an ili9341, this worked to a degree, when I ran ./demo the screen flickered and showed a few rectangles, the word "ili9431" and the centre of some circles. certainly not perfect but better than I had achieved before. the ili9481 drivers didn't seem to be as good.
So I looked at the code in "ili93xx.c", "demo.c", "draw.c" and "pin.conf" and thought it wouldn't be too difficult to include ili9486 as a new display. I think I have succeeded with this but the screen is still not working properly, I get rectangles of the correct size and more colours now, but still not getting the demo I am expecting. I seem to be able to make it worse and better by changing the init sequence.
The init sequence I am using is one I found in your file "STM32_TFT_8bit.cpp", I wonder if you had any ideas on what parameters would be worth tweaking to try and get this screen working?
Many thanks
// ILI9486
} else if (_model == 0x9486) {
static const uint8_t regValues[] = {
0xC0, 2, 0x0d, 0x0d, //Power Control 1 [0E 0E]
0xC1, 2, 0x43, 0x00, //Power Control 2 [43 00]
0xC2, 1, 0x00, //Power Control 3 [33]
0xC5, 4, 0x00, 0x48, 0x00, 0x48, //VCOM Control 1 [00 40 00 40]
0xB4, 1, 0x00, //Inversion Control [00]
0xB6, 3, 0x02, 0x02, 0x3B, // Display Function Control [02 02 3B]
0xE0, 15, 0x0F, 0x1F, 0x1C, 0x0C, 0x0F, 0x08, 0x48, 0x98, 0x37, 0x0A, 0x13, 0x04, 0x11, 0x0D, 0x00,
0xE1, 15, 0x0F, 0x32, 0x2E, 0x0B, 0x0D, 0x05, 0x47, 0x75, 0x37, 0x06, 0x10, 0x03, 0x24, 0x20, 0x00,
};
init_table(reset_off, sizeof(reset_off));
init_table(regValues, sizeof(regValues));
init_table(wake_on, sizeof(wake_on));
Good afternoon, I am trying to connect an Arduino LCD Shield with ILI9341 to a Raspberry Pi model A, but it does not work.
Your schematic uses the full comb of pins from the RPi model 3, so I reassigned the pins to those of my RPi version.
Unfortunately, I always get a picture like the one in the picture.
Below in the schematic and in the config pins.confiring the pins I used:
#Number is WiringPi Number(NOT GPIO Number)
RST=7
CS=8
RS=9
WR=11
RD=10
D0=0
D1=2
D2=3
D3=4
D4=5
D5=6
D6=12
D7=13
#If your TFT is 8 bit Parallel,A definition after this isn't used.
D8=2
D9=3
D10=4
D11=5
D12=15
D13=16
D14=29
D15=30
My LCD module looks like this:
I have tried reassigning the pins several times, but I either get the same thing as above, or just a white screen.
I really need your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.