Jump to content
43oh

(Universal) Color LCD graphics library


Recommended Posts

Updated 2 files: colorLCD.c and font_11x16.h

What's new? Small speed improvements and font background.

In most cases, fonts with background should be faster, but if you have a lot of white spaces, you could try using old functions (they are commented out.)

The main advantage of using new functions is that you don't have to erase before writing new content and updates are faster and flicker free.

Link to post
Share on other sites
  • 2 weeks later...
  • Replies 127
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

NOTE: Those files are not current as of May 5th 2013. See the first post for the latest. PCF8833 (Nokia 6100) SPFD54124B (Nokia 6085 and 6101) ST7735R (JD-T1800, 1.8" LCD) HX8340B (BTL221722, 2.2" wi

Just FYI. In a couple of weeks, I will be updating this library with the following:   support for HX8340 (2.2" LCD) support for ILI9225 (2.2" LCD with touch panel) landscape/portrait switch most

New versions are here   UPDATE: Sep 3rd 2013 New way to configure dev boards Works with TI's G2 LaunchPad (G2553,) and my G2955, F5172, F5510, F5529 dev boards. Just one line change to switch bet

Posted Images

Do you feel like this library is slow? Well, I have a good news for you :smile:

I have few updates coming and one of them is hardware SPI option (available only for 1.8" JD-T1800 and 2.2" LCD with touch displays, no Nokia.)

With this new option, you will get about 500% speed increase, take a look:

 

Drawing 600 shapes and about 3000 different size characters.

Link to post
Share on other sites

Do you feel like this library is slow? Well, I have a good news for you :smile:

I have few updates coming and one of them is hardware SPI option (available only for 1.8" JD-T1800 and 2.2" LCD with touch displays, no Nokia.)

With this new option, you will get about 500% speed increase, take a look:

 

Drawing 600 shapes and about 3000 different size characters.

 

Holy crap!

Link to post
Share on other sites

Exactly.

I was working on some GUI controls for my touch LCD and really needed that boost.

The only possible problem is the touch controller chip which has 2MHz max clock speed.

 

BTW, I get about 5fps on 2.2" display and about 10fps on 1.8" (fill the entire screen with color, 176 x 220 & 128 x 160.)

Link to post
Share on other sites

Rob,

 

Great work on the library, it works great! I need a larger font, did you use a program to generate the fonts or do it by hand.  I have looked at several of the programs that are available but the ones I have found have variaable character widths.

 

Thanks

Link to post
Share on other sites
  • 2 weeks later...

Here are the changes required to make ILI9225B horizontal. In the next round of updates, I will add conditionals to make H/V switch possible with a single define.

 

colorLCD.h

#ifdef ILI9225B
//
#define USE16BIT
#define LCD_HEIGHT 176 // horizontal
#define LCD_WIDTH 220 // horizontal

colorLCD.c

 

#ifdef ILI9225B

	char trueXStart, trueYStart, trueXEnd, trueYEnd; // horizontal
	trueXStart = yStart; // horizontal
	trueXEnd = yEnd; // horizontal
	trueYStart = xStart; // horizontal
	trueYEnd = xEnd; // horizontal

	writeCommand(ILIGRAMHEA);
	writeData(0);
	writeData(trueXEnd + LCD_OFFSET_WIDTH); // horizontal
	writeCommand(ILIGRAMHSA);
	writeData(0);
	writeData(trueXStart + LCD_OFFSET_WIDTH); // horizontal

	writeCommand(ILIGRAMVEA);
	writeData(0);
	writeData(trueYEnd + LCD_OFFSET_HEIGHT); // horizontal
	writeCommand(ILIGRAMVSA);
	writeData(0);
	writeData(trueYStart + LCD_OFFSET_HEIGHT); // horizontal

	writeCommand(ILIGRAMADDRX);
	writeData(0);
	writeData(trueXStart + LCD_OFFSET_WIDTH); // horizontal
	writeCommand(ILIGRAMADDRY);
	writeData(0);
	writeData(trueYStart + LCD_OFFSET_HEIGHT); // horizontal
void initILI9225B() {

	writeCommand(0x28);
	delay(20);
	writeCommand(0x01);
	writeData(0x03); // set SS and NL bit // horizontal
	writeData(0x1C);
	writeCommand(0x02);
	writeData(0x01); // set 1 line inversion
	writeData(0x00);
	writeCommand(0x03);
	writeData(0x10); // set GRAM write direction and BGR=1.//1030
	writeData(0x38); // horizontal

 

Link to post
Share on other sites
  • 3 weeks later...
  • 3 weeks later...

Noob problems:

Purchased latest offering of the 2.2" LCD (beautiful work!!!), soldered on the connectors, plugged in and it lights up. Yippee!  Then comes using it.  Create a new project in CCS for the Lights Out game.  Downloaded all of RobG's latest files in Post #20, searched and found a copy of the msp430g2553.h file on internet.  Placed this and the color.h and colorLCD.h files, plus the in430.h file in the same Project folder, clearing the question marks (?) next to the INCLUDE statements at the start of main.c.

But now I get a wad of nasty errors.  Noob can't figure out what he's done wrong.  Any help appreciated.

 


**** Build of configuration Debug for project LightsOut ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv5/tools/compiler/arm_5.0.1/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16

--abi=eabi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --

include_path="C:/" --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile

--preproc_dependency="main.pp"  "../main.c"
"..\msp430g2553.h", line 1: error #171: expected a declaration
"..\msp430g2553.h", line 8: error #24: invalid octal digit
"..\msp430g2553.h", line 9: error #24: invalid octal digit
"..\msp430g2553.h", line 12: error #10: "#" not expected here
"..\msp430g2553.h", line 13: error #10: "#" not expected here
"..\msp430g2553.h", line 18: error #24: invalid octal digit
"..\msp430g2553.h", line 19: error #24: invalid octal digit
"..\msp430g2553.h", line 19: warning #12-D: parsing restarts here after previous syntax error
"..\msp430g2553.h", line 20: error #171: expected a declaration
"..\msp430g2553.h", line 21: error #171: expected a declaration
"..\msp430g2553.h", line 22: error #171: expected a declaration
"..\msp430g2553.h", line 23: error #171: expected a declaration
"..\msp430g2553.h", line 24: error #171: expected a declaration
"..\msp430g2553.h", line 25: error #171: expected a declaration
"..\msp430g2553.h", line 26: error #171: expected a declaration
"..\msp430g2553.h", line 27: error #171: expected a declaration
"..\msp430g2553.h", line 28: error #24: invalid octal digit
"..\msp430g2553.h", line 28: error #171: expected a declaration
"..\msp430g2553.h", line 29: error #24: invalid octal digit
"..\msp430g2553.h", line 29: error #171: expected a declaration
"..\msp430g2553.h", line 30: error #171: expected a declaration
"..\msp430g2553.h", line 35: error #10: "#" not expected here
"..\msp430g2553.h", line 36: error #10: "#" not expected here
"..\msp430g2553.h", line 37: error #10: "#" not expected here
"..\msp430g2553.h", line 38: error #24: invalid octal digit
"..\msp430g2553.h", line 38: error #10: "#" not expected here
"..\msp430g2553.h", line 39: error #24: invalid octal digit
"..\msp430g2553.h", line 39: error #10: "#" not expected here
"..\msp430g2553.h", line 40: error #10: "#" not expected here
"..\msp430g2553.h", line 41: error #10: "#" not expected here
"..\msp430g2553.h", line 42: error #10: "#" not expected here
"..\msp430g2553.h", line 48: error #24: invalid octal digit
"..\msp430g2553.h", line 48: error #10: "#" not expected here
"..\msp430g2553.h", line 49: error #24: invalid octal digit
"..\msp430g2553.h", line 49: error #10: "#" not expected here
"..\msp430g2553.h", line 50: error #10: "#" not expected here
"..\msp430g2553.h", line 51: error #10: "#" not expected here
"..\msp430g2553.h", line 52: error #10: "#" not expected here
"..\msp430g2553.h", line 53: error #10: "#" not expected here
"..\msp430g2553.h", line 54: error #10: "#" not expected here
"..\msp430g2553.h", line 55: error #10: "#" not expected here
"..\msp430g2553.h", line 56: error #10: "#" not expected here
"..\msp430g2553.h", line 57: error #10: "#" not expected here
"..\msp430g2553.h", line 58: error #24: invalid octal digit
"..\msp430g2553.h", line 59: error #24: invalid octal digit
"..\msp430g2553.h", line 59: error #10: "#" not expected here
"..\typedefs.h", line 13: warning #12-D: parsing restarts here after previous syntax error
"..\colorLCD.h", line 105: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 106: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 107: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 120: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 123: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 123: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 123: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 123: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 124: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 125: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 125: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 126: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 126: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 127: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 127: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 128: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 128: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 129: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 129: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 130: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 130: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 131: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 131: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 132: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 132: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 132: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 132: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 133: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 133: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 133: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 133: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 134: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 134: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 134: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 136: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 136: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 136: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 136: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 137: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 137: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 137: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 139: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 139: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 139: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 139: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 139: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 141: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 141: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 141: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 141: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 142: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 142: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 142: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 142: error #20: identifier "u_char" is undefined
"..\colorLCD.h", line 142: error #20: identifier "u_char" is undefined
Error limit reached.
100 errors detected in the compilation of "../main.c".
Compilation terminated.

>> Compilation failure
gmake: *** [main.obj] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****
 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...