LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_lcd.c
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #include "lms2012.h"
23 #include "c_ui.h"
24 #include "d_lcd.h"
25 
26 #if (HARDWARE != SIMULATION)
27 
28 #include <stdio.h>
29 #include <string.h>
30 #include <math.h>
31 #include <fcntl.h>
32 #include <unistd.h>
33 
34 #endif
35 
36 
37 
38 #ifndef Linux_X86
39 
40 
41 #include <sys/ioctl.h>
42 #include <sys/stat.h>
43 #include <sys/mman.h>
44 
45 #include <stdlib.h>
46 #include <errno.h>
47 #include <endian.h>
48 #include <linux/fb.h>
49 
50 
51 #define FBCTL(cmd, arg) \
52  if(ioctl(UiInstance.DispFile, cmd, arg) == -1) { \
53  LogErrorNumber(LCD_DEVICE_FILE_NOT_FOUND); }
54 
55 struct fb_var_screeninfo var;
56 struct fb_fix_screeninfo fix;
57 int dll, fll;
58 unsigned char *dbuf=NULL;
59 
60 
62 {
63  0x00, // 000 00000000
64  0xE0, // 001 11100000
65  0x1C, // 010 00011100
66  0xFC, // 011 11111100
67  0x03, // 100 00000011
68  0xE3, // 101 11100011
69  0x1F, // 110 00011111
70  0xFF // 111 11111111
71 };
72 
73 
74 void dLcdExec(LCD *pDisp)
75 {
76  UBYTE *pSrc;
77  UBYTE *pDst;
78  ULONG Pixels;
79  UWORD X;
80  UWORD Y;
81 
82 
83  if (dbuf)
84  {
85  if (memcmp((const void*)pDisp,(const void*)&VMInstance.LcdBuffer,sizeof(LCD)) != 0)
86  {
87  pSrc = (*pDisp).Lcd;
88  pDst = dbuf;
89 
90  for (Y = 0;Y < 128;Y++)
91  {
92  for (X = 0;X < 7;X++)
93  {
94  Pixels = (ULONG)*pSrc;
95  pSrc++;
96  Pixels |= (ULONG)*pSrc << 8;
97  pSrc++;
98  Pixels |= (ULONG)*pSrc << 16;
99  pSrc++;
100 
101  *pDst = PixelTab[Pixels & 0x07];
102  pDst++;
103  Pixels >>= 3;
104  *pDst = PixelTab[Pixels & 0x07];
105  pDst++;
106  Pixels >>= 3;
107  *pDst = PixelTab[Pixels & 0x07];
108  pDst++;
109  Pixels >>= 3;
110  *pDst = PixelTab[Pixels & 0x07];
111  pDst++;
112  Pixels >>= 3;
113  *pDst = PixelTab[Pixels & 0x07];
114  pDst++;
115  Pixels >>= 3;
116  *pDst = PixelTab[Pixels & 0x07];
117  pDst++;
118  Pixels >>= 3;
119  *pDst = PixelTab[Pixels & 0x07];
120  pDst++;
121  Pixels >>= 3;
122  *pDst = PixelTab[Pixels & 0x07];
123  pDst++;
124  }
125  Pixels = (ULONG)*pSrc;
126  pSrc++;
127  Pixels |= (ULONG)*pSrc << 8;
128  pSrc++;
129 
130  *pDst = PixelTab[Pixels & 0x07];
131  pDst++;
132  Pixels >>= 3;
133  *pDst = PixelTab[Pixels & 0x07];
134  pDst++;
135  Pixels >>= 3;
136  *pDst = PixelTab[Pixels & 0x07];
137  pDst++;
138  Pixels >>= 3;
139  *pDst = PixelTab[Pixels & 0x07];
140  pDst++;
141  }
142 
143  LCDCopy(&UiInstance.LcdBuffer,&VMInstance.LcdBuffer,sizeof(LCD));
145  }
146  }
147 }
148 
149 
150 #ifdef MAX_FRAMES_PER_SEC
151 void dLcdAutoUpdate(void)
152 {
153  if (UiInstance.AllowUpdate)
154  {
155  if (UiInstance.DisplayUpdate)
156  {
157  dLcdExec(&UiInstance.LcdBuffer);
158  UiInstance.DisplayUpdate = 0;
159  UiInstance.DisplayTimer = 0;
160  UiInstance.AllowUpdate = 0;
161  }
162  }
163 }
164 #endif
165 
166 
167 void dLcdUpdate(LCD *pDisp)
168 {
169 #ifdef MAX_FRAMES_PER_SEC
170  LCDCopy(pDisp,&UiInstance.LcdBuffer,sizeof(LCD));
171  UiInstance.DisplayUpdate = 1;
172  dLcdAutoUpdate();
173 #else
174  dLcdExec(pDisp);
175 #endif
176 }
177 
178 
179 void dLcdInit(UBYTE *pImage)
180 {
181  UiInstance.DispFile = open(LCD_DEVICE_NAME, O_RDWR);
183 
184  ioctl(UiInstance.DispFile, _IOW('S',0, int), NULL);
185 
186  FBCTL(FBIOGET_VSCREENINFO, &var);
187  FBCTL(FBIOGET_FSCREENINFO, &fix);
188 
189  /* Display line length in bytes */
190  dll = fix.line_length;
191  /* Image file line length in bytes */
192  fll = (var.xres >> 3) + 1;
193 
194  dbuf = (unsigned char *)mmap(0, var.yres * dll, PROT_WRITE | PROT_READ, MAP_SHARED, UiInstance.DispFile, 0);
195  if (dbuf == MAP_FAILED) LogErrorNumber(LCD_DEVICE_FILE_NOT_FOUND);
196 }
197 
198 
200 {
201  return (0);
202 }
203 
204 
205 void dLcdExit(void)
206 {
207  if (UiInstance.DispFile >= MIN_HANDLE)
208  {
209  close(UiInstance.DispFile);
210  }
211 }
212 
213 
214 #else
215 
216 #include <X11/Xlib.h>
217 #include <X11/X.h>
218 #include <X11/Xutil.h>
219 #include <time.h>
220 #include <unistd.h>
221 #include <stdio.h>
222 #include <X11/xpm.h>
223 
224 #define DISPLAY_LEFT 10
225 #define DISPLAY_TOP 100
226 #define DISPLAY_WIDTH 366
227 #define DISPLAY_HEIGHT 557
228 
229 #define LCD_LEFT 93
230 #define LCD_TOP 65
231 
232 enum UiButPins
233 {
234  BUT0, // UP
235  BUT1, // ENTER
236  BUT2, // DOWN
237  BUT3, // RIGHT
238  BUT4, // LEFT
239  BUT5, // BACK
240  BUT_PINS
241 };
242 
243 
244 Display *pDisplay;
245 Window hWindow;
246 GC hGC;
247 int Background;
248 int Foreground;
249 XEvent Event;
250 Colormap CM;
251 XColor colour_bk;
252 
253 XImage *pImg,*pClp;
254 
255 Pixmap hLcd;
256 
257 XImage Image;
258 
259 
260 void dLcdExec(LCD *pDisp)
261 {
262  if (memcmp((const void*)pDisp,(const void*)&VMInstance.LcdBuffer,sizeof(LCD)) != 0)
263  {
264  XPutImage(pDisplay,hWindow,hGC,&Image,0,0,LCD_LEFT,LCD_TOP,LCD_WIDTH,LCD_HEIGHT);
265  XFlush(pDisplay);
266  usleep(25);
267 
268  LCDCopy(&UiInstance.LcdBuffer,&VMInstance.LcdBuffer,sizeof(LCD));
270  }
271 }
272 
273 
274 #ifdef MAX_FRAMES_PER_SEC
275 void dLcdAutoUpdate(void)
276 {
277  if (UiInstance.AllowUpdate)
278  {
279  if (UiInstance.DisplayUpdate)
280  {
281  dLcdExec(&UiInstance.LcdBuffer);
282  UiInstance.DisplayUpdate = 0;
283  UiInstance.DisplayTimer = 0;
284  UiInstance.AllowUpdate = 0;
285  }
286  }
287 }
288 #endif
289 
290 
291 void dLcdUpdate(LCD *pDisp)
292 {
293 #ifdef MAX_FRAMES_PER_SEC
294  LCDCopy(pDisp,&UiInstance.LcdBuffer,sizeof(LCD));
295  UiInstance.DisplayUpdate = 1;
296  dLcdAutoUpdate();
297 #else
298  dLcdExec(pDisp);
299 #endif
300 }
301 
302 
303 void dLcdInit(UBYTE *pImage)
304 {
305  XSetWindowAttributes WindowAttributes;
306  unsigned long WindowMask;
307  int Depth;
308  char Buffer[255];
309  int ScreenNo;
310 
311  pDisplay = XOpenDisplay(NULL);
312  if (pDisplay != NULL)
313  {
314  Background = BlackPixel(pDisplay,DefaultScreen(pDisplay));
315  Foreground = WhitePixel(pDisplay,DefaultScreen(pDisplay));
316 
317  Depth = DefaultDepth(pDisplay,DefaultScreen(pDisplay));
318  ScreenNo = DefaultScreen(pDisplay);
319  CM = XDefaultColormap(pDisplay,ScreenNo);
320  colour_bk.flags = DoRed|DoGreen|DoBlue;
321  colour_bk.red = 32512;
322  colour_bk.green = 34304;
323  colour_bk.blue = 34560;
324 
325  WindowAttributes.border_pixel = Background;
326  WindowAttributes.background_pixel = Foreground;
327  WindowAttributes.override_redirect = 1;
328  WindowMask = CWBackPixel|CWBorderPixel|CWOverrideRedirect;
329  hWindow = XCreateWindow(pDisplay,RootWindow(pDisplay,ScreenNo),DISPLAY_LEFT,DISPLAY_TOP,DISPLAY_WIDTH,DISPLAY_HEIGHT,0,Depth,InputOutput,CopyFromParent,WindowMask,&WindowAttributes);
330 
331 
332 
333  if (XAllocColor(pDisplay,CM,&colour_bk) == 0)
334  {
335  printf("XAllocColor failure.\n");
336  }
337  if (XSetWindowBackground(pDisplay,hWindow, colour_bk.pixel) == BadGC)
338  {
339  printf("XSetBackground failure.\n");
340  }
341 
342  snprintf(Buffer,255,"%s V%4.2f",PROJECT,VERS);
343  XSetStandardProperties(pDisplay,hWindow,Buffer,Buffer,None,NULL,0,NULL);
344 
345  XSelectInput(pDisplay,hWindow,StructureNotifyMask);
346  XMapWindow(pDisplay,hWindow);
347 
348  hGC = XCreateGC(pDisplay,hWindow,0,NULL);
349  XSetForeground(pDisplay,hGC,Background);
350  XSetBackground(pDisplay,hGC,colour_bk.pixel);
351  XFlush(pDisplay);
352 
353  do
354  {
355  XNextEvent(pDisplay,&Event);
356  }
357  while (Event.type != MapNotify);
358 
359  hLcd = XCreatePixmap(pDisplay,hWindow,LCD_WIDTH,LCD_HEIGHT,Depth);
360 
361  // Load body bitmap
362  if (XpmReadFileToImage(pDisplay,"body.xpm",&pImg,&pClp,NULL) == 0)
363  {
364  XPutImage(pDisplay,hWindow,hGC,pImg,0,0,0,0,DISPLAY_WIDTH,DISPLAY_HEIGHT);
365  }
366  XFlush(pDisplay);
367 
368  XSetForeground(pDisplay,hGC,Background);
369  XSetBackground(pDisplay,hGC,colour_bk.pixel);
370 
371  XCopyArea(pDisplay,hLcd,hWindow,hGC,0,0,LCD_WIDTH,LCD_HEIGHT,LCD_LEFT,LCD_TOP);
372  XFlush(pDisplay);
373 
374  Image.width = LCD_WIDTH;
375  Image.height = LCD_HEIGHT;
376  Image.xoffset = 0;
377  Image.format = XYBitmap;
378  Image.data = (char*)pImage;
379  Image.byte_order = LSBFirst;
380  Image.bitmap_unit = 8;
381  Image.bitmap_bit_order = LSBFirst;
382  Image.bitmap_pad = 8;
383  Image.depth = 1;
384  Image.bytes_per_line = (LCD_WIDTH + 7) / 8;
385  Image.bits_per_pixel = 1;
386 
387  XInitImage(&Image);
388 
389  LCDClear(pImage);
390 
391  XSelectInput(pDisplay,hWindow,ExposureMask | ButtonPressMask | ButtonReleaseMask);
392  }
393 }
394 
395 
396 UBYTE dLcdRead(void)
397 {
398  UBYTE Result = 0;
399  int X,Y;
400 
401  if (XCheckMaskEvent(pDisplay,ExposureMask | ButtonPressMask | ButtonReleaseMask,&Event))
402  {
403  //printf("%d %d\r\n",Event.type,Event.xbutton.button);
404 
405  switch (Event.type)
406  {
407  case ButtonPress :
408  {
409  X = Event.xbutton.x;
410  Y = Event.xbutton.y;
411 
412  switch (Event.xbutton.button)
413  {
414  case Button1 :
415  {
416  //printf("%4d %4d\r\n",X,Y);
417 
418  if ((X >= 162) && (X <= 205) && (Y >= 288) && (Y <= 327))
419  {
420  UiInstance.ButtonState[BUT0] |= BUTTON_ACTIVE;
421  }
422  if ((X >= 162) && (X <= 205) && (Y >= 382) && (Y <= 421))
423  {
424  UiInstance.ButtonState[BUT2] |= BUTTON_ACTIVE;
425  }
426  if ((X >= 230) && (X <= 264) && (Y >= 338) && (Y <= 371))
427  {
428  UiInstance.ButtonState[BUT3] |= BUTTON_ACTIVE;
429  }
430  if ((X >= 98) && (X <= 137) && (Y >= 337) && (Y <= 370))
431  {
432  UiInstance.ButtonState[BUT4] |= BUTTON_ACTIVE;
433  }
434  if ((X >= 162) && (X <= 202) && (Y >= 333) && (Y <= 375))
435  {
436  UiInstance.ButtonState[BUT1] |= BUTTON_ACTIVE;
437  }
438  if ((X >= 51) && (X <= 120) && (Y >= 258) && (Y <= 295))
439  {
440  UiInstance.ButtonState[BUT5] |= BUTTON_ACTIVE;
441  }
442  }
443  break;
444 
445  case Button3 :
446  {
447 // UiInstance.Event = vmEVENT_BT_PIN;
448 // UiInstance.Event = vmEVENT_BT_REQ_CONF;
449 // SetUiUpdate();
450 // UiInstance.Warning |= WARNING_TEMP;
451 
452  // printf("%4d %4d\r\n",X,Y);
453  }
454  break;
455 
456  }
457  }
458  break;
459 
460  case ButtonRelease :
461  {
462  X = Event.xbutton.x;
463  Y = Event.xbutton.y;
464 
465  switch (Event.xbutton.button)
466  {
467  case Button1 :
468  {
469  //printf("%4d %4d\r\n",X,Y);
470 
471  if ((X >= 162) && (X <= 205) && (Y >= 288) && (Y <= 327))
472  {
473  UiInstance.ButtonState[BUT0] &= ~BUTTON_ACTIVE;
474  }
475  if ((X >= 162) && (X <= 205) && (Y >= 382) && (Y <= 421))
476  {
477  UiInstance.ButtonState[BUT2] &= ~BUTTON_ACTIVE;
478  }
479  if ((X >= 230) && (X <= 264) && (Y >= 338) && (Y <= 371))
480  {
481  UiInstance.ButtonState[BUT3] &= ~BUTTON_ACTIVE;
482  }
483  if ((X >= 98) && (X <= 137) && (Y >= 337) && (Y <= 370))
484  {
485  UiInstance.ButtonState[BUT4] &= ~BUTTON_ACTIVE;
486  }
487  if ((X >= 162) && (X <= 202) && (Y >= 333) && (Y <= 375))
488  {
489  UiInstance.ButtonState[BUT1] &= ~BUTTON_ACTIVE;
490  }
491  if ((X >= 51) && (X <= 120) && (Y >= 258) && (Y <= 295))
492  {
493  UiInstance.ButtonState[BUT5] &= ~BUTTON_ACTIVE;
494  }
495  }
496  break;
497 
498  }
499  }
500  break;
501 
502  }
503  }
504 
505  return (Result);
506 }
507 
508 
509 void dLcdExit(void)
510 {
511  if (pDisplay)
512  {
513  XFreePixmap(pDisplay,hLcd);
514  XFreeGC(pDisplay,hGC);
515  XCloseDisplay(pDisplay);
516  }
517 }
518 
519 #endif
520 
521 
522 void dLcdScroll(UBYTE *pImage,DATA16 Y0)
523 {
524 
525  memmove(pImage,&pImage[((LCD_WIDTH + 7) / 8) * Y0],(LCD_HEIGHT - Y0) * ((LCD_WIDTH + 7) / 8));
526  memset(&pImage[(LCD_HEIGHT - Y0) * ((LCD_WIDTH + 7) / 8)],0,((LCD_WIDTH + 7) / 8) * Y0);
527 }
528 
529 
530 void dLcdDrawPixel(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0)
531 {
532  if ((X0 >= 0) && (X0 < LCD_WIDTH) && (Y0 >= 0) && (Y0 < LCD_HEIGHT))
533  {
534  if (Color)
535  {
536  pImage[(X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3)] |= (1 << (X0 % 8));
537  }
538  else
539  {
540  pImage[(X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3)] &= ~(1 << (X0 % 8));
541  }
542  }
543 }
544 
545 
546 void dLcdInversePixel(UBYTE *pImage,DATA16 X0,DATA16 Y0)
547 {
548  if ((X0 >= 0) && (X0 < LCD_WIDTH) && (Y0 >= 0) && (Y0 < LCD_HEIGHT))
549  {
550  pImage[(X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3)] ^= (1 << (X0 % 8));
551  }
552 }
553 
554 
556 {
557  DATA8 Result = 0;
558 
559  if ((X0 >= 0) && (X0 < LCD_WIDTH) && (Y0 >= 0) && (Y0 < LCD_HEIGHT))
560  {
561  if ((pImage[(X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3)] & (1 << (X0 % 8))))
562  {
563  Result = 1;
564  }
565  }
566 
567  return (Result);
568 }
569 
570 
571 void dLcdDrawLine(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
572 {
573  DATA16 XLength;
574  DATA16 YLength;
575  DATA16 XInc;
576  DATA16 YInc;
577  DATA16 Diff;
578  DATA16 Tmp;
579 
580  if (X0 < X1)
581  {
582  XLength = X1 - X0;
583  XInc = 1;
584  }
585  else
586  {
587  XLength = X0 - X1;
588  XInc = -1;
589  }
590  if (Y0 < Y1)
591  {
592  YLength = Y1 - Y0;
593  YInc = 1;
594  }
595  else
596  {
597  YLength = Y0 - Y1;
598  YInc = -1;
599  }
600  Diff = XLength - YLength;
601 
602  dLcdDrawPixel(pImage,Color,X0,Y0);
603 
604  while ((X0 != X1) || (Y0 != Y1))
605  {
606  Tmp = Diff << 1;
607  if (Tmp > (-YLength))
608  {
609  Diff -= YLength;
610  X0 += XInc;
611  }
612  if (Tmp < XLength)
613  {
614  Diff += XLength;
615  Y0 += YInc;
616  }
617  dLcdDrawPixel(pImage,Color,X0,Y0);
618  }
619 }
620 
621 
622 void dLcdDrawDotLine(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1,DATA16 On,DATA16 Off)
623 {
624  DATA16 XLength;
625  DATA16 YLength;
626  DATA16 XInc;
627  DATA16 YInc;
628  DATA16 Diff;
629  DATA16 Tmp;
630  DATA16 Count;
631 
632  if ((X0 != X1) && (Y0 != Y1))
633  {
634  dLcdDrawLine(pImage,Color,X0,Y0,X1,Y1);
635  }
636  else
637  {
638  if (X0 < X1)
639  {
640  XLength = X1 - X0;
641  XInc = 1;
642  }
643  else
644  {
645  XLength = X0 - X1;
646  XInc = -1;
647  }
648  if (Y0 < Y1)
649  {
650  YLength = Y1 - Y0;
651  YInc = 1;
652  }
653  else
654  {
655  YLength = Y0 - Y1;
656  YInc = -1;
657  }
658  Diff = XLength - YLength;
659 
660  dLcdDrawPixel(pImage,Color,X0,Y0);
661  Count = 1;
662 
663  while ((X0 != X1) || (Y0 != Y1))
664  {
665  Tmp = Diff << 1;
666  if (Tmp > (-YLength))
667  {
668  Diff -= YLength;
669  X0 += XInc;
670  }
671  if (Tmp < XLength)
672  {
673  Diff += XLength;
674  Y0 += YInc;
675  }
676  if (Count < (On + Off))
677  {
678  if (Count < On)
679  {
680  dLcdDrawPixel(pImage,Color,X0,Y0);
681  }
682  else
683  {
684  dLcdDrawPixel(pImage,1 - Color,X0,Y0);
685  }
686  }
687  Count++;
688  if (Count >= (On + Off))
689  {
690  Count = 0;
691  }
692  }
693  }
694 }
695 
696 
697 void dLcdPlotPoints(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
698 {
699  dLcdDrawPixel(pImage,Color,X0 + X1,Y0 + Y1);
700  dLcdDrawPixel(pImage,Color,X0 - X1,Y0 + Y1);
701  dLcdDrawPixel(pImage,Color,X0 + X1,Y0 - Y1);
702  dLcdDrawPixel(pImage,Color,X0 - X1,Y0 - Y1);
703  dLcdDrawPixel(pImage,Color,X0 + Y1,Y0 + X1);
704  dLcdDrawPixel(pImage,Color,X0 - Y1,Y0 + X1);
705  dLcdDrawPixel(pImage,Color,X0 + Y1,Y0 - X1);
706  dLcdDrawPixel(pImage,Color,X0 - Y1,Y0 - X1);
707 }
708 
709 
710 void dLcdDrawCircle(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 R)
711 {
712  int X = 0;
713  int Y = R;
714  int P = 3 - 2 * R;
715 
716  while (X<Y)
717  {
718  dLcdPlotPoints(pImage,Color,X0,Y0,X,Y);
719  if (P < 0)
720  {
721  P = P + 4 * X + 6;
722  }
723  else
724  {
725  P = P + 4 * (X - Y) + 10;
726  Y = Y - 1;
727  }
728  X = X + 1;
729  }
730  dLcdPlotPoints(pImage,Color,X0,Y0,X,Y);
731 }
732 
733 
734 typedef struct
735 {
736  const char *pFontBits; // Pointer to start of font bitmap
737  const DATA16 FontHeight; // Character height (all inclusive)
738  const DATA16 FontWidth; // Character width (all inclusive)
739  const DATA16 FontHorz; // Number of horizontal character in font bitmap
740  const DATA8 FontFirst; // First character supported
741  const DATA8 FontLast; // Last character supported
742 }
743 FONTINFO;
744 
745 
746 #include "normal_font.xbm"
747 #include "small_font.xbm"
748 #include "large_font.xbm"
749 #include "tiny_font.xbm"
750 
751 
753 {
754  [NORMAL_FONT] = {
755  .pFontBits = (const char*)normal_font_bits,
756  .FontHeight = 9,
757  .FontWidth = 8,
758  .FontHorz = 16,
759  .FontFirst = 0x20,
760  .FontLast = 0x7F
761  },
762  [SMALL_FONT] = {
763  .pFontBits = (const char*)small_font_bits,
764  .FontHeight = 8,
765  .FontWidth = 8,
766  .FontHorz = 16,
767  .FontFirst = 0x20,
768  .FontLast = 0x7F
769  },
770  [LARGE_FONT] = {
771  .pFontBits = (const char*)large_font_bits,
772  .FontHeight = 16,
773  .FontWidth = 16,
774  .FontHorz = 16,
775  .FontFirst = 0x20,
776  .FontLast = 0x7F
777  },
778  [TINY_FONT] = {
779  .pFontBits = (const char*)tiny_font_bits,
780  .FontHeight = 7,
781  .FontWidth = 5,
782  .FontHorz = 16,
783  .FontFirst = 0x20,
784  .FontLast = 0x7F
785  },
786 
787 };
788 
789 
791 {
792  return (FontInfo[Font].FontWidth);
793 }
794 
795 
797 {
798  return (FontInfo[Font].FontHeight);
799 }
800 
801 
802 void dLcdDrawChar(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA8 Font,DATA8 Char)
803 {
804  DATA16 CharWidth;
805  DATA16 CharHeight;
806  DATA16 CharByteIndex;
807  DATA16 LcdByteIndex;
808  UBYTE CharByte;
809  DATA16 Tmp,X,Y,TmpX,MaxX;
810 
811 
812  CharWidth = FontInfo[Font].FontWidth;
813  CharHeight = FontInfo[Font].FontHeight;
814 
815  if ((Char >= FontInfo[Font].FontFirst) && (Char <= FontInfo[Font].FontLast))
816  {
817  Char -= FontInfo[Font].FontFirst;
818 
819  CharByteIndex = (Char % FontInfo[Font].FontHorz) * ((CharWidth + 7) / 8);
820  CharByteIndex += ((Char / FontInfo[Font].FontHorz) * ((CharWidth + 7) / 8) * CharHeight * FontInfo[Font].FontHorz);
821 
822  if (((CharWidth % 8) == 0) && ((X0 % 8) == 0))
823  { // Font aligned
824 
825  X0 = (X0 >> 3) << 3;
826  LcdByteIndex = (X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3);
827 
828  if (Color)
829  {
830  while (CharHeight)
831  {
832  Tmp = 0;
833  do
834  {
835  if (LcdByteIndex < sizeof(LCD))
836  {
837  pImage[LcdByteIndex + Tmp] = FontInfo[Font].pFontBits[CharByteIndex + Tmp];
838  }
839  Tmp++;
840  }
841  while (Tmp < (CharWidth / 8));
842 
843  CharByteIndex += (CharWidth * FontInfo[Font].FontHorz) / 8;
844  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
845  CharHeight--;
846  }
847  }
848  else
849  {
850  while (CharHeight)
851  {
852  Tmp = 0;
853  do
854  {
855  if (LcdByteIndex < sizeof(LCD))
856  {
857  pImage[LcdByteIndex + Tmp] = ~FontInfo[Font].pFontBits[CharByteIndex + Tmp];
858  }
859  Tmp++;
860  }
861  while (Tmp < (CharWidth / 8));
862 
863  CharByteIndex += (CharWidth * FontInfo[Font].FontHorz) / 8;
864  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
865  CharHeight--;
866  }
867  }
868  }
869  else
870  { // Font not aligned
871 
872  MaxX = X0 + CharWidth;
873 
874  if (Color)
875  {
876  for (Y = 0;Y < CharHeight;Y++)
877  {
878  TmpX = X0;
879 
880  for (X = 0;X < ((CharWidth + 7) / 8);X++)
881  {
882  CharByte = FontInfo[Font].pFontBits[CharByteIndex + X];
883 
884  for (Tmp = 0;(Tmp < 8) && (TmpX < MaxX);Tmp++)
885  {
886  if (CharByte & 1)
887  {
888  dLcdDrawPixel(pImage,1,TmpX,Y0);
889  }
890  else
891  {
892  dLcdDrawPixel(pImage,0,TmpX,Y0);
893  }
894  CharByte >>= 1;
895  TmpX++;
896  }
897  }
898  Y0++;
899  CharByteIndex += ((CharWidth + 7) / 8) * FontInfo[Font].FontHorz;
900 
901  }
902  }
903  else
904  {
905  for (Y = 0;Y < CharHeight;Y++)
906  {
907  TmpX = X0;
908 
909  for (X = 0;X < ((CharWidth + 7) / 8);X++)
910  {
911  CharByte = FontInfo[Font].pFontBits[CharByteIndex + X];
912 
913  for (Tmp = 0;(Tmp < 8) && (TmpX < MaxX);Tmp++)
914  {
915  if (CharByte & 1)
916  {
917  dLcdDrawPixel(pImage,0,TmpX,Y0);
918  }
919  else
920  {
921  dLcdDrawPixel(pImage,1,TmpX,Y0);
922  }
923  CharByte >>= 1;
924  TmpX++;
925  }
926  }
927  Y0++;
928  CharByteIndex += ((CharWidth + 7) / 8) * FontInfo[Font].FontHorz;
929  }
930  }
931  }
932  }
933 }
934 
935 
936 void dLcdDrawText(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA8 Font,DATA8 *pText)
937 {
938  while (*pText)
939  {
940  if (X0 < (LCD_WIDTH - FontInfo[Font].FontWidth))
941  {
942  dLcdDrawChar(pImage,Color,X0,Y0,Font,*pText);
943  X0 += FontInfo[Font].FontWidth;
944  }
945  pText++;
946  }
947 }
948 
949 
950 typedef struct
951 {
952  const char *pIconBits;
956 }
957 ICONINFO;
958 
959 #include "normal_icons.xbm"
960 #include "small_icons.xbm"
961 #include "large_icons.xbm"
962 #include "menu_icons.xbm"
963 #include "arrow_icons.xbm"
964 
965 
967 {
968  [NORMAL_ICON] = {
969  .pIconBits = normal_icons_bits,
970  .IconSize = normal_icons_height,
971  .IconHeight = 12,
972  .IconWidth = normal_icons_width
973  },
974  [SMALL_ICON] = {
975  .pIconBits = small_icons_bits,
976  .IconSize = small_icons_height,
977  .IconHeight = 8,
978  .IconWidth = small_icons_width
979  },
980  [LARGE_ICON] = {
981  .pIconBits = large_icons_bits,
982  .IconSize = large_icons_height,
983  .IconHeight = 22,
984  .IconWidth = large_icons_width
985  },
986  [MENU_ICON] = {
987  .pIconBits = menu_icons_bits,
988  .IconSize = menu_icons_height,
989  .IconHeight = 12,
990  .IconWidth = menu_icons_width
991  },
992  [ARROW_ICON] = {
993  .pIconBits = arrow_icons_bits,
994  .IconSize = arrow_icons_height,
995  .IconHeight = 12,
996  .IconWidth = arrow_icons_width
997  },
998 };
999 
1000 
1002 {
1003  UBYTE *pResult;
1004 
1005  pResult = (UBYTE*)IconInfo[Type].pIconBits;
1006 
1007  return (pResult);
1008 }
1009 
1010 
1012 {
1013  return (IconInfo[Type].IconWidth);
1014 }
1015 
1016 
1018 {
1019  return (IconInfo[Type].IconHeight);
1020 }
1021 
1022 
1024 {
1025  return (IconInfo[Type].IconSize / IconInfo[Type].IconHeight);
1026 }
1027 
1028 
1029 void dLcdDrawPicture(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 IconWidth,DATA16 IconHeight,UBYTE *pIconBits)
1030 {
1031  DATA16 IconByteIndex;
1032  DATA16 LcdByteIndex;
1033  DATA16 Tmp;
1034 
1035  IconByteIndex = 0;
1036 
1037  X0 = (X0 >> 3) << 3;
1038  LcdByteIndex = (X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3);
1039 
1040 
1041  if (Color)
1042  {
1043  while (IconHeight)
1044  {
1045  for (Tmp = 0;Tmp < (IconWidth / 8);Tmp++)
1046  {
1047  pImage[LcdByteIndex + Tmp] = pIconBits[IconByteIndex + Tmp];
1048  }
1049 
1050  IconByteIndex += IconWidth / 8;
1051  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
1052  IconHeight--;
1053  }
1054  }
1055  else
1056  {
1057  while (IconHeight)
1058  {
1059  for (Tmp = 0;Tmp < (IconWidth / 8);Tmp++)
1060  {
1061  pImage[LcdByteIndex + Tmp] = ~pIconBits[IconByteIndex + Tmp];
1062  }
1063 
1064  IconByteIndex += IconWidth / 8;
1065  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
1066  IconHeight--;
1067  }
1068  }
1069 }
1070 
1071 
1072 void dLcdDrawIcon(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA8 Type,DATA8 No)
1073 {
1074  DATA16 IconByteIndex;
1075  DATA16 IconHeight;
1076  DATA16 IconWidth;
1077  UBYTE *pIconBits;
1078 
1079  IconHeight = dLcdGetIconHeight(Type);
1080  IconWidth = dLcdGetIconWidth(Type);
1081 
1082  if ((No >= 0) && (No <= dLcdGetNoOfIcons(Type)))
1083  {
1084  pIconBits = dLcdGetIconBits(Type);
1085  IconByteIndex = ((DATA16)No * IconWidth * IconHeight) / 8;
1086  dLcdDrawPicture(pImage,Color,X0,Y0,IconWidth,IconHeight,&pIconBits[IconByteIndex]);
1087  }
1088 }
1089 
1090 
1091 void dLcdGetBitmapSize(IP pBitmap,DATA16 *pWidth,DATA16 *pHeight)
1092 {
1093  *pWidth = 0;
1094  *pHeight = 0;
1095 
1096  if (pBitmap)
1097  {
1098 
1099  *pWidth = (DATA16)pBitmap[0];
1100  *pHeight = (DATA16)pBitmap[1];
1101  }
1102 }
1103 
1104 
1105 void dLcdDrawBitmap(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,IP pBitmap)
1106 {
1107  DATA16 BitmapWidth;
1108  DATA16 BitmapHeight;
1109  DATA16 BitmapByteIndex;
1110  UBYTE *pBitmapBytes;
1111  UBYTE BitmapByte;
1112  DATA16 Tmp,X,Y,TmpX,MaxX;
1113 
1114  DATA16 LcdByteIndex;
1115 
1116  if (pBitmap)
1117  {
1118 
1119  BitmapWidth = (DATA16)pBitmap[0];
1120  BitmapHeight = (DATA16)pBitmap[1];
1121  MaxX = X0 + BitmapWidth;
1122  pBitmapBytes = &pBitmap[2];
1123 
1124  if ((BitmapWidth >=0) && (BitmapHeight >= 0))
1125  {
1126  if ((X0 % 8) || (BitmapWidth % 8))
1127  { // X is not aligned
1128 
1129  BitmapWidth = ((BitmapWidth + 7) >> 3) << 3;
1130 
1131  if (Color)
1132  {
1133  for (Y = 0;Y < BitmapHeight;Y++)
1134  {
1135  BitmapByteIndex = (Y * BitmapWidth) / 8;
1136  TmpX = X0;
1137 
1138  for (X = 0;X < (BitmapWidth / 8);X++)
1139  {
1140  BitmapByte = pBitmapBytes[BitmapByteIndex + X];
1141 
1142  for (Tmp = 0;(Tmp < 8) && (TmpX < MaxX);Tmp++)
1143  {
1144  if (BitmapByte & 1)
1145  {
1146  dLcdDrawPixel(pImage,1,TmpX,Y0);
1147  }
1148  else
1149  {
1150  dLcdDrawPixel(pImage,0,TmpX,Y0);
1151  }
1152  BitmapByte >>= 1;
1153  TmpX++;
1154  }
1155  }
1156  Y0++;
1157  }
1158  }
1159  else
1160  {
1161  for (Y = 0;Y < BitmapHeight;Y++)
1162  {
1163  BitmapByteIndex = (Y * BitmapWidth) / 8;
1164  TmpX = X0;
1165 
1166  for (X = 0;X < (BitmapWidth / 8);X++)
1167  {
1168  BitmapByte = pBitmapBytes[BitmapByteIndex + X];
1169 
1170  for (Tmp = 0;(Tmp < 8) && (TmpX < MaxX);Tmp++)
1171  {
1172  if (BitmapByte & 1)
1173  {
1174  dLcdDrawPixel(pImage,0,TmpX,Y0);
1175  }
1176  else
1177  {
1178  dLcdDrawPixel(pImage,1,TmpX,Y0);
1179  }
1180  BitmapByte >>= 1;
1181  TmpX++;
1182  }
1183  }
1184  Y0++;
1185  }
1186  }
1187  }
1188 
1189  else
1190  { // X is byte aligned
1191 
1192  BitmapByteIndex = 0;
1193 
1194  LcdByteIndex = (X0 >> 3) + Y0 * ((LCD_WIDTH + 7) >> 3);
1195 
1196  if (Color)
1197  {
1198  while (BitmapHeight)
1199  {
1200  X = X0;
1201  for (Tmp = 0;Tmp < (BitmapWidth / 8);Tmp++)
1202  {
1203  if (((LcdByteIndex + Tmp) < LCD_BUFFER_SIZE) && (X < LCD_WIDTH) && (X >= 0))
1204  {
1205  pImage[LcdByteIndex + Tmp] = pBitmapBytes[BitmapByteIndex + Tmp];
1206  }
1207  X += 8;
1208  }
1209 
1210  BitmapByteIndex += BitmapWidth / 8;
1211  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
1212 
1213  BitmapHeight--;
1214  }
1215  }
1216  else
1217  {
1218  while (BitmapHeight)
1219  {
1220  X = X0;
1221  for (Tmp = 0;Tmp < (BitmapWidth / 8);Tmp++)
1222  {
1223  if (((LcdByteIndex + Tmp) < LCD_BUFFER_SIZE) && (X < LCD_WIDTH) && (X >= 0))
1224  {
1225  pImage[LcdByteIndex + Tmp] = ~pBitmapBytes[BitmapByteIndex + Tmp];
1226  }
1227  X += 8;
1228  }
1229 
1230  BitmapByteIndex += BitmapWidth / 8;
1231  LcdByteIndex += ((LCD_WIDTH + 7) >> 3);
1232 
1233  BitmapHeight--;
1234  }
1235  }
1236  }
1237 
1238  }
1239  }
1240 }
1241 
1242 
1243 void dLcdRect(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
1244 {
1245  X1--;
1246  Y1--;
1247  dLcdDrawLine(pImage,Color,X0,Y0,X0 + X1,Y0);
1248  dLcdDrawLine(pImage,Color,X0 + X1,Y0,X0 + X1,Y0 + Y1);
1249  dLcdDrawLine(pImage,Color,X0 + X1,Y0 + Y1,X0,Y0 + Y1);
1250  dLcdDrawLine(pImage,Color,X0,Y0 + Y1,X0,Y0);
1251 }
1252 
1253 
1254 void dLcdFillRect(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
1255 {
1256  DATA16 StartX;
1257  DATA16 MaxX;
1258  DATA16 MaxY;
1259 
1260  StartX = X0;
1261  MaxX = X0 + X1;
1262  MaxY = Y0 + Y1;
1263 
1264  for (;Y0 < MaxY;Y0++)
1265  {
1266  for (X0 = StartX;X0 < MaxX;X0++)
1267  {
1268  dLcdDrawPixel(pImage,Color,X0,Y0);
1269  }
1270  }
1271 }
1272 
1273 
1274 void dLcdInverseRect(UBYTE *pImage,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
1275 {
1276  DATA16 StartX;
1277  DATA16 MaxX;
1278  DATA16 MaxY;
1279 
1280  StartX = X0;
1281  MaxX = X0 + X1;
1282  MaxY = Y0 + Y1;
1283 
1284  for (;Y0 < MaxY;Y0++)
1285  {
1286  for (X0 = StartX;X0 < MaxX;X0++)
1287  {
1288  dLcdInversePixel(pImage,X0,Y0);
1289  }
1290  }
1291 }
1292 
1293 
1294 void dLcdPlotLines(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0,DATA16 X1,DATA16 Y1)
1295 {
1296  dLcdDrawLine(pImage,Color,X0 - X1,Y0 + Y1,X0 + X1,Y0 + Y1);
1297  dLcdDrawLine(pImage,Color,X0 - X1,Y0 - Y1,X0 + X1,Y0 - Y1);
1298  dLcdDrawLine(pImage,Color,X0 - Y1,Y0 + X1,X0 + Y1,Y0 + X1);
1299  dLcdDrawLine(pImage,Color,X0 - Y1,Y0 - X1,X0 + Y1,Y0 - X1);
1300 }
1301 
1302 
1304 {
1305  int X = 0;
1306  int Y = R;
1307  int P = 3 - 2 * R;
1308 
1309  while (X<Y)
1310  {
1311  dLcdPlotLines(pImage,Color,X0,Y0,X,Y);
1312  if (P < 0)
1313  {
1314  P = P + 4 * X + 6;
1315  }
1316  else
1317  {
1318  P = P + 4 * (X - Y) + 10;
1319  Y = Y - 1;
1320  }
1321  X = X + 1;
1322  }
1323  dLcdPlotLines(pImage,Color,X0,Y0,X,Y);
1324 }
1325 
1326 
1328 {
1329  DATA8 Result = 0;
1330 
1331  if ((X0 >= 0) && (X0 < LCD_WIDTH) && (Y0 >= 0) && (Y0 < LCD_HEIGHT))
1332  {
1333  if (dLcdReadPixel(pImage,X0,Y0) != Color)
1334  {
1335  Result = 1;
1336  }
1337  }
1338 
1339  return (Result);
1340 }
1341 
1342 
1343 void dLcdFlodfill(UBYTE *pImage,DATA8 Color,DATA16 X0,DATA16 Y0)
1344 {
1345  DATA16 X;
1346  DATA16 Y;
1347 
1348  Y = Y0;
1349  X = X0;
1350 
1351  while (dLcdCheckPixel(pImage,Color,X,Y))
1352  {
1353  while (dLcdCheckPixel(pImage,Color,X,Y))
1354  {
1355  if (X != X0)
1356  {
1357  dLcdDrawPixel(pImage,Color,X,Y);
1358  }
1359  X--;
1360  }
1361  X = X0;
1362  Y--;
1363  }
1364 
1365  Y = Y0;
1366  X = X0;
1367 
1368  while (dLcdCheckPixel(pImage,Color,X,Y))
1369  {
1370  while (dLcdCheckPixel(pImage,Color,X,Y))
1371  {
1372  if (X != X0)
1373  {
1374  dLcdDrawPixel(pImage,Color,X,Y);
1375  }
1376  X--;
1377  }
1378  X = X0;
1379  Y++;
1380  }
1381 
1382  Y = Y0;
1383  X = X0;
1384 
1385  while (dLcdCheckPixel(pImage,Color,X,Y))
1386  {
1387  while (dLcdCheckPixel(pImage,Color,X,Y))
1388  {
1389  dLcdDrawPixel(pImage,Color,X,Y);
1390  X++;
1391  }
1392  X = X0;
1393  Y--;
1394  }
1395 
1396  Y = Y0 + 1;
1397  X = X0;
1398 
1399  while (dLcdCheckPixel(pImage,Color,X,Y))
1400  {
1401  while (dLcdCheckPixel(pImage,Color,X,Y))
1402  {
1403  dLcdDrawPixel(pImage,Color,X,Y);
1404  X++;
1405  }
1406  X = X0;
1407  Y++;
1408  }
1409 
1410 }
const char * pIconBits
Definition: d_lcd.c:952
struct fb_var_screeninfo var
Definition: d_lcd.c:55
char Char
Definition: tistdtypes.h:54
#define snprintf
Definition: c_input.c:141
const DATA8 FontLast
Definition: d_lcd.c:741
LCD LcdBuffer
Copy of last LCD update.
Definition: lms2012.h:1498
void dLcdScroll(UBYTE *pImage, DATA16 Y0)
Definition: d_lcd.c:522
Definition: d_ui.c:102
SWORD DATA16
VM Type for 2 byte signed value.
Definition: lmstypes.h:62
DATA16 dLcdGetFontWidth(DATA8 Font)
Definition: d_lcd.c:790
void LogErrorNumber(ERR Err)
Definition: lms2012.c:445
void dLcdExec(LCD *pDisp)
Definition: d_lcd.c:74
DATA8 LcdUpdated
LCD updated.
Definition: lms2012.h:1499
UBYTE dLcdRead(void)
Definition: d_lcd.c:199
const DATA16 FontHorz
Definition: d_lcd.c:739
#define LCDCopy(S, D, L)
Definition: d_lcd.h:82
void dLcdInversePixel(UBYTE *pImage, DATA16 X0, DATA16 Y0)
Definition: d_lcd.c:546
const DATA16 IconHeight
Definition: d_lcd.c:954
Definition: d_ui.c:104
void dLcdInit(UBYTE *pImage)
Definition: d_lcd.c:179
UBYTE PixelTab[]
Definition: d_lcd.c:61
Definition: d_ui.c:106
const DATA16 IconSize
Definition: d_lcd.c:953
void dLcdDrawText(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA8 Font, DATA8 *pText)
Definition: d_lcd.c:936
const DATA8 FontFirst
Definition: d_lcd.c:740
int fll
Definition: d_lcd.c:57
void dLcdDrawIcon(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA8 Type, DATA8 No)
Definition: d_lcd.c:1072
void dLcdExit(void)
Definition: d_lcd.c:205
unsigned char * dbuf
Definition: d_lcd.c:58
#define LCD_WIDTH
LCD horizontal pixels.
Definition: lms2012.h:196
void dLcdDrawLine(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:571
IMGDATA * IP
Instruction pointer type.
Definition: lmstypes.h:74
void dLcdDrawChar(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA8 Font, DATA8 Char)
Definition: d_lcd.c:802
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
int dll
Definition: d_lcd.c:57
DATA16 dLcdGetFontHeight(DATA8 Font)
Definition: d_lcd.c:796
Definition: d_ui.c:100
Definition: d_ui.c:103
UiButPins
Definition: d_ui.c:98
struct fb_fix_screeninfo fix
Definition: d_lcd.c:56
void dLcdUpdate(LCD *pDisp)
Definition: d_lcd.c:167
#define UiInstance
Definition: c_ui.h:460
const char * pFontBits
Definition: d_lcd.c:736
#define BUTTON_ACTIVE
Definition: c_ui.h:301
DATA16 dLcdGetIconHeight(DATA8 Type)
Definition: d_lcd.c:1017
DATA16 dLcdGetIconWidth(DATA8 Type)
Definition: d_lcd.c:1011
const DATA16 FontWidth
Definition: d_lcd.c:738
UBYTE * dLcdGetIconBits(DATA8 Type)
Definition: d_lcd.c:1001
#define FBCTL(cmd, arg)
Definition: d_lcd.c:51
const DATA16 FontHeight
Definition: d_lcd.c:737
void dLcdInverseRect(UBYTE *pImage, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:1274
DATA8 dLcdReadPixel(UBYTE *pImage, DATA16 X0, DATA16 Y0)
Definition: d_lcd.c:555
ICONINFO IconInfo[]
Definition: d_lcd.c:966
unsigned char UBYTE
Basic Type used to symbolise 8 bit unsigned values.
Definition: lmstypes.h:29
void dLcdRect(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:1243
DATA16 dLcdGetNoOfIcons(DATA8 Type)
Definition: d_lcd.c:1023
#define LCDClear(I)
Definition: d_lcd.h:76
unsigned short UWORD
Basic Type used to symbolise 16 bit unsigned values.
Definition: lmstypes.h:30
char Buffer[1024]
Definition: c_wifi.c:102
void dLcdDrawDotLine(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1, DATA16 On, DATA16 Off)
Definition: d_lcd.c:622
void dLcdAutoUpdate(void)
void dLcdFlodfill(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0)
Definition: d_lcd.c:1343
#define LCD_BUFFER_SIZE
Definition: lms2012.h:1237
const DATA16 IconWidth
Definition: d_lcd.c:955
void dLcdDrawCircle(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 R)
Definition: d_lcd.c:710
void dLcdPlotPoints(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:697
Definition: d_ui.c:105
Definition: d_ui.c:101
SBYTE DATA8
VM Type for 1 byte signed value.
Definition: lmstypes.h:61
void dLcdDrawBitmap(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, IP pBitmap)
Definition: d_lcd.c:1105
void dLcdPlotLines(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:1294
void dLcdGetBitmapSize(IP pBitmap, DATA16 *pWidth, DATA16 *pHeight)
Definition: d_lcd.c:1091
void dLcdFillRect(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 X1, DATA16 Y1)
Definition: d_lcd.c:1254
void dLcdDrawFilledCircle(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 R)
Definition: d_lcd.c:1303
void dLcdDrawPicture(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0, DATA16 IconWidth, DATA16 IconHeight, UBYTE *pIconBits)
Definition: d_lcd.c:1029
GLOBALS VMInstance
Definition: lms2012.c:131
void dLcdDrawPixel(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0)
Definition: d_lcd.c:530
#define LCD_HEIGHT
LCD vertical pixels.
Definition: lms2012.h:197
FONTINFO FontInfo[]
Definition: d_lcd.c:752
DATA8 dLcdCheckPixel(UBYTE *pImage, DATA8 Color, DATA16 X0, DATA16 Y0)
Definition: d_lcd.c:1327
#define NULL