.base.used_pins = 0x00FF,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(400e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(500e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(45),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.022),
.base.is_quadrature = true,
.base.i_and_q_swapped = true,
.base.spectrum_inverted = false,
.base.used_pins = 0x00FF,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(800e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(1000e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(70),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.034),
.base.is_quadrature = true,
.base.i_and_q_swapped = true,
.base.spectrum_inverted = false,
.base.used_pins = 0x00FF,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(1150e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(1350e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(70),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.034),
.base.is_quadrature = true,
.base.i_and_q_swapped = true,
.base.spectrum_inverted = false,
.base.used_pins = 0x00FF,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(1600e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2000e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(70),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.034),
.base.is_quadrature = true,
.base.i_and_q_swapped = true,
.base.spectrum_inverted = false,
.base.used_pins = 0x00FF,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(2300e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(2700e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(70),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(0.034),
.base.is_quadrature = true,
.base.i_and_q_swapped = true,
.base.spectrum_inverted = false,
// test gain
dbb->set_gain(dbb,U2_DOUBLE_TO_FXPT_GAIN(45.0));
- printf("set the gain\n");
return true;
}
mdelay(10);
spi_transact(SPI_TXONLY,db->common.spi_mask,N,24,SPIF_PUSH_FALL);
- printf("A = %d, B = %d, N_DIV = %d\n",A, B, N_DIV);
+ //printf("A = %d, B = %d, N_DIV = %d\n",A, B, N_DIV);
*dc = (N_DIV * phdet_freq) / db->common.freq_mult;
return true;
}
int offset_q8 = (int)(1.2/3.3*4096*(1<<15));
int slope_q8 = (int)(-1.0/45.0*4096/3.3*256);
int dacword = ((slope_q8 * gain) + offset_q8)>>15;
- printf("DACWORD %d\n",dacword);
+ //printf("DACWORD %d\n",dacword);
lsdac_write_rx(1,dacword);
return true;
/*
.base.used_pins = 0x0000,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(50e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(860e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(95),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(1),
.base.is_quadrature = false,
.base.i_and_q_swapped = false,
.base.spectrum_inverted = false,
.base.used_pins = 0x0000,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(50e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(860e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(95),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(1),
.base.is_quadrature = false,
.base.i_and_q_swapped = false,
.base.spectrum_inverted = true,
.base.used_pins = 0x0000,
.base.freq_min = U2_DOUBLE_TO_FXPT_FREQ(50e6),
.base.freq_max = U2_DOUBLE_TO_FXPT_FREQ(860e6),
- //.base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(xxx),
- //.base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(xxx),
+ .base.gain_min = U2_DOUBLE_TO_FXPT_GAIN(0),
+ .base.gain_max = U2_DOUBLE_TO_FXPT_GAIN(95),
+ .base.gain_step_size = U2_DOUBLE_TO_FXPT_GAIN(1),
.base.is_quadrature = false,
.base.i_and_q_swapped = false,
.base.spectrum_inverted = true,
if(N_DIV > 32767)
return false;
- printf("N_DIV = %d, actual_freq = %d, actual_lo_freq = %d\n",
- N_DIV, u2_fxpt_freq_round_to_int(actual_freq),u2_fxpt_freq_round_to_int(actual_freq));
+ if (0)
+ printf("N_DIV = %d, actual_freq = %d, actual_lo_freq = %d\n",
+ N_DIV, u2_fxpt_freq_round_to_int(actual_freq),
+ u2_fxpt_freq_round_to_int(actual_lo_freq));
unsigned char buf[4];
buf[0] = (N_DIV>>8) & 0xff;
lsdac_write_rx(0,rfdac);
lsdac_write_rx(1,ifdac);
- printf("Setting gain %d, rf %d, if %d\n",gain,rfdac,ifdac);
+ if (0)
+ printf("Setting gain %d, rf %d, if %d\n",gain,rfdac,ifdac);
+
return true;
}