|
|
@ -522,8 +522,9 @@ xs_error_code_t Xsync::readfreq(uint32_t reg, float &freqfloat) { |
|
|
|
} |
|
|
|
|
|
|
|
if (freq_cnt != 0) { |
|
|
|
uint32_t freq_10x = ((uint32_t)(1.0 / (freq_cnt * 1.0 / (10 * 1000 * 1000))) * 10 + 0.5); //+0.5是因为c++ 小数强转成整数时是取整,而非四舍五入
|
|
|
|
freqfloat = freq_10x / 10.0; |
|
|
|
uint32_t freq_1000x = ((1.0 / (freq_cnt * 1.0 / (10 * 1000 * 1000))) * 1000 + 0.5); //+0.5是因为c++ 小数强转成整数时是取整,而非四舍五入
|
|
|
|
// ZLOGI(TAG, "freq_10x %f", freq_10x);
|
|
|
|
freqfloat = freq_1000x / 1000.0; |
|
|
|
} else { |
|
|
|
freqfloat = 0; |
|
|
|
} |
|
|
@ -759,6 +760,16 @@ xs_error_code_t Xsync::TTLOutputModule2_getFreqMultiplication(uint32_t &multi) { |
|
|
|
xs_error_code_t Xsync::TTLOutputModule3_getFreqMultiplication(uint32_t &multi) { REG_READ(reg::kreg_ttlout3_pllout_freq_multiplication_ctrl, multi); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule4_getFreqMultiplication(uint32_t &multi) { REG_READ(reg::kreg_ttlout4_pllout_freq_multiplication_ctrl, multi); } |
|
|
|
|
|
|
|
xs_error_code_t Xsync::TTLOutputModule1_readInFreq(float &freq) { return readfreq(reg::kreg_ttlout1_sig_in_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule2_readInFreq(float &freq) { return readfreq(reg::kreg_ttlout2_sig_in_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule3_readInFreq(float &freq) { return readfreq(reg::kreg_ttlout3_sig_in_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule4_readInFreq(float &freq) { return readfreq(reg::kreg_ttlout4_sig_in_freq_detect, freq); } |
|
|
|
|
|
|
|
xs_error_code_t Xsync::TTLOutputModule1_readOutFreq(float &freq) { return readfreq(reg::kreg_ttlout1_sig_out_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule2_readOutFreq(float &freq) { return readfreq(reg::kreg_ttlout2_sig_out_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule3_readOutFreq(float &freq) { return readfreq(reg::kreg_ttlout3_sig_out_freq_detect, freq); } |
|
|
|
xs_error_code_t Xsync::TTLOutputModule4_readOutFreq(float &freq) { return readfreq(reg::kreg_ttlout4_sig_out_freq_detect, freq); } |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* TimecodeInputModule * |
|
|
|
*******************************************************************************/ |
|
|
@ -825,8 +836,13 @@ xs_error_code_t Xsync::TimecodeOutputModule_getHeadphoneOutputLevel(int &level) |
|
|
|
xs_error_code_t Xsync::ExternalGenlock_detectFreq(float &freq) { return readfreq(reg::external_genlock_freq, freq); } |
|
|
|
xs_error_code_t Xsync::InternalGenlock_setFormat(GenlockFormat_t format) { return reg_write(reg::internal_genlock_format, format); } |
|
|
|
xs_error_code_t Xsync::InternalGenlock_getFormat(GenlockFormat_t &format) { REG_READ(reg::internal_genlock_format, format); } |
|
|
|
xs_error_code_t Xsync::SysGenlock_setSrc(SignalType_t sig) { return reg_write(reg::sys_genlock_source, sig); } |
|
|
|
xs_error_code_t Xsync::SysGenlock_getSrc(SignalType_t &sig) { REG_READ(reg::sys_genlock_source, sig); } |
|
|
|
|
|
|
|
xs_error_code_t Xsync::SysGenlock_setSrc(uint32_t source) { return reg_write(reg::sys_genlock_source, source); } |
|
|
|
xs_error_code_t Xsync::SysGenlock_getSrc(uint32_t &extern_or_internal) { |
|
|
|
REG_READ(reg::sys_genlock_source, extern_or_internal); |
|
|
|
return kxs_ec_success; |
|
|
|
} |
|
|
|
|
|
|
|
xs_error_code_t Xsync::SysGenlock_readFreq(float &freq) { return readfreq(reg::sys_genlock_freq, freq); } |
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|