I think this is the right section. I'm trying to connect a 240x320 TFT LCD module to my pi. I think it's mainly designed for Arduino, but i was hoping to get it working on pi..
I have found notro's fbtft repo which in theory had support for the ili9325 IC my module uses: https://github.com/notro/fbtft/blob/master/fb_ili9325.c
However, the repo is apparently now out of date and I need a .dtb file. Does anyone know if one already exists - specifically for the 8-bit parallel interface? There is SPI options around, but my board doesn't seem to break those pins out.
Otherwise, is it possible to convert the above C file into the needed .dtb file?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5300
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: .dtb file for ili9325 supporting 8-bit parallel bus?
The standard "hy28b" overlay uses the ili9325. The documentation for it says:
Code: Select all
Name: hy28b
Info: HY28B - 2.8" TFT LCD Display Module by HAOYU Electronics
Default values match Texy's display shield
Usage: dtoverlay=hy28b,<param>=<val>
Params: speed Display SPI bus speed
rotate Display rotation {0,90,180,270}
fps Delay between frame updates
debug Debug output level {0-7}
xohms Touchpanel sensitivity (X-plate resistance)
resetgpio GPIO used to reset controller
ledgpio GPIO used to control backlight
Re: .dtb file for ili9325 supporting 8-bit parallel bus?
I couldn't find a known working example, but a Device Tree overlay would look something like this:
reset,dc and led-gpios are optional from the driver point of view. debug=7 gives a lot of info in the kernel log to help debug any issues.
Be aware that this will be a lot slower than using the SPI bus. gpio bitbanging is slow. SPI has the added benefit of using dma.
Code: Select all
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/soc";
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
display@0{
compatible = "ilitek,ili9325";
buswidth = <8>;
reset-gpios = = <&gpio n 0>;
dc-gpios = <&gpio n 0>;
wr-gpios = <&gpio n 0>;
db-gpios = <&gpio n 0>, /* db0 */
<&gpio n 0>, /* db1 */
<&gpio n 0>, /* db2 */
<&gpio n 0>, /* db3 */
<&gpio n 0>, /* db4 */
<&gpio n 0>, /* db5 */
<&gpio n 0>, /* db6 */
<&gpio n 0>; /* db7 */
led-gpios = <&gpio n 0>;
debug = <7>;
};
};
};
};
Be aware that this will be a lot slower than using the SPI bus. gpio bitbanging is slow. SPI has the added benefit of using dma.