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

Big font for T6963c Graphic LCD

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



Joined: 26 Feb 2013
Posts: 30
Location: Algeria

View user's profile Send private message

Big font for T6963c Graphic LCD
PostPosted: Fri Nov 01, 2013 4:58 pm     Reply with quote

Hi friends............

I used the driver for a graphic display T6963C, but I found a problem to display large letter, the resolution is very unpleasant when I use a letter with a large size. so I would like letters with resolution of 16x16 if possible, because the one I use is 5x7.




Main prog :
Code:
#include <16F877A.h>
#device adc=16

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOPROTECT                //Code not protected from reading

#use delay(clock=25000000)

#include "T6963KELLAL.c"
CHAR PP[]="Ab5";

void main() {
   int16 counter;
   

   set_tris_c(0x00); 
   glcd_init();       
   glcd_WriteByte(1, (LCDModeSet|LCDMode_XOR)); 
   glcd_WriteByte(1, (LCDDispMode|LCDDisp_TXT|LCDDisp_GRH));
   delay_ms(200);
   
clear_screen();
   While (1)
   {   

       glcd_text57(5, 32, PP, 1, 1);
       glcd_text57(40, 20, PP, 4, 1);
       glcd_text57(140, 20, PP, 5, 1);
       delay_ms(3000);

   }   
}



driver : T6963KELLAL.c

Code:
#use fast_io(D)
#include "math.h"
#define set_tris_lcd(x) set_tris_d(x)   
//TRIS DataBus=x,  note:control bus (PORTC) always outputs

const int16 TextHome=0x0780;      //(240*64)/8=1920-->0x0780
const int8  TextArea=0x001E;      // how many bytes before a new line (30 bytes)
const int16 GraphicsHome=0x0000;
const int8  GraphicsArea=0x001E;   // how many bytes before a new line (30 bytes)

const int8 AutoModeWrite=0xB0;      //DataAutoWrite
const int8 AutoModeRead=0xB1;      //DataAutoRead
const int8 AutoModeReset=0xB2;      //Auto reset

const int8 LCDModeSet  = 0x80;   // send this OR'd with the following
const int8 LCDMode_OR  = 0b0000;
const int8 LCDMode_XOR = 0b0001;
const int8 LCDMode_AND = 0b0010;
const int8 LCDMode_TA  = 0b0100; // TEXT ATTRIBUTE mode.
const int8 LCDMode_RAM = 0b1000; // 1=CG RAM, 0=internal CG ROM

const int8 LCDSetCursorPtr  = 0x21;  // cursor address
const int8 LCDSetCursorSize = 0xA0;  // 1 line cursor

const int8 LCDDispMode = 0x90;   // send this OR'd with the following
const int8 LCDDisp_BLK = 0b0011; // Blink Cursor
const int8 LCDDisp_CUR = 0b0010; // Add Cursor
const int8 LCDDisp_TXT = 0b0100; //Text-OK,Graphic-NG
const int8 LCDDisp_GRH = 0b1000; //Text-NG,Graphic-OK



const int8 LCDBitSet   = 0xF8;
const int8 LCDBitReset = 0xF0;


struct lcd_pin_def             //Struct type bitfield
{
   int1 unused1   :1;      // C0
   int1 unused2   :1;      // C1
   int1 unused3   :1;      // C2
   int1 ce         :1;     // C3 Chip enable active low
   int1 w_bar       :1;      // C4 Write bar active low
   int1 r_bar      :1;      // C5 Read bar active low
   int1 cd         :1;      // C6 Command/Data BAR   1=command 0=data
   int1 reset_bar   :1;      // C7 Reset active low
   int8 data      :8;      // PortD=Data bus(address=8) 
};
struct lcd_pin_def  LCD;
#byte LCD = 7    // portC address=7 on 16F887

//Prototyping
int   glcd_ReadByte(void);
void  glcd_WriteByte(int1 cd, int data);
void  glcd_WriteByteAuto(int data);
void  glcd_WriteCmd2(int16 data, int cmd);
void  glcd_WriteCmd1(int data, int cmd);
void  glcd_gotoxy(int x, int y, int1 text);

void glcd_init(void)
{
   int16 counter;
   set_tris_lcd(0x00);      //TRIS DATA bus(PORT D),note:control bus always outputs
   
   LCD.ce=0;               //INITIAL STATES OF CONTROL PINS         
   LCD.w_bar=1;            // 
   LCD.r_bar=1;            //
   LCD.cd=1;               // command
   
   LCD.reset_bar=0;         // perform a reset
   delay_us(10);            // delay for a reset
   LCD.reset_bar = 1;      // run
   
   // Set up the graphics and text areas
   glcd_WriteCmd2(TextHome, 0x40);       //TextHomeAddress Set
   glcd_WriteCmd2(TextArea, 0x41);         //TextArea column Set
   glcd_WriteCmd2(GraphicsHome, 0x42);    //GraphicHomeAddress Set
   glcd_WriteCmd2(GraphicsArea, 0x43);    //GraphicArea column Set

   // set AddressPointer to 0
   glcd_WriteCmd2(0x0000, 0x24);       //Set AddressPointer to 0
   
   // Clear all RAM of LCD (8k)
   glcd_WriteByte(1, AutoModeWrite);    //Set Data Auto Write
   for (counter = 0; counter < 0x1fff; counter++)    //0x1fff=8191 bytes
      {
         glcd_WriteByteAuto(0);    // fill everything with zeros
      }
   glcd_WriteByte(1, AutoModeReset);
}

void glcd_WriteByte(int1 cd, int data)      //Write PORTD as command or data in "Normal" mode.
{
    int status = 0, temp = 0;
    set_tris_lcd(0xff); // All inputs
    LCD.ce = 1;
    LCD.w_bar = 1;
    LCD.r_bar= 1;
    LCD.cd = 1;//defaults

    while (status != 0x03) {  // is LCD busy?
       LCD.r_bar= 0;
       LCD.ce = 0;         //After 150ns read the data on D0-7
       #asm nop #endasm
       temp = LCD.data;
       LCD.ce = 1;
       LCD.r_bar = 1;
       status = temp & 0x03; //Masking
    }

    set_tris_lcd(0x00);    // All outputs
    LCD.cd = cd;           // Command/Data bar (1=command 0=data)
    LCD.data = data;        // Put data on data bus
    LCD.ce = 0;
    LCD.r_bar = 1;         // not read
    LCD.w_bar = 0;         // write
    LCD.ce = 1;
    LCD.w_bar = 1;         // release
}

