GDISP driver

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

Re: GDISP driver

Post by Abhishek »

Wow! That's great news!

It's really a great effort from your side to enlarge our codebase. Enjoy your sleep!

Also, it'll be a good idea on your side to implement a font generator for us. Though not to make it complex, may I suggest using a packed bitstream to store the font data, saving some space at the cost of some performance (This lib is going to be used most of the time on ARM micros anyway, I'm not sure how much size it takes, but won't matter)? It'll also make fonts of any size possible, not just 16-bit or 32-bit. We could have fonts as large as 64pixels for say, displaying time.

Cheers
Abhishek

P.S. The site which I told you was the one I learnt my GLCD and GUI concepts from, two-three years ago. I ported it to the AVR first, then the STM32, before I joined the project.
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: GDISP driver

Post by Abhishek »

Hi inmarket,

As promised, here is my code for the 6610 LCD module on the SPI1 [no remap] of STM32F105RCT6 [ported from my AVR code two yrs ago, which was ported from the 8051 three years ago], will work out of the box with all STM32s (except the F0, which has a new SPI cell). See the driver files for more info.

Two notes:
1. Besides having a driver for the LCD, It also includes a fancy dimmable PWM backlight control powered by the timer PWM and VTs of ChibiOS, use the defs to set backlight on time in intervals of 0.1 sec.

2. This is for the philips instruction set family of LCDs only (using an undocumented 16bpp mode) , you might consider n6610_philips_lld.c and n6610_epson_lld.c . The LCD I use is identical to the one used on that website (PICUserInterface), so worked nicely. However, I don't know about your LCD. Would you mind posting some photos so that I might be able to identify it for you, or you know which controller your LCD uses?

Best Regards
Abhishek
Attachments
CLCD6610_Driver.zip
(17.46 KiB) Downloaded 491 times
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: GDISP driver

Post by Tectu »

I found some time to try out the SSD1289 driver. Could you really compile it? I did the steps in halext/readme.txt and also replaced the current glcd.h with the halext/include/glcd.h
But I am not able to compile.

Is there something else missing, which is not described in the readme files?


~ Tectu
inmarket
Posts: 89
Joined: Fri Jul 27, 2012 1:37 pm

Re: GDISP driver

Post by inmarket »

Tectu wrote:I found some time to try out the SSD1289 driver. Could you really compile it?


I am using a different CPU, board and display so I could not compile to no errors.
I did however compile the current gdispNokia6100 (which is currently just a stub) without errors.
I then compiled the SSD1289 and S6... driver until the only errors I got appeared to be platform related defines.

I also have not tested the glcd.h include file although again it appears to compile.

Suggestions:
  • Try compiling with the stub driver first. If this works then the issues are directly related to the specific low level driver.
  • Send me a list of your compile errors and I will be ahppy to help.

Outcome of this points to the value of having a proper stub driver with no hardware dependancies for exactly this type of purpose.
I will create one - it should only take 5 minutes or so.
inmarket
Posts: 89
Joined: Fri Jul 27, 2012 1:37 pm

Re: GDISP driver

Post by inmarket »

Abhishek wrote:As promised, here is my code for the 6610 LCD module on the SPI1 [no remap] of STM32F105RCT6


Thanks. That should save me a lot of work.

Abhishek wrote:1. Besides having a driver for the LCD, It also includes a fancy dimmable PWM backlight control,


Oops - that looks like a missing high level routine in GDISP to be able to set it.

Abhishek wrote:or you know which controller your LCD uses?


For prototyping I am using an Olimex SAM7-EX256 board which can be shipped with either an Epson S1D15G00 (GE8) controller or a Philips PCF8833/Leadis LDS176 (GE12) controller. In my case I think it has the GE8. I intend to write the code to support both controllers as they are very similiar.
inmarket
Posts: 89
Joined: Fri Jul 27, 2012 1:37 pm

Re: GDISP driver

Post by inmarket »

Tectu wrote:Is there something else missing, which is not described in the readme files?


