Restructorizing

User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: Restructorizing

Post by Badger »

I suppose that is only useful if we want to support several different display types at once? or did you have another use in mind?
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Restructorizing

Post by Tectu »

Badger wrote:of course, we would have two low level functions for some aspects. For example, to draw a pixel, there would be one external 'draw a pixel' routine that wraps the request and sends it to the server. Then there would be an internal 'draw a pixel' routine which is called only by the server, but not necessarily only as a result of a client calling 'draw a pixel', but also by other server functions, perhaps to render a character.


Aw, afaik the current code is doing exactly that? there is lcdDrawPixel() which does get called by other functions, and the worker thread then does call lld_lcdDrawPixel().
Am I missunderstanding something?


~ Tectu
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: Restructorizing

Post by Badger »

Tectu wrote:Aw, afaik the current code is doing exactly that? there is lcdDrawPixel() which does get called by other functions, and the worker thread then does call lld_lcdDrawPixel().
Am I missunderstanding something?


that is true, I was just addressing Abhishek's point. Some of the glcd functions are more than just a wrapper to a lld_ function, and might well be used by other functions, so we would have internal functions designed only to be used by the worker.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Restructorizing

Post by Tectu »

Is the current implementation usable, beside to fix the set curser stuff?


~ Tectu
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Restructorizing

Post by Abhishek »

Tectu, I was talking about two functions: one for the external application that calls the worker. The other one is the direct method. Think of it as wf_write and f_write methods.

Right now we have two functions lld_lcdInit and lcdInit, and similarly other functions. The lcdInit just calls lld_lcdInit and that'a all. Of course such accesses are optimized out by the compiler but I was thinking if we leave it from the main file and just implement it in the LLD.

And suppose we make the lib support all QVGA LCDs at once. The user need not bother what LCD he's using, whether it's a S6D 1121 or SSD1289 or SSD1963 or ILI9325 or HX8347. He just uses the lib and it's done. Is the idea worth the effort?
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: Restructorizing

Post by Badger »

It looks like it is getting there, it just needs a few more of the functions implemented on the server (e.g draw character).

do you think it is worth implementing drawCircle as a wrapper to drawElipse? there would be a slight over head when drawing a circle, but it would clean up the code a bit.
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Restructorizing

Post by Abhishek »

I think it would be OK, it's the way some graphic libs do it.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Restructorizing

Post by Tectu »

Abhishek, I somehow don't see what you are trying to tell me. The whole Idea of the current lld implemention stuff is to give the user the ability that he does not has to care bout which LCD he uses, right?


~ Tectu
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: Restructorizing

Post by Abhishek »

You're right Tectu.

But taking it a step further. The user needn't worry which controller the LCD is using, even at compile time! The driver will read the production code code from the LCD, and automatically select the correct driver. And the LLDs aren't very bulky so we might have many commandsets preloaded. Of course this might only be for the QVGA family of displays, if we have some other screen size, we'll have to deal with it separately.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Restructorizing

Post by Tectu »

I understand what you mean, but I guess we should make the library usable before we start implementing something like that.


~ Tectu
Locked