From 5d5b61a606b1d2ba5512ef3c71fb11975eed5e40 Mon Sep 17 00:00:00 2001 From: Egahp <57124987+Egahp@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:24:02 +0800 Subject: feat: host add event callback mechanism similar to device * fix: fix warning for speed_table * fix(port/dwc2/usb_hc_dwc2): add roothub.speed init * feat(usbh_core): add event_callback * fix(usbh_hub): fix event device reset port * fix(usbh_hub): remove event init when init failed * feat(usbh_core): add default dummy_event_callback * fix(usbh_hub): emit reset event only on successful reset * fix(usbh_core): emit interface start only on successful connect class driver * feat(usbh_core): change event_callback to typedef * feat(port): update port usbh init params * doc: update usbh_initialize desc * fix(usbh_core): check result from ret == 0 change to ret >= 0 --------- Signed-off-by: egahp <2687434412@qq.com> --- docs/source/api/api_host.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/source/api') diff --git a/docs/source/api/api_host.rst b/docs/source/api/api_host.rst index 3368f47f..28287a0b 100644 --- a/docs/source/api/api_host.rst +++ b/docs/source/api/api_host.rst @@ -126,10 +126,11 @@ usbh_initialize .. code-block:: C - int usbh_initialize(uint8_t busid, uint32_t reg_base); + int usbh_initialize(uint8_t busid, uint32_t reg_base, usbh_event_handler_t event_handler); - **busid** bus id,从 0开始,不能超过 `CONFIG_USBHOST_MAX_BUS` - **reg_base** hcd 寄存器基地址 +- **event_handler** host 事件回调函数,可以为NULL - **return** 0 表示正常其他表示错误 usbh_find_class_instance -- cgit v1.3.1