From f73848014030f0fb62b4f9738e9192621fae1aa2 Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 14 Feb 2001 07:40:16 +0000 Subject: [lcd4linux @ 2001-02-14 07:40:16 by reinelt] first (incomplete) GPO implementation git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@80 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- MatrixOrbital.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'MatrixOrbital.c') diff --git a/MatrixOrbital.c b/MatrixOrbital.c index cb23d92..b2ae3e7 100644 --- a/MatrixOrbital.c +++ b/MatrixOrbital.c @@ -1,4 +1,4 @@ -/* $Id: MatrixOrbital.c,v 1.20 2001/02/13 09:00:13 reinelt Exp $ +/* $Id: MatrixOrbital.c,v 1.21 2001/02/14 07:40:16 reinelt Exp $ * * driver for Matrix Orbital serial display modules * @@ -20,6 +20,10 @@ * * * $Log: MatrixOrbital.c,v $ + * Revision 1.21 2001/02/14 07:40:16 reinelt + * + * first (incomplete) GPO implementation + * * Revision 1.20 2001/02/13 09:00:13 reinelt * * prepared framework for GPO's (general purpose outputs) @@ -157,6 +161,7 @@ static int Device=-1; static char Txt[4][40]; static BAR Bar[4][40]; +static int GPO; static int nSegment=2; static SEGMENT Segment[128] = {{ len1:0, len2:0, type:255, used:0, ascii:32 }, @@ -397,7 +402,9 @@ int MO_clear (void) Bar[row][col].segment=-1; } } - MO_write ("\014", 1); + MO_write ("\014", 1); // Clear Screen + MO_write ("\376V", 2); // GPO off + GPO=0; return 0; } @@ -453,7 +460,6 @@ int MO_init (LCD *Self) MO_write ("\376T", 2); // blink off MO_write ("\376D", 2); // line wrapping off MO_write ("\376R", 2); // auto scroll off - MO_write ("\376V", 2); // GPO off return 0; } @@ -542,6 +548,14 @@ int MO_bar (int type, int row, int col, int max, int len1, int len2) int MO_gpo (int num, int val) { + if (num>=Lcd.gpos) + return -1; + + if (val) { + GPO |= 1<