-/* $Id: MatrixOrbital.c,v 1.29 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.30 2003/08/17 16:37:39 reinelt Exp $
*
* driver for Matrix Orbital serial display modules
*
*
*
* $Log: MatrixOrbital.c,v $
+ * Revision 1.30 2003/08/17 16:37:39 reinelt
+ * more icon framework
+ *
* Revision 1.29 2003/08/16 07:31:35 reinelt
* double buffering in all drivers
*
static char *Port=NULL;
static speed_t Speed;
static int Device=-1;
+static int Icons;
static int GPO;
static char *FrameBuffer1=NULL;
static int MO_init (LCD *Self, int protocol)
{
char *port;
- char *speed;
+ char *s, *e;
Lcd=*Self;
}
Port=strdup(port);
- speed=cfg_get("Speed","19200");
+ s=cfg_get("Speed","19200");
- switch (atoi(speed)) {
+ switch (atoi(s)) {
case 1200:
Speed=B1200;
break;
Speed=B19200;
break;
default:
- error ("MatrixOrbital: unsupported speed '%s' in %s", speed, cfg_file());
+ error ("MatrixOrbital: unsupported speed '%s' in %s", s, cfg_file());
return -1;
}
- debug ("using port %s at %d baud", Port, atoi(speed));
+ debug ("using port %s at %d baud", Port, atoi(s));
Device=MO_open();
if (Device==-1) return -1;
- bar_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS);
+ s=cfg_get("Icons", "0");
+ if ((Icons=strtol(s, &e, 0))==0 || *e!='\0' || (Icons<0 && Icons>8)) {
+ error ("MatrixOrbital: bad Iconss '%s' in %s, must be between 0 and 8", s, cfg_file());
+ return -1;
+ }
+ if (Icons>0) {
+ info ("reserving %d of %d user-defined characters for icons", Icons, CHARS);
+ Self->icons=Icons;
+ Lcd.icons=Icons;
+ }
+
+ bar_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS-Icons);
bar_add_segment( 0, 0,255, 32); // ASCII 32 = blank
bar_add_segment(255,255,255,255); // ASCII 255 = block
}
+int MO_icon (int num, int row, int col, unsigned char *bitmap)
+{
+ // Fixme: ToDo!!
+ return 0;
+}
+
+
int MO_gpo (int num, int val)
{
if (num>=Lcd.gpos)
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 1,
init: MO_init1,
clear: MO_clear1,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush1,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 1,
init: MO_init1,
clear: MO_clear1,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush1,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 1,
init: MO_init1,
clear: MO_clear1,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush1,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 1,
init: MO_init1,
clear: MO_clear1,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush1,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 1,
init: MO_init1,
clear: MO_clear1,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush1,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 6,
init: MO_init2,
clear: MO_clear2,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush2,
quit: MO_quit
xres: XRES,
yres: YRES,
bars: BAR_L | BAR_R | BAR_U | BAR_D | BAR_H2,
+ icons: 0,
gpos: 6,
init: MO_init2,
clear: MO_clear2,
put: MO_put,
bar: MO_bar,
+ icon: MO_icon,
gpo: MO_gpo,
flush: MO_flush2,
quit: MO_quit
-/* $Id: display.c,v 1.36 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: display.c,v 1.37 2003/08/17 16:37:39 reinelt Exp $
*
* framework for device drivers
*
*
*
* $Log: display.c,v $
+ * Revision 1.37 2003/08/17 16:37:39 reinelt
+ * more icon framework
+ *
* Revision 1.36 2003/08/17 12:11:58 reinelt
* framework for icons prepared
*
return -1;
}
-int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *gpos)
+int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *icons, int *gpos)
{
if (Lcd==NULL)
return -1;
- if (rows) *rows=Lcd->rows;
- if (cols) *cols=Lcd->cols;
- if (xres) *xres=Lcd->xres;
- if (yres) *yres=Lcd->yres;
- if (bars) *bars=Lcd->bars;
- if (gpos) *gpos=Lcd->gpos;
+ if (rows) *rows=Lcd->rows;
+ if (cols) *cols=Lcd->cols;
+ if (xres) *xres=Lcd->xres;
+ if (yres) *yres=Lcd->yres;
+ if (bars) *bars=Lcd->bars;
+ if (icons) *icons=Lcd->icons;
+ if (gpos) *gpos=Lcd->gpos;
return 0;
}
-/* $Id: display.h,v 1.17 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: display.h,v 1.18 2003/08/17 16:37:39 reinelt Exp $
*
* framework for device drivers
*
*
*
* $Log: display.h,v $
+ * Revision 1.18 2003/08/17 16:37:39 reinelt
+ * more icon framework
+ *
* Revision 1.17 2003/08/17 12:11:58 reinelt
* framework for icons prepared
*
int lcd_list (void);
int lcd_init (char *driver);
-int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *gpos);
+int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *icons, int *gpos);
int lcd_clear (int full);
int lcd_put (int row, int col, char *text);
int lcd_bar (int type, int row, int col, int max, int len1, int le2);
-/* $Id: lcd4linux.c,v 1.42 2003/08/14 03:47:40 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.43 2003/08/17 16:37:39 reinelt Exp $
*
* LCD4Linux
*
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.43 2003/08/17 16:37:39 reinelt
+ * more icon framework
+ *
* Revision 1.42 2003/08/14 03:47:40 reinelt
* remove PID file if driver initialisation fails
*
"(c) M.Reinelt",
NULL };
- lcd_query (&y, &x, NULL, NULL, NULL, NULL);
+ lcd_query (&y, &x, NULL, NULL, NULL, NULL, NULL);
flag=0;
for (i=0; line1[i]; i++) {
-/* $Id: processor.c,v 1.35 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: processor.c,v 1.36 2003/08/17 16:37:39 reinelt Exp $
*
* main data processing
*
*
*
* $Log: processor.c,v $
+ * Revision 1.36 2003/08/17 16:37:39 reinelt
+ * more icon framework
+ *
* Revision 1.35 2003/07/24 04:48:09 reinelt
* 'soft clear' needed for virtual rows
*
#include "exec.h"
#define ROWS 64
+#define ICONS 8
#define GPOS 16
static char *row[ROWS+1];
static int gpo[GPOS+1];
-static int rows, cols, xres, yres, supported_bars, gpos;
+static int rows, cols, xres, yres, supported_bars, icons, gpos;
static int lines, scroll, turn;
static int token_usage[256]={0,};
load.overload=atof(cfg_get("overload","2.0"));
- lcd_query (&rows, &cols, &xres, &yres, &supported_bars, &gpos);
+ lcd_query (&rows, &cols, &xres, &yres, &supported_bars, &icons, &gpos);
if (rows>ROWS) {
error ("%d rows exceeds limit, reducing to %d rows", rows, ROWS);
rows=ROWS;
}
+ if (icons>ICONS) {
+ error ("%d icons exceeds limit, reducing to %d icons", icons, ICONS);
+ icons=ICONS;
+ }
if (gpos>GPOS) {
error ("%d gpos exceeds limit, reducing to %d gpos", gpos, GPOS);
gpos=GPOS;
}
- debug ("Display: %d rows, %d columns, %dx%d pixels, %d GPOs", rows, cols, xres, yres, gpos);
+ debug ("Display: %d rows, %d columns, %dx%d pixels, %d icons, %d GPOs", rows, cols, xres, yres, icons, gpos);
lines=atoi(cfg_get("Rows","1"));