void glcd_WriteByteAuto(int data)       //Write PORTD as data in "Auto" mode.
{
   int status = 0, temp = 0; // WHEN Auto mode,the status bits ARE DIFFERENT BITS THAN NORMAL MODE
   set_tris_lcd(0xff);      // All inputs
   LCD.ce = 1;
   LCD.w_bar = 1;
   LCD.r_bar = 1;
   LCD.cd = 1; // defaults

   while (status != 0x08) {  // is LCD busy?  Checking STA3!
     LCD.r_bar = 0;
     LCD.ce =0;         //After 150ns read the data on D0-7
     #asm nop #endasm
     temp = LCD.data;
     LCD.ce = 1;
     LCD.r_bar = 1;
     status = temp & 0x08; //Masking
   }

   set_tris_lcd(0x00);     // All outputs
   LCD.cd = 0;             // This is always data
   LCD.data = data;        // Put data on data bus
   LCD.ce = 0;
   LCD.r_bar = 1;         // not read
   LCD.w_bar = 0;         // write
   LCD.ce = 1;
   LCD.w_bar = 1;         // release
}

void glcd_WriteCmd1(int data, int cmd)
{
  glcd_WriteByte(0, data);
  glcd_WriteByte(1, cmd);
}

void glcd_WriteCmd2(int16 data, int cmd)
{
  glcd_WriteByte(0, data & 0xff);    //masking,LSB Set
  glcd_WriteByte(0, data>>8);       //shift right 8bir,MSB Set
  glcd_WriteByte(1, cmd);
}

int glcd_ReadByte(void)
{
  int data = 0, status = 0, temp = 0;
  set_tris_lcd(0xff);             // All inputs
  LCD.ce = 1;
  LCD.w_bar = 1;
  LCD.r_bar = 1;
  LCD.cd = 1;  // defaults

  #asm nop #endasm

  while (status != 0x03) {  // is LCD busy?
    LCD.r_bar = 0;
    LCD.ce = 0;
    temp = LCD.data;
    LCD.ce = 1;
    LCD.r_bar = 1;
    status = temp & 0x03;  //Masking
  }

  LCD.cd = 0;          // Command/Data bar
  LCD.ce = 0;
  LCD.r_bar = 0;        // read
  /////////////////////////////////////////////////////////
  #asm nop #endasm    // THIS PAUSE IS VERY NESSESARY !!!//
  /////////////////////////////////////////////////////////
  data = LCD.data;
  LCD.r_bar = 1;
  LCD.ce = 1;
  LCD.cd = 1;
  return data;        // Return the read data
}

void glcd_putc(char c) {
   glcd_WriteCmd1(c - 0x20, 0xc0); //c-0x20=Transfer from Ascii Code, Data Write UP.
}

void glcd_gotoxy(int x, int y, int1 text) { // sets memory location to screen location x, y
   // location 1,1 is upper left corner;
   // text = 1 (text area), text = 0 (graphics area)
   int16 location, home;
   int line;

   if (!text) {
      home = GraphicsHome;
      line = GraphicsArea;
   }
   else {
      home = TextHome;
      line = TextArea;
   }

   location = home + (((int16)y - 1) * line) + x - 1;
   glcd_WriteCmd2(location, 0x24);
}


Void clear_screen(void){      //very simular to the glcd_init(void)
   int16 counter;
  // set address to 0
  glcd_WriteCmd2(0x0000, 0x24);       //Set AddressPointer to 0
  // Clear all RAM of LCD (8k)
  glcd_WriteByte(1, AutoModeWrite);    //Set Data Auto Write
  for (counter = 0; counter < 0x1fff; counter++)    //0x1fff=8191 bytes
  {
    glcd_WriteByteAuto(0);    // fill everything with zeros
  }
  glcd_WriteByte(1, AutoModeReset);
}



unsigned int8 i;  //General Purpouse variable


// glcd_pixel8(x,y,px8) sets 8 pixels in line. 
void glcd_pixel8(unsigned int8 x, unsigned int8 y, int8 pixel8){
   unsigned int8 x_H;
   x_H = (x / 8);
   glcd_gotoxy(x_H+1,y,0);
   glcd_WriteCmd1(pixel8,0xc0);      //Write data and increament
}



// glcd_pixel(x,y,c) sets pixel x,y with c color
void glcd_pixel(unsigned int8 x, unsigned int8 y, int1 c){
unsigned int8 x_H;
unsigned int8 x_L=0;
x_H = (x / 8);
x_L = 7 - (x - 8*x_H);
glcd_gotoxy(x_H+1,y,0);
if(c){
glcd_WriteCmd1(1,(LCDBitSet|x_L));
} else {
glcd_WriteCmd1(1,(LCDBitReset|x_L));
}
}


// glcd_line(x0,y0, x1,y1, c) puts line from (x0, y0) to (x1, y1) with c color
//#separate
void glcd_line(signed int16 x0, signed int16 y0,
               signed int16 x1, signed int16 y1 , int1 c){
   int16 x;
   int16 y;
   unsigned int16 n;
   int1 m_case;
   
   x=abs(x1-x0);
   y=abs(y1-y0);
   
   if (y > x){
      n=(y1-y0);
      m_case=1;
   } else {
      n=(x1-x0);
      m_case=0;
   }
   for(i=0 ; i<=n ; i++){
      if (m_case){
         y=i + y0;
         x=(y*(x1-x0))/(y1-y0) + x0;
      } else {
         x=i + x0;
         y=(x*(y1-y0))/(x1-x0) + y0;
      }
      glcd_pixel(x, y,c);
   }
                         
}

