1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

Added support for HackRF

This commit is contained in:
f4exb 2015-09-27 11:27:02 +02:00
parent 2b092bf660
commit 7cc0d95054
3 changed files with 24 additions and 5 deletions

View File

@ -255,7 +255,7 @@ void HackRFGui::on_fcPos_currentIndexChanged(int index)
void HackRFGui::on_lna_valueChanged(int value) void HackRFGui::on_lna_valueChanged(int value)
{ {
if ((value < 0) || (value > 14)) if ((value < 0) || (value > 40))
return; return;
ui->lnaGainText->setText(tr("%1dB").arg(value)); ui->lnaGainText->setText(tr("%1dB").arg(value));
@ -265,7 +265,7 @@ void HackRFGui::on_lna_valueChanged(int value)
void HackRFGui::on_vga_valueChanged(int value) void HackRFGui::on_vga_valueChanged(int value)
{ {
if ((value < 0) || (value > 15)) if ((value < 0) || (value > 62))
return; return;
ui->vgaText->setText(tr("%1dB").arg(value)); ui->vgaText->setText(tr("%1dB").arg(value));
@ -281,7 +281,7 @@ void HackRFGui::updateHardware()
m_updateTimer.stop(); m_updateTimer.stop();
} }
unsigned int HackRFSampleRates::m_rates_k[] = {2400, 3200, 4800, 6400, 9680, 12800, 19200}; unsigned int HackRFSampleRates::m_rates_k[] = {2500, 3200, 5000, 6400, 10000, 12800, 19200};
unsigned int HackRFSampleRates::getRate(unsigned int rate_index) unsigned int HackRFSampleRates::getRate(unsigned int rate_index)
{ {

View File

@ -420,7 +420,7 @@ bool HackRFInput::applySettings(const Settings& settings, bool force)
if(rc != HACKRF_SUCCESS) if(rc != HACKRF_SUCCESS)
{ {
qDebug("HackRFInput::applySettings: airspy_set_rf_bias failed: %s", hackrf_error_name(rc)); qDebug("HackRFInput::applySettings: hackrf_set_antenna_enable failed: %s", hackrf_error_name(rc));
} }
else else
{ {
@ -429,6 +429,25 @@ bool HackRFInput::applySettings(const Settings& settings, bool force)
} }
} }
if ((m_settings.m_lnaExt != settings.m_lnaExt) || force)
{
m_settings.m_lnaExt = settings.m_lnaExt;
if (m_dev != 0)
{
rc = (hackrf_error) hackrf_set_amp_enable(m_dev, (m_settings.m_lnaExt ? 1 : 0));
if(rc != HACKRF_SUCCESS)
{
qDebug("HackRFInput::applySettings: hackrf_set_amp_enable failed: %s", hackrf_error_name(rc));
}
else
{
qDebug() << "HackRFInput:applySettings: extra LNA set to " << m_settings.m_lnaExt;
}
}
}
if (forwardChange) if (forwardChange)
{ {
int sampleRate = devSampleRate/(1<<m_settings.m_log2Decim); int sampleRate = devSampleRate/(1<<m_settings.m_log2Decim);

View File

@ -24,7 +24,7 @@
#include "dsp/samplefifo.h" #include "dsp/samplefifo.h"
#include "dsp/decimators.h" #include "dsp/decimators.h"
#define HACKRF_BLOCKSIZE (1<<17) #define HACKRF_BLOCKSIZE (1<<16)
class HackRFThread : public QThread { class HackRFThread : public QThread {
Q_OBJECT Q_OBJECT