⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s5h1410_ver1.2.c

📁 mstar 776 开发的车载dvd
💻 C
📖 第 1 页 / 共 3 页
字号:
	if(value1==0x1110 && result==1)		{SnrValue = Qam256SnrLookUpTable(lvalue);}
	else if(value1==0x1110 && result==0)	{SnrValue = Qam64SnrLookUpTable(lvalue);}
	else if(value1==0x1100)			{SnrValue = Qam64SnrLookUpTable(lvalue);}
	else if(value1==0x1101)			{SnrValue = Qam256SnrLookUpTable(lvalue);}

	return (SnrValue);
}

/*******************************************************************************************************************************
* S5H1410 QAM AM HUM set driver
* Conditions: Only in QAM mode
* Description: This function set the equalizer step size automatically while monitoring the equalizer output values.
* The AM_HUM  performance gets better through this function. This function should be always set and work in
* 64/256QAM mode.
* Addr: 0x88, 0x95
* Value: 0x88: 0x322f (in normal condition), 0x302f(in the TOV state)
*        0x95: 0x2c37 (in normal condition), 0x2836(in the TOV state)
*******************************************************************************************************************************/
void AMHUM_SetDriver(void)
{
    U16 temp;

	temp = MDrv_IIC_Read2Bytes(IIC_1410x_RegId, 0xf0); //EQ lock check

	if((temp>>13)&0x1) //EQ lock
	{
		MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x8d, 0x0014);
		if((temp&0xff)<0x38 || ((temp&0xff)>0x68))
			MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x88, 0x322f);
		else if( ((temp&0xff)>0x40) && ((temp&0xff)<0x68) )
			MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x88, 0x302f);

		if((temp&0xff)<0x38 || ((temp&0xff)>0x68))
			MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x95, 0x2c37);
		else if( ((temp&0xff)>0x40) && ((temp&0xff)<0x68) )
			MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x95, 0x2836);
	}
	else //EQ unlock
	{
		MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x8d, 0xa);
		MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x88, 0x322f);
		MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0x95, 0x2c37);
	}
}

SamsungQamMode_t Sec_1410xGetQamMode(void)
{
    U16 temp;
    SamsungQamMode_t enQamMode;

    temp = MDrv_IIC_Read2Bytes(IIC_1410x_RegId, 0xf0);
    if( (temp>>8) & 0x1 ) //256 QAM Mode
        enQamMode = QAM_MODE_256;
    else
        enQamMode = QAM_MODE_64;

    return enQamMode;
}

#if 0 //leo_1214 use for OOB only
/*********************************************************************************************************
* S5H1410 Register Value reset Driver
* Conditions: This function is called when the system needs initialization.
* Description:
* A register value is reset following this call.
* The system needs to call initialization function to be run properly after this function is called.
* Addr: 0xfa
* Value:
* Following this call, a register value of the 0xfa is changed from '0x01' to '0x00'.
* After that the value is back to '0x01' automatically.
**********************************************************************************************************/
I2C_STATUS Sec_1410xRegReset(void)
{
	U16 result = OK;
	result |= MDrv_IIC_Write2Bytes(IIC_1410x_RegId, 0xfa, 0x00);
	return result;
}

/*********************************************************************************************************
* S5H1410 VSB/QAM Power On/Down Set Driver
* Conditions:
* Description: The software-based VSB/QAM power down function is as follows.
* This function is called in order to set a sleep on or sleep off in VSB/QAM mode.
* Addr : 0xd8
* Value: [8]
* 0: power on(default)
* 1: power off
**********************************************************************************************************/

I2C_STATUS Sec1410_VQ_PowerOn()
{
	U16 vq_on;
	vq_on = MDrv_IIC_Write2Bytes(0x32,0xd8,0x01);
	return vq_on;
}
I2C_STATUS Sec1410_VQ_PowerOff()
{
	U16 vq_off;
	vq_off = MDrv_IIC_Write2Bytes(0x32,0xd8,0x101);
	return vq_off;
}


/*********************************************************************************************************
* S5H1410 FDC Power On/Down Set Driver
* Conditions:
* Description: The software-based FDC power down function is as follows.
* This function is called in order to set a sleep on or sleep off in FDC mode.
* Addr : 0xd8
* Value: [4]
* 0: power on(default)
* 1: power off
**********************************************************************************************************/
I2C_STATUS Sec1410_FDC_On()
{
	U16 Fdc_on;
	Fdc_on = MDrv_IIC_Write2Bytes(0x32,0xd8,0x01);
	return Fdc_on;
}

I2C_STATUS Sec1410_FDC_Off()
{
	U16 FDC_Off;
	FDC_Off = MDrv_IIC_Write2Bytes(0x32,0xd8,0x11);
	return FDC_Off;
}

/*********************************************************************************************************
* S5H1410 System Reset Driver
* Conditions:
* Description: This driver reset the system.
* Addr : 0xd2
* Value: [8]
* 1 : enable
* 0 : default
**********************************************************************************************************/
I2C_STATUS Sec1410_System_Reset()
{
	U16 Sys_reset;
	Sys_reset = MDrv_IIC_Write2Bytes(0x32,0xd2,0x1000);
	return Sys_reset;
}


