View previous topic :: View next topic |
Author |
Message |
waheed
Joined: 19 May 2012 Posts: 26 Location: Pakistan
|
GLCD Driver Explanation |
Posted: Thu May 31, 2012 6:58 am |
|
|
Controller: 18f452
Compiler v 4.125
GLCD: 96*60 KS0713 Family Graphic LCDs
I want to make changes to GLCD Driver and I don't understand the following things:
Print Character Routine:
Code: |
void dt_lcd_printchar(byte cvar) // Write 1 character to LCD
{
charsel=cvar;
int i;
for ( i = 0; i < 5; i++ ){
if(charsel<0x50) dt_Lcd_Write_data(TABLE5[charsel - 0x20][i] << 1);
else if(charsel>0x4f) dt_Lcd_Write_data(TABLE6[charsel - 0x50][i] << 1);
} // send data to nokia
dt_lcd_write_data(0x00); // 1 byte (always blank)
}
|
TABLE5[48][5] contains the ASCII codes for characters.
dt_Lcd_Write_data() & dt_lcd_write_dorc routines are:
Code: |
void dt_lcd_write_data(char bytefor_data)
{
dt_cs=0;
//nop;nop;nop;nop;
dt_rs=1;
dt_lcd_write_dorc(bytefor_data); // write display data
dt_cs=1;
}
//////////////////////////////////////////////////////////////////////////////////
void dt_lcd_write_dorc(char bytefor) // serial write data or command subroutine
{
char caa;
for (caa=8;caa>0;caa--) {
dt_sclk=0;
// delay_us(2);
if ((bytefor&0x80)==0){dt_sid=0;}
else {dt_sid=1;}
//nop;nop;
dt_sclk=1;
bytefor=bytefor<<1;
//nop;nop;
}
}
|
Q1: Why I have to use "printf" before calling Printchar routine.
e.g. printf(dt_lcd_printchar,"CCS-FORUMS");
Q2: How to set a single pixel?
Q3: How to Highlight the text?
Q4: dt_lcd_write_data(char bytefor) takes a character as input then,
what is this supposed to mean?
Code: |
the " << 1 " in the following line:
dt_Lcd_Write_data(TABLE5[charsel - 0x20][i] << 1);
|
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu May 31, 2012 7:39 am |
|
|
RTM (won't be rude....).
Look at the entry for the printf routine. You are _not_ 'using printf, before calling printchar routine'. You are calling the printf routine, and it is sending it's _output_ to the printchar routine.
glcd_pixel
You can't. There isn't any such thing as text really. You are drawing text as graphic lines, on a graphic display. The way to 'highligt', is to draw a dark filled rectangle first, covering where you are going to put the text, then draw the text with a white pen, instead of black.
Read a basic C book.
Best Wishes |
|
|
waheed
Joined: 19 May 2012 Posts: 26 Location: Pakistan
|
|
Posted: Thu May 31, 2012 11:21 pm |
|
|
Quote: |
The way to 'highligt', is to draw a dark filled rectangle first, covering where you are going to put the text, then draw the text with a white pen, instead of black.
|
I already knew that. What I actually wanted to ask that how can I draw a dark filled rectangle, and write text in white pen. Is there any library file which have that kind of option. |
|
|
|