|
|
@@ -97,6 +97,7 @@
|
|
|
<li class="toctree-l2"><a class="reference internal" href="#usb">USB 网卡相关的宏和文件</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="#id1">USB 网卡对接过程</a></li>
|
|
|
<li class="toctree-l2"><a class="reference internal" href="#usb-lwip">USB 网卡 LWIP 配置宏相关注意事项</a></li>
|
|
|
+<li class="toctree-l2"><a class="reference internal" href="#id2">总结</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="toctree-l1"><a class="reference internal" href="usbh_bluetooth.html">usbh_bluetooth</a></li>
|
|
|
@@ -164,15 +165,18 @@
|
|
|
|
|
|
<section id="usbh-net">
|
|
|
<h1>usbh_net<a class="headerlink" href="#usbh-net" title="Link to this heading"></a></h1>
|
|
|
-<p>本节主要介绍 USB 网卡的使用,USB 网卡推荐采用 AIR780(RNDIS),EC20(ECM/RNDIS), 手机(RNDIS),RTL8152 USB 网卡,AX88772 USB 网卡。</p>
|
|
|
-<div class="admonition note">
|
|
|
-<p class="admonition-title">Note</p>
|
|
|
-<p>看完下面内容,你将感受到什么是全自动化的 USB 网卡驱动对接,无需手动调用任何函数。</p>
|
|
|
-</div>
|
|
|
+<p>本节主要介绍 USB 网卡的使用,当前已经支持和测试以下 USB 网卡:</p>
|
|
|
+<ul class="simple">
|
|
|
+<li><p>4G 网卡:EC20(ECM/RNDIS)、手机(RNDIS)、SIMCOM7600(RNDIS)、ML307R(RNDIS)、AIR780(RNDIS)</p></li>
|
|
|
+</ul>
|
|
|
<div class="admonition caution">
|
|
|
<p class="admonition-title">Caution</p>
|
|
|
<p>请注意,部分 4G 网卡默认不带自动拨号功能,请更换固件或者使用 AT 配置成自动拨号,否则无法获取 IP。</p>
|
|
|
</div>
|
|
|
+<ul class="simple">
|
|
|
+<li><p>USB 以太网卡:ASIX AX88772,REALTEK RTL8152</p></li>
|
|
|
+<li><p>USB WIFI 网卡: 博流 BL616(RNDIS/ECM)</p></li>
|
|
|
+</ul>
|
|
|
<section id="usb">
|
|
|
<h2>USB 网卡相关的宏和文件<a class="headerlink" href="#usb" title="Link to this heading"></a></h2>
|
|
|
<p>网卡相关的宏如下,主要用于根据不同的网络组件注册网卡驱动:</p>
|
|
|
@@ -185,14 +189,14 @@
|
|
|
</div>
|
|
|
<div class="admonition note">
|
|
|
<p class="admonition-title">Note</p>
|
|
|
-<p>如果使用 Kconfig 系统,上述宏自定生成,其他平台请手动定义。</p>
|
|
|
+<p>如果使用了 Kconfig 系统,上述宏自定生成,其他平台请手动定义。</p>
|
|
|
</div>
|
|
|
<p>USB 网卡传输层面已经对接好了相关网络组件,列举如下:</p>
|
|
|
<ul class="simple">
|
|
|
-<li><p>自定义 OS + LWIP 请使用 <strong>platform/lwip/usbh_lwip.c</strong>,需要自行包含该文件,并使能上述相关的宏</p></li>
|
|
|
-<li><p>RT-THREAD + LWIP 请使用 <strong>platform/rtthread/usbh_lwip.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件</p></li>
|
|
|
-<li><p>ESP-IDF + LWIP 请使用 <strong>platform/freertos/usbh_net.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件</p></li>
|
|
|
-<li><p>NUTTX + NUTTX 网络组件 请使用 <strong>platform/nuttx/usbh_net.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件</p></li>
|
|
|
+<li><p>自定义 OS + LWIP 请使用 <strong>platform/lwip/usbh_lwip.c</strong>,需要自行包含该文件,并使能上述相关的宏。并在初始化 USB 之前调用 <cite>tcpip_init(NULL, NULL)</cite></p></li>
|
|
|
+<li><p>RT-THREAD + LWIP 请使用 <strong>platform/rtthread/usbh_lwip.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件,勾选 rt-thread lwip以后自动调用 <cite>tcpip_init(NULL, NULL)</cite></p></li>
|
|
|
+<li><p>ESP-IDF + LWIP 请使用 <strong>platform/freertos/usbh_net.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件,并且在初始化 USB 之前调用 <cite>esp_netif_init()</cite> + <cite>esp_event_loop_create_default()</cite></p></li>
|
|
|
+<li><p>NUTTX + NUTTX 网络组件 请使用 <strong>platform/nuttx/usbh_net.c</strong>,在 Kconfig 中使能对应的网卡驱动后自动勾选该文件,勾选网络组件以后自动调用</p></li>
|
|
|
</ul>
|
|
|
<div class="admonition note">
|
|
|
<p class="admonition-title">Note</p>
|
|
|
@@ -306,9 +310,14 @@
|
|
|
<span class="cp">#endif</span>
|
|
|
</pre></div>
|
|
|
</div>
|
|
|
-<ul class="simple">
|
|
|
-<li><p>具体移植文章可以参考开发者的一些笔记 <a class="reference external" href="https://club.rt-thread.org/ask/article/5cf3e9e0b2d95800.html">https://club.rt-thread.org/ask/article/5cf3e9e0b2d95800.html</a></p></li>
|
|
|
-</ul>
|
|
|
+</section>
|
|
|
+<section id="id2">
|
|
|
+<h2>总结<a class="headerlink" href="#id2" title="Link to this heading"></a></h2>
|
|
|
+<div class="admonition note">
|
|
|
+<p class="admonition-title">Note</p>
|
|
|
+<p>通过以上内容,我们可以看到 CherryUSB 对 USB 网卡的支持是非常完善的,用户只需要使能对应的宏或者勾选,就可以实现 USB 网卡的自动识别和驱动注册,无需手动初始化网卡相关配置,用户只需关注应用层,极大地方便了用户的使用。</p>
|
|
|
+</div>
|
|
|
+<p>具体移植文章可以参考开发者的一些笔记 <a class="reference external" href="https://club.rt-thread.org/ask/article/5cf3e9e0b2d95800.html">https://club.rt-thread.org/ask/article/5cf3e9e0b2d95800.html</a></p>
|
|
|
</section>
|
|
|
</section>
|
|
|
|