// glcd_square(x0,y0,x1,y1, c) sets square
void glcd_square( unsigned int8 x0, unsigned int8 y0,
                  unsigned int8 x1, unsigned int8 y1 , int1 c){
   glcd_line(x0,y0, x1,y0, c);
   glcd_line(x1,y0, x1,y1, c);
   glcd_line(x0,y1, x1,y1, c);
   glcd_line(x0,y0, x0,y1, c);
}

// glcd_box(x0,y0,x1,y1, c)
void glcd_box( unsigned int8 x0, unsigned int8 y0,
               unsigned int8 x1, unsigned int8 y1 , int1 c){
   unsigned int8 x;
   unsigned int8 y;
   
   for(y=y0; y<=y1;y++){
      for(x=x0; x<=x1;x++){
         if((!(x%8)) && ((x1-x)>8)){
            glcd_pixel8(x,y,0xFF*c);  //Same time to write 8 pixel
            x +=7 ;
         } else {
            glcd_pixel(x,y,c);
         }
      }
   }
}

//glcd_image8 (*Pic, x, y, size_x, size_y)
void glcd_image8(int8 *pic_px, unsigned int8 x, unsigned int8 y,
                 unsigned int8 size_x, unsigned int8 size_y){
   
   unsigned int8 px_y;
   unsigned int8 px_x;
   unsigned int8 px=0;
   
   for(px_y=y; px_y<(y+size_y); px_y++){
      for(px_x=x; px_x<(x+size_x); px_x+=8){
         glcd_pixel8(px_x, px_y, *(pic_px+px));
         px+=1;
      }
   }
}


