moononournation / Arduino_GFX

Arduino GFX developing for various color displays and various data bus interfaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arduino_AXS15231B driver exception

TopgunZh opened this issue · comments

I try to use Arduino_GFX that driver my 172x640 qspi display. But it doesn't work properly.
datasheet: https://tailorpixels.com/product/3-48-touch-lcd-172x640-mipi-rgb-mcu-spi/

The following is my test code and test phenomenon. I hope you can help me solve the problem.
1.

#include <Arduino.h>
#include <Arduino_GFX_Library.h>

#define LCD_CS 15
#define LCD_SCLK 5
#define LCD_SDIO0 7
#define LCD_SDIO1 16
#define LCD_SDIO2 42
#define LCD_SDIO3 2
#define LCD_RST 6
#define TFT_BL  4

#define LCD_WIDTH 172
#define LCD_HEIGHT 640

Arduino_DataBus *bus = new Arduino_ESP32QSPI(
    LCD_CS /* CS */, LCD_SCLK /* SCK */, LCD_SDIO0 /* SDIO0 */,
    LCD_SDIO1 /* SDIO1 */, LCD_SDIO2 /* SDIO2 */, LCD_SDIO3 /* SDIO3 */);

Arduino_GFX *gfx = new Arduino_AXS15231B(bus, LCD_RST /* RST */, 0 /* rotation */,
                                        false /* IPS */, LCD_WIDTH, LCD_HEIGHT, 0, 0, 0, 0);

void setup() {
  // put your setup code here, to run once:
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(LCD_RST, HIGH);
  delay(2);
  digitalWrite(LCD_RST, LOW);
  delay(100);
  digitalWrite(LCD_RST, HIGH);
  delay(2);

  digitalWrite(TFT_BL, HIGH);
  gfx->begin();
  gfx->fillScreen(BLACK);
  gfx->setCursor(10, 10);
  gfx->setTextColor(RED);
  gfx->println("Hello World!");

}

void loop() {
  // put your main code here, to run repeatedly:
}

As shown below, the font cannot be displayed.
1794784447

#include <Arduino.h>
#include <Arduino_GFX_Library.h>

#define LCD_CS 15
#define LCD_SCLK 5
#define LCD_SDIO0 7
#define LCD_SDIO1 16
#define LCD_SDIO2 42
#define LCD_SDIO3 2
#define LCD_RST 6
#define TFT_BL  4

#define LCD_WIDTH 172
#define LCD_HEIGHT 640

Arduino_DataBus *bus = new Arduino_ESP32QSPI(
    LCD_CS /* CS */, LCD_SCLK /* SCK */, LCD_SDIO0 /* SDIO0 */,
    LCD_SDIO1 /* SDIO1 */, LCD_SDIO2 /* SDIO2 */, LCD_SDIO3 /* SDIO3 */);

Arduino_GFX *gfx = new Arduino_AXS15231B(bus, LCD_RST /* RST */, 0 /* rotation */,
                                        false /* IPS */, LCD_WIDTH, LCD_HEIGHT, 0, 0, 0, 0);

void setup() {
  // put your setup code here, to run once:
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(LCD_RST, HIGH);
  delay(2);
  digitalWrite(LCD_RST, LOW);
  delay(100);
  digitalWrite(LCD_RST, HIGH);
  delay(2);

  digitalWrite(TFT_BL, HIGH);
  gfx->begin();
  gfx->fillScreen(BLACK);
  gfx->fillRect(80, 80, 50, 50, RED);

}

void loop() {
  // put your main code here, to run repeatedly:
}

As shown below, The drawn box does not start from x=80 y=80, but from x=0 y=0.
1605882003
3.

#include <Arduino.h>
#include <Arduino_GFX_Library.h>

#define LCD_CS 15
#define LCD_SCLK 5
#define LCD_SDIO0 7
#define LCD_SDIO1 16
#define LCD_SDIO2 42
#define LCD_SDIO3 2
#define LCD_RST 6
#define TFT_BL  4

#define LCD_WIDTH 172
#define LCD_HEIGHT 640

Arduino_DataBus *bus = new Arduino_ESP32QSPI(
    LCD_CS /* CS */, LCD_SCLK /* SCK */, LCD_SDIO0 /* SDIO0 */,
    LCD_SDIO1 /* SDIO1 */, LCD_SDIO2 /* SDIO2 */, LCD_SDIO3 /* SDIO3 */);

Arduino_GFX *gfx = new Arduino_AXS15231B(bus, LCD_RST /* RST */, 1 /* rotation */,
                                        false /* IPS */, LCD_WIDTH, LCD_HEIGHT, 0, 0, 0, 0);    // set 90° rotation

void setup() {
  // put your setup code here, to run once:
  pinMode(TFT_BL, OUTPUT);
  digitalWrite(LCD_RST, HIGH);
  delay(2);
  digitalWrite(LCD_RST, LOW);
  delay(100);
  digitalWrite(LCD_RST, HIGH);
  delay(2);

  digitalWrite(TFT_BL, HIGH);
  gfx->begin();
  gfx->fillScreen(BLACK);
  gfx->fillRect(80, 80, 50, 50, RED);

}

void loop() {
  // put your main code here, to run repeatedly:
}

As shown below, setting the screen to rotate 90 degrees and 270 degrees will display abnormally, while rotating the screen 180 degrees will display normally..
1519919202

Yes, as show in PDQgraphicstest.ino example, you need a canvas in the middle.