ST77889 (1.14" LCD) library on MegacoreX Arduino

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
kscharf
 
Posts: 277
Joined: Wed Sep 10, 2008 10:29 am

ST77889 (1.14" LCD) library on MegacoreX Arduino

Post by kscharf »

I'm trying to use the 240x135 ST7789 display with the Adafruit_ST7789 library on an atmega4809 with the MegacoreX arduino package (https://github.com/MCUdude/MegaCoreX). This arduino core adds a method to the SPI library to swap the SPI pins via the pinmux. The method is bool SPI:swap(i) where i is 0,1 or 2 for the defaut and two alternate pin mappings. I tried to compile the graphicstest example and it does compile if I don't call SPI.swap();, calling this function returns an error message that SPI.swap is undefined.
The spi.h file DOES automatically instantiate the SPIclass as an SPI object, and this method does exist in the core libraries for the atmega4809.
I suspect that the Adafruit_ST7789 library extends the SPI class so that the default instantiation of SPI is overridden and I can no longer call the SPI.swap() method. Even worse, the overridden SPI class may now be a private member of a higher level class used in the ST7789 driver.

I haven't been able to navigate the entire include chain of the busio, GFX, and other included classes used by the ST7789 library to find the SPI object actually being used in the hware spi constructor case. Does anybody know how to call the pin swap() (pin mux) method in the MegaCorex core version of the SPI support library, or does the Adafruit extension of the Arduino SPI support need to be hacked? I'd like to get this library to work with the ATmega4809.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”