diff --git a/src/TFT.cpp b/src/TFT.cpp index 1bdf7ed..bb6f197 100644 --- a/src/TFT.cpp +++ b/src/TFT.cpp @@ -35,6 +35,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. TFT EsploraTFT(7, 0, 1); #endif +TFT::TFT(uint8_t CS, uint8_t RS, uint8_t SID, uint8_t SCLK, uint8_t RST) + : Adafruit_ST7735(CS, RS, SID, SCLK, RST) +{ + // as we already know the orientation (landscape, therefore rotated), + // set default width and height without need to call begin() first. + _width = ST7735_TFTHEIGHT; + _height = ST7735_TFTWIDTH; +} + TFT::TFT(uint8_t CS, uint8_t RS, uint8_t RST) : Adafruit_ST7735(CS, RS, RST) { diff --git a/src/TFT.h b/src/TFT.h index 16791d6..65157fb 100644 --- a/src/TFT.h +++ b/src/TFT.h @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// @author Enrico Gueli class TFT : public Adafruit_ST7735 { public: + TFT(uint8_t CS, uint8_t RS, uint8_t SID, uint8_t SCLK, uint8_t RST); TFT(uint8_t CS, uint8_t RS, uint8_t RST); void begin();