juj / fbcp-ili9341

A blazing fast display driver for SPI-based LCD displays for Raspberry Pi A, B, 2, 3, 4 and Zero
MIT License
1.61k stars 267 forks source link

Support for Adafruit Mini PiTFT 1.14" (240x135) - ST7789 #258

Open leonpierre opened 2 years ago

leonpierre commented 2 years ago

Is this display already supported and if yes which cmake options / modifications do I need?

Thx

juj commented 2 years ago

ST7789 has been tested with this driver, but that particular display with 240x135 has not been. Try compiling following the ST7789 instructions, and edit this line https://github.com/juj/fbcp-ili9341/blob/4aa3b97f4d295e3301651bd3dc3d314b25f2531e/st7735r.h#L20 to adjust for 135 pixels height.

leonpierre commented 2 years ago

Tried it with:

cmake -DST7789=ON -DSPI_BUS_CLOCK_DIVISOR=6 -DARMV6Z=ON -DSTATISTICS=0 -DGPIO_TFT_DATA_CONTROL=24 -DUSE_DMA_TRANSFERS=OFF ..

and your suggested changes in st7735r.h

Output: sudo ./fbcp-ili9341 bcm_host_get_peripheral_address: 0x20000000, bcm_host_get_peripheral_size: 33554432, bcm_host_get_sdram_address: 0x40000000 BCM core speed: current: 400000000hz, max turbo: 400000000hz. SPI CDIV: 6, SPI max frequency: 66666667hz Initializing display InitSPI done Relevant source display area size with overscan cropped away: 720x480. Source GPU display is 720x480. Output SPI display is 240x135 with a drawable area of 240x135. Applying scaling factor horiz=0.28x & vert=0.28x, xOffset: 18, yOffset: 0, scaledWidth: 203, scaledHeight: 135 Creating dispmanX resource of size 203x135 (aspect ratio=1.503704). GPU grab rectangle is offset x=0,y=0, size w=203xh=135, aspect ratio=1.503704 All initialized, now running main loop...

the screen flicker a little bit and stays black with no output or a corrupted output! Link: https://imgur.com/a/AJYsSip