I am using the Adafruit__GC9A01A library and I believe it is using the software spi with my esp32-s3.
Am I wanting to test out using hardware spi to see if the slow redraw rate im notincing can be improved.
How can I properly set the default pins for the esp32-s3 board in platformio to be picked up, or, how can I modify the adafruit library to use my pins for hardware spi?
Below is some things ive tried:
with this code, everything works (with SWSPI I believe)
#define MISO -1
#define SCLK 4
#define MOSI 5
#define RES 6
#define DC 7
#define CS 15
Adafruit_GC9A01A tft(CS, DC, MOSI, SCLK, RES, MISO);
but when I try to use the contructor for hardware spi
SPIClass mySPI(HSPI);
Adafruit_GC9A01A tft(&mySPI, DC, CS, RES);
I get errors
“HSPI Does not have default pins on ESP32S3!”
I tried setting the pins MOSI, and SCK in the esp32-hal-spi.c file, and while it compiles the device still does not work.
I can see in the constructor that software spi is used with the first contructor
Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc,
int8_t mosi, int8_t sck, int8_t rst,
int8_t miso)
: Adafruit_GFX(w, h), connection(TFT_SOFT_SPI), _rst(rst), _cs(cs),
_dc(dc) {
so I wanted to test hardware spi but I dont know how to properly implement that.
I believe I need to pass a pointer with the second option.
I see that it calls in “Adafruit_SPITFT.cpp”
void Adafruit_SPITFT::initSPI(uint32_t freq, uint8_t spiMode) {
and I added a serial.print to confirm the code is hit, so I can I pass the pins im using to the pointer I passed
Serial.println("Hardware spi woooo");
hwspi._spi->begin(4, -1, 5, 5);
but that still doesnt seem to work.
I also tried updated the code in the esp32-hal-spi.c file where the error is coming from, to set the MOSI and CLK pins but that didnt seem to work either.