液晶驱动C语言综述Word格式文档下载.docx

上传人:b****5 文档编号:15938236 上传时间:2022-11-17 格式:DOCX 页数:23 大小:17.78KB
下载 相关 举报
液晶驱动C语言综述Word格式文档下载.docx_第1页
第1页 / 共23页
液晶驱动C语言综述Word格式文档下载.docx_第2页
第2页 / 共23页
液晶驱动C语言综述Word格式文档下载.docx_第3页
第3页 / 共23页
液晶驱动C语言综述Word格式文档下载.docx_第4页
第4页 / 共23页
液晶驱动C语言综述Word格式文档下载.docx_第5页
第5页 / 共23页
点击查看更多>>
下载资源
资源描述

液晶驱动C语言综述Word格式文档下载.docx

《液晶驱动C语言综述Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《液晶驱动C语言综述Word格式文档下载.docx(23页珍藏版)》请在冰豆网上搜索。

液晶驱动C语言综述Word格式文档下载.docx

*Output:

None

*Return:

*******************************************************************************/

voidDelay_LCD(u16n)

{

u16i,j;

for(i=0;

i<

n;

++i)

for(j=0;

j<

3000;

++j);

}

STM3210B_LCD_Init

InitializestheLCD.

voidSTM3210B_LCD_Init(void)

{

vu16dummy=0;

//总线配置

LCD_CtrlLinesConfig();

LCD_WriteReg(0x0000,0x0001);

Delay_LCD(1000);

LCD_WriteReg(0x0001,0x0000);

LCD_WriteReg(0x0010,0x1790);

LCD_WriteReg(0x0060,0x2700);

LCD_WriteReg(0x0061,0x0001);

LCD_WriteReg(0x0046,0x0002);

LCD_WriteReg(0x0013,0x8010);

LCD_WriteReg(0x0012,0x80fe);

LCD_WriteReg(0x0002,0x0500);

LCD_WriteReg(0x0003,0x1030);

LCD_WriteReg(0x0030,0x0303);

LCD_WriteReg(0x0031,0x0303);

LCD_WriteReg(0x0032,0x0303);

LCD_WriteReg(0x0033,0x0300);

LCD_WriteReg(0x0034,0x0003);

LCD_WriteReg(0x0035,0x0303);

LCD_WriteReg(0x0036,0x0014);

LCD_WriteReg(0x0037,0x0303);

LCD_WriteReg(0x0038,0x0303);

LCD_WriteReg(0x0039,0x0303);

LCD_WriteReg(0x003a,0x0300);

LCD_WriteReg(0x003b,0x0003);

LCD_WriteReg(0x003c,0x0303);

LCD_WriteReg(0x003d,0x1400);

LCD_WriteReg(0x0092,0x0200);

LCD_WriteReg(0x0093,0x0303);

LCD_WriteReg(0x0090,0x080d);

LCD_WriteReg(0x0003,0x1018);

LCD_WriteReg(0x0007,0x0173);

dummy=LCD_ReadReg(0);

LCD_SetTextColor

SetstheTextcolor.

-Color:

specifiestheTextcolorcodeRGB(5-6-5).

-TextColor:

TextcolorglobalvariableusedbyLCD_DrawChar

*andLCD_DrawPicturefunctions.

voidLCD_SetTextColor(vu16Color)

TextColor=Color;

LCD_SetBackColor

SetstheBackgroundcolor.

specifiestheBackgroundcolorcodeRGB(5-6-5).

-BackColor:

Backgroundcolorglobalvariableusedby

*LCD_DrawCharandLCD_DrawPicturefunctions.

voidLCD_SetBackColor(vu16Color)

BackColor=Color;

LCD_ClearLine

Clearstheselectedline.

-Line:

theLinetobecleared.

*Thisparametercanbeoneofthefollowingvalues:

*-Linex:

wherexcanbe0..9

voidLCD_ClearLine(u8Line)

LCD_DisplayStringLine(Line,"

"

);

LCD_Clear

ClearstheholeLCD.

Color:

thecolorofthebackground.

voidLCD_Clear(u16Color)

u32index=0;

LCD_SetCursor(0x00,0x0000);

LCD_WriteRAM_Prepare();

/*PreparetowriteGRAM*/

for(index=0;

index<

76800;

index++)

{

LCD_WriteRAM(Color);

}

LCD_SetCursor

Setsthecursorposition.

-Xpos:

specifiestheXposition.

*-Ypos:

specifiestheYposition.

voidLCD_SetCursor(u8Xpos,u16Ypos)

LCD_WriteReg(R32,Xpos);

LCD_WriteReg(R33,Ypos);

LCD_DrawChar

DrawsacharacteronLCD.

theLinewheretodisplaythecharactershape.

startcolumnaddress.

*-c:

pointertothecharacterdata.

voidLCD_DrawChar(u8Xpos,u16Ypos,uc16*c)

u32index=0,i=0;

u8Xaddress=0;

Xaddress=Xpos;

LCD_SetCursor(Xaddress,Ypos);

24;

LCD_WriteRAM_Prepare();

/*

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 表格模板 > 合同协议

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1