Revision 543a6364 host/lib/usrp/usrp1/usrp1_impl.cpp
| b/host/lib/usrp/usrp1/usrp1_impl.cpp | ||
|---|---|---|
| 30 | 30 |
#include <boost/assign/list_of.hpp> |
| 31 | 31 |
#include <boost/filesystem.hpp> |
| 32 | 32 |
#include <boost/thread/thread.hpp> |
| 33 |
#include <boost/lexical_cast.hpp> |
|
| 33 | 34 |
#include <iostream> |
| 34 | 35 |
|
| 35 | 36 |
using namespace uhd; |
| ... | ... | |
| 107 | 108 |
/*********************************************************************** |
| 108 | 109 |
* Make |
| 109 | 110 |
**********************************************************************/ |
| 111 |
template<typename output_type> static output_type cast_from_dev_addr( |
|
| 112 |
const device_addr_t &device_addr, |
|
| 113 |
const std::string &key, |
|
| 114 |
output_type def_val |
|
| 115 |
){
|
|
| 116 |
return (device_addr.has_key(key))? |
|
| 117 |
boost::lexical_cast<output_type>(device_addr[key]) : def_val; |
|
| 118 |
} |
|
| 119 |
|
|
| 110 | 120 |
static device::sptr usrp1_make(const device_addr_t &device_addr) |
| 111 | 121 |
{
|
| 112 | 122 |
//extract the FPGA path for the USRP1 |
| ... | ... | |
| 130 | 140 |
usrp_ctrl = usrp_ctrl::make(ctrl_transport); |
| 131 | 141 |
usrp_ctrl->usrp_load_fpga(usrp1_fpga_image); |
| 132 | 142 |
|
| 133 |
data_transport = usb_zero_copy::make(handle, // identifier |
|
| 134 |
6, // IN endpoint |
|
| 135 |
2, // OUT endpoint |
|
| 136 |
2 * (1 << 20), // buffer size |
|
| 137 |
16384); // transfer size |
|
| 143 |
data_transport = usb_zero_copy::make( |
|
| 144 |
handle, // identifier |
|
| 145 |
6, // IN endpoint |
|
| 146 |
2, // OUT endpoint |
|
| 147 |
size_t(cast_from_dev_addr<double>(device_addr, "recv_xfer_size", 0)), |
|
| 148 |
size_t(cast_from_dev_addr<double>(device_addr, "recv_num_xfers", 0)), |
|
| 149 |
size_t(cast_from_dev_addr<double>(device_addr, "send_xfer_size", 0)), |
|
| 150 |
size_t(cast_from_dev_addr<double>(device_addr, "send_num_xfers", 0)) |
|
| 151 |
); |
|
| 138 | 152 |
break; |
| 139 | 153 |
} |
| 140 | 154 |
} |
| ... | ... | |
| 173 | 187 |
//initialize the mboard |
| 174 | 188 |
mboard_init(); |
| 175 | 189 |
|
| 176 |
//initialize the dboards
|
|
| 190 |
//initialize the dboards |
|
| 177 | 191 |
dboard_init(); |
| 178 | 192 |
|
| 179 | 193 |
//initialize the dsps |
Also available in: Unified diff