1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 17:28:50 -05:00

LimeSDR input: antenna select fixes

This commit is contained in:
f4exb 2017-05-07 01:47:31 +02:00
parent ed9a74f0ff
commit df9e1d5900
7 changed files with 18 additions and 10 deletions

View File

@ -179,7 +179,7 @@ bool DeviceLimeSDR::SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float v
return true; return true;
} }
bool DeviceLimeSDR::setAntennaPath(lms_device_t *device, std::size_t chan, int path) bool DeviceLimeSDR::setRxAntennaPath(lms_device_t *device, std::size_t chan, int path)
{ {
// if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0) // if (LMS_WriteParam(device, LMS7param(MAC), chan+1) < 0)
// { // {
@ -245,7 +245,7 @@ bool DeviceLimeSDR::setAntennaPath(lms_device_t *device, std::size_t chan, int p
// //
// return true; // return true;
switch ((PathRFE) path) switch ((PathRxRFE) path)
{ {
case PATH_RFE_LNAH: case PATH_RFE_LNAH:
if (LMS_SetAntenna(device, LMS_CH_RX, chan, 1) < 0) if (LMS_SetAntenna(device, LMS_CH_RX, chan, 1) < 0)
@ -262,7 +262,7 @@ bool DeviceLimeSDR::setAntennaPath(lms_device_t *device, std::size_t chan, int p
} }
break; break;
case PATH_RFE_LNAW: case PATH_RFE_LNAW:
if (LMS_SetAntenna(device, LMS_CH_RX, chan, 2) < 0) if (LMS_SetAntenna(device, LMS_CH_RX, chan, 3) < 0)
{ {
fprintf(stderr, "DeviceLimeSDR::setAntennaPath: cannot set to LNAW\n"); fprintf(stderr, "DeviceLimeSDR::setAntennaPath: cannot set to LNAW\n");
return false; return false;

View File

@ -22,7 +22,7 @@
class DeviceLimeSDR class DeviceLimeSDR
{ {
public: public:
enum PathRFE enum PathRxRFE
{ {
PATH_RFE_NONE = 0, PATH_RFE_NONE = 0,
PATH_RFE_LNAH, PATH_RFE_LNAH,
@ -41,7 +41,7 @@ public:
/** set PGA gain Range: [0-32] (dB) **/ /** set PGA gain Range: [0-32] (dB) **/
static bool SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float value); static bool SetRBBPGA_dB(lms_device_t *device, std::size_t chan, float value);
/** Set antenna path **/ /** Set antenna path **/
static bool setAntennaPath(lms_device_t *device, std::size_t chan, int path); static bool setRxAntennaPath(lms_device_t *device, std::size_t chan, int path);
}; };
#endif /* DEVICES_LIMESDR_DEVICELIMESDR_H_ */ #endif /* DEVICES_LIMESDR_DEVICELIMESDR_H_ */

View File

@ -708,7 +708,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if (m_deviceShared.m_deviceParams->getDevice() != 0) if (m_deviceShared.m_deviceParams->getDevice() != 0)
{ {
if (DeviceLimeSDR::setAntennaPath(m_deviceShared.m_deviceParams->getDevice(), if (DeviceLimeSDR::setRxAntennaPath(m_deviceShared.m_deviceParams->getDevice(),
m_deviceShared.m_channel, m_deviceShared.m_channel,
m_settings.m_antennaPath)) m_settings.m_antennaPath))
{ {

View File

@ -264,6 +264,8 @@ void LimeSDRInputGUI::displaySettings()
ui->gain->setValue(m_settings.m_gain); ui->gain->setValue(m_settings.m_gain);
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain)); ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
ui->antenna->setCurrentIndex((int) m_settings.m_antennaPath);
setNCODisplay(); setNCODisplay();
} }

View File

@ -668,9 +668,12 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Antenna select: No: none, Lo: 700:900M, Hi: 2:2.6G, Wi: wideband, T1: Tx1 LB, T2: Tx2 LB</string>
</property>
<item> <item>
<property name="text"> <property name="text">
<string>Au</string> <string>No</string>
</property> </property>
</item> </item>
<item> <item>

View File

@ -54,6 +54,7 @@ QByteArray LimeSDRInputSettings::serialize() const
s.writeU32(10, m_gain); s.writeU32(10, m_gain);
s.writeBool(11, m_ncoEnable); s.writeBool(11, m_ncoEnable);
s.writeS32(12, m_ncoFrequency); s.writeS32(12, m_ncoFrequency);
s.writeS32(13, (int) m_antennaPath);
return s.final(); return s.final();
} }
@ -83,6 +84,8 @@ bool LimeSDRInputSettings::deserialize(const QByteArray& data)
d.readU32(10, &m_gain, 0); d.readU32(10, &m_gain, 0);
d.readBool(11, &m_ncoEnable, false); d.readBool(11, &m_ncoEnable, false);
d.readS32(12, &m_ncoFrequency, 0); d.readS32(12, &m_ncoFrequency, 0);
d.readS32(13, &intval, 0);
m_antennaPath = (PathRFE) intval;
return true; return true;
} }

View File

@ -126,9 +126,9 @@ Use this slider to adjust the global gain of the LNA, TIA and PGA. LimeSuite sof
Use this combo box to select the antenna input: Use this combo box to select the antenna input:
- **Au**: Auto: automatically selects optimal input depending on LO center frequency - **No**: None
- **Lo**: Selects the low frequency input - **Lo**: Selects the low frequency input (700 to 900 MHz nominally)
- **Hi**: Selects the high frequncy input - **Hi**: Selects the high frequncy input (2 to 2.6 GHz)
- **Wo**: Selects the wideband input - **Wo**: Selects the wideband input
- **T1**: Selects loopback from TX #1 (experimental) - **T1**: Selects loopback from TX #1 (experimental)
- **T1**: Selects loopback from TX #2 (experimental) - **T1**: Selects loopback from TX #2 (experimental)