From 188f238fbc3b51430a06149a3b58fe9eba54738f Mon Sep 17 00:00:00 2001 From: Buger Date: Mon, 1 Nov 2021 18:13:10 +0100 Subject: [PATCH 1/3] variables for pin definitions changed from int8_t to int16_t to make this comatible with stm32duino (tested using 2.1.0) --- Adafruit_SPITFT.cpp | 20 ++++++++++---------- Adafruit_SPITFT.h | 36 ++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Adafruit_SPITFT.cpp b/Adafruit_SPITFT.cpp index b78d5ce..39d3ef0 100644 --- a/Adafruit_SPITFT.cpp +++ b/Adafruit_SPITFT.cpp @@ -114,9 +114,9 @@ static const struct { need to call subclass' begin() function, which in turn calls this library's initSPI() function to initialize pins. */ -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_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, + int16_t mosi, int16_t sck, int16_t rst, + int16_t miso) : Adafruit_GFX(w, h), connection(TFT_SOFT_SPI), _rst(rst), _cs(cs), _dc(dc) { swspi._sck = sck; @@ -235,15 +235,15 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, this library's initSPI() function to initialize pins. */ #if defined(ESP8266) // See notes below -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst) +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, + int16_t rst) : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = &SPI; } #else // !ESP8266 -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst) +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, + int16_t rst) : Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) { // This just invokes the hardware SPI constructor below, // passing the default SPI device (&SPI). @@ -279,7 +279,7 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, begin or init function. Unfortunate but unavoidable. */ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, - int8_t cs, int8_t dc, int8_t rst) + int16_t cs, int16_t dc, int16_t rst) : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = spiClass; @@ -375,8 +375,8 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, wanting to break existing code). */ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, - int8_t d0, int8_t wr, int8_t dc, int8_t cs, - int8_t rst, int8_t rd) + int16_t d0, int16_t wr, int16_t dc, int16_t cs, + int16_t rst, int16_t rd) : Adafruit_GFX(w, h), connection(TFT_PARALLEL), _rst(rst), _cs(cs), _dc(dc) { tft8._d0 = d0; diff --git a/Adafruit_SPITFT.h b/Adafruit_SPITFT.h index 7f5d80f..17aef23 100644 --- a/Adafruit_SPITFT.h +++ b/Adafruit_SPITFT.h @@ -127,23 +127,23 @@ public: // (reset, miso). cs argument is required but can be -1 if unused -- // rather than moving it to the optional arguments, it was done this way // to avoid breaking existing code (-1 option was a later addition). - Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, int8_t mosi, - int8_t sck, int8_t rst = -1, int8_t miso = -1); + Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi, + int16_t sck, int16_t rst = -1, int16_t miso = -1); // Hardware SPI constructor using the default SPI port: expects width & // height (at default rotation setting 0), 2 signal pins (cs, dc), // optional reset pin. cs is required but can be -1 if unused -- rather // than moving it to the optional arguments, it was done this way to // avoid breaking existing code (-1 option was a later addition). - Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst = -1); + Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, + int16_t rst = -1); #if !defined(ESP8266) // See notes in .cpp // Hardware SPI constructor using an arbitrary SPI peripheral: expects // width & height (rotation 0), SPIClass pointer, 2 signal pins (cs, dc) // and optional reset pin. cs is required but can be -1 if unused. - Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int8_t cs, - int8_t dc, int8_t rst = -1); + Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs, + int16_t dc, int16_t rst = -1); #endif // end !ESP8266 // Parallel constructor: expects width & height (rotation 0), flag @@ -151,9 +151,9 @@ public: // pins (d0, wr, dc), 3 optional pins (cs, rst, rd). 16-bit parallel // isn't even fully implemented but the 'wide' flag was added as a // required argument to avoid ambiguity with other constructors. - Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int8_t d0, - int8_t wr, int8_t dc, int8_t cs = -1, int8_t rst = -1, - int8_t rd = -1); + Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0, + int16_t wr, int16_t dc, int16_t cs = -1, int16_t rst = -1, + int16_t rd = -1); // DESTRUCTOR ---------------------------------------------------------- @@ -435,9 +435,9 @@ protected: ADAGFX_PORT_t misoPinMask; ///< Bitmask for MISO #endif // end !KINETISK #endif // end USE_FAST_PINIO - int8_t _mosi; ///< MOSI pin # - int8_t _miso; ///< MISO pin # - int8_t _sck; ///< SCK pin # + int16_t _mosi; ///< MOSI pin # + int16_t _miso; ///< MISO pin # + int16_t _sck; ///< SCK pin # } swspi; ///< Software SPI values struct { // Values specific to 8-bit parallel: #if defined(USE_FAST_PINIO) @@ -479,9 +479,9 @@ protected: ADAGFX_PORT_t rdPinMaskClr; ///< Bitmask for read strobe CLEAR (AND) #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO - int8_t _d0; ///< Data pin 0 # - int8_t _wr; ///< Write strobe pin # - int8_t _rd; ///< Read strobe pin # (or -1) + int16_t _d0; ///< Data pin 0 # + int16_t _wr; ///< Write strobe pin # + int16_t _rd; ///< Read strobe pin # (or -1) bool wide = 0; ///< If true, is 16-bit interface } tft8; ///< Parallel interface settings #if defined(__cplusplus) && (__cplusplus >= 201100) @@ -513,9 +513,9 @@ protected: #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO uint8_t connection; ///< TFT_HARD_SPI, TFT_SOFT_SPI, etc. - int8_t _rst; ///< Reset pin # (or -1) - int8_t _cs; ///< Chip select pin # (or -1) - int8_t _dc; ///< Data/command pin # + int16_t _rst; ///< Reset pin # (or -1) + int16_t _cs; ///< Chip select pin # (or -1) + int16_t _dc; ///< Data/command pin # int16_t _xstart = 0; ///< Internal framebuffer X offset int16_t _ystart = 0; ///< Internal framebuffer Y offset From 83224c719835a202c1836cab6a53575e76b45a5b Mon Sep 17 00:00:00 2001 From: Buger Date: Mon, 1 Nov 2021 20:16:08 +0100 Subject: [PATCH 2/3] added ARDUINO_ARCH_STM32 platform detection and change dc/rst/ce pin variables from int8_t to int16_t for this platform --- Adafruit_SPITFT.cpp | 30 +++++++++++++++++++++++++++--- Adafruit_SPITFT.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/Adafruit_SPITFT.cpp b/Adafruit_SPITFT.cpp index 39d3ef0..abb8d24 100644 --- a/Adafruit_SPITFT.cpp +++ b/Adafruit_SPITFT.cpp @@ -114,9 +114,15 @@ static const struct { need to call subclass' begin() function, which in turn calls this library's initSPI() function to initialize pins. */ +#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi, int16_t sck, int16_t rst, int16_t miso) +#else +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) +#endif : Adafruit_GFX(w, h), connection(TFT_SOFT_SPI), _rst(rst), _cs(cs), _dc(dc) { swspi._sck = sck; @@ -235,19 +241,26 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, this library's initSPI() function to initialize pins. */ #if defined(ESP8266) // See notes below -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, - int16_t rst) +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, + int8_t rst) : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = &SPI; } -#else // !ESP8266 +#elif defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t rst) : Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) { // This just invokes the hardware SPI constructor below, // passing the default SPI device (&SPI). } +#else // other than ESP8266 / STM32 +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, + int8_t rst) + : Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) { + // This just invokes the hardware SPI constructor below, + // passing the default SPI device (&SPI). +} #endif // end !ESP8266 #if !defined(ESP8266) @@ -278,8 +291,13 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, GPIO manually. Do this BEFORE calling the display-specific begin or init function. Unfortunate but unavoidable. */ +#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs, int16_t dc, int16_t rst) +#else +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, + int8_t cs, int8_t dc, int8_t rst) +#endif : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = spiClass; @@ -374,9 +392,15 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, only SPI displays, parallel being a recent addition (but not wanting to break existing code). */ +#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0, int16_t wr, int16_t dc, int16_t cs, int16_t rst, int16_t rd) +#else +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, + int8_t d0, int8_t wr, int8_t dc, int8_t cs, + int8_t rst, int8_t rd) +#endif : Adafruit_GFX(w, h), connection(TFT_PARALLEL), _rst(rst), _cs(cs), _dc(dc) { tft8._d0 = d0; diff --git a/Adafruit_SPITFT.h b/Adafruit_SPITFT.h index 17aef23..c0d1810 100644 --- a/Adafruit_SPITFT.h +++ b/Adafruit_SPITFT.h @@ -127,23 +127,38 @@ public: // (reset, miso). cs argument is required but can be -1 if unused -- // rather than moving it to the optional arguments, it was done this way // to avoid breaking existing code (-1 option was a later addition). +#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi, int16_t sck, int16_t rst = -1, int16_t miso = -1); +#else + Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, int8_t mosi, + int8_t sck, int8_t rst = -1, int8_t miso = -1); +#endif // Hardware SPI constructor using the default SPI port: expects width & // height (at default rotation setting 0), 2 signal pins (cs, dc), // optional reset pin. cs is required but can be -1 if unused -- rather // than moving it to the optional arguments, it was done this way to // avoid breaking existing code (-1 option was a later addition). +#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t rst = -1); +#else + Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, + int8_t rst = -1); +#endif #if !defined(ESP8266) // See notes in .cpp // Hardware SPI constructor using an arbitrary SPI peripheral: expects // width & height (rotation 0), SPIClass pointer, 2 signal pins (cs, dc) // and optional reset pin. cs is required but can be -1 if unused. +#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs, int16_t dc, int16_t rst = -1); +#else + Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int8_t cs, + int8_t dc, int8_t rst = -1); +#endif #endif // end !ESP8266 // Parallel constructor: expects width & height (rotation 0), flag @@ -151,9 +166,15 @@ public: // pins (d0, wr, dc), 3 optional pins (cs, rst, rd). 16-bit parallel // isn't even fully implemented but the 'wide' flag was added as a // required argument to avoid ambiguity with other constructors. +#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0, int16_t wr, int16_t dc, int16_t cs = -1, int16_t rst = -1, int16_t rd = -1); +#else + Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int8_t d0, + int8_t wr, int8_t dc, int8_t cs = -1, int8_t rst = -1, + int8_t rd = -1); +#endif // DESTRUCTOR ---------------------------------------------------------- @@ -435,9 +456,15 @@ protected: ADAGFX_PORT_t misoPinMask; ///< Bitmask for MISO #endif // end !KINETISK #endif // end USE_FAST_PINIO +#if defined(ARDUINO_ARCH_STM32) int16_t _mosi; ///< MOSI pin # int16_t _miso; ///< MISO pin # int16_t _sck; ///< SCK pin # +#else + int8_t _mosi; ///< MOSI pin # + int8_t _miso; ///< MISO pin # + int8_t _sck; ///< SCK pin # +#endif } swspi; ///< Software SPI values struct { // Values specific to 8-bit parallel: #if defined(USE_FAST_PINIO) @@ -479,9 +506,15 @@ protected: ADAGFX_PORT_t rdPinMaskClr; ///< Bitmask for read strobe CLEAR (AND) #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO +#if defined(ARDUINO_ARCH_STM32) int16_t _d0; ///< Data pin 0 # int16_t _wr; ///< Write strobe pin # int16_t _rd; ///< Read strobe pin # (or -1) +#else + int8_t _d0; ///< Data pin 0 # + int8_t _wr; ///< Write strobe pin # + int8_t _rd; ///< Read strobe pin # (or -1) +#endif bool wide = 0; ///< If true, is 16-bit interface } tft8; ///< Parallel interface settings #if defined(__cplusplus) && (__cplusplus >= 201100) @@ -513,9 +546,15 @@ protected: #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO uint8_t connection; ///< TFT_HARD_SPI, TFT_SOFT_SPI, etc. +#if defined(ARDUINO_ARCH_STM32) int16_t _rst; ///< Reset pin # (or -1) int16_t _cs; ///< Chip select pin # (or -1) int16_t _dc; ///< Data/command pin # +#else + int8_t _rst; ///< Reset pin # (or -1) + int8_t _cs; ///< Chip select pin # (or -1) + int8_t _dc; ///< Data/command pin # +#endif int16_t _xstart = 0; ///< Internal framebuffer X offset int16_t _ystart = 0; ///< Internal framebuffer Y offset From 3bb45ed24c0e6803566593b042245959f7407a70 Mon Sep 17 00:00:00 2001 From: Buger Date: Mon, 1 Nov 2021 21:14:20 +0100 Subject: [PATCH 3/3] Revert "added ARDUINO_ARCH_STM32 platform detection and change dc/rst/ce pin variables from int8_t to int16_t for this platform" This reverts commit 83224c719835a202c1836cab6a53575e76b45a5b. --- Adafruit_SPITFT.cpp | 30 +++--------------------------- Adafruit_SPITFT.h | 39 --------------------------------------- 2 files changed, 3 insertions(+), 66 deletions(-) diff --git a/Adafruit_SPITFT.cpp b/Adafruit_SPITFT.cpp index abb8d24..39d3ef0 100644 --- a/Adafruit_SPITFT.cpp +++ b/Adafruit_SPITFT.cpp @@ -114,15 +114,9 @@ static const struct { need to call subclass' begin() function, which in turn calls this library's initSPI() function to initialize pins. */ -#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi, int16_t sck, int16_t rst, int16_t miso) -#else -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) -#endif : Adafruit_GFX(w, h), connection(TFT_SOFT_SPI), _rst(rst), _cs(cs), _dc(dc) { swspi._sck = sck; @@ -241,26 +235,19 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, this library's initSPI() function to initialize pins. */ #if defined(ESP8266) // See notes below -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst) +Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, + int16_t rst) : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = &SPI; } -#elif defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions +#else // !ESP8266 Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t rst) : Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) { // This just invokes the hardware SPI constructor below, // passing the default SPI device (&SPI). } -#else // other than ESP8266 / STM32 -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst) - : Adafruit_SPITFT(w, h, &SPI, cs, dc, rst) { - // This just invokes the hardware SPI constructor below, - // passing the default SPI device (&SPI). -} #endif // end !ESP8266 #if !defined(ESP8266) @@ -291,13 +278,8 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, GPIO manually. Do this BEFORE calling the display-specific begin or init function. Unfortunate but unavoidable. */ -#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs, int16_t dc, int16_t rst) -#else -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, - int8_t cs, int8_t dc, int8_t rst) -#endif : Adafruit_GFX(w, h), connection(TFT_HARD_SPI), _rst(rst), _cs(cs), _dc(dc) { hwspi._spi = spiClass; @@ -392,15 +374,9 @@ Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, only SPI displays, parallel being a recent addition (but not wanting to break existing code). */ -#if defined(ARDUINO_ARCH_STM32) //use int16_t for STM32 pin definitions Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0, int16_t wr, int16_t dc, int16_t cs, int16_t rst, int16_t rd) -#else -Adafruit_SPITFT::Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, - int8_t d0, int8_t wr, int8_t dc, int8_t cs, - int8_t rst, int8_t rd) -#endif : Adafruit_GFX(w, h), connection(TFT_PARALLEL), _rst(rst), _cs(cs), _dc(dc) { tft8._d0 = d0; diff --git a/Adafruit_SPITFT.h b/Adafruit_SPITFT.h index c0d1810..17aef23 100644 --- a/Adafruit_SPITFT.h +++ b/Adafruit_SPITFT.h @@ -127,38 +127,23 @@ public: // (reset, miso). cs argument is required but can be -1 if unused -- // rather than moving it to the optional arguments, it was done this way // to avoid breaking existing code (-1 option was a later addition). -#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t mosi, int16_t sck, int16_t rst = -1, int16_t miso = -1); -#else - Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, int8_t mosi, - int8_t sck, int8_t rst = -1, int8_t miso = -1); -#endif // Hardware SPI constructor using the default SPI port: expects width & // height (at default rotation setting 0), 2 signal pins (cs, dc), // optional reset pin. cs is required but can be -1 if unused -- rather // than moving it to the optional arguments, it was done this way to // avoid breaking existing code (-1 option was a later addition). -#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, int16_t cs, int16_t dc, int16_t rst = -1); -#else - Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t cs, int8_t dc, - int8_t rst = -1); -#endif #if !defined(ESP8266) // See notes in .cpp // Hardware SPI constructor using an arbitrary SPI peripheral: expects // width & height (rotation 0), SPIClass pointer, 2 signal pins (cs, dc) // and optional reset pin. cs is required but can be -1 if unused. -#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int16_t cs, int16_t dc, int16_t rst = -1); -#else - Adafruit_SPITFT(uint16_t w, uint16_t h, SPIClass *spiClass, int8_t cs, - int8_t dc, int8_t rst = -1); -#endif #endif // end !ESP8266 // Parallel constructor: expects width & height (rotation 0), flag @@ -166,15 +151,9 @@ public: // pins (d0, wr, dc), 3 optional pins (cs, rst, rd). 16-bit parallel // isn't even fully implemented but the 'wide' flag was added as a // required argument to avoid ambiguity with other constructors. -#if defined(ARDUINO_ARCH_STM32) Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int16_t d0, int16_t wr, int16_t dc, int16_t cs = -1, int16_t rst = -1, int16_t rd = -1); -#else - Adafruit_SPITFT(uint16_t w, uint16_t h, tftBusWidth busWidth, int8_t d0, - int8_t wr, int8_t dc, int8_t cs = -1, int8_t rst = -1, - int8_t rd = -1); -#endif // DESTRUCTOR ---------------------------------------------------------- @@ -456,15 +435,9 @@ protected: ADAGFX_PORT_t misoPinMask; ///< Bitmask for MISO #endif // end !KINETISK #endif // end USE_FAST_PINIO -#if defined(ARDUINO_ARCH_STM32) int16_t _mosi; ///< MOSI pin # int16_t _miso; ///< MISO pin # int16_t _sck; ///< SCK pin # -#else - int8_t _mosi; ///< MOSI pin # - int8_t _miso; ///< MISO pin # - int8_t _sck; ///< SCK pin # -#endif } swspi; ///< Software SPI values struct { // Values specific to 8-bit parallel: #if defined(USE_FAST_PINIO) @@ -506,15 +479,9 @@ protected: ADAGFX_PORT_t rdPinMaskClr; ///< Bitmask for read strobe CLEAR (AND) #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO -#if defined(ARDUINO_ARCH_STM32) int16_t _d0; ///< Data pin 0 # int16_t _wr; ///< Write strobe pin # int16_t _rd; ///< Read strobe pin # (or -1) -#else - int8_t _d0; ///< Data pin 0 # - int8_t _wr; ///< Write strobe pin # - int8_t _rd; ///< Read strobe pin # (or -1) -#endif bool wide = 0; ///< If true, is 16-bit interface } tft8; ///< Parallel interface settings #if defined(__cplusplus) && (__cplusplus >= 201100) @@ -546,15 +513,9 @@ protected: #endif // end HAS_PORT_SET_CLR #endif // end USE_FAST_PINIO uint8_t connection; ///< TFT_HARD_SPI, TFT_SOFT_SPI, etc. -#if defined(ARDUINO_ARCH_STM32) int16_t _rst; ///< Reset pin # (or -1) int16_t _cs; ///< Chip select pin # (or -1) int16_t _dc; ///< Data/command pin # -#else - int8_t _rst; ///< Reset pin # (or -1) - int8_t _cs; ///< Chip select pin # (or -1) - int8_t _dc; ///< Data/command pin # -#endif int16_t _xstart = 0; ///< Internal framebuffer X offset int16_t _ystart = 0; ///< Internal framebuffer Y offset