-
Notifications
You must be signed in to change notification settings - Fork 297
Open
Description
I've managed to get my ST7789V based display working almost correctly, however, I noticed the cursor was disappearing off of the right hand side of the screen. I used the command:
xdpyinfo | grep -oP 'dimensions:\s+\K\S+'
Which reports that my resolution is 960x320. 960 is a multiple of both 320 and 240 so I must have messed up a setting somewhere.
The display I am using is the Phoenix Contact 1226370.
Below are the changes I made to the files. This is on a fresh install of Raspbian on a CM4 plugged into the IO board. Ignore the [!], these aren't in the code, I just used them for syntax highlighting.
- config.h:
// If defined, rotates the display 180 degrees. This might not rotate the panel scan order though,
// so adding this can cause up to one vsync worth of extra display latency. It is best to avoid this and
// install the display in its natural rotation order, if possible.
! #define DISPLAY_ROTATE_180_DEGREES
// If defined, displays in landscape. Undefine to display in portrait.
! //#define DISPLAY_OUTPUT_LANDSCAPE- st7735r.h:
#if defined(ST7789) || defined(ST7789VW)
#define DISPLAY_NATIVE_WIDTH 240
!#define DISPLAY_NATIVE_HEIGHT 320- st7735r.cpp:
#endif
! madctl ^= MADCTL_COLUMN_ADDRESS_ORDER_SWAP;
SPI_TRANSFER(0x36/*MADCTL: Memory Access Control*/, madctl);
usleep(10*1000);- st7735r.cpp:
#ifdef ST7789
// The ST7789 controller is actually a unit with 320x240 graphics memory area, but only 240x240 portion
// of it is displayed. Therefore if we wanted to swap row address mode above, writes to Y=0...239 range will actually land in
// memory in row addresses Y = 319-(0...239) = 319...80 range. To view this range, we must scroll the view by +80 units in Y
// direction so that contents of Y=80...319 is displayed instead of Y=0...239.
if ((madctl & MADCTL_ROW_ADDRESS_ORDER_SWAP))
! SPI_TRANSFER(0x37/*VSCSAD: Vertical Scroll Start Address of RAM*/, 0, 0);
#endif- /boot/config.txt:
!hdmi_group=2
!hdmi_mode=87
!hdmi_cvt=240 320 60 1 0 0 0
!hdmi_force_hotplug=1
- /etc/rc.local
sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &
The cmake command I used was:
cmake -DST7789VW=ON -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=27 -DSPI_BUS_CLOCK_DIVISOR=8 -DSTATISTICS=0 ..
Thank you in advance.
Metadata
Metadata
Assignees
Labels
No labels