Jump to content
43oh

(Universal) Color LCD graphics library (2)


Recommended Posts

  • 3 weeks later...
  • Replies 127
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

This is my new universal graphics library (original one is here.)   Supported boards (this is out of the "box" support, but the library will work with any board after small changes.)   TI's MSP430

This was the case, at least for me. According to the datasheet I have for this display, the RGB/BGR direction is controlled by HW pin, so I made the following changes to the code in graphics.c file.

Here's something you can use for testing (software SPI only.)   ugl16stella.zip

Posted Images

Draw TI Logo function

 

post-73-0-88751900-1381240782_thumb.jpg

const u_char ti1[10] = { 94, 36, 109, 36, 97, 92, 82, 92, 94, 36 };
const u_char ti2[82] = { 0, 58, 41, 58, 41, 0, 80, 0, 80, 25, 88, 28, 84, 47,
		72, 47, 68, 65, 80, 65, 76, 84, 75, 95, 76, 103, 82, 110, 94, 112, 110,
		107, 115, 93, 106, 93, 104, 90, 110, 65, 122, 65, 126, 47, 114, 47, 118,
		29, 148, 32, 148, 54, 156, 65, 154, 95, 130, 106, 116, 120, 111, 134,
		114, 149, 98, 150, 80, 138, 62, 104, 54, 97, 46, 99, 38, 106, 30, 104,
		20, 88, 0, 58 };

///////////////////////////
// TI Logo
///////////////////////////
void drawTILogo(u_int x, u_int y, u_int color) {
	u_char sx = 0;
	u_char sy = 0;
	u_int ax = 0;
	u_int ay = 0;
	setColor(color);
	drawCircle(105 + x, 23 + y, 8);
	u_char i = 0;
	sx = ti1[i++] + x;
	sy = ti1[i++] + y;
	while (i < 10) {
		ax = ti1[i++] + x;
		ay = ti1[i++] + y;
		drawLine(sx, sy, ax, ay);
		sx = ax;
		sy = ay;
	}
	i = 0;
	sx = ti2[i++] + x;
	sy = ti2[i++] + y;
	while (i < 82) {
		ax = ti2[i++] + x;
		ay = ti2[i++] + y;
		drawLine(sx, sy, ax, ay);
		sx = ax;
		sy = ay;
	}
}
Link to post
Share on other sites
  • 1 month later...

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...