Commit 473328a0 authored by Florian Kaltenberger's avatar Florian Kaltenberger Committed by Robert Schmidt

Add support for USRP X400

parent a981291b
......@@ -92,6 +92,8 @@ typedef enum {
USRP_X300_DEV,
/*!\brief device is USRP N300/N310*/
USRP_N300_DEV,
/*!\brief device is USRP X400/X410*/
USRP_X400_DEV,
/*!\brief device is BLADE RF*/
BLADERF_DEV,
/*!\brief device is LMSSDR (SoDeRa)*/
......
......@@ -273,6 +273,7 @@ static int sync_to_gps(openair0_device *device) {
static int trx_usrp_start(openair0_device *device) {
usrp_state_t *s = (usrp_state_t *)device->priv;
if (device->type != USRP_X400_DEV) {
// setup GPIO for TDD, GPIO(4) = ATR_RX
//set data direction register (DDR) to output
s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff);
......@@ -285,6 +286,7 @@ static int trx_usrp_start(openair0_device *device) {
s->usrp->set_gpio_attr("FP0", "ATR_XX", (1<<5), 0x7f);
// set the output pins to 1
s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80);
}
s->wait_for_first_pps = 1;
s->rx_count = 0;
......@@ -847,7 +849,7 @@ rx_gain_calib_table_t calib_table_x310[] = {
{-1,0}
};
/*! \brief USRPB210 RX calibration table */
/*! \brief USRPn3xf RX calibration table */
rx_gain_calib_table_t calib_table_n310[] = {
{3500000000.0,0.0},
{2660000000.0,0.0},
......@@ -857,6 +859,16 @@ rx_gain_calib_table_t calib_table_n310[] = {
{-1,0}
};
/*! \brief Empty RX calibration table */
rx_gain_calib_table_t calib_table_none[] = {
{3500000000.0,0.0},
{2660000000.0,0.0},
{2300000000.0,0.0},
{1880000000.0,0.0},
{816000000.0, 0.0},
{-1,0}
};
/*! \brief Set RX gain offset
* \param openair0_cfg RF frontend parameters set by application
......@@ -1011,7 +1023,6 @@ extern "C" {
device->type=USRP_N300_DEV;
usrp_master_clock = 122.88e6;
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
//args += ", send_buff_size=33554432";
}
if (device_adds[0].get("type") == "x300") {
......@@ -1025,6 +1036,13 @@ extern "C" {
LOG_W(HW,"Can't set kernel parameters for X3xx\n");
}
if (device_adds[0].get("type") == "x4xx") {
printf("Found USRP x400\n");
device->type = USRP_X400_DEV;
usrp_master_clock = 245.76e6;
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
}
s->usrp = uhd::usrp::multi_usrp::make(args);
if (args.find("clock_source")==std::string::npos) {
......@@ -1103,8 +1121,13 @@ extern "C" {
std::cerr << "-- Using calibration table: calib_table_n310" << std::endl;
}
if (device->type == USRP_X400_DEV) {
openair0_cfg[0].rx_gain_calib_table = calib_table_none;
std::cerr << "-- Using calibration table: calib_table_none" << std::endl;
}
if (device->type==USRP_N300_DEV || device->type==USRP_X300_DEV) {
if (device->type==USRP_N300_DEV || device->type==USRP_X300_DEV || device->type==USRP_X400_DEV) {
LOG_I(HW,"%s() sample_rate:%u\n", __FUNCTION__, (int)openair0_cfg[0].sample_rate);
switch ((int)openair0_cfg[0].sample_rate) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment