📄 stv199.c
字号:
Error = STV0199A_GetProperty(Hw_p, STV0199A_E, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->E = Value; return Error;} /* STV0199A_GetE() *//*****************************************************************************Name: STV0199A_GetAGC1()Description: Obtains the value of AGC 1 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAGC1(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC1_INTEGRATOR, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->AGC1 = Value; return Error;} /* STV0199A_GetAGC1() *//*****************************************************************************Name: STV0199A_GetAGC2()Description: Obtains the value of AGC 2 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAGC2(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC2_GAIN, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->AGC2 = Value; return Error;} /* STV0199A_GetAGC2() *//*****************************************************************************Name: STV0199A_GetAlphaCarrier()Description: Obtains the value of the alpha carrier on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAlphaCarrier(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_ALPHA_CARRIER, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->AlphaCarrier = Value; return Error;} /* STV0199A_GetAlphaCarrier() *//*****************************************************************************Name: STV0199A_GetBetaCarrier()Description: Obtains the value of the beta carrier on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetBetaCarrier(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_BETA_CARRIER, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->BetaCarrier = Value; return Error;} /* STV0199A_GetBetaCarrier() *//*****************************************************************************Name: STV0199A_GetAlphaTiming()Description: Obtains the value of the alpha timing on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAlphaTiming(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_ALPHA_TIMING, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->AlphaTiming = Value; return Error;} /* STV0199A_GetAlphaTiming() *//*****************************************************************************Name: STV0199A_GetBetaTiming()Description: Obtains the value of the beta timing on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetBetaTiming(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_BETA_TIMING, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->BetaTiming = Value; return Error;} /* STV0199A_GetBetaTiming() *//*****************************************************************************Name: STV0199A_GetNaturalFrequency1()Description: Obtains the value of natural frequency 1 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetNaturalFrequency1(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC2_REF, &Value); if (Error == STV0199A_NO_ERROR) { Error = STV0199A_GetSymbolRate(Hw_p); if (Error == STV0199A_NO_ERROR) { Hw_p->NaturalFrequency1 = Value; Hw_p->NaturalFrequency1 <<= (Hw_p->BetaCarrier+1); /* MULT 2^(BetaCarrier+1) */ Hw_p->NaturalFrequency1 *= 62832; Hw_p->NaturalFrequency1 /= 30000; Hw_p->NaturalFrequency1 = LongSqrt(Hw_p->NaturalFrequency1); Hw_p->NaturalFrequency1 *= Hw_p->SymbolRate / 25736; } } return Error;} /* STV0199A_GetNaturalFrequency1() *//*****************************************************************************Name: STV0199A_GetNaturalFrequency2()Description: Obtains the value of natural frequency 2 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure. NOTE: Symbol rate value must be known before calling this routine.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetNaturalFrequency2(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; U32 L; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC2_REF, &Value); if (Error == STV0199A_NO_ERROR) { L = 5000*Value; L <<= (Hw_p->BetaTiming+1); /* MULT 2^(BetaTiming+1) */ Hw_p->NaturalFrequency2 = (52 * (Hw_p->SymbolRate / 10000)); Hw_p->NaturalFrequency2 *= LongSqrt(L); Hw_p->NaturalFrequency2 /= 100000; } return Error;} /* STV0199A_GetNaturalFrequency2() *//*****************************************************************************Name: STV0199A_GetDampingFactor1()Description: Obtains the value of damping factor 1 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetDampingFactor1(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC2_REF, &Value); if (Error == STV0199A_NO_ERROR) { Hw_p->DampingFactor1 = Value * 16755200; Hw_p->DampingFactor1 >>= Hw_p->BetaCarrier; /* DIV 2^(BetaCarrier) */ Hw_p->DampingFactor1 = LongSqrt(Hw_p->DampingFactor1); Hw_p->DampingFactor1 <<= (Hw_p->AlphaCarrier+7); /* MULT 2^(AlphaCarrier+7) */ Hw_p->DampingFactor1 >>= 12; /* DIV 4096 */ } return Error;} /* STV0199A_GetDampingFactor1() *//*****************************************************************************Name: STV0199A_GetDampingFactor2()Description: Obtains the value of damping factor 2 on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetDampingFactor2(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; U32 L; Error = STV0199A_GetProperty(Hw_p, STV0199A_AGC2_REF, &Value); if (Error == STV0199A_NO_ERROR) { Hw_p->DampingFactor2 = Value * 10000; Hw_p->DampingFactor2 = 67 * LongSqrt(Hw_p->DampingFactor2); Hw_p->DampingFactor2 <<= (Hw_p->AlphaTiming+1); /* MULT 2^(AlphaTiming+1) */ L = (5000 << (Hw_p->BetaTiming+1)); /* 5000 MULT 2^(BetaTiming+1) */ Hw_p->DampingFactor2 /= LongSqrt(L); } return Error;} /* STV0199A_GetDampingFactor2() *//*****************************************************************************Name: STV0199A_GetAGC1TimeConstant()Description:Parameters:Return Value:See Also: Nothing.*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAGC1TimeConstant(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; return Error;} /* STV0199A_GetAGC1TimeConstant() *//*****************************************************************************Name: STV0199A_GetAGC2TimeConstant()Description:Parameters:Return Value:See Also: Nothing.*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetAGC2TimeConstant(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; return Error;} /* STV0199A_GetAGC2TimeConstant() *//*****************************************************************************Name: STV0199A_GetTimingLoopFrequency()Description: Obtains the value of the timing loop frequency on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_SetTimingLoopFrequency() STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetTimingLoopFrequency(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_TLOOP_FREQUENCY, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->TimingLoopFrequency = Value; return Error;} /* STV0199A_GetTimingLoopFrequency() *//*****************************************************************************Name: STV0199A_GetCarrierLoopFrequency()Description: Obtains the value of the carrier loop frequency on the STV0119A. The value is stored for future use in the STV0199A_Device_t structure.Parameters: Hw_p, pointer to the STV0199A device.Return Value: STV0199A_NO_ERROR, the operation completed without error. STV0199A_ERROR_BUS, there was a problem accessing the device.See Also: STV0199A_SetCarrierLoopFrequency() STV0199A_Device_t*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetCarrierLoopFrequency(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error; U8 Value; Error = STV0199A_GetProperty(Hw_p, STV0199A_CLOOP_FREQUENCY, &Value); if (Error == STV0199A_NO_ERROR) Hw_p->CarrierLoopFrequency = Value; return Error;} /* STV0199A_GetCarrierLoopFrequency() *//*****************************************************************************Name: STV0199A_GetVENRate()Description:Parameters:Return Value:See Also:*****************************************************************************/STV0199A_ErrorCode_t STV0199A_GetVENRate(STV0199A_Device_t *Hw_p){ STV0199A_ErrorCode_t Error;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -