资源简介
LCD驱动芯片,ST75256的驱动及文档。适合深圳晶联讯的LCD屏。单片机采用8051。模拟IO方式
代码片段和文件信息
#include
#define uchar unsigned char
#define uint unsigned int
#define PSB 2 //0:I2C1:3SPI2:4SPI3:80804:6800
#define DATAPORT P1
sbit CSB=P3^3;
sbit RSTB=P3^4;
sbit ERD=P3^2;
sbit WR0=P3^1;
sbit SCL=P3^6;
sbit SDA=P3^7;
sbit A0=P3^5;
uchar code gImage_24080[2400];
void NOP(void)
{
int i;
for(i=0; i<10; i++);
}
void Delay_Ms(uint ms)
{
int ij;
for(i=0;i {
for(j=0;j<65;j++);
}
}
void Write_4spi(uchar Cduchar Dat)
{
uchar i;
CSB=0;
A0=Cd;
for(i=0;i<8;i++)
{
if(Dat&0x80)
{
SDA=1;
}
else
{
SDA=0;
}
SCL=0;
SCL=1;
Dat<<=1;
}
CSB=1;
//A0=1;
}
void Write_3spi(uchar Cduchar Dat)
{
uchar i;
CSB=0;
A0=Cd;
SDA=A0;
SCL=0;
SCL=1;
for(i=0;i<8;i++)
{
if(Dat&0x80)
{
SDA=1;
}
else
{
SDA=0;
}
SCL=0;
SCL=1;
Dat<<=1;
}
}
void Write_i2c8byte(uchar Dat)
{
uchar i;
for(i=0;i<8;i++)
{
if(Dat&0x80)
{
SDA=1;
}
else
{
SDA=0;
}
SCL=0;
SCL=1;
Dat<<=1;
}
SCL=0;
SCL=1;
}
void I2C_Start()
{
SCL=1;
SDA=1;
SDA=0;
SCL=0;
}
void I2C_Stop()
{
SCL=0;
SDA=0;
SCL=1;
SDA=1;
}
void Write_i2c(uchar Cduchar Dat)
{
I2C_Start();
Write_i2c8byte(0x78);//SA1=0SA0=0;需要根据实际情况确认
if(Cd==1)
{
Write_i2c8byte(0xc0);
}
else if(Cd==0)
{
Write_i2c8byte(0x80);
}
Write_i2c8byte(Dat);
I2C_Stop();
}
void Write_8080(uchar Cduchar Dat)
{
CSB=0;
A0=Cd;
ERD=1;
DATAPORT=Dat;
WR0=0;
NOP();NOP();NOP();
WR0=1;
CSB=1;
}
void Write_6800(uchar Cduchar Dat)
{
CSB=0;
A0=Cd;
WR0=0;
DATAPORT=Dat;
ERD=1;
NOP();NOP();NOP();
ERD=1;
CSB=1;
}
void Write(uchar Cduchar Dat)
{
if (PSB==0){Write_i2c(CdDat);}
else if(PSB==1){Write_3spi(CdDat);}
else if(PSB==2){Write_4spi(CdDat);}
else if(PSB==3){Write_8080(CdDat);}
else if(PSB==4){Write_6800(CdDat);}
}
void LCD_Init()
{
Write(00xaf);//display on
Write(00xa6);//normal display0xa7:inverse display
//Write(00x23);//all pixel display on
Write(00xca);//display control
Write(10x00);//cld =0;not divide
Write(10x4F);//set 1/80duty
Write(10x0e);//LF
Write(00x94);//SLPSleep out mode
Write(00x75);//Set page address
Write(10x00);//starting page address 00~28h//14h
Write(10x0A);//Ending page address
Write(00x15);//Set Column address
Write(10x00);//Set Column address
Write(10xef);//Set Column address
Write(00xBC);//Set DATA scan direction
Write(10x00);//从左到右,从上到下
Write(00xA3);//Set Start Line
Write(10x00);//
Write(00xD1);//Set OSC ON
Write(00x20);//Set Power control
Write(10x0B);//VBVFVR =1;
Write(00x81);//Set VOP
Write(10x1f);//Set VOP543210
Write(10x03);//Set VOP876
Write(00xD6);//Set VOP Increase one step
Write(00x08);//Set DO=0Data Format selectLSB on bottom
Write(00xf0);//Set display mode
Write(10x10);//DM=0Mono m
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3806865 2018-09-18 07:39 st75256\ST75256_v1.6b.pdf
文件 16537 2018-01-05 13:11 st75256\st75256.c
目录 0 2019-03-31 10:45 st75256\
相关资源
- 基于STM32F103C8单片机的晶联讯电子JL
- 手机静电放电的ESD问题解决与防护
- HT16C21 LCD驱动中文文档
- TFT/LCD驱动IC NT35510芯片手册datasheet
- STM32 UCGUIKEIL工程,已经移植好,修改
- DMA刷数据LCD驱动
- 宏芯T108 LCD驱动电路图
- PT6523和PT6524 LCD驱动芯片驱动程序
- RN7213是ARM Cortex-M0内核的电表SOC芯片带
- RN7213是ARM Cortex-M0内核的电表SOC芯片带
- st7541的LCD驱动
- linux下的通用lcd驱动lcdproc
- 240128lcd驱动程序
- ILI9163C 128*160 1.8寸 LCD驱动芯片说明
- 基于pic32mx单片机的FREE RTOS编程,涉及
评论
共有 条评论