Page 3 of 18

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:11 pm
by inmarket
Tectu wrote:Just curious.... What happened to the font stuff? Afaikt nothing happened to the font stuff in the current version of the GLCD library? Do we have now more/other/better font rendering? Or is the program there to generate new stuff?


The original GLCD font code used a byte array table. The existing code accessed components from it assuming the endianness of the CPU. For a different CPU the code would not have worked. It also made non-word aligned accesses into the data which would have caused sig-faults on many processors. Even on those cpu's that do allow it there is a significant performance penalty. To change the maximum height of font from 16 to 32 would have required completly updated code and for the font data to be regenerated.

I therefore rewrote the code and changed the structure to allow extra metric information, correct word aligned accesses, correct behaviour regardless of endianness, and the optional ability to expand the maximum height of the font to 32 bits without having to generate new font tables. I also commented to font data so you can see which font data belongs to which character.

To make these changes I needed to convert the existing font array's. That is what the program was for.

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:17 pm
by Tectu
Okay, as I said, I cannot check at the moment. Did you change things in the glcd/ folder or not? When yes, we can now have larger fonts, right? What would I have to do know to write a 25px high font?


~ Tectu

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:20 pm
by Abhishek
Write a new font generator script program and use it to generate new tables. It has a option of 16-bit or 32-bit wide fonts.

BTW Tectu, the lib wasn't changed. Inmarket just created his lib inside the halext folder

EDIT:'It' refers to the graphics lib.

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:27 pm
by inmarket
Abhishek wrote:Once we're done I guess we could do something like a switchable driver for an entire LCD family, like say QVGA Family. True, this may bloat code but allows for protection against module chip revisions. And could be useful for commercial products too (sourcing products from multiple OEM's). Even the 6610 LCD is in two variants, it'd be nice to somehow create a lib that can seamlessly use both.

Would you like to give such an impl a try?


Yes I can look at that. My priority right now however is to get some drivers back-ported. I'll look at the similiarities between them as I go and consider making a single common low level driver. For the 6610, when I write the driver it is my intention to put both controllers into the one low level driver.


Abhishek wrote:I've some audio playback code and CS43L22 drivers for the F4 discovery board. Look at github.com/abhishek-kakkar/STM32F4Player . Could it be considered for your halext?


Yes it certainly could be considered for the halext and that sort of thing is what I invisaged when I designed the file structure.
For example, the high level code might be called "audio" and sit in the include & src directory with the low level driver in a subdirectory of the drivers directory called something like audioCS43L22.

Thanks for the code reference. While I concentrate on gdisp perhaps you would like to have a crack at building a suitable audio subsystem. The key is getting the generalisation at the high level driver correct. It certainly helps when you have had someone else do a lot of the design work like I had with GLCD.

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:31 pm
by Tectu
So is someone able to make such a font generator script? Abhishek? Could you add some more fonts for now?


~ Tectu

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:39 pm
by Abhishek
My idea, inmarket is to have a separate source file for each driver as a VMT. Then we could group related drivers in a driver group structure, and using a production code read back from LCD, select the VMT. This would help to keep LLD drivers clean and avoid if - else on every LLD command.

What do you say?

@Tectu, it's not an easy job. Even if I be able to make it, it'll be windows only. I'll concentrate on other things now, especially, learning the new architecture. I have to see how to do bitmap rendering using blt functions.

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:41 pm
by inmarket
Tectu wrote:Okay, as I said, I cannot check at the moment. Did you change things in the glcd/ folder or not? When yes, we can now have larger fonts, right? What would I have to do know to write a 25px high font?


I left glcd completely unchanged. I created a whole new directory for GDISP as the changes were too significant to merge into glcd.

I have however created a glcd.h in the gdisp area which should enable you to use the new GDISP driver wih your existing application and gain the benefit of the new functionality such as large fonts.

To create a 25px font you would need to change the definition of fontcolumn_t in gdisp.c and then create your new font structure in gdisp_inc_fonts.c

Use the code in the utility posted earlier in this topic as a base to generating the font structure correctly. The padding in the sub-structures is particularly important for the offset calculations to work. We pad to ensure that each sub-structure begins and ends on a 8 byte boundary (which will suit every compiler I know).

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:44 pm
by inmarket
Abhishek wrote:My idea, inmarket is to have a separate source file for each driver as a VMT. Then we could group related drivers in a driver group structure, and using a production code read back from LCD, select the VMT. This would help to keep LLD drivers clean and avoid if - else on every LLD command.


Sounds like a good way to handle it.

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:47 pm
by Abhishek
Since only you are under control of your code right now ;) , how would you go about it with your current framework?

Abhishek

Re: GDISP driver

Posted: Tue Jul 31, 2012 5:49 pm
by Tectu
I will definitly try that. Using the posted utility, I also get the fonttable, right? I guess it works on linux too? I am very sorry, no access to take a look for the next few hours, but it sounds so interesting *__*


~ Tectu