[Lcdproc] help w/ hd44780 driver to support hd66712

Andrew Foss a.foss@f5.com
Sat May 6 00:08:01 2006


This is a multi-part message in MIME format.
--------------060405090701010009030703
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

lcdproc folks,

anyone familiar w/ the hd44780 driver that could help point me toward 
the best way to integrate patch and configuration to support hd66712?

Attached is a test patchfile w/ #ifdef to force hd66712. Andreas is 
testing to confirm that this works.

It's essentially the hd44780 driver w/ a 2 line change to 
hd44780_position() accommodate the hd66712's cleaner memory layout. The 
question is how best to indicate hd66712 capability to the hd44780 driver?

I'm thinking add an [hd66712] to the config file, referencing the 
hd44780 driver w/ some flag to indicate it's an hd66712 for the right 
mem layout.

thanks in advance,

andrew

-------- Original Message --------
Subject: 	AW: [Lcdproc] Screen->Client List has timeout->-1
Date: 	Sat, 6 May 2006 01:06:45 +0200
From: 	Andreas <Andreaz@t-online.de>
Reply-To: 	<Andreaz@t-online.de>
To: 	'Andrew Foss' <a.foss@f5.com>



Hello Andrew (again),

sorry, the last mail is a failure.
It's a lot more working than before...

I forget to break the lcd4linux instance
and mixed it together with lcdproc.

For the first view it seems to be working.
Output is fixed i believe. Let me test
some more.

For implement this. Wouldnt be an arg
in the config file like "Model=hd66712"
make sense? Or a complete new driver,
with that name ?

So far, seems to work... Ill test some
more..

Great work, Andrew !

Thanks alot...


-----Ursprüngliche Nachricht-----
Von: Andrew Foss [mailto:a.foss@f5.com]
Gesendet: Samstag, 6. Mai 2006 00:01
An: Andreaz@t-online.de
Betreff: Re: AW: AW: AW: [Lcdproc] Screen->Client List has timeout->-1


Andreas,

can you try the attached patch and see what it does? It will break a
normal hd44780, but I'd like to see if this is what the hd66712 needs
first, then we can figure out how to integrate it for real.

If you're not familiar w/ patch and assuming this patchfile is in your ~
directory, then

cd lcdproc-0.5.0/server/drivers
patch < ~/lcdprochd66712.testpatch

then make clean;make

replace the hd 44780 drivers on your system w/ these shouldn't need to
touch the rest and let me know...

andrew

Andreas wrote:
> I would love to test it out...
>
> Afternoon? Where you from? Here its already
> late evening.. ;)
>
>
> -----Ursprüngliche Nachricht-----
> Von: Andrew Foss [mailto:a.foss@f5.com]
> Gesendet: Donnerstag, 4. Mai 2006 21:26
> An: Andreaz@t-online.de
> Betreff: Re: AW: AW: [Lcdproc] Screen->Client List has timeout->-1
>
>
> that should get us going, if I have a moment this afternoon, I'll try a
> test driver version that will just do the simple flush and senddata w/o
> all the special cases and see if we don't learn something from that...
>
> Andreas wrote:
>
>> Just the driver code or the whole package?
>> I start with just the driver...
>>
>> Attached...
>>
>> Thank you alot for your help!
>>
>> -----Ursprüngliche Nachricht-----
>> *Von:* Andrew Foss [mailto:A.Foss@F5.com]
>> *Gesendet:* Donnerstag, 4. Mai 2006 20:26
>> *An:* Andreaz@t-online.de
>> *Betreff:* RE: AW: [Lcdproc] Screen->Client List has timeout->-1
>>
>>     Ok were on the right track maybe we try the simple positioning as
>>     you founf w/o the special cases. Could you email me the other
>>     driver code that works in lcd4linux?
>>
>>      -----Original Message-----
>>     From:   Andreas [mailto:Andreaz@t-online.de]
>>     Sent:   Thu May 04 11:14:27 2006
>>     To:     Andrew Foss
>>     Subject:        AW: [Lcdproc] Screen->Client List has timeout->-1
>>
>>     ROFL. I also just realized it, compared to the ncurses driver.
>>     Yeah, exactly... Line 3 and 2 seems to be swapped, also...
>>
>>     Seems its an complete different adressing method.
>>
>>     Im a lil angry that my c isnt any better. I dig around like
>>     hell in that lcd4linux project. The one code-line ive found
>>     so far is in the driver drv_hd44780 (of lcd4linux!):
>>
>>      if (Capabilities & CAP_HD66712) {
>>             /* the HD66712 doesn't have a braindamadged RAM layout */
>>             pos = row * 32 + col;
>>         }
>>
>>     Maybe it means, the controller always think it got 32 columns per
>>     row ?
>>
>>     Im still digging, maybe i find some more...
>>
>>
>>     >Betreff: Re: AW: AW: [Lcdproc] Screen->Client List has timeout->-1
>>     >
>>     >ok, thanks, there's some odd looking code around the virtual
>>     positioning
>>     >in the hd44780 driver w/ some hardcoded constants that make me
>>     wonder a
>>     bit.
>>     >
>>     >Interestingly, Clients: 0 should be on line 2 and Screens: 0
>>     should be
>>     >on line 3, yet they seem reversed in yours?
>>     >
>>     >andrew
>>
>>
>>
>>
>>
>>
>
>


--------------060405090701010009030703
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
 name="lcdprochd66712.testpatch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lcdprochd66712.testpatch"

--- hd44780.c.orig	2006-05-05 14:48:28.000000000 -0700
+++ hd44780.c	2006-05-05 14:48:36.000000000 -0700
@@ -435,6 +435,11 @@
 		DDaddr = x + (relY % 2) * 0x40;
 		if ((relY % 4) >= 2)
 			DDaddr += p->width;
+
+#define HD66712
+#ifdef HD66712
+	DDaddr = x + relY * 0x20;
+#endif //HD66712
 	}
 	p->hd44780_functions->senddata (p, dispID, RS_INSTR, POSITION | DDaddr);
 	p->hd44780_functions->uPause (p, 40);  // Minimum exec time for all commands

--------------060405090701010009030703--