/*********************************************************************************************************
* S5H1410 FDC Symbol Rate Change Driver
* Conditions:
* Description: This driver selects a FDC mode.
* Addr : 0xb0
* Value: [1:0]
* 00: DVS178 ? 1024Ksps(default) ,   01: DVS178 ? 1024Ksps
* 10: DVS167(GRADE A) ? 772Ksps,  11: DVS167(GRADE B) ? 1544Ksps
**********************************************************************************************************/
I2C_STATUS Sec1410_Symbolrate772()
{
	U16 temp,temp1,result;
	temp = (MDrv_IIC_Read2Bytes(0x32,0xb0))&0x110;
	temp1= temp | 0x2;
	result = MDrv_IIC_Write2Bytes(0x32,0xb0,temp1);
	return result;
}

I2C_STATUS Sec1410_Symbolrate1024()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32,0xb0)) & 0x110;
	result =	MDrv_IIC_Write2Bytes(0x32,0xb0,temp);
	return result;
}

I2C_STATUS Sec1410_Symbolrate1544()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32,0xb0)) | 0x3;
	result = MDrv_IIC_Write2Bytes(0x32,0xb0,temp);
	return result;
}


/*********************************************************************************************************
* S5H1410 FDC Changing IQ sequence driver
* Conditions:
* Description: This driver selects the IQ sequence type of DRX output.
* Addr : 0xb0
* Value: [8]
* 0: Q | I | Q | I | ˇ
* 1: I | Q | I | Q | ˇ.
**********************************************************************************************************/
I2C_STATUS Sec1410_IQ_Inversion()
{
	U16 temp,result;
	temp=(MDrv_IIC_Read2Bytes(0x32, 0xb0)) & 0x0ff;
	result = MDrv_IIC_Write2Bytes(0x32, 0xb0, temp);

	return result;
}
I2C_STATUS Sec1410_IQ_Normal()
{
	U16 temp,result;
	temp=(MDrv_IIC_Read2Bytes(0x32, 0xb0)) | 0x100;
	result =	MDrv_IIC_Write2Bytes(0x32, 0xb0, temp);

	return result;
}

/*********************************************************************************************************
* S5H1410 FDC CRX Inversion driver
* Conditions:
* Description: This driver selects the type of CRX clock output.
* Addr : 0xc0
* Value: [4]
* 0: inversion
* 1: normal(default)
**********************************************************************************************************/
I2C_STATUS Sec1410_CRX_Inversion()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32, 0xc0)) & 0x1fef;
	result = MDrv_IIC_Write2Bytes(0x32, 0xc0, temp);  //inversion
	return result;
}

I2C_STATUS Sec1410_CRX_Normal()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32, 0xc0)) | 0x0010;
	result = MDrv_IIC_Write2Bytes(0x32, 0xc0, temp);  //normal
	return result;
}

/*********************************************************************************************************
* S5H1410 FDC DRX Inversion driver
* Conditions:
* Description: This driver selects the type of DRX output.

* Addr: 0xc0
* Value: [0]
* 0: inversion
* 1: normal(default)
**********************************************************************************************************/
I2C_STATUS Sec1410_DRX_Inversion()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32, 0xc0)) & 0x1ffe;
	result = MDrv_IIC_Write2Bytes(0x32, 0xc0, temp);
	return 1;
}
I2C_STATUS Sec1410_DRX_Normal()
{
	U16 temp,result;
	temp = (MDrv_IIC_Read2Bytes(0x32, 0xc0)) | 0x1;
	result = 	MDrv_IIC_Write2Bytes(0x32, 0xc0, temp);
	return 1;
}


/*********************************************************************************************************
* S5H1410 FDC SW Reset driver
* Conditions:
* Description: This driver is FDC software reset.
* Addr : 0xc3
* Value: [4]
* 0: reset
* 1: Normal(default)
**********************************************************************************************************/
I2C_STATUS Sec1410_FDC_SWRESET()
{
	U16 oob_sw,oob_sw1,result;
	oob_sw = (MDrv_IIC_Read2Bytes(0x32, 0xc3)) & 0x100;
	MDrv_IIC_Write2Bytes(0x32, 0xc3, oob_sw);
	oob_sw1 = (MDrv_IIC_Read2Bytes(0x32, 0xc3)) | 0x011;
	result = MDrv_IIC_Write2Bytes(0x32, 0xc3, oob_sw1);

	return result;
}

/*********************************************************************************************************
* S5H1410 FDC EQ Lock Check driver
* Conditions:
* Description: This driver checks the FDC EQ lock state.
* Addr : 0xca
* Value: [0]
* 0: Unlock
* 1: Lock
**********************************************************************************************************/
I2C_STATUS Sec1410_FDC_EQLock()
{
	U16 temp;
	temp=MDrv_IIC_Read2Bytes(0x32, 0xca);
	return (temp);
}
#endif


#undef _S5H1410_C_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -