From 297479844e3d9a6eea54fa69147e6a20c0bfc412 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Sat, 27 Dec 2008 21:09:26 +0000 Subject: 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 --- gr-usrp2/src/usrp2_base.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gr-usrp2/src/usrp2_base.cc') 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 +usrp2_base::peek(uint32_t addr, uint32_t len) +{ + return d_u2->peek(addr, len); +} + bool usrp2_base::start() { -- cgit