Just had a thought - perhaps there was config stuff in glcdconf.h that would now need to be transferred to halconf.h ?
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: GDISP driver

Post by Abhishek »

I'll see if I can compile the S6D1121 today.

Anyways, the code I gave you is for GE12 family of LCDs. So I guess we'll have both working soon :) .
inmarket
Posts: 89
Joined: Fri Jul 27, 2012 1:37 pm

Re: GDISP driver

Post by inmarket »

Abhishek wrote:may I suggest using a packed bitstream to store the font data, saving some space at the cost of some performance


There are currently two sources of bitstream inefficiencies - the padding inserted between sub-structures, and the bit padding to 16/32 bits on each font column. In practice the first is really minor, it is the 2nd that increases the size of the font table the most. For example, for a 12 bit high font using a 16 bit column table the space ineffeciency is 25%. This is reasonable but going to a 32 bit column table this jumps to 63% space inefficiency! 64 bit would just be nasty!

The truth is that for 64 bit fonts - bitmap fonts are just not the best way of doing things although driver scaling of a smaller font may be easy.

The reason for the existing methodology is performance. The current font code is small and runs fast (important for small cpu's with larger displays).

Alternatives are:
  • Change to a bit packed format as suggested. This would have significant effects on code size and font drawing performance for only a very small gain in font table size for most standard situations (16 bit fonts).
  • Go to a font mechanism that "draws" the font instead of blitting it eg. Truetype or Adobe fonts. There are libraries available to perform this complex task that could be interfaced. Note there is significant code size added to handle this and performance is always an issue particularly in RAM constrained situations (like most small cpu's). If someone wanted to take on the task of adding a truetype replacement for the font routines into the emulation layer this would be welcomed (A great idea!). Note that this would always need to be conditionally compiled as an alternative to bitmap fonts due to the code size/RAM/cpu constraints on some platforms.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: GDISP driver

Post by Tectu »

I use the new TestStubs driver now and I also moved the #define macros from the glcdconf.h to the halconf.h
The glcd/glcd.h file got replaced with the halext/include/glcd.h
Everything else is done as described in the readme.

Here are the compiler errors I get. Simply removing this from the glcd.h file didn't help. I will have some time in the evening to track down the error, when you don't find it first:

Code: Select all

Compiling /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c
Compiling /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/s6d1121_lld.c
Compiling /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/ads7843_lld.c
board.c:17:1: warning: missing initializer [-Wmissing-field-initializers]
board.c:17:1: warning: (near initialization for 'pal_default_config.PFData') [-Wmissing-field-initializers]
In file included from /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.h:4:0,
                 from /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:1:
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: nested redefinition of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: redeclaration of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:19: error: redeclaration of enumerator 'portrait'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:27: note: previous definition of 'portrait' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:29: error: redeclaration of enumerator 'landscape'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:37: note: previous definition of 'landscape' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:40: error: redeclaration of enumerator 'portraitInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:48: note: previous definition of 'portraitInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:53: error: redeclaration of enumerator 'landscapeInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:61: note: previous definition of 'landscapeInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: nested redefinition of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: redeclaration of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:17: error: redeclaration of enumerator 'powerOff'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:25: note: previous definition of 'powerOff' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:27: error: redeclaration of enumerator 'powerOn'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:47: note: previous definition of 'powerOn' was here
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdWriteIndex':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:17:2: warning: implicit declaration of function 'lld_lcdWriteGPIO' [-Wimplicit-function-declaration]
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdReadData':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:48:2: warning: implicit declaration of function 'lld_lcdReadGPIO' [-Wimplicit-function-declaration]
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdReadStream':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:101:20: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdSetPowerMode':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:191:3: error: duplicate case value
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:187:3: error: previously used here
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:194:3: error: duplicate case value
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:187:3: error: previously used here
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdSetCursor':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:205:9: error: 'GDISP1' undeclared (first use in this function)
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:205:9: note: each undeclared identifier is reported only once for each function it appears in
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdSetWindow':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:272:12: error: 'GDISP1' undeclared (first use in this function)
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c: In function 'lld_lcdVerticalScroll':
/home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/ssd1289_lld.c:426:2: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
make: *** [build/obj/ssd1289_lld.o] Error 1
make: *** Waiting for unfinished jobs....
Compiling /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/xpt2046_lld.c
In file included from /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/ads7843_lld.h:4:0,
                 from /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/ads7843_lld.c:1:
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: nested redefinition of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: redeclaration of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:19: error: redeclaration of enumerator 'portrait'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:27: note: previous definition of 'portrait' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:29: error: redeclaration of enumerator 'landscape'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:37: note: previous definition of 'landscape' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:40: error: redeclaration of enumerator 'portraitInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:48: note: previous definition of 'portraitInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:53: error: redeclaration of enumerator 'landscapeInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:61: note: previous definition of 'landscapeInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: nested redefinition of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: redeclaration of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:17: error: redeclaration of enumerator 'powerOff'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:25: note: previous definition of 'powerOff' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:27: error: redeclaration of enumerator 'powerOn'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:47: note: previous definition of 'powerOn' was here
make: In file included from /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/xpt2046_lld.h:4:0,
                 from /home/tectu/projects/resources/chibios/ext/lcd/drivers/touchpad/xpt2046_lld.c:1:
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: nested redefinition of 'enum orientation'*** [build/obj/ads7843_lld.o] Error 1

/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: redeclaration of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:19: error: redeclaration of enumerator 'portrait'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:27: note: previous definition of 'portrait' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:29: error: redeclaration of enumerator 'landscape'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:37: note: previous definition of 'landscape' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:40: error: redeclaration of enumerator 'portraitInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:48: note: previous definition of 'portraitInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:53: error: redeclaration of enumerator 'landscapeInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:61: note: previous definition of 'landscapeInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: nested redefinition of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: redeclaration of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:17: error: redeclaration of enumerator 'powerOff'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:25: note: previous definition of 'powerOff' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:27: error: redeclaration of enumerator 'powerOn'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:47: note: previous definition of 'powerOn' was here
make: *** [build/obj/xpt2046_lld.o] Error 1
In file included from /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/s6d1121_lld.h:4:0,
                 from /home/tectu/projects/resources/chibios/ext/lcd/drivers/lcd/s6d1121_lld.c:4:
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: nested redefinition of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:6: error: redeclaration of 'enum orientation'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:19: error: redeclaration of enumerator 'portrait'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:27: note: previous definition of 'portrait' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:29: error: redeclaration of enumerator 'landscape'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:37: note: previous definition of 'landscape' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:40: error: redeclaration of enumerator 'portraitInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:48: note: previous definition of 'portraitInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:57:53: error: redeclaration of enumerator 'landscapeInv'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:285:61: note: previous definition of 'landscapeInv' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: nested redefinition of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:6: error: redeclaration of 'enum powermode'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:14: note: originally defined here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:17: error: redeclaration of enumerator 'powerOff'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:25: note: previous definition of 'powerOff' was here
/home/tectu/projects/resources/chibios/os/halext/include/glcd.h:60:27: error: redeclaration of enumerator 'powerOn'
/home/tectu/projects/resources/chibios/os/halext/include/gdisp.h:289:47: note: previous definition of 'powerOn' was here
make: *** [build/obj/s6d1121_lld.o] Error



~ Tectu
petr
Posts: 7
Joined: Mon Jul 30, 2012 8:54 pm

Re: GDISP driver

Post by petr »

Hi there,

fist, thank you all for the fantastic work!
I have an issue with the new GDISP Driver, drawing primitives works fine, but all text is garbled. This happens with GPIO and FSMC on two different boards, with two different LCDs, but same driver (SSD1289). Everything works fine with the original code from Tectu.
I am not sure where to start debugging this. Please see the attached photo.
garbage.jpg
garbage.jpg (117.17 KiB) Viewed 6874 times

Petr
Locked