Hi,
In the same process, I’m trying to use API calls from both LimeSuite LMS_ and lime:LMS7002M – @joshblum @IgnasJ is this possible? The reason why is that there are no functions to set the amplifiers gain levels individually (LNA, TIA, PGA) in the LMS API, but there are in in the LMS7002M functions. And there are functions in the LMS APi, (e.g. SetAntenna and GetAntenna), that don’t exist in the LMS7002M one.
After I set up the device using the examples approach and then instantiate a lime:LMS7002M object, setting any gain level doesn’t change the gain as reported by LMS::GetGaindB and observing streaming results.
lms_device_t* device = NULL;
LMS_Open(&device, list[0], NULL);
uint16_t lna = 13; //15 = Gmax, 13 = Gmax -2
uint16_t pga = 0;
uint16_t tia = 1; //3= Gmax, 1 = Gmax-12
unsigned int gain;
LMS_GetGaindB(device,false,0,&gain);
printf("gain 1 %d (dB)\n",gain);
//the below calls work, but are commented out to test the LMS7002 calls.
//int result = LMS_WriteParam(device,LMS7param(G_LNA_RFE),lna);
//result = LMS_WriteParam(device,LMS7param(G_TIA_RFE),tia);
//result = LMS_WriteParam(device,LMS7param(G_PGA_RBB),pga);
//LMS_GetGaindB(device,false,0,&gain);
//try the other API
lime::LMS7002M lms;
lms.SetRFELNA_dB(27);
lms.SetRBBPGA_dB(-12);
lms.SetRFETIA_dB(0);
lms.UploadAll();
float pga_dba = lms.GetRBBPGA_dB();
printf("LMS7002M GetRBBPGA_dB %.1f\n",pga_dba);
printf("LMS7002M GetRFELNA_db %.1f\n",lms.GetRFELNA_dB());
LMS_GetGaindB(device,false,0,&gain);
printf("gain 2 %d (dB)\n",gain);
Output:
gain 1 70 (dB)
LMS7002M GetRBBPGA_dB -12.0
LMS7002M GetRFELNA_db 27.0
gain 2 70 (dB)
Clearly those did not work, at least with how the device is being driven.
Thanks.