|
|
@@ -727,7 +727,11 @@ double lmx_lower_bond_set (double freq, double f_pd) {
|
|
|
}
|
|
|
|
|
|
double lmx_get_freq(double freq) {
|
|
|
-
|
|
|
+
|
|
|
+ if (freq < 100e3 || freq> 45e9) {
|
|
|
+ printf("Frequency range is 100 kHz to 45 GHz\n");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
if (freq >= 100e3 && freq <= 1000e6) {
|
|
|
double f_max2870 = 4e9;
|
|
|
double lmx_freq = f_max2870-freq; // 4 GHz - freq
|
|
|
@@ -744,7 +748,7 @@ double lmx_get_freq(double freq) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-int lmx_freq_set(void *bar1, double freq,double f_pd) {
|
|
|
+int lmx_freq_set(void *bar1, double lmx_freq,double f_pd) {
|
|
|
// Set the 4 Mosi mode
|
|
|
usleep(1);
|
|
|
uint32_t cfg_reg = get_cfg_reg();
|
|
|
@@ -757,11 +761,6 @@ int lmx_freq_set(void *bar1, double freq,double f_pd) {
|
|
|
usleep(1);
|
|
|
SET_REGISTER_PARAM(cfg_reg, CFG_REG_RST_FOR_FPGA_BITM, CFG_REG_RST_FOR_FPGA_BITP, CFG_REG_RST_FOR_FPGA_OFF);
|
|
|
*spi_mode = cfg_reg;
|
|
|
- if (freq < 100e3 || freq > 45e9) {
|
|
|
- printf("Frequency range is 100 kHz to 45 GHz\n");
|
|
|
- return -1;
|
|
|
- }
|
|
|
- double lmx_freq = lmx_get_freq(freq);
|
|
|
// if the frequency is in the main band - 7.5 GHz to 15 GHz
|
|
|
if (lmx_freq >= 7.5e9 && lmx_freq <= 15e9) {
|
|
|
// lmx_freq_set_main_band(bar1, freq, f_pd);
|
|
|
@@ -775,9 +774,7 @@ int lmx_freq_set(void *bar1, double freq,double f_pd) {
|
|
|
usleep(1);
|
|
|
SET_REGISTER_PARAM(cfg_reg,CFG_REG_SPI_MODE_BITM,CFG_REG_SPI_MODE_BITP, CFG_REG_SPI_MODE_1MOSI);
|
|
|
*spi_mode = cfg_reg;
|
|
|
- // Switch the keys
|
|
|
usleep(1);
|
|
|
- key_switch(bar1, freq,lmx_freq);
|
|
|
set_cfg_reg(cfg_reg);
|
|
|
return 0;
|
|
|
}
|