void Lcd_TFT_Init(void) { Lcd_Init(); Lcd_PowerEnable(0, 1); Lcd_EnvidOnOff(1); //turn on vedio Lcd_ClearScr( (0x00<<11) | (0x00<<5) | (0x00) ); }
/* * 以240x320,8bpp的显示模式测试TFT LCD */ void Test_Lcd_Tft_8Bit_240320(void) { Lcd_Port_Init(); // 设置LCD引脚 Tft_Lcd_Init(MODE_TFT_8BIT_240320); // 初始化LCD控制器 Lcd_PowerEnable(0, 1); // 设置LCD_PWREN有效,它用于打开LCD的电源 Lcd_EnvidOnOff(1); // 使能LCD控制器输出信号 Lcd_Palette8Bit_Init(); // 初始化调色板 ClearScr(0x0); // 清屏 printf("[TFT 64K COLOR(16bpp) LCD TEST]\n"); printf("1. Press any key to draw line\n"); getc(); DrawLine(0 , 0 , 239, 0 , 0); // 颜色为DEMO256pal[0] DrawLine(0 , 0 , 0 , 319, 1); // 颜色为DEMO256pal[1] DrawLine(239, 0 , 239, 319, 2); // …… DrawLine(0 , 319, 239, 319, 4); DrawLine(0 , 0 , 239, 319, 8); DrawLine(239, 0 , 0 , 319, 16); DrawLine(120, 0 , 120, 319, 32); DrawLine(0 , 160, 239, 160, 64); printf("2. Press any key to draw circles\n"); getc(); Mire(); printf("3. Press any key to fill the screem with one color\n"); getc(); ClearScr(128); // 输出单色图像,颜色为DEMO256pal[128] printf("4. Press any key to fill the screem by temporary palette\n"); getc(); ClearScrWithTmpPlt(0x0000ff); // 输出单色图像,颜色为蓝色 printf("5. Press any key to fill the screem by palette\n"); getc(); DisableTmpPlt(); // 关闭临时调色板寄存器 ChangePalette(0xffff00); // 改变整个调色板为黄色,输出单色图像 printf("6. Press any key stop the testing\n"); getc(); Lcd_EnvidOnOff(0); }
/* * 以240x320,16bpp的显示模式测试TFT LCD */ void Test_Lcd_Tft_16Bit_240320(void) { Lcd_Port_Init(); // 设置LCD引脚 Tft_Lcd_Init(MODE_TFT_16BIT_240320); // 初始化LCD控制器 Lcd_PowerEnable(0, 1); // 设置LCD_PWREN有效,它用于打开LCD的电源 Lcd_EnvidOnOff(1); // 使能LCD控制器输出信号 ClearScr(0x0); // 清屏,黑色 printf("[TFT 64K COLOR(16bpp) LCD TEST]\n"); printf("1. Press any key to draw line\n"); getc(); DrawLine(0 , 0 , 239, 0 , 0xff0000); // 红色 DrawLine(0 , 0 , 0 , 319, 0x00ff00); // 绿色 DrawLine(239, 0 , 239, 319, 0x0000ff); // 蓝色 DrawLine(0 , 319, 239, 319, 0xffffff); // 白色 DrawLine(0 , 0 , 239, 319, 0xffff00); // 黄色 DrawLine(239, 0 , 0 , 319, 0x8000ff); // 紫色 DrawLine(120, 0 , 120, 319, 0xe6e8fa); // 银色 DrawLine(0 , 160, 239, 160, 0xcd7f32); // 金色 printf("2. Press any key to draw circles\n"); getc(); Mire(); printf("3. Press any key to fill the screem with one color\n"); getc(); ClearScr(0xff0000); // 红色 printf("4. Press any key to fill the screem by temporary palette\n"); getc(); ClearScrWithTmpPlt(0x0000ff); // 蓝色 printf("5. Press any key stop the testing\n"); getc(); Lcd_EnvidOnOff(0); }
void PWR_Lcd_Tft_16Bit_240320_On(void) { int i,j,k; Lcd_Port_Init(); //Lcd_Lpc3600Enable(); // Enable LPC3600 Lcd_Init(MODE_TFT_16BIT_240320); Glib_Init(MODE_TFT_16BIT_240320); Lcd_EnvidOnOff(1); Glib_ClearScr(0, MODE_TFT_16BIT_240320); Glib_Rectangle(0,0,239,319,0x07e0); Glib_FilledRectangle(0,0,20,20,65535); Glib_Rectangle(220,300,239,319,65535); Glib_Line(0,0,239,319,0x1f); Glib_Line(239,0,0,319,0xf800); Uart_Printf("TFT 64K color mode test 2!\n"); }
int main() { char data[100]; uart0_init(); uart0_init(); // 波特率115200,8N1(8个数据位,无校验位,1个停止位) Lcd_Port_Init(); // 设置LCD引脚 Tft_Lcd_Init(); // 初始化LCD控制器 Lcd_PowerEnable(0, 1); // 设置LCD_PWREN有效,它用于打开LCD的电源 Lcd_EnvidOnOff(1); // 使能LCD控制器输出信号 ClearScr(50); // 清屏,黑色ssssssssssssssssssssssssssssssssssssssss VideoInit(); //setting font color and windwos size printf_k("\n\rhao are you\n\r"); while (1) { memset(data, 0, sizeof(data)); gets(data); puts(data); printf_k("%s\n\r", data); } return 0; }
void Set_Lcd_Tft_16Bit_240320_Dvs(void) { // int i,j;//,k; Uart_Printf("[Set LCD]\n"); Lcd_Port_Init(); Lcd_Init(MODE_TFT_16BIT_240320); Glib_Init(MODE_TFT_16BIT_240320); Lcd_Lcc3600Enable(); // Enable LCC3600 Lcd_PowerEnable(0, 1); Lcd_EnvidOnOff(1); Glib_ClearScr(0, MODE_TFT_16BIT_240320); Glib_FilledRectangle(0,0,119,159,0xf800); Glib_FilledRectangle(120,0,239,159,0x07e0); Glib_FilledRectangle(0,160,119,320,0x001f); Glib_FilledRectangle(120,160,239,320,0xffff); Glib_FilledRectangle(100,100,150,200,0x5555); rLCDCON1 &= ~(0x1); // ENVID off. rLCDCON1 = (rLCDCON1 & ~(0x3ff<<8)) | (9<<8) | 1; // ENVID on. 5MHz 60fps // ON PWREN signal rLCDCON5 = (rLCDCON5 & ~(1<<3)) ; // PWREN disable rGPGCON = (rGPGCON & ~(0x3<<8)) | 0x1<<8; // GPG4, PWR_EN -> Output. rGPGDAT&=(~(1<<4)); // GPG4=Low Delay(50); // GPG4=Low rGPGDAT|=(1<<4); //GPG4=High //--------LCD frame interrupt setting ------------------------------------START pISR_LCD=(unsigned)Lcd_Int_Frame_ForDvs; rINTMSK &= ~(BIT_LCD); rLCDINTMSK=(1<<2)|(0<<1)|(1); // 8Words Trigger Level,Unmask Frame int,mask Fifo int //--------LCD frame interrupt setting ------------------------------------END }
void Test_HoldMode(void) { Uart_Printf("[ Power Saving Mode by Stopping Each Block ]\n"); Uart_Printf("LCD ENVID is turned off.\n"); Lcd_EnvidOnOff(0); Uart_Printf("Check the current cunsumption. Type any key to proceed.\n"); //Except GPIO,UART0 rCLKCON=0x7fff0; Uart_Getch(); Uart_Printf("NFC off.\n"); rCLKCON&=~(1<<4); Uart_Getch(); Uart_Printf("LCD off.\n"); rCLKCON&=~(1<<5); Lcd_EnvidOnOff(0); Uart_Getch(); Uart_Printf("USB host off(DP0/DN0 is suspended).\n"); rCLKCON&=~(1<<6); rMISCCR|=(1<<12); //USB port0 = suspend Uart_Getch(); Uart_Printf("USB device off(DP1/DN1 is also suspended).\n"); rCLKCON&=~(1<<7); rMISCCR|=(1<<13); //USB port1 = suspend Uart_Getch(); Uart_Printf("PWM Timer off.\n"); rCLKCON&=~(1<<8); Uart_Getch(); Uart_Printf("SDI off.\n"); rCLKCON&=~(1<<9); Uart_Getch(); Uart_Printf("UART1 off.\n"); rCLKCON&=~(1<<11); Uart_Getch(); Uart_Printf("UART2 off.\n"); rCLKCON&=~(1<<12); Uart_Getch(); Uart_Printf("RTC_control off.\n"); rCLKCON&=~(1<<14); Uart_Getch(); Uart_Printf("ADC off.\n"); rADCCON|=(1<<2); rCLKCON&=~(1<<15); Uart_Getch(); Uart_Printf("IIC off.\n"); rCLKCON&=~(1<<16); Uart_Getch(); Uart_Printf("IIS off.\n"); rCLKCON&=~(1<<17); Uart_Getch(); Uart_Printf("SPI off.\n"); rCLKCON&=~(1<<18); Uart_Getch(); Uart_Printf("Return to Normal Mode.\n"); rCLKCON=0xffff0; rADCCON&=(1<<2); rMISCCR&=~((1<<12)|(1<<13)); //USB port0,1 = normal Lcd_EnvidOnOff(1); }