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); }
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 }
/* * 以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 lcd_enable (void) { Lcd_PowerEnable(1); LCDCON1|=1<<0; }
void MeasurePowerConsumption(void) { int i,j; volatile int a,b,c; Uart_Printf("[ Measure the power consumption of S3C2410 ]\n"); Uart_Printf("FCLK is changed to %5.1lfMhz.\n",TMP_FCLK/1000000.); MMU_Init(); ChangeClockDivider(1,1); // 1:2:4 // ChangeClockDivider(0,1); // 1:1:2 #if TMP_FCLK==266000000 ChangeMPllValue(125,4,0); // TMP_FCLK=237000000Hz Uart_Init(266000000/4,115200); #endif #if TMP_FCLK==237000000 ChangeMPllValue(150,2,1); // TMP_FCLK=237000000Hz Uart_Init(237000000/4,115200); #endif #if TMP_FCLK==226000000 ChangeMPllValue(105,1,1); // TMP_FCLK=226000000Hz Uart_Init(226000000/4,115200); #endif #if TMP_FCLK==214500000 ChangeMPllValue(135,2,1); // TMP_FCLK=214500000Hz Uart_Init(214500000/4,115200); #endif #if TMP_FCLK==202800000 ChangeMPllValue(161,3,1); // TMP_FCLK=202800000Hz Uart_Init(202800000/4,115200); #endif #if TMP_FCLK==180000000 ChangeMPllValue(82,1,1); // TMP_FCLK=180000000Hz Uart_Init(180000000/4,115200); #endif #if TMP_FCLK==152000000 ChangeMPllValue(68,1,1); // TMP_FCLK=152000000Hz Uart_Init(152000000/4,115200); #endif #if TMP_FCLK==135000000 ChangeMPllValue(82,2,1); // FCLK=135000000Hz Uart_Init(135000000/4,115200); #endif #if TMP_FCLK==101250000 ChangeMPllValue(127,2,2); // TMP_FCLK=101250000Hz Uart_Init(101250000/2,115200); #endif #if TMP_FCLK==50700000 ChangeMPllValue(161,3,3); // TMP_FCLK=50700000Hz Uart_Init(50700000/4,115200); #endif rGPHCON = rGPHCON&~(3<<18|3<<20)|(1<<18|1<<20); //GPH9:CLKOUT0->OUT,GPH10:CLKOUT1->OUT #if 0 rGPHCON = rGPHCON&~(3<<18)|(2<<18); //CLKOUT0 rMISCCR = rMISCCR&~(7<<4)|(4<<4); //PCLK=45Mhz @FCLK=180Mhz #endif #if UNUSED_BLCOK_ON==0 rCLKCON=rCLKCON&~(1<<18|1<<16|1<<12|1<<11|1<<9|1<<4); //SPI,IIC,UART1,2,SDI,NFC #endif #if DMA2_ON==1 StartDmaMem2Mem(); #endif PWR_StartTimer(); Uart_Printf("TFT-LCD 240x320 16bit is running.\n"); Lcd_PowerEnable(0,1); PWR_Lcd_Tft_16Bit_240320_On(); PWR_StartIIS(); #if CPU_WORK==QUICK_SORT Uart_Printf("CPU JOB : quick sort of 65536 intteger data.\n"); //qsort; for(i=0; i<NUM_SORT_DATA; i++)dim2[i]=i; i=0; while(1) { qsort(dim2,NUM_SORT_DATA,sizeof(int),compare1); qsort(dim2,NUM_SORT_DATA,sizeof(int),compare2); Uart_Printf(","); } #else Uart_Printf("CPU JOB : Dhrystone 2.1 code.\n"); while(1) { dhrystone21(); Uart_Printf("."); } #endif Uart_Printf("End of the Measurement\n"); }