⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_8h.html

📁 BlueLab3 bluetooth API 说明文档
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>BlueLab: usb.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.8 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>usb.h File Reference</h1>Control of USB EndPoints. <a href="#_details">More...</a><p><h2>Data Structures</h2><ul><li>struct <a class="el" href="struct_end_point_info.html">EndPointInfo</a><li>struct <a class="el" href="struct_usb_codes.html">UsbCodes</a><li>struct <a class="el" href="struct_usb_request.html">UsbRequest</a><li>struct <a class="el" href="struct_usb_response.html">UsbResponse</a></ul><h2>Enumerations</h2><ul><li>enum <a class="el" href="usb_8h.html#a8">EndPointAttr</a> { <br>&nbsp;&nbsp;<a class="el" href="usb_8h.html#a8a0">end_point_attr_ctl</a> =  0, <br>&nbsp;&nbsp;<a class="el" href="usb_8h.html#a8a1">end_point_attr_iso</a> =  1, <br>&nbsp;&nbsp;<a class="el" href="usb_8h.html#a8a2">end_point_attr_bulk</a> =  2, <br>&nbsp;&nbsp;<a class="el" href="usb_8h.html#a8a3">end_point_attr_int</a> =  3<br> }</ul><h2>Functions</h2><ul><li><a class="el" href="usb___8h.html#a8">UsbInterface</a> <a class="el" href="usb_8h.html#a4">UsbAddInterface</a> (const <a class="el" href="struct_usb_codes.html">UsbCodes</a> *codes, <a class="el" href="csrtypes_8h.html#a4">uint16</a> type, const <a class="el" href="csrtypes_8h.html#a8">uint8</a> *if_descriptor, <a class="el" href="csrtypes_8h.html#a4">uint16</a> descriptor_length)<dl class="el"><dd class="mdescRight">Adds a USB interface.  <a href="#a4"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="usb_8h.html#a5">UsbAddEndPoints</a> (<a class="el" href="usb___8h.html#a8">UsbInterface</a> interface, <a class="el" href="csrtypes_8h.html#a4">uint16</a> num_end_points, const <a class="el" href="struct_end_point_info.html">EndPointInfo</a> *end_point_info)<dl class="el"><dd class="mdescRight">Adds USB endpoints to the interface passed.  <a href="#a5"></a><br></dl><li><a class="el" href="csrtypes_8h.html#a9">bool</a> <a class="el" href="usb_8h.html#a6">UsbAddDescriptor</a> (<a class="el" href="usb___8h.html#a8">UsbInterface</a> interface, <a class="el" href="csrtypes_8h.html#a4">uint16</a> type, const <a class="el" href="csrtypes_8h.html#a8">uint8</a> *descriptor, <a class="el" href="csrtypes_8h.html#a4">uint16</a> descriptor_length)<dl class="el"><dd class="mdescRight">Adds a USB descriptor to an interface.  <a href="#a6"></a><br></dl><li>void <a class="el" href="usb_8h.html#a7">UsbAddDfuInterface</a> (void)<dl class="el"><dd class="mdescRight">Adds a DFU interface to the USB port.  <a href="#a7"></a><br></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>Control of USB EndPoints. <p>Bluelab applications have access to the on-chip USB interface. USB devices communications occur through channels known as endpoints. The USB specification defines a number of USB device classes through Class Specifications. Each of the Class Specifications define the type and direction of endpoints required to comply with that particular device class. Examples include the Human Interface Device (HID) class, and the Communication Device Class (CDC).<hr><h2>Enumeration Type Documentation</h2><a class="anchor" name="a8" doxytag="usb.h::EndPointAttr" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> enum <a class="el" href="usb_8h.html#a8">EndPointAttr</a>          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><dl compact><dt><b>Enumeration values: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em><a class="anchor" name="a8a0" doxytag="end_point_attr_ctl" ></a>end_point_attr_ctl</em>&nbsp;</td><td>Control. </td></tr><tr><td valign=top><em><a class="anchor" name="a8a1" doxytag="end_point_attr_iso" ></a>end_point_attr_iso</em>&nbsp;</td><td>Isochronous. </td></tr><tr><td valign=top><em><a class="anchor" name="a8a2" doxytag="end_point_attr_bulk" ></a>end_point_attr_bulk</em>&nbsp;</td><td>Bulk. </td></tr><tr><td valign=top><em><a class="anchor" name="a8a3" doxytag="end_point_attr_int" ></a>end_point_attr_int</em>&nbsp;</td><td>Interrupt. </td></tr></table></dl>    </td>  </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a4" doxytag="usb.h::UsbAddInterface" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="usb___8h.html#a8">UsbInterface</a> UsbAddInterface           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="struct_usb_codes.html">UsbCodes</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>codes</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a>&nbsp;</td>          <td class="mdname" nowrap> <em>type</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>const <a class="el" href="csrtypes_8h.html#a8">uint8</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>if_descriptor</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a>&nbsp;</td>          <td class="mdname" nowrap> <em>descriptor_length</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Adds a USB interface. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>codes</em>&nbsp;</td><td>Defines the USB class, sub-class and protocol. </td></tr>    <tr><td></td><td valign=top><em>type</em>&nbsp;</td><td>Defines the type of USB interface. </td></tr>    <tr><td></td><td valign=top><em>if_descriptor</em>&nbsp;</td><td>Points to the interface descriptor. </td></tr>    <tr><td></td><td valign=top><em>descriptor_length</em>&nbsp;</td><td>The length in bytes of if_descriptor.</td></tr>  </table></dl>Returns an interface number on success, else returns usb_interface_error.     </td>  </tr></table><a class="anchor" name="a5" doxytag="usb.h::UsbAddEndPoints" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a9">bool</a> UsbAddEndPoints           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="usb___8h.html#a8">UsbInterface</a>&nbsp;</td>          <td class="mdname" nowrap> <em>interface</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a>&nbsp;</td>          <td class="mdname" nowrap> <em>num_end_points</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>const <a class="el" href="struct_end_point_info.html">EndPointInfo</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>end_point_info</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Adds USB endpoints to the interface passed. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>interface</em>&nbsp;</td><td>The interface to add endpoints to (returned by a call to UsbAddInterface). </td></tr>    <tr><td></td><td valign=top><em>num_end_points</em>&nbsp;</td><td>The number of endpoints to be added. </td></tr>    <tr><td></td><td valign=top><em>end_point_info</em>&nbsp;</td><td>Points to an array of endpoint definitions.</td></tr>  </table></dl>Returns TRUE if the endpoints were successfully added, else FALSE.     </td>  </tr></table><a class="anchor" name="a6" doxytag="usb.h::UsbAddDescriptor" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="csrtypes_8h.html#a9">bool</a> UsbAddDescriptor           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="usb___8h.html#a8">UsbInterface</a>&nbsp;</td>          <td class="mdname" nowrap> <em>interface</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a>&nbsp;</td>          <td class="mdname" nowrap> <em>type</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>const <a class="el" href="csrtypes_8h.html#a8">uint8</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>descriptor</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap><a class="el" href="csrtypes_8h.html#a4">uint16</a>&nbsp;</td>          <td class="mdname" nowrap> <em>descriptor_length</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Adds a USB descriptor to an interface. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>interface</em>&nbsp;</td><td>The interface to add the descriptor to. </td></tr>    <tr><td></td><td valign=top><em>type</em>&nbsp;</td><td>The type to use. </td></tr>    <tr><td></td><td valign=top><em>descriptor</em>&nbsp;</td><td>descriptor The interface descriptor to add. </td></tr>    <tr><td></td><td valign=top><em>descriptor_length</em>&nbsp;</td><td>The length of the descriptor in bytes.</td></tr>  </table></dl>Returns TRUE if the descriptor was successfully added, else FALSE.     </td>  </tr></table><a class="anchor" name="a7" doxytag="usb.h::UsbAddDfuInterface" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0">  <tr>    <td class="mdRow">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void UsbAddDfuInterface           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Adds a DFU interface to the USB port. <p>    </td>  </tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -