-
Notifications
You must be signed in to change notification settings - Fork 0
/
ezLCDLib.h
1050 lines (913 loc) · 33.9 KB
/
ezLCDLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ---------------------------------------------------------------------------
// Created by Ken Segler 6/1/2013.
// Modified by Rich Obermeyer 1/14/2014.
// Modified by Jonathan Doerr 4/11/2014.
// Copyright 2013 - Under creative commons license 3.0:
// Attribution-ShareAlike CC BY-SA
//
// This software is furnished "as is", without technical support, and with no
// warranty, express or implied, as to its usefulness for any purpose.
//
// @file ezLCDLib.h
// This file supports the ezLCD3xx interface to an Arduino serial port.
//
// @author Ken Segler - [email protected]
// ---------------------------------------------------------------------------
#ifndef _EZLCDLIB_H
#define _EZLCDLIB_H
#include <Arduino.h>
#include "Print.h"
#if defined(ARDUINO_ARCH_RP2040)
#define EZM_BAUD_RATE 230400 //default rate for coms link to GPU, this must match startup.ezm
#warning "RP2040 EZM_BAUD_RATE 230400"
#else
#define EZM_BAUD_RATE 230400 //default rate for coms link to GPU, this must match startup.ezm
#endif
#define FIFO 0
#define LIFO 1
#define CLEAR 2
#define PEEK 3
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define DELETE 0
#define ENABLE 1
#define DISABLE 2
#define REDRAW 3
#define FILL 1
#define NOFILL 0
#define PRESSED 4
#define RELEASED 1
#define CANCEL 2
#define ON 1
#define OFF 0
#define DRAW 1
#define BUTTON_PRESSED 3
#define BUTTON_NOT_PRESSED 4
#define BUTTON_PRESSED_DISABLED 5
#define BUTTON_NOT_PRESSED_DISABLED 6
#define LEFTJUSTIFIED 1
#define RIGHTJUSTIFIED 3
#define CENTERJUSTIFIED 4
#define LEFTJUSTIFIEDF 5
#define RIGHTJUSTIFIEDF 7
#define CENTERJUSTIFIEDF 8
/** Enum for standard colors */
enum { BLACK,GRAY,SILVER,WHITE,RED,MAROON,YELLOW,OLIVE,
LIME,GREEN,AQUA,TEAL,BLUE,NAVY,FUCHSIA,PURPLE,
INDIANRED,LIGHTCORAL,SALMON,DARKSALMON,LIGHTSALMON,RED2,CRIMSON,FIREBRICK,
DARKRED,PINK,LIGHTPINK,HOTPINK,DEEPPINK,MEDIUMVIOLETRED,PALEVIOLETRED,LIGHTSALMON2,
CORAL,TOMATO,ORANGERED,DARKORANGE,ORANGE,GOLD,YELLOW2,LIGHTYELLOW,
LEMONCHIFFON,LIGHTGOLDENRODYELLOW,PAPAYAWHIP,MOCCASIN,PEACHPUFF,PALEGOLDENROD,KHAKI,DARKKHAKI,
LAVENDER,THISTLE,PLUM,VIOLET,ORCHID,FUCHSIA2,MAGENTA,MEDIUMORCHID,
MEDIUMPURPLE,BLUEVIOLET,DARKVIOLET,DARKORCHID,DARKMAGENTA,PURPLE2,INDIGO,SLATEBLUE,
DARKSLATEBLUE,GREENYELLOW,CHARTREUSE,LAWNGREEN,LIME2,LIMEGREEN,PALEGREEN,LIGHTGREEN,
MEDIUMSPRINGGREEN,SPRINGGREEN,MEDIUMSEAGREEN,SEAGREEN,FORESTGREEN,GREEN2,DARKGREEN,YELLOWGREEN,
OLIVEDRAB,OLIVE2,DARKOLIVEGREEN,MEDIUMAQUAMARINE,DARKSEAGREEN,LIGHTSEAGREEN,DARKCYAN,TEAL2,
AQUA2,CYAN2,LIGHTCYAN,PALETURQUOISE,AQUAMARINE,TURQUOISE,MEDIUMTURQUISE2,DARKTURQUOISE,
CADETBLUE,STEELBLUE,LIGHTSTEELBLUE,POWDERBLUE,LIGHTBLUE,SKYBLUE,LIGHTSKYBLUE,DEEPSKYBLUE,
DODGERBLUE,CORNFLOWERBLUE,MEDIUMSLATEBLUE,ROYALBLUE,BLUE2,MEDIUMBLUE,DARKBLUE,NAVY2,
MIDNIGHTBLUE,CORNSILK,BLANCHEDALMOND,BISQUE,NAVAJOWHITE,WHEAT,BURLYWOOD,TAN,
ROSYBROWN,SANDYBROWN,GOLDENROD,DARKGOLDENROD,PERU,CHOCOLATE,SADDLEBROWN,SIENNA,BROWN,MAROON2,
WHITE2,SNOW,HONEYDEW,MINTCREAM,AZURE,ALICEBLUE,GHOSTWHITE,WHITESMOKE,
SEASHELL,BEIGE,OLDLACE,FLORALWHITE,IVORY,ANTIQUEWHITE,LINEN,LAVENDERBLUSH,
MISTYROSE,GAINSBORO,LIGHTGREY,SILVER2,DARKGRAY,GRAY2,DIMGRAY,LIGHTSLATEGRAY,
SLATEGRAY,DARKSLATEGRAY,BLACK2};
class Stream; /* Forward declaration of Stream to be used
* in the EzLCD3 abstract class */
/** Interface to the EarthLCD ezLCD3xx line of smart displays
* Derived class from Serial so that you
* can conveniently printf(), putc(), etc to the display.
*/
class ezLCD3: public Print
{
public:
volatile unsigned int currentWidget;
volatile unsigned int currentInfo;
volatile unsigned int currentData;
volatile bool timedOut;
volatile unsigned int error;
unsigned long timeOutMilliseconds;
unsigned long timeOutBeginMillis;
volatile unsigned int X;
volatile unsigned int Y;
volatile unsigned int hexmode;
char localbuffer[128];
/** Create a new interface to a ezLCD3xx display
*/
ezLCD3(void);
/** Class destructor */
virtual ~ezLCD3();
/**
* @param[in] baud baud rate defined here EZM_BAUD_RATE 115200
*
*/
void begin( long baud = EZM_BAUD_RATE );
/************************ Library Internal Functions *****************/
/** required for classes derived from Print
* This allows using build in arduino print functions
* like println(test,HEX);
*/
virtual size_t write(uint8_t);
/** Converts an int value to a ascii array stored at address of char* sp
* Has to be char* becuase itoa modifies the buffer sent to it.
*
*/
void itoa(int value, char* sp, int radix);
/** Strips spaces from char* ascii array passed to this function
* Has to be char* becuase stripSpace modifies the buffer sent to it.
*
*/
void stripSpace(char* str);
/**
*
*
*/
bool sync( void );
/** Send a integer to the display as command
* @param[in] i integer to send
*/
void sendInt( int i );
/** Send a integer to the display as command
* @param[in] i integer to send
*/
void sendIntS( int i );
/** Send a long to the display as command
* @param[in] i long to send
*/
void sendLong( long i );
/** Send hex to the display as command
* @param[in] i hex to send
*/
void PrintHex( int value );
/** Get a integer from the display
* @param[out] str string to put the data in
* str has to be a char* becuase getInt calls stripSpace
*/
int getInt( char* str );
/** Get a long from the display
* @param[out] str string to put the data in
* str has to be a char* becuase getLong calls stripSpace
*/
long getLong( char* str );
/** Get a string from the display
* @param[out] str string to put the data in
* str has to be a char* becuase getString stores retrived data in str
*/
bool getString( char* str );
/** Get a string from the display
* @param[out] str string to put the data in
* str has to be a char* becuase getStringToSpace stores retrived data in str
*/
bool getStringToSpace( char* str );
/** Waits for a CR from display
*
*/
bool waitForCRNTO( void );
bool waitForCR( void );
void ClrSerial( void );
/************************ Library Internal Functions *****************/
/**
*
*/
void calibrate( void );
/**
*
*/
unsigned char choice( const char* str, unsigned char c );
/** clear the screen to black
*
*/
void cls(void);
/** clear the screen with background color
* @param[in] bcolor Background color
*/
void cls(int bColor);
/** clear the screen with background color and drawing color
*
* @param[in] bColor background color
* @param[in] fColor drawing color
*/
void cls(int bColor, int fColor);
/** Set drawing color
* @param[in] color color to draw with
*/
void color( int color );
/** Set drawing color
* @param[in] color color to draw with
*/
void colorID( unsigned char ID, unsigned char r, unsigned char g, unsigned char b );
/** set x y position for drawing and text
*
* @param[in] x is the x coordinate
* @param[in] y is the y coordinate
*/
void xy(int x, int y);
void xy( void );
void xy( const char* str );
unsigned int getX( void );
unsigned int getY( void );
/** set pixel at current x y
*
*/
void plot(void);
void point(void);
/** set pixel in current draw color at x y
*
* @param[in] x is the x coordinate
* @param[in] y is the y coordinate
*/
void plot(int x, int y);
void point(int x, int y);
/** get pixel from x y
*
* @param[in] x is the x coordinate
* @param[in] y is the y coordinate
*/
unsigned int getPixel( int x, int y );
/** draw line from current x y to new x y
*
* @param[in] x is the x coordinate
* @param[in] y is the y coordinate
*/
void line(int x, int y);
/** Set line drawing type
* @param[in] type Options: 0 = solid, 1= dotted (1 pixel spacing between dots), 2 = dashed (2 pixel spacing between dashes)
*/
void lineType( int type );
/** Set line drawing width
* @param[in] width in pixels
*/
void lineWidth( int width );
/** Draw circle in current color at current x y
*
* @param[in] x location of circle
* @param[in] y location of circle
* @param[in] radius diameter of circle
* @param[in] filled true for a filled box outline if false
*/
void circle(int radius, bool filled );
void circle(int x, int y, int radius, bool filled );
/**
* Draw a pie with the specified radius, start angle and end angle.
* \param[in] radius pie radius in pixels.
* \param[in] start Start angle in degrees.
* \param[in] end End angle in degrees.
*/
void pie( uint16_t radius, int16_t start, int16_t end );
/**
* Draw an arc with the specified radius, start angle and end angle.
* \param[in] radius Arc radius in pixels.
* \param[in] start Start angle in degrees.
* \param[in] end End angle in degrees.
*/
void arc( uint16_t radius, int16_t start, int16_t end , bool fill);
/** draw a box from current x y of width and heigth
*
* @param[in] width
* @param[in] heigth
* @param[in] filled true for a filled box outline if false
*/
void box(int width, int height, bool filled);
void rect(int x, int y, int width, int height, bool filled);
/**
* Return current brightness setting.
* \return Brightness in 0-100.
*/
int light();
/** set backlight brightness
*
* @param[in] level is brightness 0=off 100=full in steps of 32
*/
void light(int level);
/**
* Set brightness & timeout
* \param[in] level Brightness in 0-100.
* \param[in] timeout Timeout value in minutes before dimming
* \param[in] timeOutBrightness
*/
void light( int level, unsigned long timeout, int timeOutBrightness );
/**
* Set brightness & timeout
* \param[in] level Brightness in 0-100.
* \param[in] timeout Timeout value in minutes before dimming
* \param[in] timeOutBrightness
* \param[in] comm timeout disable 0=COMM enabled
*/
void light( int level, unsigned long timeout, int timeOutBrightness, int commdis );
/** Send a command direct to display
* @param str command string
*
* Example:\n
* @code
* lcd.sendCommand( "cls" ); // clear display
* @endcode
*/
void sendCommand( const char* str );
/** Return Xmax of display
* @return int Xmax of display
*
*/
int getXmax( void );
/** Return Ymax of display
* @return int Ymax of display
*
*/
int getYmax( void );
/** Return last touch x
* @return int
*
*/
int touchX( void );
/** Return last touch y
* @return int
*
*/
int touchY( void );
/** Return last touch status
* @return int touch status
*
*/
int touchS( void );
/** Send a string of data to display
*
*/
void sendString( const char* str );
/** Set stringID to display
* @param ID string ID to write
* @param str string to write
*
*/
void string( int ID, const char* str );
/** Get stringID from Display
* @param ID string ID to read
* @param str string to put data in
* str has to be a char* becuase getStringID calls getString
* Example:
* @code
* lcd.getStringID(66, ezVer); // get ezLCD Firmware version
* lcd.print(ezVer); // print version
* @endcode
*/
void getStringID( int ID, char* str );
void crlf(void);
void print(int value, int mode);
void print(long int value, int mode);
void println(int value, int mode);
void println(long int value, int mode);
/** print string at current x y
* @param str string prints directly to display
*/
void printString( const char* str );
void print( const char* str );
void print( char c );
void println( const char* str );
void println( char c );
void println( void );
/** print integer at current x y
* @param int prints directly to display
*/
void printInt( int value );
void print(int value );
void println(int value );
/** print long at current x y
* @param long prints directly to display
*/
void printLong( long value );
void print(long value);
void println(long value);
void print(double value);
void println(double value);
void print(double value, int digits);
void println(double value, int digits);
/** print stringID at current x y
* @param str string prints directly to display
*/
void printStringID( char ID );
void printNumber(unsigned long n, int base);
void printFloat(double number, int digits);
/** Set widget font
* Fonts are located in the flash drive of the display\n
* font 0 and font 1 are builtin fonts and are much faster to draw\n
* in the /EZUSERS/FONTS and /EZSYS/FONTS directory\n
* use the ezLCD3xx font convert utilty to convert true type fonts
* @param str font name
*/
void fontw( int id, const char* str);
/**
*
*
*
*/
void fontw( int ID, int font);
/**
*
*
*
*/
void font(const char* str);
/**
*
*
*
*/
void font(int font);
/**
*
*
*
*/
void fontO( bool dir );
/**
*
*
*
*/
void clipArea( int l, int t, int r, int b);
/**
*
*
*
*/
void clipEnable( bool enable );
/** Sets color themes for widgets
*
*
*/
void theme(int ID, int EmbossDkColor, int EmbossLtColor, int TextColor0, int TextColor1, int TextColorDisabled, int Color0, int Color1, int ColorDisabled, int CommonBkColor, int Fontw);
/**
* Draw an LED on display.
* \param[in] x x location of LED center
* \param[in] y y location of LED center
* \param[in] radius radius of the LED
* \param[in] colorLed color of the LED
* \param[in] colorHigh color of the LED highlights
*/
void drawLed( int x, int y, int radius, unsigned char colorLed, unsigned char colorHigh) ;
/**
* Draw/alter a groupBox.
* \param[in] id Widget ID to assign.
* \param[in] x Starting x-coordinate in pixels.
* \param[in] y Starting y-coordinate in pixels.
* \param[in] width Width in pixels.
* \param[in] height Height in pixels.
* \param[in] options Options 1=draw, 2=draw disabled, 3=draw right aligned, 4=draw center aligned
* \param[in] theme Theme ID to use.
* \param[in] stringID String ID to use for text.
*/
void groupBox( int id, int x, int y, int width, int height, int options, int theme, int stringID) ;
/**
* Draw/alter a checkBox.
* \param[in] id Widget ID to assign.
* \param[in] x Starting x-coordinate in pixels.
* \param[in] y Starting y-coordinate in pixels.
* \param[in] width Width in pixels.
* \param[in] height Height in pixels.
* \param[in] option Options 1=draw unchecked, 2=draw disabled, 3=draw checked, 4=redraw
* \param[in] theme Theme ID to use.
* \param[in] strid String ID to use for text.
*/
void checkBox( int id, uint16_t x, uint16_t y, uint16_t width, uint16_t height,
uint16_t option, int theme, int strid );
/**
* Draw/alter a radioButton.
* \param[in] id Widget ID to assign.
* \param[in] x Starting x-coordinate in pixels.
* \param[in] y Starting y-coordinate in pixels.
* \param[in] width Width in pixels.
* \param[in] height Height in pixels.
* \param[in] option Options 1=draw unchecked, 2=draw disabled, 3=draw checked, 4=redraw
* \param[in] theme Theme ID to use.
* \param[in] strid String ID to use for text.
*/
void radioButton( int id, uint16_t x, uint16_t y, uint16_t width, uint16_t height,
uint16_t option, int theme, int strid );
/** Analog Meter Widget
* Draw Analog Meter.
* \param[in] id Widget ID to assign.
* \param[in] x Starting x-coordinate in pixels.
* \param[in] y Starting y-coordinate in pixels.
* \param[in] w Width in pixels.
* \param[in] h Height in pixels.
* \param[in] options Options
* \param[in] value Current Value
* \param[in] min Minimum Value
* \param[in] max Maximum Value
* \param[in] theme Theme ID to use.
* \param[in] strid String ID to use for text.
* \param[in] type Meter Value 0=360, 1=180, 2=90
*/
void analogMeter( int ID, int x, int y, int w, int h, int options, int value, int min, int max, int theme, int stringID, int type);
/** Analog Meter Color
* Analog Meter Color.
* \param[in] ID Widget ID to assign.
* \param[in] Sector1 Sector Color.
* \param[in] Sector2 Sector Color.
* \param[in] Sector3 Sector Color.
* \param[in] Sector4 Sector Color.
* \param[in] Sector5 Sector Color.
* \param[in] Sector6 Sector Color.
*/
void analogMeterColor( int ID, int Sector1, int Sector2, int Sector3, int Sector4, int Sector5, int Sector6 );
/** Touchzone Widget
*
*
*/
void touchZone( int ID, int x, int y, int w, int h, bool option);
/** Touchzone Shadow
* \param[in] mode 0=OFF, 1=ON.
* \param[in] Scolor Shadow Color
* \param[in] Slinetype Shadow Line Type
* \param[in] Slinethickness Shadow Line Thickness
*/
void shadow( int mode, int Scolor, int Slinetype, int Slinethickness );
/** Button Widget
*
*
*/
void button( int ID, int x, int y, int w, int h, int option, int align, int radius, int theme, int stringID );
/**
* Create/alter a dial widget.
* \param[in] id Widget ID to assign.
* \param[in] theme Theme ID to use.
* \param[in] x Starting x-coordinate in pixels.
* \param[in] y Starting y-coordinate in pixels.
* \param[in] radius Radius of the dial in pixels.
* \param[in] resolution Resolution of the dial in degrees.
* \param[in] initial Initial numeric position of the dial.
* \param[in] max Maximum numeric position of the dial.
* \param[in] option 1=draw, 2=disabled, 3=ring, 4=accuracy
*/
void dial( int id, uint16_t x, uint16_t y, uint16_t radius, uint16_t option,
int resolution, int initial, int max, int theme );
/** Display Bitmap
* Display Bitmap at current x y \n
* supports GIF BMP JPG \n
* images are located in the /EZUSERS/FONTS and /EZSYS/FONTS directory
* @param str filename
*/
bool picture( const char* str );
/** Display Bitmap
* Display Bitmap at specfied x y \n
* supports GIF BMP JPG \n
* images are located in the /EZUSERS/FONTS and /EZSYS/FONTS directory
* @param x x location to start bitmap
* @param y y location to start bitmap
* @param str filename
*/
bool picture( int x, int y ,const char* str);
/** Display Bitmap
* Display Bitmap at specfied x y \n
* supports GIF BMP JPG \n
* images are located in the /EZUSERS/FONTS and /EZSYS/FONTS directory
* @param x x location to start bitmap
* @param y y location to start bitmap
* @param options 1=align center 2=downscale 3= both
* @param str filename
*/
bool picture( int x, int y, int options, const char* str);
/** StaticBox Widget
* @param ID the Widget ID to create
* @param x
* @param y
* @param w
* @param h
* @param option
* @param theme
* @param stringID
*/
void staticText( int ID, int x, int y, int w, int h, int option, int theme, int stringID);
/** ProgressBar Widget
* @param ID
* @param x
* @param y
* @param w
* @param h
* @param option
* @param value
* @param max
* @param theme
* @param stringID
*/
void progressBar(int ID, int x, int y, int w, int h, int option, int value, int max, int theme, int stringID);
/** gauge Widget
* @param ID
* @param x
* @param y
* @param w
* @param h
* @param option
* @param initial
* @param min
* @param max
* @param theme
* @param stringID
*
*
*/
void gauge(int ID, int x, int y, int w, int h, int option, int initial, int min, int max, int theme, int stringID);
/** Slider Widget
* @param ID
* @param x
* @param y
* @param w
* @param h
* @param option
* @param range
* @param res
* @param value
* @param theme
*
*/
void slider(int ID, int x, int y, int w, int h, int option, int range, int res, int value, int theme);
void digitalMeter( int id, uint16_t x, uint16_t y, uint16_t width,
uint16_t height, uint16_t option, int initial,
int digits, int dotpos,int theme );
/** wstate
*
*
*
*/
unsigned int wstate( int ID );
/** wstate
*
*
*
*/
void wstate( int ID, int option );
/** wquiet
* will disable the default data comming back from the GPU
* on widget events
*
*/
void wquiet( void );
/** Wvalue set widget values
* @param ID widget ID to update
* @param value widget value to update
*/
void wvalue( int ID, int value);
/** Wvalue set widget values
* @param ID widget ID to update
* @param string to update
*/
void wvalue( int ID, const char* str );
/** Wvalue set widget values
* @param ID widget ID to update
* @return widget value
*/
unsigned int wvalue( int ID );
//********************************************************
/** St_value sets static text widget string
* @param ID widget ID of static text widget to update
* @param stringIDValue string to update widget with
*/
void st_value( int ID, int stringIDValue );
/** St_value sets static text widget string
* @param ID widget ID of static text widget to update
* @param stringIDValue string to update widget with
*/
void st_value( int ID, const char* str);
//********************************************************
/** Wstack is a 32 level stack of widget events
* @param type LIFO - Get the last widget event off the stack
* @param type FIFO - Get the first widget event off the stack
* @param type CLEAR - Clear stack
* @returns widget id and even touch, release
*/
unsigned int wstack( int type );
/** Send Debug data to IDE monitor
* @param data - data to display
* @returns none
*/
void Debug( unsigned long data, const char* format = "%lu" );
void Debug( long data, const char* format = "%ld" );
void Debug( unsigned int data, const char* format = "%u" );
void Debug( int data, const char* format = "%i" );
void Debug( char data );
void Debug( const char* str );
/** Tx UART send character to GPU uart
* @param type port - Get the port number (pin)
* @returns UART character or 0x8000 if none
*/
void TxUART( int port, char data );
void TxUART( int port, const char* str );
/** Recv UART gets character from GPU uart
* @param type port - Get the port number (pin)
* @returns UART character or 0x8000 if none
*/
int RecvUART( int port );
int RxUART( int port );
/** Available check to see if uart has character
* @param type port - Get the port number (pin)
* @returns 1 has char, -1 no character -2 not configured
*/
int Available( int port );
/** Available check to see if uart has character
* @param type port - Get the port number (pin)
* @returns char, -1 no character -2 not configured
*/
int peek( int port );
/** flush Initializes the UART (Rx and RX)
* @param type port - Get the port number (pin)
* @returns 1 OK -1 not configured
*/
int flush( int port );
/** FSopen is a file system open command for the flash drive on the arLCD
* @param Filename - Defines the file to open
* @param fileoption - defines the type open r=read, w=write, a=append, followed by h is binary mode
*/
int FSopen( const char* filename, const char* mode );
/** FSread is a file system read command for the flash drive on the arLCD
* @param bytecount - Defines the number to read (upto 64 bytes)
* buffer must be char* since it is loaded with data in this function
*/
int FSread( char* buffer, int bytecount );
/** FSwrite is a file system write command for the flash drive on the arLCD
* @param data - Defines the data to write. Upto 64 bytes. in binary mode send hex (2 bytes)
*/
int FSwrite( const char* data, int count );
/** FSclose is a file system close command for the flash drive on the arLCD
*/
int FSclose( void );
/** FSrewind is a file system rewind command for the flash drive on the arLCD
*/
int FSrewind( void );
/** FSseek is a file system seek command for the flash drive on the arLCD
* @param offset - Defines the desired file location
* @param whence - Defines from where the offset applies. SEEK_SET=Begin, SEEK_CUR=Current, SEEK_END=END of file
*/
int FSseek( long offset, int whence );
/** FSerror is a file system FSerrno command for the flash drive on the arLCD
* @returns FSerrno the latest file system error number
*/
int FSerror( void );
/** FStell is a file system tell command for the flash drive on the arLCD
* @returns the current file location
*/
long FStell( void );
/** FSattrib is a file system attribute command for the flash drive on the arLCD
* @param attrib - Defines the attributes of the currently open file
* 1=ReadOnly, 2=Hidden, 4=System, 0x20=Archive
*/
int FSattrib( int attribute );
int GetFSattrib( void );
/** FSeof is a file system end of file command for the flash drive on the arLCD
* @returns the current EOF status 0=No EOF, 1=EOF
*/
int FSeof( void );
/** FSgetcwd is a file system Get Current working directory command for the flash drive on the arLCD
* @returns the current directory
*/
void FSgetcwd( void );
/** FSchdir is a file system change directory command for the flash drive on the arLCD
* @param directory - the directory to change to
*/
int FSchdir( const char* directory );
/** FSmkdir is a file system make directory command for the flash drive on the arLCD
* @param directory - the new directory to create
*/
int FSmkdir( const char* directory );
/** FScopy is a file system copy file command for the flash drive on the arLCD
* @param source_filename - source file name
* @param dest_filename - new file name
*/
int FScopy( const char* source_filename, const char* dest_filename );
/** FSrename is a file system rename file command for the flash drive on the arLCD
* @param source_filename - existing file name
* @param dest_filename - new file name
*/
int FSrename( const char* source_filename, const char* dest_filename );
/** FSremove is a file system remove file command for the flash drive on the arLCD
* @param source_filename - existing file name
*/
int FSremove( const char* source_filename );
/**
* Numerical values for the EarthSEMPL commands.
*/
enum Commands {
Command= 0, /**< Direct command. */
Clr_Screen= 2, /**< Clear to provided color. */
Ping= 3, /**< Return Pong */
zBeep= 4, /**< Beep provided duration
*(frequency fixed) */
Light= 5, /**< \c 0 (off) to \c 100 (on) */
Color= 6,
eColor_ID= 7,
Font= 10, /**< Font number. */
Fontw= 11, /**< Font number widget. */
Font_Orient= 12, /**< Horizontal or vertical. */
Line_Width= 13, /**< 1 or 3. */
Line_Type= 14, /**< 1=dot dot 2=dash dash. */
XY= 15, /**< X and Y. */
StringID= 16, /**< SID ASCII String or File Name that
* ends with 0. */
Plot= 17, /**< Place Pixel at X and Y. */
Line= 18, /**< Draw a line to X and Y. */
Box= 19, /**< Draws a Box to X and Y optional
* fill. */
Circle= 20, /**< Draws a Circle with Radius optional
* fill */
Arc= 21, /**< Draws an Arc with Radius and Begin
* Angle to End Angle. */
Pie= 22, /**< Draws a Pie figure with Radius and
* Begin Angle to End Angle and fills
* it. */
Picture= 24, /**< Places a Picture on display. */
Print= 25, /**< Places the string on display which
* ends with 0. */
Beep_Freq= 26, /**< Set the beeper frequency. */
Get_Pixel= 27, /**< Get Pixel. */
Calibrate= 28, /**< Calibrate touch screen. */
zReset= 29, /**< Reset. */
Rec_Macro= 30, /**< Record Macro to flash drive. */
Play_Macro= 31, /**< Play Macro. */
Stop_Macro= 32, /**< Stop Macro. */
Pause_Macro= 33, /**< Pause n msec. */
Loop_Macro= 34, /**< Loop on Macro. */
Speed_Macro= 35, /**< Set the macro speed. */
ConfigIO= 37,
IO= 38, /**< Set/Get IO pin state */
Bridge= 39, /**< Set Bridge Command. */
Security= 40, /**< Set drive security string. */
Location= 41, /**< LID Location Value. */
Upgrade= 43,
Run_Macro= 44,
Parameters= 45,
ClipEnable= 46, /**< Set clip Enable. */
ClipArea= 47, /**< Set clip area. */
Snapshot= 48, /**< Snapshot the screen area. */
Cmd= 49, /**< Sets the Command Port. */
/* Filesystem operations */
Comment= 50, /**< Comment */
Fsgetcwd= 51, /**< Get current working directory */
Fschdir= 52, /**< Change directory */
Fsmkdir= 53, /**< Make directory */
Fsrmdir= 54, /**< Remove directory */
Fsdir= 55, /**< Display directory */
Fscopy= 56, /**< File copy */
Fsrename= 57, /**< File rename */
Fsremove= 58, /**< File remove */
Fsmore= 59, /**< File dump */
Fsattrib= 60, /**< File Attributes */
Fsopen= 61, /**< File Open */
Fswrite= 62, /**< File Write */
Fsread= 63, /**< File Close */
Fsclose= 64, /**< File Read */
Fsrewind= 65, /**< File Rewind */
Fserror= 66, /**< File Error */
Fsseek= 67, /**< File Seek */
Fseof= 68, /**< File EOF */
Fstell= 69, /**< File Tell */
/* Widget commands */
Set_Button= 70, /**< Widget Button. */
Set_CheckBox= 71, /**< Widget Checkbox. */
Set_Gbox= 72, /**< Widget Group Box. */
Set_RadioButton= 73, /**< Widget Radio Button. */