LA: Adding some "Ex" features to DmTftBase

Files at this revision

API Documentation at this revision

Comitter:
lex9296
Date:
Fri Mar 11 10:09:43 2022 +0000
Parent:
17:0e2203ae4cec
Commit message:
Added some "DrawVerticalLineEx" with INT "Length"

Changed in this revision

DmTftBase.cpp Show annotated file Show diff for this revision Revisions of this file
DmTftBase.h Show annotated file Show diff for this revision Revisions of this file
diff -r 0e2203ae4cec -r 980fff4fd306 DmTftBase.cpp
--- a/DmTftBase.cpp	Fri Nov 11 12:48:02 2016 +0000
+++ b/DmTftBase.cpp	Fri Mar 11 10:09:43 2022 +0000
@@ -81,6 +81,20 @@
   sbi(_pinCS, _bitmaskCS);
 }
 
+void    DmTftBase::drawVerticalLineEx   (uint16_t ui16_X, uint16_t ui16_Y, int16_t i16_YLen, uint16_t ui16_Color) {
+    cbi(_pinCS, _bitmaskCS);
+
+    if  (i16_YLen >= 0)
+        setAddress(ui16_X, ui16_Y, ui16_X, ui16_Y+ i16_YLen);
+    else
+        setAddress(ui16_X, ui16_Y+ i16_YLen, ui16_X, ui16_Y);
+
+    for (int i = 0; i <= abs(i16_YLen); i++)
+        sendData(ui16_Color);
+
+    sbi(_pinCS, _bitmaskCS);
+}
+
 void DmTftBase::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
   int x = x1-x0;
   int y = y1-y0;
diff -r 0e2203ae4cec -r 980fff4fd306 DmTftBase.h
--- a/DmTftBase.h	Fri Nov 11 12:48:02 2016 +0000
+++ b/DmTftBase.h	Fri Mar 11 10:09:43 2022 +0000
@@ -53,6 +53,7 @@
   void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
   void drawVerticalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color);
   void drawHorizontalLine(uint16_t x, uint16_t y, uint16_t length, uint16_t color);
+  void drawVerticalLineEx(uint16_t ui16_X, uint16_t ui16_Y, int16_t i16_YLen, uint16_t ui16_Color);
 
   void drawRectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);
   void fillRectangle(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color);