1、* Output : None* Return :*/void Delay_LCD(u16 n) u16 i,j; for (i = 0;in;+i) for(j=0;j3000;+j); STM3210B_LCD_Init Initializes the LCD.void STM3210B_LCD_Init(void) vu16 dummy = 0; /总线配置 LCD_CtrlLinesConfig(); LCD_WriteReg(0x0000,0x0001); Delay_LCD(1000); LCD_WriteReg(0x0001,0x0000); LCD_WriteReg(0x001
2、0,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);
3、 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_Write
4、Reg(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 Sets the Text color. - Color: specifies the Text color code RGB(5-6-5). - TextColor: Text colo
5、r global variable used by LCD_DrawChar* and LCD_DrawPicture functions.void LCD_SetTextColor(vu16 Color) TextColor = Color; LCD_SetBackColor Sets the Background color. specifies the Background color code RGB(5-6-5). - BackColor: Background color global variable used by * LCD_DrawChar and LCD_DrawPict
6、ure functions.void LCD_SetBackColor(vu16 Color) BackColor = Color; LCD_ClearLine Clears the selected line. - Line: the Line to be cleared.* This parameter can be one of the following values:* - Linex: where x can be 0.9void LCD_ClearLine(u8 Line) LCD_DisplayStringLine(Line, ); LCD_Clear Clears the h
7、ole LCD. Color: the color of the background.void LCD_Clear(u16 Color) u32 index = 0; LCD_SetCursor(0x00, 0x0000); LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */ for(index = 0; index 76800; index+) LCD_WriteRAM(Color); LCD_SetCursor Sets the cursor position. - Xpos: specifies the X position.* -
8、Ypos: specifies the Y position. void LCD_SetCursor(u8 Xpos, u16 Ypos) LCD_WriteReg(R32, Xpos); LCD_WriteReg(R33, Ypos); LCD_DrawChar Draws a character on LCD. the Line where to display the character shape. start column address.* - c: pointer to the character data.void LCD_DrawChar(u8 Xpos, u16 Ypos, uc16 *c) u32 index = 0, i = 0; u8 Xaddress = 0; Xaddress = Xpos; LCD_SetCursor(Xaddress, Ypos); 24; LCD_WriteRAM_Prepare(); /*
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1