Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Picaso_4DGL-32PTU_graphics.cpp
- Revision:
- 0:a5ef6bc3c2e8
- Child:
- 1:e2337e2653e1
diff -r 000000000000 -r a5ef6bc3c2e8 Picaso_4DGL-32PTU_graphics.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Picaso_4DGL-32PTU_graphics.cpp Thu Sep 08 13:35:36 2016 +0000
@@ -0,0 +1,87 @@
+
+
+
+
+#include "mbed.h"
+#include "Picaso_4DGL-32PTU.h"
+
+//**************************************************************************
+// The Clear Screen command clears the screen using the current background colour.
+// This command brings some of the settings back to default; such as,
+// Transparency turned OFF
+// Outline colour set to BLACK
+// Opacity set to OPAQUE
+// Pen set to OUTLINE
+// Line patterns set to OFF
+// Right text margin set to full width
+// Text magnifications set to 1
+// All origins set to 0:0
+// The alternative to maintain settings and clear screen is
+// to draw a filled rectangle with the required background colour.
+//**************************************************************************
+void TFT_4DGL :: cls() { // clear screen
+
+ char command[2] = "";
+
+ command[0] = CLS_MSB;
+ command[1] = CLS_LSB;
+
+ writeCOMMAND(command, 2);
+}
+
+//**************************************************************************
+// The Change Colour command changes all oldColour pixels to newColour
+// within the clipping window area.
+//**************************************************************************
+void TFT_4DGL :: changeColor(char oldM, char oldL, char newM, char newL) {
+
+ char command[6] = "";
+
+ command[0] = CHANGE_COLOR_MSB;
+ command[1] = CHANGE_COLOR_LSB;
+ command[2] = oldM;
+ command[3] = oldL;
+ command[4] = newM;
+ command[5] = newL;
+
+ writeCOMMAND(command, 6);
+}
+
+//**************************************************************************
+// The Draw Circle command draws a circle with centre point x, y
+// with radius r using the specified colour.
+//**************************************************************************
+void TFT_4DGL :: drawCircle(short x, short y, short r, char colorM, char colorL) {
+
+ char command[10] = "";
+
+ command[0] = DRAW_CIRCLE_MSB;
+ command[1] = DRAW_CIRCLE_LSB;
+ command[2] = (x >> (8*1)) & 0xff;
+ command[3] = (x >> (8*0)) & 0xff;
+ command[4] = (y >> (8*1)) & 0xff;
+ command[5] = (y >> (8*0)) & 0xff;
+ command[6] = (r >> (8*1)) & 0xff;
+ command[7] = (r >> (8*0)) & 0xff;
+ command[8] = colorM;
+ command[9] = colorL;
+
+ writeCOMMAND(command, 10);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+