//------------------------------------------------- // Shenzhen TOPWAY Technology Co.,Ltd. // FONT Size: ?????? // Interface: serial mode // by: GuoQ // Date: 2012-01-04 // note: ???????LM6063N //------------------------------------------------- #include #include #include #define uchar unsigned char // 0~255 #define uint unsigned int // 0~65535 #define ulong unsigned long // 32bit, 0 ~ 4,294,967,295 //============****************************========== sbit SCLK = P1^6; sbit SID = P1^7; sbit _RST = P3^5; sbit A0 = P3^6; sbit _CS1 = P3^4; sbit _CS2 = P3^3; // ????IC????? sbit TAB_DO = P1^3; // ????IC????????? uchar FontTAB[74]; // ?????????? uchar ContrastLevel; uchar code Logo[]={ /*-- ????????????D:\120\pic\LM6063N-LOGO-128x64.bmp --*/ /*-- ????x???=128x64 --*/ 0xFF,0x01,0x81,0x01,0x81,0x01,0x81,0x01,0x81,0x41,0x81,0x41,0x81,0x41,0x81,0x41, 0x81,0x41,0xA1,0x41,0xA1,0x41,0xA1,0x51,0xA1,0x51,0xA1,0x51,0xA9,0x51,0xA9,0x51, 0xA9,0x55,0xA9,0x55,0x29,0x15,0xAB,0x95,0xCB,0xC5,0xEB,0xE5,0xE3,0xF5,0xF3,0xF9, 0xFB,0xF9,0xF9,0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0x01,0x01,0x41,0x81,0x01,0x81,0x81, 0x81,0x81,0x81,0x81,0x81,0x81,0x01,0x01,0x01,0xC1,0x01,0x01,0xC1,0x01,0x01,0x81, 0x01,0x01,0xC1,0x01,0x01,0x01,0xC1,0x01,0x01,0x81,0x81,0x81,0x81,0x81,0x81,0x81, 0x01,0x01,0x01,0x01,0x41,0x81,0x01,0x01,0x81,0x41,0x01,0x01,0x01,0x01,0x01,0x81, 0x41,0x81,0x01,0xC1,0x01,0x81,0x01,0xC1,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x80,0x41,0xA8,0x55,0xAA,0x55,0xAA,0x55,0x2A,0x95,0xCA,0xE5,0xF2,0xF9, 0xF8,0xFD,0xFC,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x42,0xE4,0x10,0x00,0x11,0x94, 0x52,0xFC,0x50,0x92,0x14,0x11,0x00,0x84,0x84,0xFF,0x44,0x44,0xFF,0x00,0x00,0xFF, 0x00,0x00,0xFF,0x00,0x22,0x22,0xFF,0x12,0x2A,0x10,0xFC,0x13,0x10,0x10,0xF0,0x00, 0x00,0x08,0x0B,0x0D,0xE9,0xAF,0xA9,0xA9,0xAF,0xA9,0xED,0x0B,0x09,0x00,0x11,0xF8, 0x04,0x0B,0xEA,0x2B,0xEA,0x8B,0x3C,0xC3,0x3E,0x02,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40, 0xA8,0x54,0x2A,0x95,0xCA,0xE5,0xF2,0xF9,0xFC,0xFE,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,0xFF,0xFF,0xFF,0x20,0x20,0x23,0x20,0x21,0x21,0x20, 0x20,0x23,0x20,0x20,0x21,0x21,0x20,0x20,0x21,0x20,0x22,0x21,0x20,0x20,0x20,0x20, 0x20,0x20,0x23,0x20,0x20,0x22,0x23,0x20,0x20,0x20,0x23,0x21,0x21,0x21,0x23,0x20, 0x20,0x20,0x20,0x20,0x23,0x22,0x22,0x22,0x22,0x22,0x23,0x20,0x20,0x20,0x20,0x23, 0x22,0x21,0x20,0x20,0x21,0x22,0x21,0x20,0x21,0x22,0x20,0x20,0x20,0x20,0x20,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x20,0x14,0xCA,0xE1, 0xF8,0xFC,0xFF,0xFF,0xFB,0xFB,0xC3,0xFB,0xFB,0xFF,0xE7,0xDB,0xDB,0xDB,0xE7,0xFF, 0xC3,0xEB,0xEB,0xEB,0xF7,0xFF,0xE3,0xDF,0xEF,0xDF,0xE3,0xFF,0xCF,0xE7,0xEB,0xE7, 0xCF,0xFF,0xFB,0xF7,0xCF,0xF7,0xFB,0xFF,0xFF,0x00,0x01,0x01,0xFF,0x01,0x01,0x00, 0x3C,0x42,0x81,0x81,0x81,0x42,0x3C,0x00,0xFF,0x11,0x11,0x11,0x0E,0x03,0x3C,0xC0, 0x30,0x0E,0x01,0x0E,0x30,0xC0,0x3C,0x03,0xC0,0x30,0x2E,0x21,0x2E,0x30,0xC0,0x00, 0x01,0x06,0x08,0xF0,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0xFF,0x80,0x80,0x80,0x80, 0x04,0xFF,0x84,0x00,0x78,0x84,0x84,0x48,0xFF,0x00,0x00,0x80,0x00,0x00,0x00,0xFF, 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, 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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC, 0xFC,0xFC,0x1C,0xFC,0xF8,0x00,0x00,0x00,0xF8,0xFC,0x1C,0xFC,0xFC,0xFC,0x00,0x00, 0xE0,0xF8,0xF8,0x1C,0x8C,0x8C,0x9C,0xBC,0x18,0x10,0x00,0x00,0xE0,0xF8,0xF8,0x1C, 0x0C,0x0C,0x1C,0xF8,0xF8,0xE0,0x00,0x00,0xE0,0xF8,0xF8,0x1C,0x8C,0x8C,0x9C,0xBC, 0x18,0x10,0x00,0x00,0x30,0x38,0x3C,0x0C,0x0C,0x8C,0xFC,0xF8,0xF0,0x00,0x00,0x00, 0xFC,0xFC,0xFC,0x78,0xE0,0xC0,0x00,0x00,0x00,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0xFF,0xFF,0xFF,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xFF, 0xFF,0xFF,0x00,0x03,0x7F,0xFF,0xF0,0xFF,0x7F,0x03,0x00,0xFF,0xFF,0xFF,0x00,0x00, 0x3F,0xFF,0xFF,0xC3,0x81,0x81,0xC3,0xFF,0xFF,0x3C,0x00,0x00,0x3F,0xFF,0xFF,0xC0, 0x80,0x80,0xC0,0xFF,0xFF,0x3F,0x00,0x00,0x3F,0xFF,0xFF,0xC3,0x81,0x81,0xC3,0xFF, 0xFF,0x3C,0x00,0x00,0x60,0xE0,0xE0,0xC3,0x83,0x83,0xC7,0xFF,0xFC,0x38,0x00,0x00, 0xFF,0xFF,0xFF,0x00,0x01,0x07,0x1F,0x7C,0xF0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF, 0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x81, 0x81,0x81,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80, 0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81, 0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80, 0x81,0x81,0x81,0x80,0x80,0x80,0x80,0x80,0x80,0x81,0x81,0x81,0x80,0x80,0x80,0x80, 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF}; //----------------------------------- // Delay Routine //----------------------------------- void delayms(uint m) // 12MHz Xtal, close to ms value { uint j; uint i; for(i=0; i>16;break; // ?????8λ case 2 : DData=TAB_addr>>8; break; // ?????8λ case 3 : DData=TAB_addr; break; // ?????8λ } for(i=0;i<8;i++) // д1??????? { if((DData&0x80)==0x80) SID=1; else SID=0; SCLK=0; SCLK=1; // ????????????д?? DData=DData<<1; } } for(j=0;j0) { B_code=*pstr++; B_code=B_code - 0x0020; switch (F_Char) { // 5*7 ASCII??? case 5: TAB_addr=B_code*8; CByte=8; a=1;b=6;break; // 7*8 ASCII??? case 7: TAB_addr=768+B_code*8; CByte=8; a=1;b=8;break; // 6*12 ASCII??? case 6: TAB_addr=1536+B_code*12; CByte=12; a=2;b=6;break; // 8*16 ASCII??? case 8: TAB_addr=3072+B_code*16; CByte=16;a=2;b=8;break; // 8*16 ASCII????? case 9: TAB_addr=5120+B_code*16; CByte=16;a=2;b=8;break; default: break; } RdTab(CByte,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; for (i=0;i>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; if ( W_code>=0x0080 && W_code<=0x00ff ) { TAB_addr=(W_code-0x0080)*16; switch (F_Char) { // ISO??? 8*16 ISO8859-1 case 1: TAB_addr=TAB_addr+147904; break; // ISO??? 8*16 ISO8859-2 case 2: TAB_addr=TAB_addr+149952; break; // ISO??? 8*16 ISO8859-3 case 3: TAB_addr=TAB_addr+152000; break; // ISO??? 8*16 ISO8859-4 case 4: TAB_addr=TAB_addr+154048; break; // ISO??? 8*16 ISO8859-5 case 5: TAB_addr=TAB_addr+156096; break; // ISO??? 8*16 ISO8859-7 case 7: TAB_addr=TAB_addr+158144; break; // ISO??? 8*16 ISO8859-8 case 8: TAB_addr=TAB_addr+160192; break; // ISO??? 8*16 ISO8859-9 case 9: TAB_addr=TAB_addr+162240; break; // ISO??? 8*16 ISO8859-10 case 10:TAB_addr=TAB_addr+164288; break; // ISO??? 8*16 ISO8859-11 case 11:TAB_addr=TAB_addr+166336; break; // ISO??? 8*16 ISO8859-13 case 13:TAB_addr=TAB_addr+168384; break; // ISO??? 8*16 ISO8859-14 case 14:TAB_addr=TAB_addr+170432; break; // ISO??? 8*16 ISO8859-15 case 15:TAB_addr=TAB_addr+172480; break; // ISO??? 8*16 ISO8859-16 case 16:TAB_addr=TAB_addr+174528; break; default: break; } RdTab(16,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; for (i=0;i<2;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<8;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-2; // ?????????? x=x+8; // ?е??????????????λ?? } N_Char--; } } // 5X7 ISO8859???д????????????? void PrintISO8859_5X7(uchar x,uchar y,uchar N_Char,uchar F_Char,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????F_Char???????????*pstr ????????????? { ulong TAB_addr; uchar j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; if ( W_code>=0x0080 && W_code<=0x00ff ) { TAB_addr=(W_code-0x0080)*8; switch (F_Char) { // ISO??? 5*7 ISO8859-1 case 1: TAB_addr=TAB_addr+176576; break; // ISO??? 5*7 ISO8859-2 case 2: TAB_addr=TAB_addr+177600; break; // ISO??? 5*7 ISO8859-3 case 3: TAB_addr=TAB_addr+178624; break; // ISO??? 5*7 ISO8859-4 case 4: TAB_addr=TAB_addr+179648; break; // ISO??? 5*7 ISO8859-5 case 5: TAB_addr=TAB_addr+180672; break; // ISO??? 5*7 ISO8859-7 case 7: TAB_addr=TAB_addr+181696; break; // ISO??? 5*7 ISO8859-8 case 8: TAB_addr=TAB_addr+182720; break; // ISO??? 5*7 ISO8859-9 case 9: TAB_addr=TAB_addr+183744; break; // ISO??? 5*7 ISO8859-10 case 10:TAB_addr=TAB_addr+184768; break; // ISO??? 5*7 ISO8859-11 case 11:TAB_addr=TAB_addr+185792; break; // ISO??? 5*7 ISO8859-13 case 13:TAB_addr=TAB_addr+186816; break; // ISO??? 5*7 ISO8859-14 case 14:TAB_addr=TAB_addr+187840; break; // ISO??? 5*7 ISO8859-15 case 15:TAB_addr=TAB_addr+188864; break; // ISO??? 5*7 ISO8859-16 case 16:TAB_addr=TAB_addr+189888; break; default: break; } RdTab(8,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<8;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } x=x+8; // ?е??????????????λ?? } N_Char--; } } // LCM ???д????????????? void PrintLCM(uchar x,uchar y,uchar N_Char,uchar F_Char,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????F_Char???????????*pstr ????????????? { ulong TAB_addr; uchar j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; if ( W_code>=0x0000 && W_code<=0x00ff ) { TAB_addr=W_code*10; switch (F_Char) { // 5*10 LCM?????????1 ????SPLC780C-01 case 1: TAB_addr=TAB_addr+190912; break; // 5*10 LCM?????????2 ????SPLC780C-02 case 2: TAB_addr=TAB_addr+193472; break; // 5*10 LCM?????????3 ????SPLC780C-03 case 3: TAB_addr=TAB_addr+196032; break; // 5*10 LCM?????????8 ????SPLC780C-08 case 8: TAB_addr=TAB_addr+198592; break; // 5*10 LCM?????????11 ????SPLC780C-11 case 11:TAB_addr=TAB_addr+201152; break; // 5*10 LCM?????????12 ????SPLC780C-12 case 12:TAB_addr=TAB_addr+203712; break; // 5*10 LCM?????????11 ????SPLC780C-13 case 13:TAB_addr=TAB_addr+206272; break; // 5*10 LCM?????????0 ????7032 case 0: TAB_addr=TAB_addr+208832; break; default: break; } RdTab(10,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; // for (i=0;i<2;i++) // { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<6;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } // y=y+1; // } // ??????1 // y=y-2; // ?????????? x=x+6; // ?е??????????????λ?? } N_Char--; } } // 8x16 ?????????????????????????????????д????????????? void PrintLatin_8x16(uchar x,uchar y,uchar N_Char,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????*pstr ????????????? { ulong TAB_addr; uchar i,j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; // 8*16 ?????????? if ( W_code>=0x0020 && W_code<=0x007f ) TAB_addr=25280+(W_code-0x0020)*16; else if ( W_code>=0x00a0 && W_code<=0x017f ) TAB_addr=25280+(W_code-0x00a0)*16; else if ( W_code>=0x01a0 && W_code<=0x01cf ) TAB_addr=25280+(W_code-0x01a0+320)*16; else if ( W_code>=0x01f0 && W_code<=0x01ff ) TAB_addr=25280+(W_code-0x01f0+368)*16; else if ( W_code>=0x0210 && W_code<=0x021f ) TAB_addr=25280+(W_code-0x0210+384)*16; else if ( W_code>=0x1ea0 && W_code<=0x1eff ) TAB_addr=25280+(W_code-0x1ea0+400)*16; // 8*16 ????????? else if ( W_code>=0x0370 && W_code<=0x03cf ) TAB_addr=33216+(W_code-0x0370)*16; // 8*16 ??????????? else if ( W_code>=0x0400 && W_code<=0x045f ) TAB_addr=34752+(W_code-0x0400)*16; else if ( W_code>=0x0490 && W_code<=0x04ff ) TAB_addr=34752+(W_code-0x0490+96)*16; // 8*16 ??????????? else if ( W_code>=0x0590 && W_code<=0x05ff ) TAB_addr=38080+(W_code-0x0590)*16; // 8*16 ?????? else if ( W_code>=0x0e00 && W_code<=0x0e5f ) TAB_addr=39872+(W_code-0x0e00)*16; RdTab(16,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; for (i=0;i<2;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<8;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-2; // ?????????? x=x+8; // ?е??????????????λ?? N_Char--; } } // 12x24 ?????????????????????д???? ????????? void PrintLatin_12x24(uchar x,uchar y,uchar N_Char,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????*pstr ????????????? { ulong TAB_addr; uchar i,j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; // 12*24 ?????????? if ( W_code>=0x0020 && W_code<=0x007f ) TAB_addr=41920+(W_code-0x0020)*48; else if ( W_code>=0x00a0 && W_code<=0x017f ) TAB_addr=41920+(W_code-0x00a0+96)*48; else if ( W_code>=0x01a0 && W_code<=0x01cf ) TAB_addr=41920+(W_code-0x01a0+320)*48; else if ( W_code>=0x01f0 && W_code<=0x01ff ) TAB_addr=41920+(W_code-0x01f0+368)*48; else if ( W_code>=0x0210 && W_code<=0x021f ) TAB_addr=41920+(W_code-0x0210+384)*48; else if ( W_code>=0x1ea0 && W_code<=0x1eff ) TAB_addr=41920+(W_code-0x1ea0+400)*48; //? // 12*24 ????????? else if ( W_code>=0x0370 && W_code<=0x03cf ) TAB_addr=65728+(W_code-0x0370)*48; // 12*24 ??????????? else if ( W_code>=0x0400 && W_code<=0x045f ) TAB_addr=70336+(W_code-0x0400)*48; else if ( W_code>=0x0490 && W_code<=0x04ff ) TAB_addr=70336+(W_code-0x0490+96)*48; RdTab(48,TAB_addr); // ?????????? // ??????д?????????????????????????? d=0; for (i=0;i<3;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<16;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-3; // ?????????? x=x+12; // ?е??????????????λ?? 12 N_Char--; } } // ASCI???д?????????????? void PrintASCIIA(uchar x,uchar y,uchar F_Char,uchar *pstr) // ????(x,y)??x???????y????????F_Char?д?????????????*pstr ????????????? { ulong TAB_addr; uchar i,j,a,b,CByte,d; uint B_code; while(*pstr>0) { B_code=*pstr++; B_code=B_code-0x0020; switch (F_Char) { // 12 ?????ASCII?????arial???壩 case 12: TAB_addr=6656+B_code*26; CByte=26;a=2;b=12;break; // 12 ?????ASCII?????times???壩 case 13: TAB_addr=9152+B_code*26; CByte=26;a=2;b=12;break; // 16 ?????ASCII?????arial???壩 case 16: TAB_addr=11648+B_code*34; CByte=34;a=2;b=16;break; // 16 ?????ASCII?????times???壩 case 17: TAB_addr=14912+B_code*34; CByte=34;a=2;b=16;break; // 24 ?????ASCII?????arial???壩 case 24: TAB_addr=18176+B_code*74; CByte=74;a=3;b=24;break; default: break; } RdTab(CByte,TAB_addr); // ?????????? // ??????д?????????????????????????? d=1; B_code = FontTAB[d++];//d++; for (i=0;i>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; // 16??????????????? if ( W_code>=0x0020 && W_code<=0x007f ) TAB_addr=99904+(W_code-0x0020)*34; else if ( W_code>=0x00a0 && W_code<=0x017f ) TAB_addr=99904+(W_code-0x00a0+96)*34; else if ( W_code>=0x01a0 && W_code<=0x01cf ) TAB_addr=99904+(W_code-0x01a0+320)*34; else if ( W_code>=0x01f0 && W_code<=0x01ff ) TAB_addr=99904+(W_code-0x01f0+368)*34; else if ( W_code>=0x0210 && W_code<=0x021f ) TAB_addr=99904+(W_code-0x0210+384)*34; else if ( W_code>=0x1ea0 && W_code<=0x1eff ) TAB_addr=99904+(W_code-0x1ea0+400)*34; // 16?????????????? else if ( W_code>=0x0370 && W_code<=0x03cf ) TAB_addr=116768+(W_code-0x0370)*34; // 16???????????????? else if ( W_code>=0x0400 && W_code<=0x045f ) TAB_addr=120032+(W_code-0x0400)*34; else if ( W_code>=0x0490 && W_code<=0x04ff ) TAB_addr=120032+(W_code-0x0490+96)*34; RdTab(34,TAB_addr); // ?????????? // ??????д?????????????????????????? d=1; W_code = FontTAB[d++];//d++; for (i=0;i<2;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<16;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-2; // ?????????? x=x+W_code;//16; // ?е??????????????λ?? 12 N_Char--; } } //12????????????д????????????? void PrintLatin_12A(uchar x,uchar y,uchar N_Char,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????*pstr ????????????? { ulong TAB_addr; uchar i,j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; // 12??????????????? if ( W_code>=0x0020 && W_code<=0x007f ) TAB_addr=127104+(W_code-0x0020)*26; else if ( W_code>=0x00a0 && W_code<=0x017f ) TAB_addr=127104+(W_code-0x00a0+96)*26; else if ( W_code>=0x01a0 && W_code<=0x01cf ) TAB_addr=127104+(W_code-0x01a0+320)*26; else if ( W_code>=0x01f0 && W_code<=0x01ff ) TAB_addr=127104+(W_code-0x01f0+368)*26; else if ( W_code>=0x0210 && W_code<=0x021f ) TAB_addr=127104+(W_code-0x0210+384)*26; else if ( W_code>=0x1ea0 && W_code<=0x1eff ) TAB_addr=127104+(W_code-0x1ea0+400)*26; // 12?????????????? else if ( W_code>=0x0370 && W_code<=0x03cf ) TAB_addr=140000+(W_code-0x0370)*26; // 12???????????????? else if ( W_code>=0x0400 && W_code<=0x045f ) TAB_addr=142496+(W_code-0x0400)*26; else if ( W_code>=0x0490 && W_code<=0x04ff ) TAB_addr=142496+(W_code-0x0490+96)*26; RdTab(26,TAB_addr); // ?????????? // ??????д?????????????????????????? d=1; W_code = FontTAB[d++];//d++; for (i=0;i<2;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<12;j++) // д12?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-2; // ?????????? x=x+W_code;//12; // ?е??????????????λ?? 12 N_Char--; } } //??????????д????????????? void PrintArabian(uchar x,y,uchar N_Char,uchar F_code,uchar *pstr) // ????(x,y)??x???????y????????N_Char?д????????????F_Char???????????*pstr ????????????? { ulong TAB_addr; uchar i,j,d; uint W_code; while(N_Char>0) { W_code=*pstr++; W_code=W_code<<8; W_code=W_code+*pstr++; switch(F_code) { case 16:d=34; // 16??????????????? if ( W_code>=0x0600 && W_code<=0x06ff ) TAB_addr=80320+(W_code-0x0600)*34; else if ( W_code>=0xfb50 && W_code<=0xfbff ) TAB_addr=80320+(W_code-0xfb50+256)*34; else if ( W_code>=0xfe70 && W_code<=0xfeff ) TAB_addr=80320+(W_code-0xfe70+432)*34; break; case 24:d=74; // 24??????????????? if ( W_code>=0x0600 && W_code<=0x06ff ) TAB_addr=216000+(W_code-0x0600)*74; else if ( W_code>=0xfb50 && W_code<=0xfbff ) TAB_addr=216000+(W_code-0xfb50+256)*74; else if ( W_code>=0xfe70 && W_code<=0xfeff ) TAB_addr=216000+(W_code-0xfe70+432)*74; break; default:break; } RdTab(d,TAB_addr); // ?????????? // ??????д?????????????????????????? d=1; W_code = FontTAB[d];d++; if (F_code==16) { for (i=0;i<2;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<16;j++) // д16?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-2; // ?????????? x=x+W_code; // ?е??????????????λ?? } else if (F_code==24) { for (i=0;i<3;i++) { SdCmd(y|0xb0); // ???????? SdCmd((x>>4)|0x10); // ?????е????4λ SdCmd(x&0x0f); // ?????е????4λ for (j=0;j<24;j++) // д24?????????? { SdData(FontTAB[d]);d++; // д??????? } y=y+1; } // ??????1 y=y-3; // ?????????? x=x+W_code; // ?е??????????????λ?? 16 } N_Char--; } } //----------------------------------- // Main Program //----------------------------------- void main() { uchar code dat816[]={0x00,0xa0,0x00,0xa1,0x00,0xa2,0x00,0xa3,0x00,0xa4,0x00,0xa5,0x00,0xa6,0x00,0xa7,0x00,0xa8,0x00,0xa9,0x00,0xaa}; uchar code datlcm[]={0x00,0x30,0x00,0x31,0x00,0x32,0x00,0x33,0x00,0x34,0x00,0x35,0x00,0x36,0x00,0x37,0x00,0x38,0x00,0x39}; uchar code latin816[]={0x00,0x30,0x00,0xa1,0x01,0xa2,0x01,0xf9,0x02,0x14,0x1e,0xa5,0x03,0xa6,0x04,0x37,0x04,0xa8,0x05,0xa9,0x0e,0x45}; uchar code arabin[]={0x06,0x30,0xfb,0xa1,0xfe,0xa2}; SP=0x7b; EA = 0; // disable interrupts _CS1 =1; _CS2 =1; _RST =1; A0 =1; SCLK =0; SID =1; initLCDM();CLRRAM(); while(1) { WriteScreen(Logo);delayms(1500);CLRRAM(); PrintASCII(0,0,5,"1234567890");//F_code=5,6,7,8,9(b) PrintASCII(0,1,6,"1234567890");//F_code=5,6,7,8,9(b) PrintASCII(0,3,7,"1234567890");//F_code=5,6,7,8,9(b) PrintASCII(0,4,8,"1234567890");//F_code=5,6,7,8,9(b) PrintASCII(0,6,9,"1234567890");delayms(1000);//F_code=5,6,7,8,9(b) CLRRAM(); PrintASCIIA(0,0,12,"1234567890");//F_code=12A,13(T),16A,17(T),24A PrintASCIIA(0,2,16,"1234567890");//F_code=12A,13(T),16A,17(T),24A PrintASCIIA(0,4,13,"1234567890");//F_code=12A,13(T),16A,17(T),24A PrintASCIIA(0,6,17,"1234567890");delayms(1000);//F_code=12A,13(T),16A,17(T),24A CLRRAM(); PrintASCIIA(0,0,24,"1234567890");delayms(1000);//F_code=12A,13(T),16A,17(T),24A CLRRAM(); PrintISO8859_8X16(0,0,11,1,dat816); PrintISO8859_8X16(0,2,11,2,dat816); PrintISO8859_8X16(0,4,11,3,dat816); PrintISO8859_8X16(0,6,11,4,dat816);delayms(1000); CLRRAM(); PrintISO8859_8X16(0,0,11,5,dat816); PrintISO8859_8X16(0,2,11,7,dat816); PrintISO8859_8X16(0,4,11,8,dat816); PrintISO8859_8X16(0,6,11,9,dat816);delayms(1000); CLRRAM(); PrintISO8859_8X16(0,0,11,10,dat816); PrintISO8859_8X16(0,2,11,11,dat816); PrintISO8859_8X16(0,4,11,13,dat816); PrintISO8859_8X16(0,6,11,14,dat816);delayms(1000); CLRRAM(); PrintISO8859_8X16(0,0,11,15,dat816); PrintISO8859_8X16(0,2,11,16,dat816);delayms(1000); CLRRAM(); PrintISO8859_5X7(0,0,11,1,dat816); PrintISO8859_5X7(0,1,11,2,dat816); PrintISO8859_5X7(0,2,11,3,dat816); PrintISO8859_5X7(0,3,11,4,dat816); PrintISO8859_5X7(0,4,11,5,dat816); PrintISO8859_5X7(0,5,11,7,dat816); PrintISO8859_5X7(0,6,11,8,dat816); PrintISO8859_5X7(0,7,11,9,dat816);delayms(1000); CLRRAM(); PrintISO8859_5X7(0,0,11,10,dat816); PrintISO8859_5X7(0,1,11,11,dat816); PrintISO8859_5X7(0,2,11,13,dat816); PrintISO8859_5X7(0,3,11,14,dat816); PrintISO8859_5X7(0,4,11,15,dat816); PrintISO8859_5X7(0,5,11,16,dat816);delayms(1000); CLRRAM(); PrintLCM(0,0,10,1,datlcm); PrintLCM(0,1,10,2,datlcm); PrintLCM(0,2,10,3,datlcm); PrintLCM(0,3,10,8,datlcm); PrintLCM(0,4,10,11,datlcm); PrintLCM(0,5,10,12,datlcm); PrintLCM(0,6,10,13,datlcm);delayms(1000); CLRRAM(); PrintLatin_8x16(0,0,11,latin816); PrintLatin_12x24(0,2,9,latin816);delayms(1000); CLRRAM(); PrintLatin_16A(0,0,9,latin816); PrintLatin_12A(0,3,9,latin816); PrintArabian(0,5,3,16,arabin); PrintArabian(0,5,3,24,arabin);delayms(1000); CLRRAM(); } } //end of program