OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_14/usb_fpga_2_14/trunk

Subversion Repositories usb_fpga_2_14

[/] [usb_fpga_2_14/] [trunk/] [docs/] [c/] [html/] [ztex_8h.html] - Rev 2

Compare with Previous | Blame | View Log

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>ZTEX core API for C: ztex.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ZTEX core API for C
   </div>
   <div id="projectbrief">Host software API for ZTEX FPGA Boards for C</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('ztex_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>
 
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>
 
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ztex.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
 
<p>The Core API for C.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;sys/types.h&gt;</code><br />
<code>#include &lt;libusb-1.0/libusb.h&gt;</code><br />
</div>
<p><a href="ztex_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structztex__device__info.html">ztex_device_info</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A structure with information about the device.  <a href="structztex__device__info.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8ee4c93eef23fbc8044347a7ce351cf5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a8ee4c93eef23fbc8044347a7ce351cf5">ztex_scan_bus</a> (char *sbuf, int sbuflen, libusb_device **devs, int op, int id_vendor, int id_product, int busnum, int devnum, char *sn, char *ps)</td></tr>
<tr class="memdesc:a8ee4c93eef23fbc8044347a7ce351cf5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scans the bus and performs certain operations on it.  <a href="#a8ee4c93eef23fbc8044347a7ce351cf5">More...</a><br /></td></tr>
<tr class="separator:a8ee4c93eef23fbc8044347a7ce351cf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28cef9d1e168b782b03579c4a59505d3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a28cef9d1e168b782b03579c4a59505d3">ztex_get_device_info</a> (libusb_device_handle *handle, <a class="el" href="structztex__device__info.html">ztex_device_info</a> *info)</td></tr>
<tr class="memdesc:a28cef9d1e168b782b03579c4a59505d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get device information.  <a href="#a28cef9d1e168b782b03579c4a59505d3">More...</a><br /></td></tr>
<tr class="separator:a28cef9d1e168b782b03579c4a59505d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa64c1cefed076a0f48cafa1882593c79"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#aa64c1cefed076a0f48cafa1882593c79">ztex_print_device_info</a> (char *sbuf, int sbuflen, const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *info)</td></tr>
<tr class="memdesc:aa64c1cefed076a0f48cafa1882593c79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print device info to a string.  <a href="#aa64c1cefed076a0f48cafa1882593c79">More...</a><br /></td></tr>
<tr class="separator:aa64c1cefed076a0f48cafa1882593c79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae679e66864c90211a3d8b4670a64d497"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#ae679e66864c90211a3d8b4670a64d497">ztex_get_fpga_config</a> (libusb_device_handle *handle)</td></tr>
<tr class="memdesc:ae679e66864c90211a3d8b4670a64d497"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get device information.  <a href="#ae679e66864c90211a3d8b4670a64d497">More...</a><br /></td></tr>
<tr class="separator:ae679e66864c90211a3d8b4670a64d497"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74c89f5aa7e3754d88f1dc95846b5cbe"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a74c89f5aa7e3754d88f1dc95846b5cbe">ztex_find_bitstream</a> (const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *info, const char *path, const char *name)</td></tr>
<tr class="memdesc:a74c89f5aa7e3754d88f1dc95846b5cbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Search for bitstream at standard locations.  <a href="#a74c89f5aa7e3754d88f1dc95846b5cbe">More...</a><br /></td></tr>
<tr class="separator:a74c89f5aa7e3754d88f1dc95846b5cbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1861aa844f2ad3cacf37bbde0f9d6bcb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a1861aa844f2ad3cacf37bbde0f9d6bcb">ztex_upload_bitstream</a> (char *sbuf, int sbuflen, libusb_device_handle *handle, const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *info, FILE *fd, int bs)</td></tr>
<tr class="memdesc:a1861aa844f2ad3cacf37bbde0f9d6bcb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Upload bitstream to volatile memory.  <a href="#a1861aa844f2ad3cacf37bbde0f9d6bcb">More...</a><br /></td></tr>
<tr class="separator:a1861aa844f2ad3cacf37bbde0f9d6bcb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f0de67505fd5f34a15dc14cecf9d44f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a4f0de67505fd5f34a15dc14cecf9d44f">ztex_default_gpio_ctl</a> (libusb_device_handle *handle, int mask, int value)</td></tr>
<tr class="memdesc:a4f0de67505fd5f34a15dc14cecf9d44f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads and modifies the 4 GPIO pins.  <a href="#a4f0de67505fd5f34a15dc14cecf9d44f">More...</a><br /></td></tr>
<tr class="separator:a4f0de67505fd5f34a15dc14cecf9d44f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42bfe7c8c78b72c747531c370003edb9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a42bfe7c8c78b72c747531c370003edb9">ztex_default_reset</a> (libusb_device_handle *handle, int leave)</td></tr>
<tr class="memdesc:a42bfe7c8c78b72c747531c370003edb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assert the reset signal.  <a href="#a42bfe7c8c78b72c747531c370003edb9">More...</a><br /></td></tr>
<tr class="separator:a42bfe7c8c78b72c747531c370003edb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21cdf044d5aa86885512f5ff9ae5bc3a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a21cdf044d5aa86885512f5ff9ae5bc3a">ztex_default_lsi_set1</a> (libusb_device_handle *handle, uint8_t addr, uint32_t val)</td></tr>
<tr class="memdesc:a21cdf044d5aa86885512f5ff9ae5bc3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to the low speed interface of default firmwares.  <a href="#a21cdf044d5aa86885512f5ff9ae5bc3a">More...</a><br /></td></tr>
<tr class="separator:a21cdf044d5aa86885512f5ff9ae5bc3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e23422eb1fedebf51335b4c4d199b8c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a3e23422eb1fedebf51335b4c4d199b8c">ztex_default_lsi_set2</a> (libusb_device_handle *handle, uint8_t addr, const uint32_t *val, int length)</td></tr>
<tr class="memdesc:a3e23422eb1fedebf51335b4c4d199b8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to the low speed interface of default firmwares.  <a href="#a3e23422eb1fedebf51335b4c4d199b8c">More...</a><br /></td></tr>
<tr class="separator:a3e23422eb1fedebf51335b4c4d199b8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ee53b6af6ce8d7d468c52f9dd1fac6c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a7ee53b6af6ce8d7d468c52f9dd1fac6c">ztex_default_lsi_set3</a> (libusb_device_handle *handle, const uint8_t *addr, const uint32_t *val, int length)</td></tr>
<tr class="memdesc:a7ee53b6af6ce8d7d468c52f9dd1fac6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data to the low speed interface of default firmwares.  <a href="#a7ee53b6af6ce8d7d468c52f9dd1fac6c">More...</a><br /></td></tr>
<tr class="separator:a7ee53b6af6ce8d7d468c52f9dd1fac6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d3f8a60e0a4d07d363d9ef7200f7ca2"><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#a7d3f8a60e0a4d07d363d9ef7200f7ca2">ztex_default_lsi_get1</a> (libusb_device_handle *handle, uint8_t addr)</td></tr>
<tr class="memdesc:a7d3f8a60e0a4d07d363d9ef7200f7ca2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data from the low speed interface of default firmwares.  <a href="#a7d3f8a60e0a4d07d363d9ef7200f7ca2">More...</a><br /></td></tr>
<tr class="separator:a7d3f8a60e0a4d07d363d9ef7200f7ca2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae9072dbf0828d9782abdd87114e1119"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ztex_8h.html#aae9072dbf0828d9782abdd87114e1119">ztex_default_lsi_get2</a> (libusb_device_handle *handle, uint8_t addr, uint32_t *val, int length)</td></tr>
<tr class="memdesc:aae9072dbf0828d9782abdd87114e1119"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data from the low speed interface of default firmwares.  <a href="#aae9072dbf0828d9782abdd87114e1119">More...</a><br /></td></tr>
<tr class="separator:aae9072dbf0828d9782abdd87114e1119"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The Core API for C. </p>
<p>An Introduction can be found in the <a href="index.html">Mainpage</a> </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a4f0de67505fd5f34a15dc14cecf9d44f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_gpio_ctl </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Reads and modifies the 4 GPIO pins. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">mask</td><td>Bitmask for the pins which are modified. 1 means a bit is set. Only the lowest 4 bits are significant. </td></tr>
    <tr><td class="paramname">value</td><td>The bit values which are to be set. Only the lowest 4 bits are significant. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>current values of the GPIO's or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a7d3f8a60e0a4d07d363d9ef7200f7ca2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int64_t ztex_default_lsi_get1 </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Read data from the low speed interface of default firmwares. </p>
<p>It's implemented as a SRAM-like interface and is typically used used to read/write configuration data, debug information or other things. This function reads one register. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">addr</td><td>The address. Valid values are 0 to 255. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The unsigned register value (32 Bits) or &lt;0 if an error occurred. </dd></dl>
 
</div>
</div>
<a class="anchor" id="aae9072dbf0828d9782abdd87114e1119"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_lsi_get2 </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Read data from the low speed interface of default firmwares. </p>
<p>It's implemented as a SRAM-like interface and is typically used used to read/write configuration data, debug information or other things. This function reads a sequential set of registers. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">addr</td><td>The start address. Valid values are 0 to 255. Address is wrapped from 255 to 0. </td></tr>
    <tr><td class="paramname">val</td><td>The array where to store the register data with a word width of 32 Bit. </td></tr>
    <tr><td class="paramname">length</td><td>The amount of register to be read. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a21cdf044d5aa86885512f5ff9ae5bc3a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_lsi_set1 </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Send data to the low speed interface of default firmwares. </p>
<p>It's implemented as a SRAM-like interface and is typically used used to read/write configuration data, debug information or other things. This function sets one register. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">addr</td><td>The address. Valid values are 0 to 255. </td></tr>
    <tr><td class="paramname">val</td><td>The register data with a width of 32 bit. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a3e23422eb1fedebf51335b4c4d199b8c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_lsi_set2 </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Send data to the low speed interface of default firmwares. </p>
<p>It's implemented as a SRAM-like interface and is typically used used to read/write configuration data, debug information or other things. This function sets a sequential set of registers. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">addr</td><td>The starting address address. Valid values are 0 to 255. Address is wrapped from 255 to 0. </td></tr>
    <tr><td class="paramname">val</td><td>The register data array with a word width of 32 bit. </td></tr>
    <tr><td class="paramname">length</td><td>The length of the data array. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a7ee53b6af6ce8d7d468c52f9dd1fac6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_lsi_set3 </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t *&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Send data to the low speed interface of default firmwares. </p>
<p>It's implemented as a SRAM-like interface and is typically used used to read/write configuration data, debug information or other things. This function sets a sequential set of registers. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">addr</td><td>The register addresses. Valid values are 0 to 255. </td></tr>
    <tr><td class="paramname">val</td><td>The register data array with a word width of 32 bit. </td></tr>
    <tr><td class="paramname">length</td><td>The length of the data array. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a42bfe7c8c78b72c747531c370003edb9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_default_reset </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>leave</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Assert the reset signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">leave</td><td>if &gt;0, the signal is left active. Otherwise only a short impulse is sent. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success or &lt;0 if an USB error occurred </dd></dl>
 
</div>
</div>
<a class="anchor" id="a74c89f5aa7e3754d88f1dc95846b5cbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* ztex_find_bitstream </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Search for bitstream at standard locations. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>device information, used for determining locations of the SDK examples, ignored if NULL </td></tr>
    <tr><td class="paramname">path</td><td>additional path to search, ignored if NULL </td></tr>
    <tr><td class="paramname">name</td><td>without suffix '.bit' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the file name or NULL no file found </dd></dl>
 
</div>
</div>
<a class="anchor" id="a28cef9d1e168b782b03579c4a59505d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_get_device_info </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structztex__device__info.html">ztex_device_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get device information. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">info</td><td>structure where device information are stored. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the error code or 0, if no error occurs. </dd></dl>
 
</div>
</div>
<a class="anchor" id="ae679e66864c90211a3d8b4670a64d497"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_get_fpga_config </td>
          <td>(</td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Get device information. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>&lt;0 if an USB error occurred, 0 if unconfigured, 1 if configured </dd></dl>
 
</div>
</div>
<a class="anchor" id="aa64c1cefed076a0f48cafa1882593c79"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_print_device_info </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>sbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sbuflen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Print device info to a string. </p>
<p>The output may be truncated and is always null-terminated. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sbuf</td><td>string buffer for output </td></tr>
    <tr><td class="paramname">sbuflen</td><td>length of the string buffer </td></tr>
    <tr><td class="paramname">info</td><td>structure where device information are stored. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>length of the output string (may be truncated) </dd></dl>
 
</div>
</div>
<a class="anchor" id="a8ee4c93eef23fbc8044347a7ce351cf5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_scan_bus </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>sbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sbuflen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">libusb_device **&#160;</td>
          <td class="paramname"><em>devs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>op</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id_vendor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id_product</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>busnum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>devnum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>sn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>ps</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Scans the bus and performs certain operations on it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">devs</td><td>A null terminated list of devices </td></tr>
    <tr><td class="paramname">op</td><td>Operation to perform. &lt;0: print bus and ignore filters, 0: find a device using the filters, &gt;0 print all devices matching the filters </td></tr>
    <tr><td class="paramname">id_vendor,id_product</td><td>Filter by USB ID's that specify the device, ignored if negative </td></tr>
    <tr><td class="paramname">busnum,devnum</td><td>Filter by bus number and device address, ignored if negative </td></tr>
    <tr><td class="paramname">sn</td><td>Filter by serial number, ignored if NULL </td></tr>
    <tr><td class="paramname">ps</td><td>Filter by product string, ignored if NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The device index if filter result unique, otherwise -1</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">devs</td><td>A null terminated list of devices </td></tr>
    <tr><td class="paramname">op</td><td>Operation to perform. &lt;0: print bus and ignore filters, 0: find a device using the filters, &gt;0 print all devices matching the filters </td></tr>
    <tr><td class="paramname">id_vendor,id_product</td><td>Filter by USB ID's that specify the device, ignored if negative </td></tr>
    <tr><td class="paramname">busnum,devnum</td><td>Filter by bus number and device address, ignored if negative </td></tr>
    <tr><td class="paramname">sn</td><td>Filter by serial number, ignored if NULL </td></tr>
    <tr><td class="paramname">ps</td><td>Filter by product string, ignored if NULL </td></tr>
    <tr><td class="paramname">sbuf</td><td>string buffer for output </td></tr>
    <tr><td class="paramname">sbuflen</td><td>length of the string buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The device index if filter result unique, otherwise -1 </dd></dl>
 
</div>
</div>
<a class="anchor" id="a1861aa844f2ad3cacf37bbde0f9d6bcb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ztex_upload_bitstream </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>sbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sbuflen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">libusb_device_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structztex__device__info.html">ztex_device_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
 
<p>Upload bitstream to volatile memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sbuf</td><td>string buffer for error messages </td></tr>
    <tr><td class="paramname">sbuflen</td><td>length of the string buffer </td></tr>
    <tr><td class="paramname">handle</td><td>device handle </td></tr>
    <tr><td class="paramname">info</td><td>device information, used for determining high speed configuration settings, ignored if NULL </td></tr>
    <tr><td class="paramname">fd</td><td>File to read from. I/O errors are ignored. </td></tr>
    <tr><td class="paramname">bs</td><td>0: disable bit swapping, 1: enable bit swapping, all other values: automatic detection of bit order. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-1 if an error occurred, otherwise 0. Error messages are printed to sbuf. </dd></dl>
 
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_0f883cfafa81589f73fbd50f77c9be78.html">capi</a></li><li class="navelem"><a class="el" href="dir_811541c6271c17b41af027698e62c386.html">c</a></li><li class="navelem"><a class="el" href="ztex_8h.html">ztex.h</a></li>
    <li class="footer">Generated on Wed Mar 22 2017 19:03:08 for ZTEX core API for C by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.8 </li>
  </ul>
</div>
</body>
</html>
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.