summaryrefslogtreecommitdiff
path: root/gr-usrp2/src/usrp2_base.cc
diff options
context:
space:
mode:
authorjcorgan2008-12-27 21:09:26 +0000
committerjcorgan2008-12-27 21:09:26 +0000
commit297479844e3d9a6eea54fa69147e6a20c0bfc412 (patch)
tree786591a2e3c8aa77d8149630a6a5d00974585af7 /gr-usrp2/src/usrp2_base.cc
parenta09700c26a39ebddbeb56b5ecddedf50f0cc7ac4 (diff)
downloadgnuradio-297479844e3d9a6eea54fa69147e6a20c0bfc412.tar.gz
gnuradio-297479844e3d9a6eea54fa69147e6a20c0bfc412.tar.bz2
gnuradio-297479844e3d9a6eea54fa69147e6a20c0bfc412.zip
Implements USRP2 peek() command, allowing arbitrary reads from the internal
Wishbone bus. Minor fix for USRP2 sync_to_pps() (uses correct packet type.) Example: >>> from gnuradio import usrp2 >>> u = usrp2.source_32fc() >>> u.peek(0x1234, 4) # Read four bytes at offset 0x1234 (code) (185, 244, 253, 164) >>> The return value will be zero length upon error. The read address must be 32-bit aligned, and only the lower 16 bits are significant. The length must be an integral multiple of 4 bytes. There is currently a read limit of 176 bytes per read; to change requires some additional firmware changes to allocate a larger reply packet. WARNING: Trying to read from memory locations not serviced by RAM or by a Wishbone peripheral may result in a hang requiring a USRP2 power cycle. The USRP2 internal memory map is documented in usrp2/firmware/lib/memory_map.h. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10172 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-usrp2/src/usrp2_base.cc')
-rw-r--r--gr-usrp2/src/usrp2_base.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gr-usrp2/src/usrp2_base.cc b/gr-usrp2/src/usrp2_base.cc
index 8f80a0119..443d1faaa 100644
--- a/gr-usrp2/src/usrp2_base.cc
+++ b/gr-usrp2/src/usrp2_base.cc
@@ -67,6 +67,12 @@ usrp2_base::sync_to_pps()
return d_u2->sync_to_pps();
}
+std::vector<uint8_t>
+usrp2_base::peek(uint32_t addr, uint32_t len)
+{
+ return d_u2->peek(addr, len);
+}
+
bool
usrp2_base::start()
{