aboutsummaryrefslogtreecommitdiffstats
path: root/drv_serdisplib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drv_serdisplib.c')
-rw-r--r--drv_serdisplib.c57
1 files changed, 50 insertions, 7 deletions
diff --git a/drv_serdisplib.c b/drv_serdisplib.c
index 9ca5e8c..ff2e8c4 100644
--- a/drv_serdisplib.c
+++ b/drv_serdisplib.c
@@ -1,9 +1,9 @@
-/* $Id: drv_serdisplib.c 773 2007-02-25 12:39:09Z michael $
- * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_serdisplib.c $
+/* $Id: drv_serdisplib.c 958 2009-01-13 04:21:29Z michael $
+ * $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_serdisplib.c $
*
* driver for serdisplib displays
*
- * Copyright (C) 2005 Michael Reinelt <reinelt@eunet.at>
+ * Copyright (C) 2005 Michael Reinelt <michael@reinelt.co.at>
* Copyright (C) 2005 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
*
* This file is part of LCD4Linux.
@@ -33,6 +33,7 @@
*/
#include "config.h"
+#include "debug.h" // verbose_level
#include <stdlib.h>
#include <stdio.h>
@@ -66,6 +67,8 @@ static char Name[] = "serdisplib";
static serdisp_CONN_t *sdcd;
static serdisp_t *dd;
+int NUMCOLS = 1;
+
/****************************************/
/*** hardware dependant functions ***/
@@ -74,10 +77,12 @@ static serdisp_t *dd;
static void drv_SD_blit(const int row, const int col, const int height, const int width)
{
int r, c;
+ RGBA p;
for (r = row; r < row + height; r++) {
for (c = col; c < col + width; c++) {
- RGBA p = drv_generic_graphic_rgb(r, c);
+ p = drv_generic_graphic_rgb(r, c);
+ // printf("blit (%d,%d) A%d.R%d.G%d.B%d\n", c, r, p.A, p.R, p.G, p.B);
serdisp_setcolour(dd, c, r, serdisp_pack2ARGB(0xff, p.R, p.G, p.B));
}
}
@@ -181,9 +186,19 @@ static int drv_SD_start(const char *section)
return -1;
}
+ /* print supported options by display */
+ info("%s: options supported by display %s:", Name, model);
+ serdisp_options_t optiondesc;
+ optiondesc.name = ""; /* start the iteration with assigning an empty string before the first call */
+ while (serdisp_nextoptiondescription(dd, &optiondesc)) {
+ info(" %s", optiondesc.name);
+ }
+
+
DROWS = serdisp_getheight(dd);
DCOLS = serdisp_getwidth(dd);
- info("%s: display size %dx%d", Name, DCOLS, DROWS);
+ NUMCOLS = serdisp_getcolours(dd);
+ info("%s: display size %dx%d, %d colors", Name, DCOLS, DROWS, NUMCOLS);
XRES = -1;
YRES = -1;
@@ -274,7 +289,35 @@ static void plugin_rotate(RESULT * result, RESULT * arg1)
/* list models */
int drv_SD_list(void)
{
- printf("%s", "any");
+ serdisp_display_t displaydesc;
+
+ displaydesc.dispname = "";
+ while (serdisp_nextdisplaydescription(&displaydesc)) {
+ printf("%s ", displaydesc.dispname);
+ }
+
+ return 0;
+}
+
+
+/* verbosely list models (special case for serdisplib) */
+int drv_SD_list_verbose(void)
+{
+ serdisp_display_t displaydesc;
+ long version;
+
+ version = serdisp_getversioncode();
+ printf("%s: header version %d.%d, library version %d.%d, available sub-drivers:\n\n", Name,
+ SERDISP_VERSION_MAJOR, SERDISP_VERSION_MINOR,
+ SERDISP_VERSION_GET_MAJOR(version), SERDISP_VERSION_GET_MINOR(version));
+
+ printf("display name alias names description\n");
+ printf("------------------ -------------------- -----------------------------------\n");
+ displaydesc.dispname = "";
+ while (serdisp_nextdisplaydescription(&displaydesc)) {
+ printf(" %-15s %-20s %-35s\n", displaydesc.dispname, displaydesc.aliasnames, displaydesc.description);
+ }
+
return 0;
}
@@ -284,7 +327,7 @@ int drv_SD_init(const char *section, const int quiet)
{
int ret;
- info("%s: %s", Name, "$Rev: 773 $");
+ info("%s: %s", Name, "$Rev: 958 $");
/* real worker functions */
drv_generic_graphic_real_blit = drv_SD_blit;