aboutsummaryrefslogtreecommitdiffstats
path: root/drv_M50530.c
diff options
context:
space:
mode:
authorreinelt <>2004-03-19 09:17:46 +0000
committerreinelt <>2004-03-19 09:17:46 +0000
commitf4dd3dfd7a634ab0cf3b371f3826c0a73d334299 (patch)
tree3523a6246f1e1db0a5bf493df438d791dd624824 /drv_M50530.c
parenta1026e97ada03ecf492eee358acdec0d6d4f12a6 (diff)
downloadlcd4linux-f4dd3dfd7a634ab0cf3b371f3826c0a73d334299.tar.gz
[lcd4linux @ 2004-03-19 09:17:46 by reinelt]
removed the extra 'goto' function, row and col are additional parameters of the write() function now.
Diffstat (limited to 'drv_M50530.c')
-rw-r--r--drv_M50530.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/drv_M50530.c b/drv_M50530.c
index 7361855..929e527 100644
--- a/drv_M50530.c
+++ b/drv_M50530.c
@@ -1,4 +1,4 @@
-/* $Id: drv_M50530.c,v 1.2 2004/02/15 21:43:43 reinelt Exp $
+/* $Id: drv_M50530.c,v 1.3 2004/03/19 09:17:46 reinelt Exp $
*
* new style driver for M50530-based displays
*
@@ -23,6 +23,11 @@
*
*
* $Log: drv_M50530.c,v $
+ * Revision 1.3 2004/03/19 09:17:46 reinelt
+ *
+ * removed the extra 'goto' function, row and col are additional parameters
+ * of the write() function now.
+ *
* Revision 1.2 2004/02/15 21:43:43 reinelt
* T6963 driver nearly finished
* framework for graphic displays done
@@ -122,31 +127,33 @@ static void drv_M5_command (unsigned int cmd, int delay)
}
-static void drv_M5_write (unsigned char *string, int len)
+static void drv_M5_write (int row, int col, unsigned char *data, int len)
{
unsigned int cmd;
-
+ unsigned int pos;
+
+ pos=row*48+col;
+ if (row>3) pos-=168;
+ drv_M5_command (0x300|pos, 20);
+
while (len--) {
- cmd=*string++;
+ cmd=*data++;
drv_M5_command (0x100|cmd, 20);
}
}
-static void drv_M5_goto (int row, int col)
-{
- int pos=row*48+col;
- if (row>3) pos-=168;
- drv_M5_command (0x300|pos, 20);
-}
-
-
static void drv_M5_defchar (int ascii, unsigned char *buffer)
{
+ int i;
+
drv_M5_command (0x300+192+8*(ascii-CHAR0), 20);
+
// Fixme: looks like the M50530 cannot control the bottom line
// therefore we have only 7 bytes here
- drv_M5_write (buffer, 7);
+ for (i=0; i<7; i++) {
+ drv_M5_command (0x100|buffer[i], 20);
+ }
}
@@ -283,7 +290,6 @@ int drv_M5_init (char *section)
// real worker functions
drv_generic_text_real_write = drv_M5_write;
- drv_generic_text_real_goto = drv_M5_goto;
drv_generic_text_real_defchar = drv_M5_defchar;