mirror of
https://github.com/nqrduck/LimeDriver.git
synced 2024-11-25 19:42:29 +00:00
Add RX/TX matching network configuration options
Introduced configuration options for RX and TX matching networks in the LimeDriver, enabling manual specification of the reception and transmission paths. This change also includes default logic to maintain previous behavior when new options are unset. Additionally, bumped the version to 0.3.0 to reflect new feature addition. This enhancement provides flexibility for advanced users to optimize signal chain characteristics based on specific requirements.
This commit is contained in:
parent
038ed21c6b
commit
2c7731e1d2
2 changed files with 30 additions and 24 deletions
|
@ -194,6 +194,8 @@ std::vector<Config2HDFattr_t> getHDFAttributes(LimeConfig_t &LimeCfg) {
|
||||||
std::vector<Config2HDFattr_t> HDFattr = {
|
std::vector<Config2HDFattr_t> HDFattr = {
|
||||||
{"sra", "SampleRate [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.srate, 1},
|
{"sra", "SampleRate [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.srate, 1},
|
||||||
{"chn", "Channel", H5::PredType::NATIVE_INT, &LimeCfg.channel, 1},
|
{"chn", "Channel", H5::PredType::NATIVE_INT, &LimeCfg.channel, 1},
|
||||||
|
{"rmt", "RX Matching", H5::PredType::NATIVE_INT, &LimeCfg.RX_matching, 1},
|
||||||
|
{"tmt", "TX Matching", H5::PredType::NATIVE_INT, &LimeCfg.TX_matching, 1},
|
||||||
{"lof", "LO Frequency [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.frq, 1},
|
{"lof", "LO Frequency [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.frq, 1},
|
||||||
{"rlp", "RX LowPass BW [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.RX_LPF,
|
{"rlp", "RX LowPass BW [Hz]", H5::PredType::IEEE_F32LE, &LimeCfg.RX_LPF,
|
||||||
1},
|
1},
|
||||||
|
@ -400,6 +402,8 @@ LimeConfig_t initializeLimeConfig(int Npulses) {
|
||||||
|
|
||||||
LimeCfg.srate = 30.72e6; // sample rate of the IF DAC/ADC
|
LimeCfg.srate = 30.72e6; // sample rate of the IF DAC/ADC
|
||||||
LimeCfg.channel = 0; // channel to use,
|
LimeCfg.channel = 0; // channel to use,
|
||||||
|
LimeCfg.RX_matching = 0; // RX matching network - 0 to use previous logic
|
||||||
|
LimeCfg.TX_matching = 0; // TX matching network - 0 to use previous logic
|
||||||
LimeCfg.frq = 50e6; // LO carrier frequency
|
LimeCfg.frq = 50e6; // LO carrier frequency
|
||||||
LimeCfg.RX_gain = 20; // total gain of the receiver
|
LimeCfg.RX_gain = 20; // total gain of the receiver
|
||||||
LimeCfg.TX_gain = 30; // total gain of the transmitter
|
LimeCfg.TX_gain = 30; // total gain of the transmitter
|
||||||
|
@ -1025,23 +1029,24 @@ DC_Q << endl;
|
||||||
for (int i = 0; i < num_antennas; i++)
|
for (int i = 0; i < num_antennas; i++)
|
||||||
cout << i << ": " << antenna_list[i] << endl;
|
cout << i << ": " << antenna_list[i] << endl;
|
||||||
// get and print antenna index and name
|
// get and print antenna index and name
|
||||||
int antenna_index;
|
int rx_path;
|
||||||
if ((antenna_index = LMS_GetAntenna(device, LMS_CH_RX, LimeCfg.channel)) <
|
|
||||||
0)
|
if (LimeCfg.RX_matching == 0) {
|
||||||
error();
|
rx_path = LMS_PATH_LNAL;
|
||||||
cout << "Automatically selected RX LNA: " << antenna_index << ": "
|
} else {
|
||||||
<< antenna_list[antenna_index] << endl;
|
rx_path = LimeCfg.RX_matching;
|
||||||
|
}
|
||||||
|
|
||||||
// manually select antenna
|
// manually select antenna
|
||||||
if (LMS_SetAntenna(device, LMS_CH_RX, LimeCfg.channel, LMS_PATH_LNAL) != 0)
|
if (LMS_SetAntenna(device, LMS_CH_RX, LimeCfg.channel, rx_path) != 0)
|
||||||
error();
|
error();
|
||||||
|
|
||||||
// get and print antenna index and name
|
// get and print antenna index and name
|
||||||
if ((antenna_index = LMS_GetAntenna(device, LMS_CH_RX, LimeCfg.channel)) <
|
if ((rx_path = LMS_GetAntenna(device, LMS_CH_RX, LimeCfg.channel)) <
|
||||||
0)
|
0)
|
||||||
error();
|
error();
|
||||||
cout << "Manually selected RX LNA: " << antenna_index << ": "
|
cout << "Manually selected RX LNA: " << rx_path << ": "
|
||||||
<< antenna_list[antenna_index] << endl;
|
<< antenna_list[rx_path] << endl;
|
||||||
|
|
||||||
// select antenna port
|
// select antenna port
|
||||||
// Alternatively, NULL can be passed to LMS_GetAntennaList() to obtain
|
// Alternatively, NULL can be passed to LMS_GetAntennaList() to obtain
|
||||||
|
@ -1054,27 +1059,26 @@ DC_Q << endl;
|
||||||
for (int i = 0; i < num_antennas; i++)
|
for (int i = 0; i < num_antennas; i++)
|
||||||
cout << i << ": " << antenna_list[i] << endl;
|
cout << i << ": " << antenna_list[i] << endl;
|
||||||
|
|
||||||
// get and print print antenna index and name
|
// Select TX pathway
|
||||||
if ((antenna_index = LMS_GetAntenna(device, LMS_CH_TX, LimeCfg.channel)) <
|
int tx_path;
|
||||||
0)
|
|
||||||
error();
|
|
||||||
cout << "Automatically selected TX pathway: " << antenna_index << ": "
|
|
||||||
<< antenna_list[antenna_index] << endl;
|
|
||||||
|
|
||||||
// manually select antenna
|
if (LimeCfg.TX_matching == 0) {
|
||||||
int tx_path = LMS_PATH_TX1;
|
tx_path = LMS_PATH_TX1;
|
||||||
if (LimeCfg.frq > 1500e6)
|
if (LimeCfg.frq > 1500e6)
|
||||||
tx_path = LMS_PATH_TX2;
|
tx_path = LMS_PATH_TX2;
|
||||||
|
} else {
|
||||||
|
tx_path = LimeCfg.TX_matching;
|
||||||
|
}
|
||||||
|
|
||||||
if (LMS_SetAntenna(device, LMS_CH_TX, LimeCfg.channel, tx_path) != 0)
|
if (LMS_SetAntenna(device, LMS_CH_TX, LimeCfg.channel, tx_path) != 0)
|
||||||
error();
|
error();
|
||||||
|
|
||||||
// get and print print antenna index and name
|
// get and print print antenna index and name
|
||||||
if ((antenna_index = LMS_GetAntenna(device, LMS_CH_TX, LimeCfg.channel)) <
|
if ((tx_path = LMS_GetAntenna(device, LMS_CH_TX, LimeCfg.channel)) <
|
||||||
0)
|
0)
|
||||||
error();
|
error();
|
||||||
cout << "Manually selected TX pathway: " << antenna_index << ": "
|
cout << "Manually selected TX pathway: " << tx_path << ": "
|
||||||
<< antenna_list[antenna_index] << endl;
|
<< antenna_list[tx_path] << endl;
|
||||||
|
|
||||||
// Set sample rate, w/o oversampling, so that we can remove the invsinc
|
// Set sample rate, w/o oversampling, so that we can remove the invsinc
|
||||||
// filter
|
// filter
|
||||||
|
|
|
@ -24,12 +24,14 @@
|
||||||
#include <direct.h> // _mkdir
|
#include <direct.h> // _mkdir
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VERSION "0.2.0"
|
#define VERSION "0.3.0"
|
||||||
|
|
||||||
struct LimeConfig_t {
|
struct LimeConfig_t {
|
||||||
|
|
||||||
float srate;
|
float srate;
|
||||||
int channel;
|
int channel;
|
||||||
|
int RX_matching;
|
||||||
|
int TX_matching;
|
||||||
float frq;
|
float frq;
|
||||||
float frq_set;
|
float frq_set;
|
||||||
float RX_LPF;
|
float RX_LPF;
|
||||||
|
|
Loading…
Reference in a new issue