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.
Dependents: Final_Coffee_Roaster
Fork of 4DGL-uLCD-SE by
Diff: uLCD_4DGL.h
- Revision:
- 2:edae99e4abe7
- Parent:
- 1:8b656995301f
- Child:
- 3:9ba47197d94f
--- a/uLCD_4DGL.h Mon Nov 11 01:22:41 2013 +0000
+++ b/uLCD_4DGL.h Sun Nov 17 04:36:12 2013 +0000
@@ -22,7 +22,7 @@
// Debug Verbose on terminal enabled
#ifndef DEBUGMODE
-#define DEBUGMODE 1
+#define DEBUGMODE 0
#endif
// Common WAIT value in millisecond
@@ -34,6 +34,7 @@
#define BAUDRATE '\x0B' //null prefix
#define VERSION '\x08' //null prefix
#define BCKGDCOLOR '\x6E'
+#define TXTBCKGDCOLOR '\x7E'
#define DISPCONTROL '\x68'
#define SETVOLUME '\x76'
#define CIRCLE '\xCC'
@@ -44,9 +45,11 @@
#define PIXEL '\xCB'
#define READPIXEL '\xCA'
#define SCREENCOPY '\x63' //na?
-#define PENSIZE '\x70' //na
+#define PENSIZE '\xD8'
#define SETFONT '\x7D'
#define TEXTMODE '\x77'
+#define TEXTWIDTH '\x7C'
+#define TEXTHEIGHT '\x7B'
#define TEXTCHAR '\xFE'
#define GRAPHCHAR '\x74'
#define TEXTSTRING '\x06' //null prefix
@@ -55,6 +58,7 @@
#define GETTOUCH '\x6F'
#define WAITTOUCH '\x77'
#define SETTOUCH '\x75'
+#define PUTCHAR '\xFE'
// Screen answers
@@ -74,7 +78,8 @@
#define OPAQUE '\x01'
// Fonts Sizes
-#define FONT_5X7 '\x00'
+#define FONT_7X8 '\x00' //only builtin font
+#define FONT_5X7 '\x04'
#define FONT_8X8 '\x01'
#define FONT_8X12 '\x02'
#define FONT_12X16 '\x03'
@@ -170,7 +175,7 @@
* @endcode
*/
-class uLCD_4DGL
+class uLCD_4DGL : public Stream
{
public :
@@ -201,6 +206,12 @@
* @param mode See 4DGL documentation
* @param value See 4DGL documentation
*/
+ void textbackground_color(int color);
+
+ /** Set screen display mode to specific values
+ * @param mode See 4DGL documentation
+ * @param value See 4DGL documentation
+ */
void display_control(char mode, char value);
/** Set internal speaker to specified value
@@ -230,6 +241,8 @@
// Texts Commands
void set_font(char);
void text_mode(char);
+ void text_width(char);
+ void text_height(char);
void text_char(char, char, char, int);
void graphic_char(char, int, int, int, char, char);
void text_string(char *, char, char, char, int);
@@ -241,6 +254,8 @@
void putc(char);
void puts(char *);
+
+
// Touch Command
void touch_mode(char);
void get_touch(int *, int *);
@@ -263,11 +278,24 @@
char current_orientation;
char max_col;
char max_row;
+ int current_w, current_h;
+ int current_fx, current_fy;
+ int current_wf, current_hf;
+
protected :
Serial _cmd;
DigitalOut _rst;
+ //used by printf
+ virtual int _putc(int c) {
+ putc(c);
+ return 0;
+ };
+ virtual int _getc() {
+ return 0;
+ }
+
void freeBUFFER (void);
void writeBYTE (char);
@@ -285,3 +313,4 @@
typedef unsigned char BYTE;
+
