CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

GLCD Driver Explanation

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
waheed



Joined: 19 May 2012
Posts: 26
Location: Pakistan

View user's profile Send private message

GLCD Driver Explanation
PostPosted: Thu May 31, 2012 6:58 am     Reply with quote

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: 19338

View user's profile Send private message

PostPosted: Thu May 31, 2012 7:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 31, 2012 11:21 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group