Merge branch 'calib-LimeSDR' of https://gitlab.eurecom.fr/oai/openairinterface5g into calib-LimeSDR
Conflicts: targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
This commit is contained in:
@@ -131,11 +131,17 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
|
||||
int ret;
|
||||
|
||||
LMS_SetGaindB(lms_device, LMS_CH_TX, 0, openair0_cfg[0].tx_gain[0]);
|
||||
LMS_SetGaindB(lms_device, LMS_CH_RX, 0, openair0_cfg[0].rx_gain[0]);
|
||||
if (openair0_cfg->rx_gain[0] > 70+openair0_cfg->rx_gain_offset[0]) {
|
||||
printf("[LMS] Reduce RX Gain 0 by %f dB\n",openair0_cfg->rx_gain[0]-openair0_cfg->rx_gain_offset[0]-70);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
LMS_SetNormalizedGain(lms_device, LMS_CH_TX, 0, .2);//openair0_cfg->tx_gain[0]);
|
||||
LMS_SetGaindB(lms_device, LMS_CH_RX, 0, openair0_cfg->rx_gain[0]-openair0_cfg->rx_gain_offset[0]);
|
||||
|
||||
return(0);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/*! \brief Start LMSSDR
|
||||
@@ -196,9 +202,9 @@ int trx_lms_start(openair0_device *device){
|
||||
}
|
||||
printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6);
|
||||
|
||||
printf("Override antenna settings to: RX1_H, TXA_2");
|
||||
LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1);
|
||||
LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2);
|
||||
//printf("Override antenna settings to: RX1_H, TXA_2");
|
||||
//LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1);
|
||||
//LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2);
|
||||
|
||||
|
||||
|
||||
@@ -276,12 +282,21 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in
|
||||
|
||||
// 31 = 19 dB => 105 dB total gain @ 2.6 GHz
|
||||
/*! \brief calibration table for LMSSDR */
|
||||
// V1.2 board
|
||||
rx_gain_calib_table_t calib_table_lmssdr_1v2[] = {
|
||||
{3500000000.0,44.0}, // on L PAD
|
||||
{2660000000.0,55.0}, // on L PAD
|
||||
{2300000000.0,54.0}, // on L PAD
|
||||
{1880000000.0,54.0}, // on L PAD
|
||||
{816000000.0,79.0}, // on W PAD
|
||||
{-1,0}};
|
||||
// V1.4 board
|
||||
rx_gain_calib_table_t calib_table_lmssdr[] = {
|
||||
{3500000000.0,97.0}, // on H PAD
|
||||
{2660000000.0,110.0}, // on H PAD
|
||||
{2300000000.0,106.0}, // on H PAD
|
||||
{1880000000.0,106.0}, // on H PAD
|
||||
{816000000.0,116.0}, // on W PAD
|
||||
{3500000000.0,44.0}, // on H PAD
|
||||
{2660000000.0,55.0}, // on H PAD
|
||||
{2300000000.0,54.0}, // on H PAD
|
||||
{1880000000.0,54.0}, // on H PAD
|
||||
{816000000.0,79.0}, // on L PAD
|
||||
{-1,0}};
|
||||
|
||||
|
||||
@@ -328,7 +343,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
|
||||
|
||||
device->type=LMSSDR_DEV;
|
||||
printf("LMSSDR: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
|
||||
|
||||
openair0_cfg[0].iq_txshift = 0;
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000:
|
||||
// from usrp_time_offset
|
||||
@@ -340,8 +355,8 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
|
||||
case 15360000:
|
||||
openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 70;
|
||||
openair0_cfg[0].tx_bw = 10e6;
|
||||
openair0_cfg[0].rx_bw = 10e6;
|
||||
openair0_cfg[0].tx_bw = 15.36e6;
|
||||
openair0_cfg[0].rx_bw = 15.36e6;
|
||||
break;
|
||||
case 7680000:
|
||||
openair0_cfg[0].samples_per_packet = 1024;
|
||||
|
||||
Reference in New Issue
Block a user