I had to hard code SPI_MODE3 into Adafruit_ST7789.cpp. I couldn't find a way to set it. After I hardcoded, the example program runs fine.
Is there a way to set it?
mega 2560. hardware spi.
// Here's the code I set in Adafruit_ST7789.cpp
void Adafruit_ST7789::init(uint16_t width, uint16_t height, uint8_t mode) {
// Save SPI data mode. commonInit() calls begin() (in Adafruit_ST77xx.cpp),
// which in turn calls initSPI() (in Adafruit_SPITFT.cpp), passing it the
// value of spiMode. It's done this way because begin() really should not
// be modified at this point to accept an SPI mode -- it's a virtual
// function required in every Adafruit_SPITFT subclass and would require
// updating EVERY such library...whereas, at the moment, we know that
// certain ST7789 displays are the only thing that may need a non-default
// SPI mode, hence this roundabout approach...
//spiMode = mode;
spiMode = SPI_MODE3; // <--- Hard coded
// case-by-case basis.)