aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/io_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-28 16:35:22 -0700
committerJosh Blum <josh@joshknows.com>2010-04-28 16:35:22 -0700
commita7c230cb1f97b452da027d5baa71891f2066d430 (patch)
tree2b6188648a5ba9091459108f93b5aef3a6a87096 /host/lib/usrp/usrp2/io_impl.cpp
parent04dae4bf6b11b5aad383f95be6a77863a7c2f6ec (diff)
downloaduhd-a7c230cb1f97b452da027d5baa71891f2066d430.tar.gz
uhd-a7c230cb1f97b452da027d5baa71891f2066d430.tar.bz2
uhd-a7c230cb1f97b452da027d5baa71891f2066d430.zip
Added reload flag to the stream cmd.
This reloads the last command to handle continuous streaming in hardware. Moved rx control register setup and stream command issuing to the host.
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 367a1d9fb..a2e99c824 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -16,6 +16,7 @@
//
#include "usrp2_impl.hpp"
+#include "usrp2_regs.hpp"
#include <uhd/transport/convert_types.hpp>
#include <boost/format.hpp>
#include <boost/asio.hpp> //htonl and ntohl
@@ -39,14 +40,23 @@ void usrp2_impl::io_init(void){
_rx_copy_buff = asio::buffer("", 0);
//send a small data packet so the usrp2 knows the udp source port
- //and the maximum number of lines (32 bit words) per packet
managed_send_buffer::sptr send_buff = _data_transport->get_send_buff();
- boost::uint32_t data[2] = {
- htonl(USRP2_INVALID_VRT_HEADER),
- htonl(_max_rx_samples_per_packet)
- };
- memcpy(send_buff->cast<void*>(), data, sizeof(data));
+ boost::uint32_t data = htonl(USRP2_INVALID_VRT_HEADER);
+ memcpy(send_buff->cast<void*>(), &data, sizeof(data));
send_buff->done(sizeof(data));
+
+ //setup RX DSP regs
+ _iface->poke32(FR_RX_CTRL_NSAMPS_PER_PKT, _max_rx_samples_per_packet);
+ _iface->poke32(FR_RX_CTRL_NCHANNELS, 1);
+ _iface->poke32(FR_RX_CTRL_CLEAR_OVERRUN, 1); //reset
+ _iface->poke32(FR_RX_CTRL_VRT_HEADER, 0
+ | (0x1 << 28) //if data with stream id
+ | (0x1 << 26) //has trailer
+ | (0x3 << 22) //integer time other
+ | (0x1 << 20) //fractional time sample count
+ );
+ _iface->poke32(FR_RX_CTRL_VRT_STREAM_ID, 0);
+ _iface->poke32(FR_RX_CTRL_VRT_TRAILER, 0);
}
/***********************************************************************