diff options
Diffstat (limited to 'docs/source/api')
| -rw-r--r-- | docs/source/api/api_common.rst | 48 | ||||
| -rw-r--r-- | docs/source/api/api_host.rst | 13 | ||||
| -rw-r--r-- | docs/source/api/api_port.rst | 8 |
3 files changed, 11 insertions, 58 deletions
diff --git a/docs/source/api/api_common.rst b/docs/source/api/api_common.rst deleted file mode 100644 index 3c4653d9..00000000 --- a/docs/source/api/api_common.rst +++ /dev/null @@ -1,48 +0,0 @@ -其他 -========================= - -usb_malloc -"""""""""""""""""""""""""""""""""""" - -``usb_malloc`` 用来申请内存。 - -.. code-block:: C - - void *usb_malloc(size_t size); - -- **size** 要申请的内存大小 -- **return** 申请的内存地址 - -usb_free -"""""""""""""""""""""""""""""""""""" - -``usb_free`` 用来释放申请的内存。 - -.. code-block:: C - - void usb_free(void *ptr); - -- **ptr** 要释放的内存地址 - -usb_iomalloc -"""""""""""""""""""""""""""""""""""" - -``usb_iomalloc`` 用来申请内存,并按照 `CONFIG_DCACHE_LINE_SIZE` 对齐,一般使用到 dcache 和 dma 需要对齐操作的时候使用。 - -.. code-block:: C - - void *usb_iomalloc(size_t size); - -- **size** 要申请的内存大小 -- **return** 申请的内存地址 - -usb_iofree -"""""""""""""""""""""""""""""""""""" - -``usb_iofree`` 用来释放申请的内存。 - -.. code-block:: C - - void usb_iofree(void *ptr); - -- **ptr** 要释放的内存地址 diff --git a/docs/source/api/api_host.rst b/docs/source/api/api_host.rst index 979aaa8e..56af923b 100644 --- a/docs/source/api/api_host.rst +++ b/docs/source/api/api_host.rst @@ -82,11 +82,13 @@ hubport 结构体 const char *iManufacturer; const char *iProduct; const char *iSerialNumber; - #if 0 - uint8_t* raw_config_desc; - #endif - USB_MEM_ALIGNX struct usb_setup_packet setup; + uint8_t *raw_config_desc; + struct usb_setup_packet *setup; struct usbh_hub *parent; + #ifdef CONFIG_USBHOST_XHCI + uint32_t protocol; /* port protocol, for xhci, some ports are USB2.0, others are USB3.0 */ + #endif + usb_osal_thread_t thread; }; hub 结构体 @@ -101,12 +103,11 @@ hub 结构体 uint8_t index; uint8_t hub_addr; usbh_pipe_t intin; - USB_MEM_ALIGNX uint8_t int_buffer[1]; + uint8_t *int_buffer; struct usbh_urb intin_urb; struct usb_hub_descriptor hub_desc; struct usbh_hubport child[CONFIG_USBHOST_MAX_EHPORTS]; struct usbh_hubport *parent; - usb_slist_t hub_event_list; }; usbh_initialize diff --git a/docs/source/api/api_port.rst b/docs/source/api/api_port.rst index 95be593d..528809d5 100644 --- a/docs/source/api/api_port.rst +++ b/docs/source/api/api_port.rst @@ -153,19 +153,19 @@ usbh_roothub_control - **buf** 接收缓冲区 - **return** 返回 0 表示正确,其他表示错误 -usbh_ep0_pipe_reconfigure +usbh_ep_pipe_reconfigure """""""""""""""""""""""""""""""""""" -``usbh_ep0_pipe_reconfigure`` 重新设置端点 0 的 pipe 属性。 **此函数不对用户开放**。 +``usbh_ep_pipe_reconfigure`` 重新设置端点 0 的 pipe 属性。 **此函数不对用户开放**。 .. code-block:: C - int usbh_ep0_pipe_reconfigure(usbh_pipe_t pipe, uint8_t dev_addr, uint8_t ep_mps, uint8_t speed); + int usbh_ep_pipe_reconfigure(usbh_pipe_t pipe, uint8_t dev_addr, uint8_t ep_mps, uint8_t mult); - **pipe** pipe 句柄 - **dev_addr** 端点所在设备地址 - **ep_mps** 端点最大包长 -- **speed** 端点所在设备的速度 +- **mult** 端点一次传输个数 - **return** 返回 0 表示正确,其他表示错误 usbh_pipe_alloc |