/*
240*64dots full image data for using Bitmap2LCD.exe(Basic Edition V1.5b) from a Bitmap file.
ƒf[ƒ^ƒTƒCƒY‚ª368ƒoƒCƒgˆÈ“à‚È‚Ì‚Å‚»‚êˆÈã‚Ì”z—ñ‚Í‚Å‚«‚È‚¢B240ƒoƒCƒg~‚W”z—ñ‚ʼn摜ƒf[ƒ^ƒe[ƒuƒ‹‚ð\¬B
ˆÈ‰º‚̃Cƒ[ƒWƒf[ƒ^‚́u‰t»Þ—¿‚ÌŠî–{‚Æ‚È‚é"5CB"‚̉»ŠwŽ®v‚Å‚·B
*/
int8 const g_image1[240]={
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x0F , 0xFF , 0xFF , 0xC0,
 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0xFF , 0xFF , 0xF8,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x1F , 0xFF , 0xFF , 0xE0 , 0x00 , 0x00,
 0x00 , 0x00 , 0x03 , 0xFF , 0xFF , 0xFC , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x30 , 0x00 , 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , 0x00,
 0x06 , 0x00 , 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x00,
 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0xFF,
 0xFF , 0xE7 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x60 , 0x00 , 0x00 , 0x18,
 0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0x3F , 0xFF , 0xC3,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0xC8 , 0x00 , 0x00 , 0x4C , 0x00 , 0x00,
 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x03 , 0x80 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
};
int8 const g_image2[240]={
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x98 , 0x00 , 0x00 , 0x6C , 0x00 , 0x00 , 0x00 , 0x00,
 0x18 , 0x00 , 0x00 , 0x01 , 0x80 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0xB0 , 0x00,
 0x00 , 0x26 , 0x00 , 0x00 , 0x00 , 0x00 , 0x30 , 0x00,
 0x00 , 0x00 , 0xC0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x03 , 0x20 , 0x00 , 0x00 , 0x36,
 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 , 0x00 , 0x00,
 0xA0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x03 , 0x60 , 0x00 , 0x00 , 0x13 , 0x00 , 0x00,
 0x00 , 0x00 , 0x60 , 0x00 , 0x00 , 0x00 , 0x60 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x06,
 0x40 , 0x00 , 0x00 , 0x19 , 0x00 , 0x00 , 0x00 , 0x00,
 0xC0 , 0x00 , 0x00 , 0x00 , 0x70 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x06 , 0xC0 , 0x00,
 0x00 , 0x09 , 0x80 , 0x00 , 0x00 , 0x00 , 0x80 , 0x00,
 0x00 , 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x0C , 0x80 , 0x00 , 0x00 , 0x0C,
 0x80 , 0x00 , 0x00 , 0x01 , 0x80 , 0x00 , 0x00 , 0x00,
 0x38 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x3C , 0x38 , 0x1F , 0x00 , 0x00,
 0x00 , 0x1D , 0x00 , 0x00 , 0x00 , 0x04 , 0xC0 , 0x00,
 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00,
 0x00 , 0x00 , 0x3E , 0x00 , 0x07 , 0x07 , 0x00 , 0x00
};
int8 const g_image3[240]={
 0x00 , 0x3C , 0x38 , 0x7F , 0xC0 , 0x00 , 0x00 , 0x1B,
 0x00 , 0x00 , 0x00 , 0x02 , 0x40 , 0x00 , 0x00 , 0x03,
 0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0x00 , 0x00 , 0x00,
 0xFF , 0x80 , 0x07 , 0x07 , 0x00 , 0x00 , 0x00 , 0x3E,
 0x38 , 0xFF , 0xC0 , 0x00 , 0x00 , 0x32 , 0x00 , 0x00,
 0x00 , 0x03 , 0x60 , 0x00 , 0x00 , 0x06 , 0x00 , 0x00,
 0x00 , 0x00 , 0x0E , 0x00 , 0x00 , 0x01 , 0xFF , 0x80,
 0x07 , 0x07 , 0x00 , 0x00 , 0x00 , 0x3E , 0x38 , 0xE1,
 0xE0 , 0x00 , 0x00 , 0x76 , 0x00 , 0x00 , 0x00 , 0x01,
 0x30 , 0x00 , 0x00 , 0x0E , 0x00 , 0x00 , 0x00 , 0x00,
 0x06 , 0x00 , 0x00 , 0x01 , 0xC3 , 0xC0 , 0x07 , 0x07,
 0x00 , 0x00 , 0x00 , 0x3F , 0x39 , 0xC0 , 0xC0 , 0x00,
 0x00 , 0x64 , 0x00 , 0x00 , 0x00 , 0x01 , 0xB0 , 0x00,
 0x00 , 0x1C , 0x00 , 0x00 , 0x00 , 0x00 , 0x07 , 0x00,
 0x00 , 0x03 , 0x81 , 0x80 , 0x07 , 0x07 , 0x00 , 0x00,
 0x00 , 0x3B , 0x39 , 0xC0 , 0x00 , 0x00 , 0x00 , 0xEC,
 0x00 , 0x00 , 0x00 , 0x00 , 0x98 , 0x00 , 0x00 , 0x18,
 0x00 , 0x00 , 0x00 , 0x00 , 0x03 , 0x00 , 0x00 , 0x03,
 0x80 , 0x00 , 0x07 , 0xFF , 0x00 , 0x00 , 0x00 , 0x3B,
 0xB9 , 0xC0 , 0x0F , 0xFF , 0xFF , 0xC8 , 0x00 , 0x00,
 0x00 , 0x00 , 0xCF , 0xFF , 0xFF , 0xF8 , 0x00 , 0x00,
 0x00 , 0x00 , 0x01 , 0xFF , 0xFF , 0xFB , 0x80 , 0x03,
 0xC7 , 0xFF , 0x0C , 0x30 , 0x00 , 0x39 , 0xB9 , 0xC0,
 0x0F , 0xFF , 0xFF , 0xC0 , 0x00 , 0x00 , 0x00 , 0x00,
 0x4F , 0xFF , 0xFF , 0xF0 , 0x00 , 0x00 , 0x00 , 0x00,
 0x01 , 0xFF , 0xFF , 0xFB , 0x80 , 0x03 , 0x07 , 0xFF,
 0x1C , 0x70 , 0x00 , 0x39 , 0xF9 , 0xC0 , 0x00 , 0x00,
 0x00 , 0xC0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0x00,
 0x00 , 0x3B , 0x00 , 0x00 , 0x00 , 0x00 , 0x09 , 0x80,
 0x00 , 0x03 , 0x80 , 0x06 , 0x07 , 0x07 , 0x3C , 0xF0
};
int8 const g_image4[240]={
 0x00 , 0x38 , 0xF9 , 0xC0 , 0xC0 , 0x00 , 0x00 , 0x60,
 0x00 , 0x00 , 0x00 , 0x00 , 0x1C , 0x00 , 0x00 , 0x19,
 0x80 , 0x00 , 0x00 , 0x00 , 0x1B , 0x00 , 0x00 , 0x03,
 0x81 , 0x87 , 0x87 , 0x07 , 0x2C , 0xB0 , 0x00 , 0x38,
 0xF8 , 0xE1 , 0xE0 , 0x00 , 0x00 , 0x60 , 0x00 , 0x00,
 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x0D , 0x80 , 0x00,
 0x00 , 0x00 , 0x33 , 0x00 , 0x00 , 0x01 , 0xC3 , 0xC4,
 0xC7 , 0x07 , 0x0C , 0x30 , 0x00 , 0x38 , 0x78 , 0xFF,
 0xC0 , 0x00 , 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , 0x00,
 0x38 , 0x00 , 0x00 , 0x0C , 0xC0 , 0x00 , 0x00 , 0x00,
 0x66 , 0x00 , 0x00 , 0x01 , 0xFF , 0x80 , 0xC7 , 0x07,
 0x0C , 0x30 , 0x00 , 0x38 , 0x78 , 0x7F , 0xC0 , 0x00,
 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , 0x00 , 0x30 , 0x00,
 0x00 , 0x06 , 0xC0 , 0x00 , 0x00 , 0x00 , 0x4E , 0x00,
 0x00 , 0x00 , 0xFF , 0x86 , 0xC7 , 0x07 , 0x0C , 0x30,
 0x00 , 0x38 , 0x38 , 0x1F , 0x00 , 0x00 , 0x00 , 0x18,
 0x00 , 0x00 , 0x00 , 0x00 , 0x60 , 0x00 , 0x00 , 0x02,
 0x60 , 0x00 , 0x00 , 0x00 , 0xCC , 0x00 , 0x00 , 0x00,
 0x3E , 0x03 , 0x87 , 0x07 , 0x0C , 0x30 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0C , 0x00 , 0x00,
 0x00 , 0x00 , 0xE0 , 0x00 , 0x00 , 0x03 , 0x20 , 0x00,
 0x00 , 0x01 , 0x98 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x0C , 0x00 , 0x00 , 0x00 , 0x00,
 0xC0 , 0x00 , 0x00 , 0x01 , 0xB0 , 0x00 , 0x00 , 0x01,
 0xB8 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x01 , 0xC0 , 0x00,
 0x00 , 0x00 , 0x98 , 0x00 , 0x00 , 0x03 , 0x30 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
};
int8 const g_image5[240]={
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x06,
 0x00 , 0x00 , 0x00 , 0x01 , 0x80 , 0x00 , 0x00 , 0x00,
 0xD8 , 0x00 , 0x00 , 0x03 , 0x60 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x03 , 0x00 , 0x00,
 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x00 , 0x6C , 0x00,
 0x00 , 0x06 , 0x60 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x03,
 0x00 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x06,
 0xC0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x01 , 0x80 , 0x00 , 0x00 , 0x06 , 0x00 , 0x00,
 0x00 , 0x00 , 0x36 , 0x00 , 0x00 , 0x0C , 0xC0 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0xC0 , 0x00 , 0x00 , 0x0C , 0x00 , 0x00 , 0x00 , 0x00,
 0x12 , 0x00 , 0x00 , 0x09 , 0x80 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xC0 , 0x00,
 0x00 , 0x0C , 0x00 , 0x00 , 0x00 , 0x00 , 0x09 , 0x00,
 0x00 , 0x19 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x63 , 0xFF , 0xFE , 0x18,
 0x00 , 0x00 , 0x00 , 0x00 , 0x0D , 0x00 , 0x00 , 0x13,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x67 , 0xFF , 0xFF , 0x18 , 0x00 , 0x00,
 0x00 , 0x00 , 0x04 , 0x00 , 0x00 , 0x06 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
};
int8 const g_image6[240]={
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x30 , 0x00 , 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , 0x00,
 0x07 , 0xFF , 0xFF , 0xFE , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x1F , 0xFF,
 0xFF , 0xE0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x03 , 0xFF,
 0xFF , 0xFC , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x1F , 0xFF , 0xFF , 0xC0,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x00
};
int8 const g_image7[240]={
 0x00 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0x00 , 0x00 , 0xF8,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xE3,
 0xFF , 0xFC , 0x79 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xF1 , 0xFE , 0x7F , 0xF8 , 0xFF , 0xFF,
 0xFF , 0xFF , 0xF1 , 0x00 , 0x00 , 0xF0 , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xE7 , 0xFF , 0xF3 , 0xFF , 0xF8,
 0x79 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF,
 0xF9 , 0xFE , 0x7F , 0xFC , 0xFF , 0xFF , 0xFF , 0xFF,
 0xF9 , 0x00 , 0x00 , 0xF0 , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xE7 , 0xFF , 0xF3 , 0xFF , 0xF8 , 0x79 , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xF9 , 0xFF,
 0xFF , 0xFC , 0xFF , 0xFF , 0xFF , 0xFF , 0xF9 , 0x00,
 0x00 , 0xE4 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xE7,
 0xFF , 0xF3 , 0xFF , 0xF2 , 0x7F , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xF9 , 0xFF , 0xFF , 0xFC,
 0xFF , 0xFF , 0xFF , 0xFF , 0xF9 , 0x00 , 0x00 , 0xE4,
 0xFF , 0xF8 , 0x0F , 0x87 , 0x01 , 0x81 , 0x0C , 0x33,
 0xFF , 0xF2 , 0x7F , 0xFF , 0xFC , 0x00 , 0xC3 , 0x07,
 0x01 , 0xF0 , 0x78 , 0x1C , 0x60 , 0x3C , 0x0F , 0x87,
 0x01 , 0x86 , 0x19 , 0x00 , 0x00 , 0xCC , 0xE0 , 0x1C,
 0x67 , 0x33 , 0x8C , 0xE7 , 0x9E , 0x73 , 0x00 , 0xE6,
 0x7F , 0xC0 , 0x39 , 0x89 , 0xE6 , 0x73 , 0x8C , 0xE7,
 0x38 , 0xCE , 0x71 , 0x9C , 0x67 , 0x33 , 0x8C , 0xCF,
 0x39 , 0x00 , 0x00 , 0xCC , 0xFF , 0xFC , 0xF2 , 0x79,
 0x9C , 0xE7 , 0xCC , 0xF3 , 0xFF , 0xE6 , 0x7F , 0xFF,
 0xF3 , 0xCC , 0xCF , 0xF3 , 0x9C , 0xCF , 0x99 , 0xE6,
 0x73 , 0xCC , 0xE6 , 0x79 , 0x9C , 0xE6 , 0x79 , 0x00
};
int8 const g_image8[240]={
 0x00 , 0x9C , 0xFF , 0xFC , 0xF2 , 0x01 , 0x9C , 0xE7,
 0xCC , 0xF3 , 0xFF , 0xCE , 0x7F , 0xFF , 0xF3 , 0xFC,
 0xCF , 0xC3 , 0x9C , 0xCF , 0x99 , 0xE6 , 0x73 , 0xCC,
 0xE6 , 0x01 , 0x9C , 0xE6 , 0x79 , 0x00 , 0x00 , 0x80,
 0x3F , 0xFC , 0xF2 , 0x7F , 0x9C , 0xE7 , 0xE1 , 0xF3,
 0xFF , 0xC0 , 0x1F , 0xFF , 0xF3 , 0xFE , 0x1F , 0x13,
 0x9C , 0xCF , 0x99 , 0xE6 , 0x73 , 0xCC , 0xE6 , 0x7F,
 0x9C , 0xF0 , 0xF9 , 0x00 , 0x00 , 0xFC , 0xFF , 0xFC,
 0xF2 , 0x7F , 0x9C , 0xE7 , 0xE1 , 0xF3 , 0xFF , 0xFE,
 0x7F , 0xFF , 0xF3 , 0xFE , 0x1E , 0x73 , 0x9C , 0xCF,
 0x99 , 0xE6 , 0x73 , 0xCC , 0xE6 , 0x7F , 0x9C , 0xF0,
 0xF9 , 0x00 , 0x00 , 0xFC , 0xFF , 0xFC , 0x67 , 0x39,
 0x9C , 0xE4 , 0xF3 , 0xF3 , 0xFF , 0xFE , 0x7F , 0xFF,
 0xF9 , 0xCF , 0x3E , 0x63 , 0x9C , 0xE7 , 0x38 , 0xCE,
 0x71 , 0x9C , 0xE7 , 0x39 , 0x9C , 0xF9 , 0xF9 , 0x00,
 0x00 , 0xF0 , 0x3F , 0xFC , 0x0F , 0x83 , 0x08 , 0x71,
 0xF3 , 0xE1 , 0xFF , 0xF8 , 0x1F , 0xFF , 0xFC , 0x1F,
 0x3F , 0x01 , 0x08 , 0x70 , 0x78 , 0x1C , 0x30 , 0x38,
 0x43 , 0x83 , 0x08 , 0x79 , 0xF0 , 0x00 , 0x00 , 0xFF,
 0xFF , 0xFC , 0xFF , 0xFF , 0xFF , 0xFF , 0x07 , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xF0 , 0x7F , 0xFF,
 0xFF , 0xFF , 0xFF , 0xFF , 0xF3 , 0xFF , 0xFF , 0xFF,
 0xFF , 0x83 , 0xFF , 0x00 , 0x00 , 0xFF , 0xFF , 0xF8,
 0x7F , 0xFF , 0xFF , 0xFF , 0x8F , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xFF , 0xF8 , 0xFF , 0xFF , 0xFF , 0xFF,
 0xFF , 0xFF , 0xE1 , 0xFF , 0xFF , 0xFF , 0xFF , 0xC7,
 0xFF , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00,
 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
};
   
