示例#1
0
文件: OutputCtrl.c 项目: lgnq/tw8836
void BT656OutputEnable(BYTE fOn, BYTE clear_port)
{
	DECLARE_LOCAL_page

	ReadTW88Page(page);
	WriteTW88Page(PAGE0_INPUT);
	if (fOn)
	{
#ifdef SUPPORT_UART1
		Printf("\nBUGBUG:BT656 and UART1..");
#else
		WriteTW88(REG007, ReadTW88(REG007) | 0x08);	 
#endif
	}
	else
	{
		WriteTW88(REG007, ReadTW88(REG007) & ~0x08);	//DataInitNTSC clear it. 
		//clear port
		if (clear_port)
		{
			if (P1_6 == 0)
				P1_6 = 1;
		}
	}
	WriteTW88Page(page);
}
示例#2
0
void ClearLogo(void)
{
	DECLARE_LOCAL_page
	BYTE i, j;

	ReadTW88Page(page);
	WriteTW88Page(PAGE3_FOSD );
	//=============================== Fade OUT ======================================
	for ( i=0; i<9; i++ ) {
		delay1ms(30);
		for ( j=0; j<16; j++ ) {
			WriteTW88(REG_FOSD_ALPHA_SEL, j );
			WriteTW88(FOSDWinBase[TECHWELLOGO_OSDWIN]  +1, i );
			WriteTW88(FOSDWinBase[TECHWELLOGO_OSDWIN+2]+1, i );
		}
	}
	//============ Disable window and recover Trans value ============================
	FOsdOnOff(OFF, 1);	//with vdelay 1
	FOsdWinEnable(TECHWELLOGO_OSDWIN,FALSE);
	FOsdWinEnable(TECHWELLOGO_OSDWIN+2,FALSE);
	//assume page3
	for ( j=0; j<16; j++ ) {
		WriteTW88(REG_FOSD_ALPHA_SEL, j );
		WriteTW88(FOSDWinBase[TECHWELLOGO_OSDWIN]  +1, 0 );
		WriteTW88(FOSDWinBase[TECHWELLOGO_OSDWIN+2]+1, 0 );
	}

	WriteTW88Page(page );
}
示例#3
0
文件: Decoder.c 项目: lby116/ACT35
/**
* Is it a video Loss State
*
* @return
*	- 1:If no Input
*	- 0:Found Input
*/
BYTE DecoderIsNoInput(void)
{
	DECLARE_LOCAL_page
	BYTE ret;
	
	ReadTW88Page(page);
	WriteTW88Page(PAGE1_DECODER);
	ret = TW8835_R101;	
	WriteTW88Page(page);
	
	if(ret & 0x80)
		return 1;	//No Input
	return 0;		//found Input
}
示例#4
0
void ChipTest_GPIO(void)
{
	DECLARE_LOCAL_page
	BYTE prev_en,prev_oe,prev_od;
	BYTE value;
	BYTE i;
	BYTE result;

	ReadTW88Page(page);
	WriteTW88Page(0);
	//GPIO0~6
	for(i=0; i < 7; i++) {
		result = ERR_SUCCESS;
		Printf("\nGPIO_%01bxx ",i);
		//read previous value
		prev_en = ReadTW88(REG080+i);
		prev_oe = ReadTW88(REG088+i);
		prev_od = ReadTW88(REG090+i);
		value = ReadTW88(REG098+i);
		Printf("PREV EN:%02X OE:%02X OD:%02X ID:%02X ", prev_en,prev_oe,prev_od,value);

		WriteTW88(REG080+i, 0xFF & GPIO_mask[i]);  		//enable GPIO
		WriteTW88(REG088+i, 0xFF & GPIO_mask[i]);  		//output enable
		WriteTW88(REG090+i, 0xFF & GPIO_mask[i]);  		//output data
		value= ReadTW88(REG098+i) & GPIO_mask[i];		//read input
		Printf(" W:%02bx R:%02bx ",0xFF & GPIO_mask[i], value);
		if((0xFF & GPIO_mask[i]) != (value & GPIO_mask[i])) 
			result = ERR_FAIL;


		WriteTW88(REG090+i, 0x00);  					//output data
		value=ReadTW88(REG098+i) & GPIO_mask[i];		//read input
		Printf(" W:00 R:%02bx ",value);
		if((value & GPIO_mask[i])) 
			result = ERR_FAIL;

		if(result==ERR_SUCCESS)
			Puts(" Pass");

		//restore orginal value
		WriteTW88(REG080+i, prev_en);
		WriteTW88(REG088+i, prev_oe);
		WriteTW88(REG090+i, prev_od);
	}
	WriteTW88Page(page);
}
示例#5
0
//code WORD LOGO_COLOR_8[16] = {
//     0xFFFF,0x0020,0xDEDB,0xA534,0x6B6D,0xC826,0x4A49,0xDCD5,
//     0xFFFF,0xC806,0xC98C,0xCB31,0xFE79,0xFCD9,0xCCD4,0xE71C
//};
//-------------------------------------------------------------------
// Display/Clear FOSD LOGO
//-------------------------------------------------------------------
void DisplayLogo(void)
{
#ifdef SUPPORT_8BIT_CHIP_ACCESS
	BYTE page;
#endif
	BYTE i;

	ReadTW88Page(page);

 	InitFOsdMenuWindow(Init_Osd_DisplayLogo);
	#ifdef ADD_ANALOGPANEL
	if(IsAnalogOn())
		InitFOsdMenuWindow(Init_Osd_DisplayLogo_A);
	#endif
	
	InitFontRamByNum(FONT_NUM_LOGO, 0);	//FOsdDownloadFont(2);

	FOsdSetPaletteColorArray(0, LOGO_COLOR_8, 16, 1);

	WriteTW88Page(PAGE4_CLOCK);
	dPrintf("\nDisplayLogo-Current MCU SPI Clock select : [0x4E0]=0x%02bx, [0x4E1]=0x%02bx", ReadTW88(REG4E0), ReadTW88(REG4E1));

	WriteTW88Page(PAGE3_FOSD );
	WriteTW88(REG304, ReadTW88(REG304)&0xFE); // OSD RAM Auto Access Enable
	WriteTW88(REG304, (ReadTW88(REG304)&0xF3)); // Normal

	for ( i=0; i<70; i++ ) {
		WriteTW88(REG306, i );
		WriteTW88(REG307, i*3 );
		WriteTW88(REG308, (i / 42)*2 );
	}

	WriteTW88(REG30B, 0 );						// 2bit multi color start = 0
	WriteTW88(REG_FOSD_MADD3, 0 );				// 3bit multi color start = 0
	WriteTW88(REG_FOSD_MADD4, 0xff );			// 4bit multi color start = 0

	FOsdWinEnable(TECHWELLOGO_OSDWIN,TRUE);
	FOsdWinEnable(TECHWELLOGO_OSDWIN+1,FALSE);
	FOsdWinEnable(TECHWELLOGO_OSDWIN+2,TRUE);
}
示例#6
0
文件: Util.c 项目: lgnq/tw8836
void WaitVBlank(BYTE cnt)
{
	XDATA	BYTE i;
	WORD loop;
	DECLARE_LOCAL_page

	ReadTW88Page(page);
	WriteTW88Page(PAGE0_GENERAL );

	for ( i=0; i<cnt; i++ ) {
		WriteTW88(REG002, 0xff );
		loop = 0;
		while (!( ReadTW88(REG002 ) & 0x40 ) ) {
			// wait VBlank
			loop++;
			if(loop > VBLANK_WAIT_VALUE  ) {
				wPrintf("\nERR:WaitVBlank");
				break;
			}
		}		
	}
	WriteTW88Page(page);
}