Ncurses and HD44780 LCD

Hey everyone,

I'm working on a project with a 4x20 HD44780-compatible character LCD which is used to display a menuing system. I'd like to use Ncurses to handle the display output to this LCD, but I'm not sure if this is possible. Can anyone provide some tips on how to do this? What functionality does the driver need to provide? Is a simple char device sufficient? Do I need to write a TTY driver for it? How do I redirect the Ncurses output to the LCD device instead of stdout? Any advice is greatly appreciated.

Cheers, Alex

Reply to
okalex
Loading thread data ...

Here's some code that might help. It's a HD44780-compatible driver for the Technologic TS-7xx0 boards. I patched it to provide some ANSI support and jj fixed my patches. It's definitely beta but you're welcome to use it.

Please provide comments/patches/kudos/flames either to me (remove the obvious from my email above or to jj (his contact info should be in the tarball.)

formatting link

--Yan

Reply to
CptDondo

My email is valid. Get in touch if you want hints on changing the code etc. Unfortunately it doesn't emulate the complete ANSI codes. But I can add stuuf.

The main problem is that I'm not too sure it works with 4 line displays. I've never had one to try out and test with.

cheers Jim

---------------------------------------------------------------------------- HomePage:

formatting link
TS7200 Page:
formatting link

Reply to
Jim Jackson

Thanks. I already had a basic driver complete, but I was unaware that I needed to implement ANSI escape sequences. That tip was exactly what I needed. I've added the relevant sequences and it's now working nicely with Ncurses.

Now that I've got the LCD up and running, I'd like to print a welcome message as early in the boot process as possible. Can anyone provide some advice as to how I'd go about doing that?

Thanks, Alex

Reply to
okalex

Care to share? Seriously, it would be nice to have an ncurses-capable screen.

Depends on your boot sequence. I'm pretty sure you could patch redboot to stuff a logo out. Otherwise add a routine to the kernel to do that on boot.

If you're in userspace (as in our driver) then there's not much you can do except wait for the kernel to boot.

--Yan

Reply to
CptDondo

Well, I haven't made the code very portable at this point, since I was only intending it for this application, but I'll have to talk to my employer to make sure it's okay for me to release it.

I'm working on patching U-Boot with a driver now, though I was sidetracked for a while as I somehow screwed my toolchain up.

Alex

Reply to
okalex

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.