void image_drawing(void)   // Free image file drawing
{
   int n;
   glcd_WriteCmd2(0x0000, 0x24);       //Set AddressPointer to 0
   for (n=0; n<240 ; n++)             //ÅãˆÊ‚Ì240*64dots•ª‚ð•`‰æ
      {
         glcd_WriteCmd1(g_image1[n],0xc0);    //Write data and increament(TSXBINƒf[ƒ^‚ªƒ|ƒWƒlƒK‹t“]¨ƒf[ƒ^‚ð•â”j
      }n=0;
   for (n=0; n<240 ; n++)            //2’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image2[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //3’i–Ú•`
      {
         glcd_WriteCmd1(g_image3[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //4’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image4[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //5’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image5[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //6’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image6[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //7’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image7[n],0xc0);
      }n=0;
   for (n=0; n<240 ; n++)             //8’i–Ú•`‰æ
      {
         glcd_WriteCmd1(g_image8[n],0xc0);
      }
}

/////////////////////////////////////////////////////////////////////////
//// Defines a 5x7 font
/////////////////////////////////////////////////////////////////////////
const int8 FONT[51][5] ={0x00, 0x00, 0x00, 0x00, 0x00, // SPACE
                         0x00, 0x00, 0x5F, 0x00, 0x00, // !
                         0x00, 0x03, 0x00, 0x03, 0x00, // "
                         0x14, 0x3E, 0x14, 0x3E, 0x14, // #
                         0x24, 0x2A, 0x7F, 0x2A, 0x12, // $
                         0x43, 0x33, 0x08, 0x66, 0x61, // %
                         0x36, 0x49, 0x55, 0x22, 0x50, // &
                         0x00, 0x05, 0x03, 0x00, 0x00, // '
                         0x00, 0x1C, 0x22, 0x41, 0x00, // (
                         0x00, 0x41, 0x22, 0x1C, 0x00, // )
                         0x14, 0x08, 0x3E, 0x08, 0x14, // *
                         0x08, 0x08, 0x3E, 0x08, 0x08, // +
                         0x00, 0x50, 0x30, 0x00, 0x00, // ,
                         0x08, 0x08, 0x08, 0x08, 0x08, // -
                         0x00, 0x60, 0x60, 0x00, 0x00, // .
                         0x20, 0x10, 0x08, 0x04, 0x02, // /
                         0x3E, 0x51, 0x49, 0x45, 0x3E, // 0
                         0x00, 0x04, 0x02, 0x7F, 0x00, // 1
                         0x42, 0x61, 0x51, 0x49, 0x46, // 2
                         0x22, 0x41, 0x49, 0x49, 0x36, // 3
                         0x18, 0x14, 0x12, 0x7F, 0x10, // 4
                         0x27, 0x45, 0x45, 0x45, 0x39, // 5
                         0x3E, 0x49, 0x49, 0x49, 0x32, // 6
                         0x01, 0x01, 0x71, 0x09, 0x07, // 7
                         0x36, 0x49, 0x49, 0x49, 0x36, // 8
                         0x26, 0x49, 0x49, 0x49, 0x3E, // 9
                         0x00, 0x36, 0x36, 0x00, 0x00, // :
                         0x00, 0x56, 0x36, 0x00, 0x00, // ;
                         0x08, 0x14, 0x22, 0x41, 0x00, // <
                         0x14, 0x14, 0x14, 0x14, 0x14, // =
                         0x00, 0x41, 0x22, 0x14, 0x08, // >
                         0x02, 0x01, 0x51, 0x09, 0x06, // ?
                         0x3E, 0x41, 0x59, 0x55, 0x5E, // @
                         0x7E, 0x09, 0x09, 0x09, 0x7E, // A
                         0x7F, 0x49, 0x49, 0x49, 0x36, // B
                         0x3E, 0x41, 0x41, 0x41, 0x22, // C
                         0x7F, 0x41, 0x41, 0x41, 0x3E, // D
                         0x7F, 0x49, 0x49, 0x49, 0x41, // E
                         0x7F, 0x09, 0x09, 0x09, 0x01, // F
                         0x3E, 0x41, 0x41, 0x49, 0x3A, // G
                         0x7F, 0x08, 0x08, 0x08, 0x7F, // H
                         0x00, 0x41, 0x7F, 0x41, 0x00, // I
                         0x30, 0x40, 0x40, 0x40, 0x3F, // J
                         0x7F, 0x08, 0x14, 0x22, 0x41, // K
                         0x7F, 0x40, 0x40, 0x40, 0x40, // L
                         0x7F, 0x02, 0x0C, 0x02, 0x7F, // M
                         0x7F, 0x02, 0x04, 0x08, 0x7F, // N
                         0x3E, 0x41, 0x41, 0x41, 0x3E, // O
                         0x7F, 0x09, 0x09, 0x09, 0x06, // P
                         0x1E, 0x21, 0x21, 0x21, 0x5E, // Q
                         0x7F, 0x09, 0x09, 0x09, 0x76};// R

const int8 FONT2[44][5]={0x26, 0x49, 0x49, 0x49, 0x32, // S
                         0x01, 0x01, 0x7F, 0x01, 0x01, // T
                         0x3F, 0x40, 0x40, 0x40, 0x3F, // U
                         0x1F, 0x20, 0x40, 0x20, 0x1F, // V
                         0x7F, 0x20, 0x10, 0x20, 0x7F, // W
                         0x41, 0x22, 0x1C, 0x22, 0x41, // X
                         0x07, 0x08, 0x70, 0x08, 0x07, // Y
                         0x61, 0x51, 0x49, 0x45, 0x43, // Z
                         0x00, 0x7F, 0x41, 0x00, 0x00, // [
                         0x02, 0x04, 0x08, 0x10, 0x20, // \
                         0x00, 0x00, 0x41, 0x7F, 0x00, // ]
                         0x04, 0x02, 0x01, 0x02, 0x04, // ^
                         0x40, 0x40, 0x40, 0x40, 0x40, // _
                         0x00, 0x01, 0x02, 0x04, 0x00, // `
                         0x20, 0x54, 0x54, 0x54, 0x78, // a
                         0x7F, 0x44, 0x44, 0x44, 0x38, // b
                         0x38, 0x44, 0x44, 0x44, 0x44, // c
                         0x38, 0x44, 0x44, 0x44, 0x7F, // d
                         0x38, 0x54, 0x54, 0x54, 0x18, // e
                         0x04, 0x04, 0x7E, 0x05, 0x05, // f
                         0x08, 0x54, 0x54, 0x54, 0x3C, // g
                         0x7F, 0x08, 0x04, 0x04, 0x78, // h
                         0x00, 0x44, 0x7D, 0x40, 0x00, // i
                         0x20, 0x40, 0x44, 0x3D, 0x00, // j
                         0x7F, 0x10, 0x28, 0x44, 0x00, // k
                         0x00, 0x41, 0x7F, 0x40, 0x00, // l
                         0x7C, 0x04, 0x78, 0x04, 0x78, // m
                         0x7C, 0x08, 0x04, 0x04, 0x78, // n
                         0x38, 0x44, 0x44, 0x44, 0x38, // o
                         0x7C, 0x14, 0x14, 0x14, 0x08, // p
                         0x08, 0x14, 0x14, 0x14, 0x7C, // q
                         0x00, 0x7C, 0x08, 0x04, 0x04, // r
                         0x48, 0x54, 0x54, 0x54, 0x20, // s
                         0x04, 0x04, 0x3F, 0x44, 0x44, // t
                         0x3C, 0x40, 0x40, 0x20, 0x7C, // u
                         0x1C, 0x20, 0x40, 0x20, 0x1C, // v
                         0x3C, 0x40, 0x30, 0x40, 0x3C, // w
                         0x44, 0x28, 0x10, 0x28, 0x44, // x
                         0x0C, 0x50, 0x50, 0x50, 0x3C, // y
                         0x44, 0x64, 0x54, 0x4C, 0x44, // z
                         0x00, 0x08, 0x36, 0x41, 0x41, // {
                         0x00, 0x00, 0x7F, 0x00, 0x00, // |
                         0x41, 0x41, 0x36, 0x08, 0x00, // }
                         0x02, 0x01, 0x02, 0x04, 0x02};// ~
/////////////////////////////////////////////////////////////////////////
void glcd_text57(int16 x, int16 y, char* textptr, int8 size, int1 color)
{
   int8 j, k, l, m;                       // Loop counters
   int8 pixelData[5];                     // Stores character data

   for(; *textptr != '\0'; ++textptr, ++x)// Loop through the passed string
   {
      if(*textptr < 'S') // Checks if the letter is in the first font array
         memcpy(pixelData, FONT[*textptr - ' '], 5);
      else if(*textptr <= '~') // Check if the letter is in the second font array
         memcpy(pixelData, FONT2[*textptr - 'S'], 5);
      else
         memcpy(pixelData, FONT[0], 5);   // Default to space

      // Handles newline and carriage returns
      switch(*textptr)
      {
         case '\n':
            y += 7*size + 1;
            continue;
         case '\r':
            x = 0;
            continue;
      }

      if(x+5*size >= 240)          // Performs character wrapping
      {
         x = 0;                           // Set x at far left position
         y += 7*size + 1;                 // Set y at next position down
      }
      for(j=0; j<5; ++j, x+=size)         // Loop through character byte data
      {
         for(k=0; k < 7; ++k)             // Loop through the vertical pixels
         {
            if(bit_test(pixelData[j], k)) // Check if the pixel should be set
            {
               for(l=0; l < size; ++l)    // These two loops change the
               {                          // character's size
                  for(m=0; m < size; ++m)
                  {
                     glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel
                  }
               }
            }
         }
      }
   }
}
////////////////////////////////////////////////////////////////////////////////
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Purpose:       Draw a bar (wide line) on a graphic LCD
// Inputs:        (x1, y1) - the start coordinate
//                (x2, y2) - the end coordinate
//                width  - The number of pixels wide
//                color - ON or OFF
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
void glcd_bar(int x1, int y1, int x2, int y2, int width, int1 color)
{
  signed int  x, y, addx, addy, j;
  signed long P, dx, dy, c1, c2;
  int i;
  dx = abs((signed int)(x2 - x1));
  dy = abs((signed int)(y2 - y1));
  x = x1;
  y = y1;
  c1 = -dx*x1 - dy*y1;
  c2 = -dx*x2 - dy*y2;

  if(x1 > x2)
  {
    addx = -1;
    c1 = -dx*x2 - dy*y2;
    c2 = -dx*x1 - dy*y1;
  }
  else
  addx = 1;
  if(y1 > y2)
  {
    addy = -1;
    c1 = -dx*x2 - dy*y2;
    c2 = -dx*x1 - dy*y1;
  }
  else
  addy = 1;

  if(dx >= dy)
  {
    P = 2*dy - dx;

    for(i=0; i<=dx; ++i)
    {
      for(j=-(width/2); j<width/2+width%2; ++j)
      {
        if(dx*x+dy*(y+j)+c1 >= 0 && dx*x+dy*(y+j)+c2 <=0)
        glcd_pixel(x, y+j, color);
      }
      if(P < 0)
      {
        P += 2*dy;
        x += addx;
      }
      else
      {
        P += 2*dy - 2*dx;
        x += addx;
        y += addy;
      }
    }
  }
  else
  {
    P = 2*dx - dy;

    for(i=0; i<=dy; ++i)
    {
      if(P < 0)
      {
        P += 2*dx;
        y += addy;
      }
      else
      {
        P += 2*dx - 2*dy;
        x += addx;
        y += addy;
      }
      for(j=-(width/2); j<width/2+width%2; ++j)
      {
        if(dx*x+dy*(y+j)+c1 >= 0 && dx*x+dy*(y+j)+c2 <=0)
          glcd_pixel(x+j, y, color);
      }
    }
  }
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// Purpose:       Draw a circle on a graphic LCD
// Inputs:        (x,y) - the center of the circle
//                radius - the radius of the circle
//                fill - YES or NO
//                color - ON or OFF
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
void glcd_circle(int x, int y, int radius, int1 fill, int1 color)
{
  signed int a, b, P;
  a = 0;
  b = radius;
  P = 1 - radius;

  do
  {
    if(fill)
    {
      glcd_line(x-a, y+b, x+a, y+b, color);
      glcd_line(x-a, y-b, x+a, y-b, color);
      glcd_line(x-b, y+a, x+b, y+a, color);
      glcd_line(x-b, y-a, x+b, y-a, color);
    }
    else
    {
      glcd_pixel(a+x, b+y, color);
      glcd_pixel(b+x, a+y, color);
      glcd_pixel(x-a, b+y, color);
      glcd_pixel(x-b, a+y, color);
      glcd_pixel(b+x, y-a, color);
      glcd_pixel(a+x, y-b, color);
      glcd_pixel(x-a, y-b, color);
      glcd_pixel(x-b, y-a, color);
    }

    if(P < 0)
      P+= 3 + 2*a++;
    else
      P+= 5 + 2*(a++ - b--);
  } while(a <= b);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
// @brief   Draws a segment of a circle
         
//   @param    x, y: center
//         radius
//         Startwinkel, Endwinkel. 0=unten, 90 = rechts
//         Set show1 to 1 to draw pixel, set to 0 to hide pixel.
//   @return   none
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void glcd_circle_segment(int x, int y, int radius, int winkel_start, int winkel_end, unsigned char show)
{
   int   x_kreis, y_kreis;
   float winkel;
   #define DEGREE 2*3.14159265/360   
   
   for (winkel = (float)winkel_start; winkel <= winkel_end; winkel += .9)
   {
      x_kreis = (int) (sin (winkel * DEGREE) * radius);
      y_kreis = (int) (cos (winkel * DEGREE) * radius);
      glcd_pixel(x + x_kreis, y + y_kreis, show);
   }
}

/**
   @brief   Draws a circle
         In Anlehnung an Bresenham (http://groups.google.de/group/maus.mathe/browse_thread/thread/8a44a51d3f43c23d/ oder
         http://groups.google.de/group/maus.lang.tpascal/browse_thread/thread/38f9e6d81de037f4/) wird nur 1/4 Kreis berechnet und
         die anderen 3/4 gespiegelt => schnell, da ohne floats
   @param    x, y: center
         radius
         Set show1 to 1 to draw pixel, set to 0 to hide pixel.
   @return   none
*/
void glcd_Losange(int x, int y, int radius, unsigned char show)
{
  int xc = 0;
  int yc ;
  int p ;
  yc=radius;
  p = 3 - (radius<<1);
  while (xc <= yc) 
  {
    glcd_pixel(x + xc, y + yc, show);
    glcd_pixel(x + xc, y - yc, show);
    glcd_pixel(x - xc, y + yc, show);
    glcd_pixel(x - xc, y - yc, show);
    glcd_pixel(x + yc, y + xc, show);
    glcd_pixel(x + yc, y - xc, show);
    glcd_pixel(x - yc, y + xc, show);
    glcd_pixel(x - yc, y - xc, show);
    if (p < 0)
      p += (xc++ << 2) + 6;
    else
      p += ((xc++ - yc--)<<2) + 10;
  }
}

 
void glcd_Losange_half(int x, int y, int radius, unsigned char show)
{
  int xc = 0;
  int yc ;
  int p ;
  yc=radius;
  p = 3 - (radius<<1);
  while (xc <= yc) 
  {
//    glcd_pixel(x + xc, y + yc, show);
    glcd_pixel(x + xc, y - yc, show);
//    glcd_pixel(x - xc, y + yc, show);
    glcd_pixel(x - xc, y - yc, show);
//    glcd_pixel(x + yc, y + xc, show);
    glcd_pixel(x + yc, y - xc, show);
//    glcd_pixel(x - yc, y + xc, show);
    glcd_pixel(x - yc, y - xc, show);
    if (p < 0)
      p += (xc++ << 2) + 6;
    else
      p += ((xc++ - yc--)<<2) + 10;
  }
}
////////////////////////////////////////////////////////////////////////////////
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Sat Nov 02, 2013 1:28 am     Reply with quote

Just make your own.

Do a search for 'font creator'. It's a tool to create a data table from a Windows font.

Then do a search here. The existing font drawing code, is easy to modify for any font size you want, but in fact some routines for other size fonts have been posted. Thing to remember is just using larger data types to hold 16bit data. Sizes like 14*21, generally produce slightly nicer fonts, than 16*16 (tends to make the characters rather 'wide', either physically or in spacing....).

It's going to take a lot more ROM. Double the font size, gives 4* the table size needed. You may find yourself running out of space on your chip.....

Best Wishes
vortexe90



Joined: 26 Feb 2013
Posts: 30
Location: Algeria

View user's profile Send private message

PostPosted: Sun Nov 03, 2013 6:58 am     Reply with quote

Thanks Ttelmah.

I would just characters for numbers only.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Sun Nov 03, 2013 8:32 am     Reply with quote

Hi,

Why on earth did you post all that code?

Here is a tool to create your own fonts: http://www.mikroe.com/glcd-font-creator/

Create the font you want, and as Ttelmah says, modify your existing 'driver' to work with the new font!

John
temtronic



Joined: 01 Jul 2010
Posts: 9162
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Nov 03, 2013 10:08 am     Reply with quote

and....

since this is a 'simulation'.....what you 'see' in the 'simulation' probably won't look like the real thing !!!!

hth
jay
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Nov 03, 2013 11:29 am     Reply with quote

Yeah, here we go with Proteus/ISIS again... I thought we weren't doing that any more?
_________________
Google and Forum Search are some of your best tools!!!!
Jerson



Joined: 31 Jul 2009
Posts: 122
Location: Bombay, India

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 04, 2013 12:31 am     Reply with quote

The dot factory is a much more featured tool and I highly recommend it. Does bitmaps and fonts.

http://www.pavius.net/2009/07/the-dot-factory-an-lcd-font-and-image-generator/
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