Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 6e7a2755bd78c9deedab199b86e675f3 > files > 7291

gnuradio-doc-3.2.2-9.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>GNU Radio 3.2.2 C++ API: usrp_prims.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GNU Radio 3.2.2 C++ API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('usrp__prims_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>usrp_prims.h</h1>  </div>
</div>
<div class="contents">
<a href="usrp__prims_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- c++ -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright 2003,2004,2006 Free Software Foundation, Inc.</span>
<a name="l00004"></a>00004 <span class="comment"> * </span>
<a name="l00005"></a>00005 <span class="comment"> * This file is part of GNU Radio</span>
<a name="l00006"></a>00006 <span class="comment"> * </span>
<a name="l00007"></a>00007 <span class="comment"> * GNU Radio is free software; you can redistribute it and/or modify</span>
<a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; either version 3, or (at your option)</span>
<a name="l00010"></a>00010 <span class="comment"> * any later version.</span>
<a name="l00011"></a>00011 <span class="comment"> * </span>
<a name="l00012"></a>00012 <span class="comment"> * GNU Radio is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00015"></a>00015 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> * </span>
<a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00018"></a>00018 <span class="comment"> * along with GNU Radio; see the file COPYING.  If not, write to</span>
<a name="l00019"></a>00019 <span class="comment"> * the Free Software Foundation, Inc., 51 Franklin Street,</span>
<a name="l00020"></a>00020 <span class="comment"> * Boston, MA 02110-1301, USA.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="comment">/*</span>
<a name="l00024"></a>00024 <span class="comment"> * Low level primitives for directly messing with USRP hardware.</span>
<a name="l00025"></a>00025 <span class="comment"> *</span>
<a name="l00026"></a>00026 <span class="comment"> * If you&#39;re trying to use the USRP, you&#39;ll probably want to take a look</span>
<a name="l00027"></a>00027 <span class="comment"> * at the usrp_rx and usrp_tx classes.  They hide a bunch of low level details</span>
<a name="l00028"></a>00028 <span class="comment"> * and provide high performance streaming i/o.</span>
<a name="l00029"></a>00029 <span class="comment"> *</span>
<a name="l00030"></a>00030 <span class="comment"> * This interface is built on top of libusb, which allegedly works under</span>
<a name="l00031"></a>00031 <span class="comment"> * Linux, *BSD and Mac OS/X.  http://libusb.sourceforge.net</span>
<a name="l00032"></a>00032 <span class="comment"> */</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="preprocessor">#ifndef _USRP_PRIMS_H_</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define _USRP_PRIMS_H_</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="usrp__slots_8h.html">usrp_slots.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a><a class="code" href="usrp__prims_8h.html#a4e6a3c8a3c4dd58a08fb5bc38eb4b538">00040</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="usrp__prims_8h.html#a4e6a3c8a3c4dd58a08fb5bc38eb4b538">USRP_HASH_SIZE</a> = 16;
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2">00042</a> <span class="keyword">enum</span> <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2">usrp_load_status_t</a> { <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2a019b1cd5a5ade04e9a2a046da8838351">ULS_ERROR</a> = 0, <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2ad0f9fbcbeef4760445bc66d20339957a">ULS_OK</a>, <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2a6d74db49055b241d7d030a8dbaf46f42">ULS_ALREADY_LOADED</a> };
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keyword">struct </span><a class="code" href="structusb__dev__handle.html">usb_dev_handle</a>;
<a name="l00045"></a>00045 <span class="keyword">struct </span>usb_device;
<a name="l00046"></a>00046 <span class="comment"></span>
<a name="l00047"></a>00047 <span class="comment">/*!</span>
<a name="l00048"></a>00048 <span class="comment"> * \brief initialize libusb; probe busses and devices.</span>
<a name="l00049"></a>00049 <span class="comment"> * Safe to call more than once.</span>
<a name="l00050"></a>00050 <span class="comment"> */</span>
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="usrp__prims_8h.html#a34bf0b9e6677081c770f7c7969d05fca" title="initialize libusb; probe busses and devices. Safe to call more than once.">usrp_one_time_init</a> ();
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="comment">/*</span>
<a name="l00054"></a>00054 <span class="comment"> * force a rescan of the buses and devices</span>
<a name="l00055"></a>00055 <span class="comment"> */</span>
<a name="l00056"></a>00056 <span class="keywordtype">void</span> <a class="code" href="usrp__prims_8h.html#a0b59ad04d1bc23fb5a070983f60572bf">usrp_rescan</a> ();
<a name="l00057"></a>00057 <span class="comment"></span>
<a name="l00058"></a>00058 <span class="comment">/*!</span>
<a name="l00059"></a>00059 <span class="comment"> * \brief locate Nth (zero based) USRP device in system.</span>
<a name="l00060"></a>00060 <span class="comment"> * Return pointer or 0 if not found.</span>
<a name="l00061"></a>00061 <span class="comment"> *</span>
<a name="l00062"></a>00062 <span class="comment"> * The following kinds of devices are considered USRPs:</span>
<a name="l00063"></a>00063 <span class="comment"> *</span>
<a name="l00064"></a>00064 <span class="comment"> *   unconfigured USRP (no firwmare loaded)</span>
<a name="l00065"></a>00065 <span class="comment"> *   configured USRP (firmware loaded)</span>
<a name="l00066"></a>00066 <span class="comment"> *   unconfigured Cypress FX2 (only if fx2_ok_p is true)</span>
<a name="l00067"></a>00067 <span class="comment"> */</span>
<a name="l00068"></a>00068 <span class="keyword">struct </span>usb_device *<a class="code" href="usrp__prims_8h.html#a5f4ddf077833e2dda26ddf46f8a01755" title="locate Nth (zero based) USRP device in system. Return pointer or 0 if not found.">usrp_find_device</a> (<span class="keywordtype">int</span> nth, <span class="keywordtype">bool</span> fx2_ok_p = <span class="keyword">false</span>);
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#aedc2226804603c60644a73f5240b087a">usrp_usrp_p</a> (<span class="keyword">struct</span> usb_device *q);                <span class="comment">//&lt; is this a USRP</span>
<a name="l00071"></a>00071 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#af6620dfc8ff08e628ddcbdb192d5f3b6">usrp_usrp0_p</a> (<span class="keyword">struct</span> usb_device *q);               <span class="comment">//&lt; is this a USRP Rev 0</span>
<a name="l00072"></a>00072 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a82027a9d7e8a3d22e724f8f13bd2ea7d">usrp_usrp1_p</a> (<span class="keyword">struct</span> usb_device *q);               <span class="comment">//&lt; is this a USRP Rev 1</span>
<a name="l00073"></a>00073 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a902ed2f94823c5ae4a6bcc0a2eb46e08">usrp_usrp2_p</a> (<span class="keyword">struct</span> usb_device *q);               <span class="comment">//&lt; is this a USRP Rev 2</span>
<a name="l00074"></a>00074 <span class="keywordtype">int</span>  <a class="code" href="usrp__prims_8h.html#adc30b4f5e06daaa3f8f2d8a7d9ef25ce">usrp_hw_rev</a> (<span class="keyword">struct</span> usb_device *q);                <span class="comment">//&lt; return h/w rev code</span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a1554cb7ff7a6645cbbe28ca1fa7c5726">usrp_fx2_p</a> (<span class="keyword">struct</span> usb_device *q);                 <span class="comment">//&lt; is this an unconfigured Cypress FX2</span>
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a3a9909a96abb29b9d16fa7a0e9e9bfea">usrp_unconfigured_usrp_p</a> (<span class="keyword">struct</span> usb_device *q);   <span class="comment">//&lt; some kind of unconfigured USRP</span>
<a name="l00079"></a>00079 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#acd505b0dabbc020f3f8b66f3d4de7e62">usrp_configured_usrp_p</a> (<span class="keyword">struct</span> usb_device *q);     <span class="comment">//&lt; some kind of configured USRP</span>
<a name="l00080"></a>00080 <span class="comment"></span>
<a name="l00081"></a>00081 <span class="comment">/*!</span>
<a name="l00082"></a>00082 <span class="comment"> * \brief given a usb_device return an instance of the appropriate usb_dev_handle</span>
<a name="l00083"></a>00083 <span class="comment"> *</span>
<a name="l00084"></a>00084 <span class="comment"> * These routines claim the specified interface and select the</span>
<a name="l00085"></a>00085 <span class="comment"> * correct alternate interface.  (USB nomenclature is totally screwed!)</span>
<a name="l00086"></a>00086 <span class="comment"> *</span>
<a name="l00087"></a>00087 <span class="comment"> * If interface can&#39;t be opened, or is already claimed by some other</span>
<a name="l00088"></a>00088 <span class="comment"> * process, 0 is returned.</span>
<a name="l00089"></a>00089 <span class="comment"> */</span>
<a name="l00090"></a>00090 <span class="keyword">struct </span><a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *<a class="code" href="usrp__prims_8h.html#a0c183bae342bd9bf9bf2430c9577c094" title="given a usb_device return an instance of the appropriate usb_dev_handle">usrp_open_cmd_interface</a> (<span class="keyword">struct</span> usb_device *dev);
<a name="l00091"></a>00091 <span class="keyword">struct </span><a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *<a class="code" href="usrp__prims_8h.html#a35cc66a67633c39b946c7122fe2b69e5">usrp_open_rx_interface</a> (<span class="keyword">struct</span> usb_device *dev);
<a name="l00092"></a>00092 <span class="keyword">struct </span><a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *<a class="code" href="usrp__prims_8h.html#aba4a59c411f144cb751216caf2582998">usrp_open_tx_interface</a> (<span class="keyword">struct</span> usb_device *dev);
<a name="l00093"></a>00093 <span class="comment"></span>
<a name="l00094"></a>00094 <span class="comment">/*!</span>
<a name="l00095"></a>00095 <span class="comment"> * \brief close interface.</span>
<a name="l00096"></a>00096 <span class="comment"> */</span>
<a name="l00097"></a>00097 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a03b956e192fcb7018729277439b65ae9" title="close interface.">usrp_close_interface</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh);
<a name="l00098"></a>00098 <span class="comment"></span>
<a name="l00099"></a>00099 <span class="comment">/*!</span>
<a name="l00100"></a>00100 <span class="comment"> * \brief load intel hex format file into USRP/Cypress FX2 (8051).</span>
<a name="l00101"></a>00101 <span class="comment"> *</span>
<a name="l00102"></a>00102 <span class="comment"> * The filename extension is typically *.ihx</span>
<a name="l00103"></a>00103 <span class="comment"> *</span>
<a name="l00104"></a>00104 <span class="comment"> * Note that loading firmware may cause the device to renumerate.  I.e.,</span>
<a name="l00105"></a>00105 <span class="comment"> * change its configuration, invalidating the current device handle.</span>
<a name="l00106"></a>00106 <span class="comment"> */</span>
<a name="l00107"></a>00107 
<a name="l00108"></a>00108 <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2">usrp_load_status_t</a> 
<a name="l00109"></a>00109 <a class="code" href="usrp__prims_8h.html#a0b125a63e9a2495bba503ad3eaefa654" title="load intel hex format file into USRP/Cypress FX2 (8051).">usrp_load_firmware</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">bool</span> force);
<a name="l00110"></a>00110 <span class="comment"></span>
<a name="l00111"></a>00111 <span class="comment">/*!</span>
<a name="l00112"></a>00112 <span class="comment"> * \brief load intel hex format file into USRP FX2 (8051).</span>
<a name="l00113"></a>00113 <span class="comment"> *</span>
<a name="l00114"></a>00114 <span class="comment"> * The filename extension is typically *.ihx</span>
<a name="l00115"></a>00115 <span class="comment"> *</span>
<a name="l00116"></a>00116 <span class="comment"> * Note that loading firmware may cause the device to renumerate.  I.e.,</span>
<a name="l00117"></a>00117 <span class="comment"> * change its configuration, invalidating the current device handle.</span>
<a name="l00118"></a>00118 <span class="comment"> * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second</span>
<a name="l00119"></a>00119 <span class="comment"> * then rescans the busses and devices.</span>
<a name="l00120"></a>00120 <span class="comment"> */</span>
<a name="l00121"></a>00121 <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2">usrp_load_status_t</a>
<a name="l00122"></a>00122 <a class="code" href="usrp__prims_8h.html#ab4f474ffd6d2b9abd11204e9f44c8c6d" title="load intel hex format file into USRP FX2 (8051).">usrp_load_firmware_nth</a> (<span class="keywordtype">int</span> nth, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">bool</span> force);
<a name="l00123"></a>00123 <span class="comment"></span>
<a name="l00124"></a>00124 <span class="comment">/*!</span>
<a name="l00125"></a>00125 <span class="comment"> * \brief load fpga configuration bitstream</span>
<a name="l00126"></a>00126 <span class="comment"> */</span>
<a name="l00127"></a>00127 <a class="code" href="usrp__prims_8h.html#a516dbfb08540b8fabe7c291fd1942ba2">usrp_load_status_t</a>
<a name="l00128"></a>00128 <a class="code" href="usrp__prims_8h.html#aa66fe132dab301b35a2e81a709f9f4d1" title="load fpga configuration bitstream">usrp_load_fpga</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">bool</span> force);
<a name="l00129"></a>00129 <span class="comment"></span>
<a name="l00130"></a>00130 <span class="comment">/*!</span>
<a name="l00131"></a>00131 <span class="comment"> * \brief load the regular firmware and fpga bitstream in the Nth USRP.</span>
<a name="l00132"></a>00132 <span class="comment"> *</span>
<a name="l00133"></a>00133 <span class="comment"> * This is the normal starting point...</span>
<a name="l00134"></a>00134 <span class="comment"> */</span>
<a name="l00135"></a>00135 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a98e9c03663ff8c1528b5c5d604508a25" title="load the regular firmware and fpga bitstream in the Nth USRP.">usrp_load_standard_bits</a> (<span class="keywordtype">int</span> nth, <span class="keywordtype">bool</span> force,
<a name="l00136"></a>00136                               <span class="keyword">const</span> std::string fpga_filename = <span class="stringliteral">&quot;&quot;</span>,
<a name="l00137"></a>00137                               <span class="keyword">const</span> std::string firmware_filename = <span class="stringliteral">&quot;&quot;</span>);
<a name="l00138"></a>00138 <span class="comment"></span>
<a name="l00139"></a>00139 <span class="comment">/*!</span>
<a name="l00140"></a>00140 <span class="comment"> * \brief copy the given \p hash into the USRP hash slot \p which.</span>
<a name="l00141"></a>00141 <span class="comment"> * The usrp implements two hash slots, 0 and 1.</span>
<a name="l00142"></a>00142 <span class="comment"> */</span>
<a name="l00143"></a>00143 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a21ec6c2858964deb139394423edf6fed" title="copy the given hash into the USRP hash slot which. The usrp implements two hash slots, 0 and 1.">usrp_set_hash</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> which,
<a name="l00144"></a>00144                     <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> hash[<a class="code" href="usrp__prims_8h.html#a4e6a3c8a3c4dd58a08fb5bc38eb4b538">USRP_HASH_SIZE</a>]);
<a name="l00145"></a>00145 <span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment">/*!</span>
<a name="l00147"></a>00147 <span class="comment"> * \brief retrieve the \p hash from the USRP hash slot \p which.</span>
<a name="l00148"></a>00148 <span class="comment"> * The usrp implements two hash slots, 0 and 1.</span>
<a name="l00149"></a>00149 <span class="comment"> */</span>
<a name="l00150"></a>00150 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#ac60533d143c7e700e84b88447e33a7e6" title="retrieve the hash from the USRP hash slot which. The usrp implements two hash slots, 0 and 1.">usrp_get_hash</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> which,
<a name="l00151"></a>00151                     <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> hash[<a class="code" href="usrp__prims_8h.html#a4e6a3c8a3c4dd58a08fb5bc38eb4b538">USRP_HASH_SIZE</a>]);
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a594272ce7fd5772ce97d39132046dc2e">usrp_write_fpga_reg</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> reg, <span class="keywordtype">int</span> value);
<a name="l00154"></a>00154 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a04fd747c11bf31290229b9784194c759">usrp_read_fpga_reg</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> reg, <span class="keywordtype">int</span> *value);
<a name="l00155"></a>00155 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a26055c0ba2f391df9afadff5d33eeff5">usrp_set_fpga_reset</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> on);
<a name="l00156"></a>00156 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a1f5fe54493a31469dbe5a383546d7f14">usrp_set_fpga_tx_enable</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> on);
<a name="l00157"></a>00157 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#afeed1d956ed81e64cfd43be74c085e32">usrp_set_fpga_rx_enable</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> on);
<a name="l00158"></a>00158 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a9ce004216efdb0ea45cd97ccc2f70e5b">usrp_set_fpga_tx_reset</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> on);
<a name="l00159"></a>00159 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#ac684986a93d10687ba66ab50c1cfc5ae">usrp_set_fpga_rx_reset</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> on);
<a name="l00160"></a>00160 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a7aef51654dcfcbefb308c5369a1047fe">usrp_set_led</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> which, <span class="keywordtype">bool</span> on);
<a name="l00161"></a>00161 
<a name="l00162"></a>00162 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a03f17343426a963b66ce52334dddb419">usrp_check_rx_overrun</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> *overrun_p);
<a name="l00163"></a>00163 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#ae3d83d88d9d9086c610f3c51f17b0258">usrp_check_tx_underrun</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">bool</span> *underrun_p);
<a name="l00164"></a>00164 
<a name="l00165"></a>00165 <span class="comment">// i2c_read and i2c_write are limited to a maximum len of 64 bytes.</span>
<a name="l00166"></a>00166 
<a name="l00167"></a>00167 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a58113840bb3dd954a146b438b7268910">usrp_i2c_write</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> i2c_addr,
<a name="l00168"></a>00168                      <span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00169"></a>00169 
<a name="l00170"></a>00170 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a8df1287cdc58b2c8559a4eae28f57abc">usrp_i2c_read</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> i2c_addr,
<a name="l00171"></a>00171                     <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 <span class="comment">// spi_read and spi_write are limited to a maximum of 64 bytes</span>
<a name="l00174"></a>00174 <span class="comment">// See usrp_spi_defs.h for more info</span>
<a name="l00175"></a>00175 
<a name="l00176"></a>00176 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a859332ca0fa91446e279fa72e78fcb50">usrp_spi_write</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00177"></a>00177                      <span class="keywordtype">int</span> optional_header, <span class="keywordtype">int</span> enables, <span class="keywordtype">int</span> format,
<a name="l00178"></a>00178                      <span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#aa374fd88849aedd1054321c761a82115">usrp_spi_read</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00181"></a>00181                      <span class="keywordtype">int</span> optional_header, <span class="keywordtype">int</span> enables, <span class="keywordtype">int</span> format,
<a name="l00182"></a>00182                      <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#ab3cfffe0284bd7b4c512e86cb961204b">usrp_9862_write</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00186"></a>00186                       <span class="keywordtype">int</span> which_codec,                  <span class="comment">// [0,  1]</span>
<a name="l00187"></a>00187                       <span class="keywordtype">int</span> regno,                        <span class="comment">// [0, 63]</span>
<a name="l00188"></a>00188                       <span class="keywordtype">int</span> value);                       <span class="comment">// [0, 255]     </span>
<a name="l00189"></a>00189 
<a name="l00190"></a>00190 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#aa8b15e769f9eb583bd18b0e432c1011f">usrp_9862_read</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00191"></a>00191                      <span class="keywordtype">int</span> which_codec,                   <span class="comment">// [0,  1]</span>
<a name="l00192"></a>00192                      <span class="keywordtype">int</span> regno,                         <span class="comment">// [0, 63]</span>
<a name="l00193"></a>00193                      <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *value);             <span class="comment">// [0, 255]</span>
<a name="l00194"></a>00194 <span class="comment"></span>
<a name="l00195"></a>00195 <span class="comment">/*!</span>
<a name="l00196"></a>00196 <span class="comment"> * \brief Write multiple 9862 regs at once.</span>
<a name="l00197"></a>00197 <span class="comment"> *</span>
<a name="l00198"></a>00198 <span class="comment"> * \p buf contains alternating register_number, register_value pairs.</span>
<a name="l00199"></a>00199 <span class="comment"> * \p len must be even and is the length of buf in bytes.</span>
<a name="l00200"></a>00200 <span class="comment"> */</span>
<a name="l00201"></a>00201 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#adbac5b8c1e8649ae31d12c81c4b5af88" title="Write multiple 9862 regs at once.">usrp_9862_write_many</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> which_codec,
<a name="l00202"></a>00202                            <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00203"></a>00203                            
<a name="l00204"></a>00204 <span class="comment"></span>
<a name="l00205"></a>00205 <span class="comment">/*!</span>
<a name="l00206"></a>00206 <span class="comment"> * \brief write specified regs to all 9862&#39;s in the system</span>
<a name="l00207"></a>00207 <span class="comment"> */</span>
<a name="l00208"></a>00208 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#aac1c325a03646703c3432aa66ed886dc" title="write specified regs to all 9862&amp;#39;s in the system">usrp_9862_write_many_all</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00209"></a>00209                                <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00210"></a>00210                            
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="comment">// Write 24LC024 / 24LC025 EEPROM on motherboard or daughterboard.</span>
<a name="l00213"></a>00213 <span class="comment">// Which EEPROM is determined by i2c_addr.  See i2c_addr.h</span>
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a4fd9df062b42febbed042f6141f2acd3">usrp_eeprom_write</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> i2c_addr,
<a name="l00216"></a>00216                         <span class="keywordtype">int</span> eeprom_offset, <span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00217"></a>00217 
<a name="l00218"></a>00218 
<a name="l00219"></a>00219 <span class="comment">// Read 24LC024 / 24LC025 EEPROM on motherboard or daughterboard.</span>
<a name="l00220"></a>00220 <span class="comment">// Which EEPROM is determined by i2c_addr.  See i2c_addr.h</span>
<a name="l00221"></a>00221 
<a name="l00222"></a>00222 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#acdccdf882fcaf299eabb1db79f1f748a">usrp_eeprom_read</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> i2c_addr,
<a name="l00223"></a>00223                        <span class="keywordtype">int</span> eeprom_offset, <span class="keywordtype">void</span> *buf, <span class="keywordtype">int</span> len);
<a name="l00224"></a>00224 
<a name="l00225"></a>00225 
<a name="l00226"></a>00226 <span class="comment">// Slot specific i/o routines</span>
<a name="l00227"></a>00227 <span class="comment"></span>
<a name="l00228"></a>00228 <span class="comment">/*!</span>
<a name="l00229"></a>00229 <span class="comment"> * \brief write to the specified aux dac.</span>
<a name="l00230"></a>00230 <span class="comment"> *</span>
<a name="l00231"></a>00231 <span class="comment"> * \p slot: which Tx or Rx slot to write.</span>
<a name="l00232"></a>00232 <span class="comment"> *    N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC&#39;s</span>
<a name="l00233"></a>00233 <span class="comment"> *          SLOT_TX_B and SLOT_RX_B share the same AUX DAC&#39;s</span>
<a name="l00234"></a>00234 <span class="comment"> *</span>
<a name="l00235"></a>00235 <span class="comment"> * \p which_dac: [0,3]  RX slots must use only 0 and 1.</span>
<a name="l00236"></a>00236 <span class="comment"> *                      TX slots must use only 2 and 3.</span>
<a name="l00237"></a>00237 <span class="comment"> *</span>
<a name="l00238"></a>00238 <span class="comment"> * AUX DAC 3 is really the 9862 sigma delta output.</span>
<a name="l00239"></a>00239 <span class="comment"> *</span>
<a name="l00240"></a>00240 <span class="comment"> * \p value to write to aux dac.  All dacs take straight</span>
<a name="l00241"></a>00241 <span class="comment"> * binary values.  Although dacs 0, 1 and 2 are 8-bit and dac 3 is 12-bit,</span>
<a name="l00242"></a>00242 <span class="comment"> * the interface is in terms of 12-bit values [0,4095]</span>
<a name="l00243"></a>00243 <span class="comment"> */</span>
<a name="l00244"></a>00244 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a2af0eaf4a23d2eb57a865421a95ccb77" title="write to the specified aux dac.">usrp_write_aux_dac</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *uhd, <span class="keywordtype">int</span> slot,
<a name="l00245"></a>00245                          <span class="keywordtype">int</span> which_dac, <span class="keywordtype">int</span> value);
<a name="l00246"></a>00246 <span class="comment"></span>
<a name="l00247"></a>00247 <span class="comment">/*!</span>
<a name="l00248"></a>00248 <span class="comment"> * \brief Read the specified aux adc</span>
<a name="l00249"></a>00249 <span class="comment"> *</span>
<a name="l00250"></a>00250 <span class="comment"> * \p slot: which Tx or Rx slot to read aux dac</span>
<a name="l00251"></a>00251 <span class="comment"> * \p which_adc: [0,1]  which of the two adcs to read</span>
<a name="l00252"></a>00252 <span class="comment"> * \p *value: return value, 12-bit straight binary.</span>
<a name="l00253"></a>00253 <span class="comment"> */</span>
<a name="l00254"></a>00254 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#ace8b533ca2d368ad003e17b61166ae8b" title="Read the specified aux adc.">usrp_read_aux_adc</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> slot,
<a name="l00255"></a>00255                         <span class="keywordtype">int</span> which_adc, <span class="keywordtype">int</span> *value);
<a name="l00256"></a>00256 
<a name="l00257"></a>00257 <span class="comment"></span>
<a name="l00258"></a>00258 <span class="comment">/*!</span>
<a name="l00259"></a>00259 <span class="comment"> * \brief usrp daughterboard id to name mapping</span>
<a name="l00260"></a>00260 <span class="comment"> */</span>
<a name="l00261"></a>00261 <span class="keyword">const</span> std::string <a class="code" href="usrp__prims_8h.html#ab860189f7bc6e0531912c03aa52d3dbe" title="usrp daughterboard id to name mapping">usrp_dbid_to_string</a> (<span class="keywordtype">int</span> dbid);
<a name="l00262"></a>00262 
<a name="l00263"></a>00263 
<a name="l00264"></a><a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319">00264</a> <span class="keyword">enum</span> <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319">usrp_dbeeprom_status_t</a> { <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319a4511bf9a250718650f856819ec07132a">UDBE_OK</a>, <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319ad40e7b8cbbd8ffbac091eaf5a3d5f800">UDBE_BAD_SLOT</a>, <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319a52291acb7ae7f8b6ca4cc43a2a0c1444">UDBE_NO_EEPROM</a>, <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319a065b565a87b98cdb159a36fdbbbdc4a3">UDBE_INVALID_EEPROM</a> };
<a name="l00265"></a>00265 
<a name="l00266"></a><a class="code" href="structusrp__dboard__eeprom.html">00266</a> <span class="keyword">struct </span><a class="code" href="structusrp__dboard__eeprom.html">usrp_dboard_eeprom</a> {
<a name="l00267"></a><a class="code" href="structusrp__dboard__eeprom.html#abb084f9acf442d8b439c8e13479d0618">00267</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>        <a class="code" href="structusrp__dboard__eeprom.html#abb084f9acf442d8b439c8e13479d0618">id</a>;             <span class="comment">// d&#39;board identifier code</span>
<a name="l00268"></a><a class="code" href="structusrp__dboard__eeprom.html#a644392481788aabc0226af00d4371124">00268</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>        <a class="code" href="structusrp__dboard__eeprom.html#a644392481788aabc0226af00d4371124">oe</a>;             <span class="comment">// fpga output enables:</span>
<a name="l00269"></a>00269                                         <span class="comment">//   If bit set, i/o pin is an output from FPGA.</span>
<a name="l00270"></a><a class="code" href="structusrp__dboard__eeprom.html#a55332624480ff6273a9910686286fab1">00270</a>   <span class="keywordtype">short</span>                 <a class="code" href="structusrp__dboard__eeprom.html#a55332624480ff6273a9910686286fab1">offset</a>[2];      <span class="comment">// ADC/DAC offset correction</span>
<a name="l00271"></a>00271 };
<a name="l00272"></a>00272 <span class="comment"></span>
<a name="l00273"></a>00273 <span class="comment">/*!</span>
<a name="l00274"></a>00274 <span class="comment"> * \brief Read and return parsed daughterboard eeprom</span>
<a name="l00275"></a>00275 <span class="comment"> */</span>
<a name="l00276"></a>00276 <a class="code" href="usrp__prims_8h.html#aff88561a43ab4eb5a12f1f6b6e1a5319">usrp_dbeeprom_status_t</a>
<a name="l00277"></a>00277 <a class="code" href="usrp__prims_8h.html#a5a545da40c2e491440921355d5ed5e22" title="Read and return parsed daughterboard eeprom.">usrp_read_dboard_eeprom</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh,
<a name="l00278"></a>00278                          <span class="keywordtype">int</span> slot_id, <a class="code" href="structusrp__dboard__eeprom.html">usrp_dboard_eeprom</a> *eeprom);
<a name="l00279"></a>00279 <span class="comment"></span>
<a name="l00280"></a>00280 <span class="comment">/*!</span>
<a name="l00281"></a>00281 <span class="comment"> * \brief write ADC/DAC offset calibration constants to d&#39;board eeprom</span>
<a name="l00282"></a>00282 <span class="comment"> */</span>
<a name="l00283"></a>00283 <span class="keywordtype">bool</span> <a class="code" href="usrp__prims_8h.html#a2a2e12e2d2da61eade7c2676aeb4fcb0" title="write ADC/DAC offset calibration constants to d&amp;#39;board eeprom">usrp_write_dboard_offsets</a> (<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh, <span class="keywordtype">int</span> slot_id,
<a name="l00284"></a>00284                                 <span class="keywordtype">short</span> offset0, <span class="keywordtype">short</span> offset1);
<a name="l00285"></a>00285 <span class="comment"></span>
<a name="l00286"></a>00286 <span class="comment">/*!</span>
<a name="l00287"></a>00287 <span class="comment"> * \brief return a usrp&#39;s serial number.</span>
<a name="l00288"></a>00288 <span class="comment"> *</span>
<a name="l00289"></a>00289 <span class="comment"> * Note that this only works on a configured usrp.</span>
<a name="l00290"></a>00290 <span class="comment"> * \returns non-zero length string iff successful.</span>
<a name="l00291"></a>00291 <span class="comment"> */</span>
<a name="l00292"></a>00292 std::string <a class="code" href="usrp__prims_8h.html#aea153aa1e930e2fc6731e65c49288769" title="return a usrp&amp;#39;s serial number.">usrp_serial_number</a>(<span class="keyword">struct</span> <a class="code" href="structusb__dev__handle.html">usb_dev_handle</a> *udh);
<a name="l00293"></a>00293 
<a name="l00294"></a>00294 <span class="preprocessor">#endif </span><span class="comment">/* _USRP_PRIMS_H_ */</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="usrp__prims_8h.html">usrp_prims.h</a>      </li>
      <li class="footer">Generated on Thu Feb 17 2011 for GNU Radio 3.2.2 C++ API by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>