Re: GUI for LCD



"Ajab" <jasusvijay@xxxxxxxxx> wrote in message
news:1186655426.475988.298640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Aug 9, 1:38 pm, "Tom Lucas"
<news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"Ajab" <jasusvi...@xxxxxxxxx> wrote in message

news:1186634638.484580.306260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

What steps do I need to follow to develope a GUI for LCD?
Are there any specific tools which you would recommend?

You can buy a number of graphics libraries off the shelf. I use
Segger's
emwin and I am very pleased with it but I've heard other people get
on
well with C/PEG and C/PEG++. This is not cheap though. I remember
there
was also someone on this group a year or so ago who was developing a
cut-down open source GUI - you'd have to check the archives.

To write one yourself then your biggest hurdle will be getting the
LCD
controller to function correctly - creating images is secondary to
that.
Some microcontroller vendors (Sharp for one although soon to be NXP)
have software tools that will create C header files to initialise
your
LCD controller to suit your panel.

Once you can drive the LCD then you just need a few simple functions
that will populate the frame buffer in the right way. You can go a
long
way toward a good GUI with simple functions like ClearScreen,
DrawPoint,
DrawLine, DrawBox, DrawCircle etc.

If you want predrawn pictures then bitmaps are easiest to work with
and
RLE encoding them can compress them if you are short of space. There
are
a number of programs available that will convert a bitmap file to a C
file for inclusion in your project - bmp2c is one I believe is free.
I
use the one that came with emwin and it is very good but certainly
not
free. A function like DrawBitmap is not too tricky to implement and
is
mainly just setting the colour of the frame buffer pixels in
sequence. A
bit harder if you use compression.

So with these tools (emwin/PEG..), I will develope the GUI
(images,dialogs etc., which will be displayed on LCD). And then I need
to write some event handler routines for each button/image.
Whatever code will be written will be flashed into the microcontroller
and then microcontroller will control the display. Is it this way?

That's exactly the way. You can use the graphic library's own event
handling mechanisms or you can do your own. I started out using emwin's
own window manager which uses callback mechanisms similar to MS windows
but I started wanting to do messy things with the frame buffer and began
to create my own window handling scheme but still used the library for
actually drawing shapes, text and pictures. I've pretty much written my
own touchscreen driver but I still use Segger's interface to inform the
GUI that there has been a touch in a location.

It's not cheap though. From their website (www.segger.com) then you're
looking at 8K euros for a comprehensive package with a window manager,
bitmap and font converter and LCD drivers. Actually, in retrospect I've
paid for a lot of things I don't really use but everything is clear in
hindsight! IT will get you going quickly though and their support is
good. I decided to pay for a bit of training and went to their offices
in Germany and they got me running there and then. Admittedly I had also
bought a development kit from LogicPD which they already supported so
there were no mysteries there.


.