杭州清达光电技术有限公司

主营:液晶模块,OLED显示模块,LCM,超低温液晶,军工显示屏,OLED显示屏,串口显示屏,彩屏模组,耐高温高湿显示屏,带字库液晶,RS232显示屏,UART显示屏

  • 黄金会员
  • 8
您现在的位置:杭州清达光电技术有限公司首页 > 佳显科技2.7寸SSD1325驱动程序HGS128645
VIP会员 8
  • 经营模式:生产型
  • 所在地区:浙江 - 杭州
  • 企业类别:私营有限责任公司
公司相册
站内搜索
佳显科技2.7寸SSD1325驱动程序HGS128645

佳显科技2.7寸SSD1325驱动程序HGS128645

佳显科技2.7寸SSD1325驱动程序HGS128645

#include<>
#include <>
#include <>
#include <>
#define uchar unsigned char
#define uint unsigned int
//#define SPI
#define P80
//#define P68
#define DATA P1
sbit RES = P3^5;
sbit CD = P3^0;
sbit WR1 = P3^1;
sbit RD1 = P3^3;
sbit CS = P3^4;
sbit BS1 = P3^6;
sbit BS2 = P3^7;
sbit SCLK=P1^0;
sbit SDIN=P1^1;
uchar RAM_data[4];
uchar REV=0;
/*unsigned char code tab[]=
{
0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, //0
0x20,0x60,0x20,0x20,0x20,0x20,0x20,0x70, //1
0x70,0x88,0x88,0x10,0x20,0x40,0x80,0xF8, //2
0x70,0x88,0x08,0x30,0x08,0x08,0x88,0x70, //3
0x10,0x30,0x50,0x50,0x90,0x78,0x10,0x18, //4
0xF8,0x80,0x80,0xF0,0x08,0x08,0x88,0x70, //5
0x70,0x90,0x80,0xF0,0x88,0x88,0x88,0x70, //6
0xF8,0x90,0x10,0x20,0x20,0x20,0x20,0x20, //7
0x70,0x88,0x88,0x70,0x88,0x88,0x88,0x70, //8
0x70,0x88,0x88,0x88,0x78,0x08,0x48,0x70, //9
0x20,0x20,0x30,0x50,0x50,0x78,0x48,0xCC, //A
0xF0,0x48,0x48,0x70,0x48,0x48,0x48,0xF0, //B
0x78,0x88,0x80,0x80,0x80,0x80,0x88,0x70, //C
0xF0,0x48,0x48,0x48,0x48,0x48,0x48,0xF0, //D
0xF8,0x48,0x50,0x70,0x50,0x40,0x48,0xF8, //E
0xF8,0x48,0x50,0x70,0x50,0x40,0x40,0xE0, //F
0x38,0x48,0x80,0x80,0x9C,0x88,0x48,0x30, //G
0xCC,0x48,0x48,0x78,0x48,0x48,0x48,0xCC, //H
0xF8,0x20,0x20,0x20,0x20,0x20,0x20,0xF8, //I
0x7C,0x10,0x10,0x10,0x10,0x10,0x90,0xE0, //J
0xEC,0x48,0x50,0x60,0x50,0x50,0x48,0xEC, //K
0xE0,0x40,0x40,0x40,0x40,0x40,0x44,0xFC, //L
0xD8,0xD8,0xD8,0xD8,0xA8,0xA8,0xA8,0xA8, //M
0xDC,0x48,0x68,0x68,0x58,0x58,0x48,0xE8, //N
0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, //O
0xF0,0x48,0x48,0x70,0x40,0x40,0x40,0xE0, //P
0x70,0x88,0x88,0x88,0xE8,0x98,0x70,0x18, //Q
0xF0,0x48,0x48,0x70,0x50,0x48,0x48,0xEC, //R
0xD8,0x50,0x50,0x20,0x20,0x50,0x50,0xD8, //X
0xF8,0xA8,0x20,0x20,0x20,0x20,0x20,0x70, //T
0xCC,0x48,0x48,0x48,0x48,0x48,0x48,0x30, //U
0xCC,0x48,0x48,0x50,0x50,0x30,0x20,0x20, //V
0xA8,0xA8,0xA8,0x70,0x50,0x50,0x50,0x50, //W
0xD8,0x50,0x50,0x20,0x20,0x50,0x50,0xD8, //X
0xD8,0x50,0x50,0x20,0x20,0x20,0x20,0x70, //Y
0xF8,0x90,0x10,0x20,0x20,0x40,0x48,0xF8, //Z
0x00,0x00,0x00,0x30,0x48,0x38,0x48,0x3C, //a
0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0x70, //b
0x00,0x00,0x00,0x38,0x48,0x40,0x40,0x38, //c
0x18,0x08,0x08,0x38,0x48,0x48,0x48,0x3C, //d
0x00,0x00,0x00,0x30,0x48,0x78,0x40,0x38, //e
0x1C,0x20,0x20,0x78,0x20,0x20,0x20,0x78, //f
0x00,0x3C,0x48,0x30,0x40,0x78,0x44,0x38, //g
0xC0,0x40,0x40,0x70,0x48,0x48,0x48,0xEC, //h
0x20,0x00,0x00,0x60,0x20,0x20,0x20,0x70, //i
0x10,0x30,0x10,0x10,0x10,0x10,0x10,0xE0, //j
0xC0,0x40,0x40,0x5C,0x50,0x70,0x48,0xEC, //k
0xE0,0x20,0x20,0x20,0x20,0x20,0x20,0xF8, //l
0x00,0x00,0x00,0xF0,0xA8,0xA8,0xA8,0xA8, //m
0x00,0x00,0xF0,0x48,0x48,0x48,0xEC,0x00, //n
0x00,0x00,0x30,0x48,0x48,0x48,0x30,0x00, //o
0x00,0xF0,0x48,0x48,0x48,0x70,0x40,0xE0, //p
0x00,0x38,0x48,0x48,0x48,0x38,0x08,0x1C, //q
0x00,0x00,0x00,0xD8,0x60,0x40,0x40,0xE0, //r
0x00,0x00,0x00,0x78,0x40,0x30,0x08,0x78, //s
0x00,0x20,0x20,0x70,0x20,0x20,0x20,0x18, //t
0x00,0x00,0x00,0xD8,0x48,0x48,0x48,0x3C, //u
0x00,0x00,0x00,0xEC,0x48,0x50,0x30,0x20, //v
0x00,0x00,0x00,0xA8,0xA8,0x70,0x50,0x50, //w
0x00,0x00,0x00,0xD8,0x50,0x20,0x50,0xD8, //x
0x00,0xEC,0x48,0x50,0x30,0x20,0x20,0xC0, //y
0x00,0x78,0x10,0x20,0x20,0x78,0x00,0x00, //z
0x40,0xA4,0x18,0x00,0x00,0x00,0x00,0x00, // ~
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, // `
0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20, //!
0x70,0x88,0x98,0xA8,0xA8,0xB8,0x80,0x78, //@
0x28,0x28,0xFC,0x28,0x50,0xFC,0x50,0x50, //#
0x20,0x78,0xA8,0xE0,0x30,0xA8,0xF0,0x20, //$
0x48,0xA8,0xB0,0x50,0x28,0x34,0x54,0x48, //%
0x00,0x20,0x50,0x00,0x00,0x00,0x00,0x00, //^
0x20,0x50,0x50,0x70,0xA4,0xA8,0x90,0x6C, //&
0x00,0x20,0xA8,0x70,0x70,0xA8,0x20,0x00, //*
0x04,0x08,0x10,0x10,0x10,0x10,0x08,0x04, //(
0x40,0x20,0x10,0x10,0x10,0x10,0x20,0x40, //)
0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00, //-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC, //_
0x20,0x20,0x20,0xF8,0x20,0x20,0x20,0x00, //+
0x00,0x00,0xF8,0x00,0x00,0xF8,0x00,0x00, //=
0x10,0x10,0x10,0x20,0x20,0x40,0x40,0x40, // /
0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x20, //:
0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x20, //;
0x00,0x28,0x50,0x50,0x00,0x00,0x00,0x00, //'
0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00, //'
0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80, //,
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, //.
0x70,0x88,0x88,0x10,0x20,0x20,0x00,0x20, //?
0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x00, //<
0x20,0x10,0x08,0x04,0x08,0x10,0x20,0x00, //>
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, //|
0x40,0x40,0x20,0x20,0x10,0x10,0x10,0x08, //\
};
uchar code table_88[]={
/*Q(0) Q(1) :(2) 1(3) 0(4) 4(5) 8(6) 5(7) 8(8) 5(9) 3(10)*/
//0x30,0x48,0x48,0x48,0x68,0x58,0x38,0x00,/*'Q',0*/
//0x30,0x48,0x48,0x48,0x68,0x58,0x38,0x00,/*'Q',1*/
//0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,/*':',2*/
//0x20,0x60,0x20,0x20,0x20,0x20,0x70,0x00,/*'1',3*/
//0x30,0x48,0x48,0x48,0x48,0x48,0x30,0x00,/*'0',4*/
//0x10,0x30,0x30,0x50,0x50,0x78,0x10,0x00,/*'4',5*/
//0x30,0x48,0x48,0x30,0x48,0x48,0x30,0x00,/*'8',6*/
//0x78,0x40,0x40,0x70,0x08,0x08,0x70,0x00,/*'5',7*/
//0x30,0x48,0x48,0x30,0x48,0x48,0x30,0x00,/*'8',8*/
//0x78,0x40,0x40,0x70,0x08,0x08,0x70,0x00,/*'5',9*/
//0x30,0x48,0x08,0x30,0x08,0x48,0x30,0x00,/*'3',10*/
//};*/
/*uchar code table_816[]={
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,/*'0',1*/
/*0x00,0x00,0x00,0x10,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,/*'1',2*/
/*0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x04,0x04,0x08,0x10,0x20,0x42,0x7E,0x00,0x00,/*'2',3*/
/*0x00,0x00,0x00,0x3C,0x42,0x42,0x04,0x18,0x04,0x02,0x02,0x42,0x44,0x38,0x00,0x00,/*'3',4*/
/*0x00,0x00,0x00,0x04,0x0C,0x14,0x24,0x24,0x44,0x44,0x7E,0x04,0x04,0x1E,0x00,0x00,/*'4',5*/
/*0x00,0x00,0x00,0x7E,0x40,0x40,0x40,0x58,0x64,0x02,0x02,0x42,0x44,0x38,0x00,0x00,/*'5',6*/
/*0x00,0x00,0x00,0x1C,0x24,0x40,0x40,0x58,0x64,0x42,0x42,0x42,0x24,0x18,0x00,0x00,/*'6',7*/
/*0x00,0x00,0x00,0x7E,0x44,0x44,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,/*'7',8*/
/*0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,/*'8',9*/
/*0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x26,0x1A,0x02,0x02,0x24,0x38,0x00,0x00,/*'9',10*/
//}; //上-->下;
uchar code BMP1[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x03,0x80,0x38,0x1C,0x00,0x03,0x80,0x00,0x18,0x00,0x00,0x00,0x04,
0x20,0x00,0x07,0x03,0x88,0x1C,0x1E,0x00,0x03,0x80,0x00,0x1C,0x00,0x00,0x00,0x04,
0x20,0x00,0x03,0x83,0x9C,0x0E,0x1C,0x00,0x63,0x98,0x00,0x18,0x00,0x00,0x00,0x04,
0x20,0x00,0x01,0xFF,0xF4,0x0E,0x1C,0x00,0x73,0x9E,0x00,0x18,0x20,0x00,0x00,0x04,
0x20,0x00,0x00,0x03,0xB8,0x00,0x1C,0x00,0x3B,0x98,0x0F,0xFF,0xF0,0x00,0x00,0x04,
0x20,0x00,0x18,0xFF,0xF8,0x00,0x1C,0x70,0x3F,0xB8,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x0E,0xC3,0x8C,0x0F,0xFF,0xF0,0x1B,0xB0,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x0F,0xFF,0xFE,0xFE,0x1C,0x00,0x03,0xE3,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x07,0x80,0x03,0x1C,0x1C,0x03,0xFF,0xFF,0x87,0xFF,0xF0,0x00,0x00,0x04,
0x20,0x00,0x01,0xB8,0x3C,0x1C,0x3C,0x00,0x0C,0xE0,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x03,0xBF,0xFC,0x1C,0x3F,0x00,0x0C,0xE0,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x03,0x38,0x18,0x1C,0x73,0x80,0x1C,0xE0,0x06,0x18,0x70,0x00,0x00,0x04,
0x20,0x00,0x07,0x3F,0xF8,0x1C,0x61,0xC0,0x1C,0xE0,0x07,0xFF,0xF0,0x00,0x00,0x04,
0x20,0x00,0x1F,0x38,0x18,0x1C,0xC0,0xE0,0x1C,0xE1,0x86,0x18,0x60,0x00,0x00,0x04,
0x20,0x00,0x07,0x3F,0xF8,0x1F,0x80,0xE0,0x38,0xE1,0x84,0x18,0x18,0x00,0x00,0x04,
0x20,0x00,0x07,0x38,0x18,0x37,0x00,0x00,0x38,0xE1,0x80,0x18,0x18,0x00,0x00,0x04,
0x20,0x00,0x07,0x38,0x18,0xF3,0x80,0x00,0x70,0xE3,0x80,0x18,0x1C,0x00,0x00,0x04,
0x20,0x00,0x07,0x38,0xF8,0x61,0xFF,0xF8,0xC0,0xFF,0xC0,0x1C,0x1C,0x00,0x00,0x04,
0x20,0x00,0x00,0x38,0x38,0x00,0x00,0x07,0x80,0x00,0x00,0x0F,0xF8,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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 delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=124;y>0;y--);
}
void delay_100us(uchar z)
{
z=z*16;
while(z--);
}
/******************************************************************
写入指令和数据;
*****************************************************************/
#ifdef P80
void wr_data(uchar b) //写数据 ;
{
RD1=1;
CS=0;
CD=1;
DATA=b;
WR1=0;
WR1=1;
_nop_();
CS=1;
}
void write_com(uchar com) //写命令;
{
RD1=1;
CS=0;
CD=0;
DATA=com;
WR1=0;
WR1=1;
_nop_();
CS=1;
}
uchar rd_data(void) //读数据 ;
{
uchar temp;
WR1=1;
CS=0;
CD=1;
DATA=0xff;
RD1=0;
temp=DATA;
RD1=1;
_nop_();
CS=1;
return temp;
}
#endif
#ifdef P68
void wr_data(uchar b) //写数据 ;
{
CS=0;
CD=1;
WR1=0;
RD1=1;
DATA=b;
RD1=0;_nop_();
CS=1;
}
void write_com(uchar com) //写命令;
{
CS=0;
CD=0;
WR1=0;
RD1=1;
DATA=com;
RD1=0;_nop_();
CS=1;
}
uchar rd_data(void) //读数据;
{
uchar temp;
CS=0;
CD=1;
WR1=1;
RD1=1;
temp=DATA;
RD1=0; _nop_();
CS=1;
return temp;
}
#endif
#ifdef SPI
void wr_data(uchar b) //写数据 ;
{
uchar i;
CS=0;
CD=1;
for(i=0;i<8;i++)
{
b<<=1;
SDIN=CY;
SCLK=0;
SCLK=1;
}
_nop_();
CS=1;
}
void write_com(uchar com) //写命令;
{
uchar i;
CS=0;
CD=0;
for(i=0;i<8;i++)
{
com<<=1;
SDIN=CY;
SCLK=0;
SCLK=1;
}
_nop_();
CS=1;
}
#endif
/******************************************************************
转换程序 :
16阶灰度,一个地址8位,4位一个像素,想控制8个点,就须写4个地址的RAM数据;
*****************************************************************/
void change(uchar b)
{
uchar i;
for(i=0;i<4;i++)
{
switch(b&0xc0)
{
case 0x00: RAM_data[i]=0x00;break;
case 0x40: RAM_data[i]=0x0f;break;
case 0x80: RAM_data[i]=0xf0;break;
case 0xc0: RAM_data[i]=0xff;break;
default: break;
}
b=b<<2;
wr_data(RAM_data[i]);
}
}
/******************************************************************
工作窗口设置;
*****************************************************************/
void SET_AW(uchar a,uchar b,uchar c,uchar d)
{
write_com(0x15);
write_com(a);
write_com(b);
write_com(0x75);
write_com(0x0c+c);
write_com(0x0c+d);
}
/******************************************************************
全屏程序;
*****************************************************************/
void all_screen(uchar b) //128*80整个RAM区清屏;
{
uchar i,j;
write_com(0x15);
write_com(0x00);
write_com(0x3f);
write_com(0x75);
write_com(0x00);
write_com(0x4f);
for (j=0;j<80;j++)
for (i=0;i<64;i++) wr_data(b);
}
void fill(uchar b)//128*64显示界面的操作,b=0清屏;b=FFH 全屏;
{
uchar i,j;
SET_AW(0,63,0,63);
for (j=0;j<64;j++)
for (i=0;i<64;i++) wr_data(b);
}
/******************************************************************
写入8*8字符;
x y-->行列地址;n首字符序号,end_n尾字符序号;
*****************************************************************/
/*void word_88(uchar x,uchar y,uchar n) //8*8字符单个写;
{
uchar i;
SET_AW(x,x+3,y,y+7);
if(REV) {for(i=0;i<8;i++) change(tab[8*n+i]);}
else {for(i=0;i<8;i++) change(tab[8*n+i]);}
}
void show_88(uchar x,uchar y,uchar n,uchar end_n)//写入y一串8*8字符,可自动换行;
{
uchar i;
for(i=n;i<=end_n;i++)
{
if(x>60) {y=y+10;x=0;}
word_88(x,y,i);
x=x+4;
}
}
/******************************************************************
写入8*16 16*16字符;
x y-->行列地址;n首字符序号,end_n尾字符序号;
*****************************************************************/
/*void word_816(uchar x,uchar y,uchar n) //8*16字符单个写;
{
uchar i;
SET_AW(x,x+3,y,y+15);
if(REV) {for(i=0;i<16;i++) change(~table_816[16*n+i]); }
else {for(i=0;i<16;i++) change(table_816[16*n+i]); }
}
void word_1616(uchar x,uchar y,uchar n) //16*16字符单个写;
{
uchar i;
SET_AW(x,x+7,y,y+15);
if(REV) {for(i=0;i<32;i++) change(~table_1616[32*n+i]); }
else {for(i=0;i<32;i++) change(table_1616[32*n+i]); }
}
void show_816(uchar x,uchar y,uchar n,uchar end_n)//写入y一串8*16字符,可自动换行;
{
uchar i;
for(i=n;i<=end_n;i++)
{
word_816(x,y,i);
x=x+4;
}
}
void show_1616(uchar x,uchar y,uchar n,uchar end_n)//写入y一串16*16字符,可自动换行;
{
uchar i;
for(i=n;i<=end_n;i++)
{
if(x>60) {y=y+8;x=0;}
word_1616(x,y,i);
x=x+8;
}
}
void word_(uchar x,uchar y,uchar n) //16*16字符单个写;
{
uchar i;
SET_AW(x,x+3,y,y+26);
{for(i=0;i<27;i++) change(table_[27*n+i]); }
}
void show_(uchar x,uchar y,uchar n,uchar end_n)//写入y一串16*16字符,可自动换行;
{
uchar i;
for(i=n;i<=end_n;i++)
{
word_(x,y,i);
x=x+4;
}
}
/******************************************************************
实现对单独像素点的描和消;
X--> x轴方向的点数(0~line_char*8-1),Y-->y轴方向的点数,
z-->1为描,0为消;flag-->显示区;
*****************************************************************/
void pix(uchar X,uchar Y,uchar z)
{
uchar temp1,temp2,read1;
temp1=X/2;
temp2=X%2;
SET_AW(temp1,temp1,Y,Y);
read1=rd_data();
read1=rd_data();
if(z) {if(temp2==0) read1=0xf0|read1; else read1=0x0f|read1; }
else {if(temp2==0) read1=0x0f&read1; else read1=0xf0&read1; }
wr_data(read1);
}
void draw_BMP(uchar code*s) //用pix函数画一幅128*64BMP;
{
uchar j,temp;
uint i;
temp=s[0];
for(j=0;j<64;j++)
for(i=0;i<128;i++)
{
temp=temp<<1;
if(CY) pix(i,j,1);
if(i%8==7) temp=*++s;
}
}
void draw_line(int x0,int y0,int x1,int y1,uchar flag)
{
int m,dx,dy,i;
float x,y,deltax,deltay;
dx=x1-x0;
dy=y1-y0;
x=(float)x0;y=(float)y0;
m = abs(dx) > abs(dy) ? abs(dx) : abs(dy) ;
deltax = (float)dx / m , deltay = (float)dy / m ;
for ( i = 0 ; i <=m ; i ++ )
{
pix ((uint)(x+0.5),(uchar)(y+0.5),flag);
x += deltax ;
y += deltay ;
}
}
/******************************************************************
滚动功能演示;
*****************************************************************/
V_scroll(uchar n,uchar flag) //垂直滚动;n-->滚动的行数(单个像素点为单位),flag=1为上滚;
{
uchar i;
for(i=1;i<=n;i++)
{
write_com(0xa1);
if(flag) write_com((0x0c+i)%80);
else write_com(79-(i+79-0x0c)%80) ;
delay(100);
}
}
H_scroll(uchar col,uchar row,uchar tim)//水平滚动;col-->单步滚动的列地址(两个像素点为单位),row-->参加滚动的行数;
{ //tim两次滚动之间的间隔时间;此滚动为水平向右滚动;
write_com(0x23);
write_com(0x02);
write_com(0x26);
write_com(col);
write_com(row);
write_com(tim);
write_com(0x2F);
}
D_scroll(void) //停止滚动;
{
write_com(0x2e);
}
/******************************************************************
灰度及画矩形演示;
*****************************************************************/
draw_REC(uchar col,uchar end_col,uchar row,uchar end_row,uchar l_g,uchar r_g)
{
//col-->列首;row-->行首;end_col列末;end_row行末;l_g左边灰度;r_g 右边灰度;
write_com(0x23);
write_com(0x01);
write_com(0x24);
write_com(col);
write_com(row);
write_com(end_col);
write_com(end_row);
write_com((l_g&0x0f)<<4|r_g&0x0f);
}
void gray(void) //16阶灰度矩形方式演示;
{
draw_REC(0x00,0x03,0x00,0x4b,0x0f,0x0f);
draw_REC(0x04,0x07,0x00,0x4b,0x0e,0x0e);
draw_REC(0x08,0x0B,0x00,0x4b,0x0d,0x0d);
draw_REC(0x0C,0x0F,0x00,0x4b,0x0c,0x0c);
draw_REC(0x10,0x13,0x00,0x4b,0x0b,0x0b);
draw_REC(0x14,0x17,0x00,0x4b,0x0a,0x0a);
draw_REC(0x18,0x1B,0x00,0x4b,0x09,0x09);
draw_REC(0x1C,0x1F,0x00,0x4b,0x08,0x08);
draw_REC(0x20,0x23,0x00,0x4b,0x07,0x07);
draw_REC(0x24,0x27,0x00,0x4b,0x06,0x06);
draw_REC(0x28,0x2B,0x00,0x4b,0x05,0x05);
draw_REC(0x2C,0x2F,0x00,0x4b,0x04,0x04);
draw_REC(0x30,0x33,0x00,0x4b,0x03,0x03);
draw_REC(0x34,0x37,0x00,0x4b,0x02,0x02);
draw_REC(0x38,0x3B,0x00,0x4b,0x01,0x01);
draw_REC(0x3C,0x3F,0x00,0x4b,0x00,0x00);
}
/******************************************************************
反显功能演示; flag=1为反显实现,0为取消;
*****************************************************************/
void reverse(uchar flag)
{
if(flag) REV=1;
else REV=0;
}
/******************************************************************
初始化函数;
*****************************************************************/
void init(void)
{
delay(15);
RES=1;delay(1);
RES=0;delay(1);
RES=1;delay(1);
delay(150);
write_com(0xae); //Display OFF
write_com(0xb3); //Set Display Clock Divide Ratio/Oscillator Freguency
write_com(0x01);
write_com(0x90);
write_com(0xa8); //Set Multiplex Ratio:64 MUX
write_com(0x3f);
write_com(0xa2); //Set Display Offset
write_com(0x4c);
write_com(0xa1); //Set Display Star Line
write_com(0x0c);
write_com(0xad); //Set Master Configuration:External VCC
write_com(0x02);
write_com(0xa0); //Set Re-map
write_com(0x52);
write_com(0x86); //Set Current Range :Full
write_com(0x81); //Set Contrast Current:40H
write_com(0x40);
write_com(0xb2); //Set Row Period:70
write_com(0x51);
write_com(0xb1); //Set Phase Length
write_com(0x55);
write_com(0xbc); //Set Pre-charge Voltage:0.51*VREF
write_com(0x10); //00
write_com(0xb4); //Set Pre-charge Compensation Level
write_com(0x02); //00
write_com(0xb0); //Set Pre-charge Compensation Enable
write_com(0x28); //08
write_com(0xbe); //Set VCOMH Voltage:0.51*VREF
write_com(0x1c);//00
write_com(0xbf); //Set Segment Low Voltage:connect a capacitor
write_com(0x0d);
write_com(0xa4); //Set Display Mode:Normal
fill(0x00); //清屏
write_com(0xaf); //Display ON */
}
/******************************************************************
主程序;
*****************************************************************/
main()
{
BS1=1;
BS2=1;
init();
fill(0x00);
delay(10);
draw_BMP(BMP1);
while(1);
}

12864系列OLED我司大批量出货,性能稳定,价格优惠!我司从事OLED模组行业已有十多年, 出货量在国内数一数二,欢迎有需求的朋友来电咨询或加微信咨询!


免责声明:以上信息由会员自行提供,内容的真实性、准确性和合法性由发布会员负责。一步电子网(www.kuyibu.com)对此不承担任何责任。
友情提醒:为规避购买风险,建议您在购买相关产品时,优先选择一步电子网(www.kuyibu.com)VIP会员

杭州清达光电技术有限公司 电话:86-0571-89902095 传真:86-0571-89902095
地址:浙江 - 杭州 杭州市余杭区良渚街道博园路1号杭州电子市场西区2楼2A001(门市部)
技术支持:一步电子网  管理商铺入口

声明:以上所展示的信息由企业自行提供,内容的真实性、准确性和合法性由发布企业负责。一步电子网对此不承担任何保证责任。

金瓶儿 <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <蜘蛛词>| <文本链> <文本链> <文本链> <文本链> <文本链> <文本链>