LimeSDR: use CMIX_BYP_TXTSP to control NCO on/off

This commit is contained in:
f4exb 2017-09-30 18:29:53 +02:00
parent 229027c345
commit 7c558b15f5
1 changed files with 346 additions and 325 deletions

View File

@ -56,20 +56,41 @@ bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size
return false;
}
return true;
}
else
if (dir_tx)
{
if (LMS_SetNCOIndex(device, dir_tx, chan, LMS_NCO_VAL_COUNT, true) < 0)
{
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable NCO\n");
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_TXTSP),0) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot enable Tx NCO\n");
return false;
}
}
else
{
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: NCO disabled\n");
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_RXTSP),0) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot enable Rx NCO\n");
return false;
}
}
return true;
}
else
{
if (dir_tx)
{
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_TXTSP),1) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable Tx NCO\n");
return false;
}
}
else
{
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_RXTSP),1) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable Rx NCO\n");
return false;
}
}
return true;
}
}