diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/common/usb_hc.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/common/usb_hc.h index 6791945a7..c7c830b55 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/common/usb_hc.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/common/usb_hc.h @@ -28,6 +28,7 @@ typedef void (*usbh_complete_callback_t)(void *arg, int nbytes); typedef void *usbh_pipe_t; struct usbh_bus; +struct usbh_hub; /** * @brief USB Endpoint Configuration. diff --git a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/core/usbh_core.h b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/core/usbh_core.h index 1637d1d2c..e31185baa 100644 --- a/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/core/usbh_core.h +++ b/Ubiquitous/XiZi_AIoT/services/drivers/usb/components/core/usbh_core.h @@ -89,27 +89,6 @@ static inline void usbh_control_urb_fill(struct usbh_urb *urb, urb->arg = arg; } -static inline void usbh_control_urb_fill_xiuos(struct usbh_urb *urb, - struct usbh_hubport *hport, - usbh_pipe_t pipe, - struct usb_setup_packet *setup, - uint8_t *transfer_buffer, - uint32_t transfer_buffer_length, - uint32_t timeout, - usbh_complete_callback_t complete, - void *arg) -{ - struct usbh_bus *usb = usbh_get_bus_of_port(hport); - urb->usb_hc_type = usb->usb_hc_type; - urb->pipe = pipe; - urb->setup = setup; - urb->transfer_buffer = transfer_buffer; - urb->transfer_buffer_length = transfer_buffer_length; - urb->timeout = timeout; - urb->complete = complete; - urb->arg = arg; -} - static inline void usbh_bulk_urb_fill(struct usbh_urb *urb, usbh_pipe_t pipe, uint8_t *transfer_buffer, @@ -127,26 +106,6 @@ static inline void usbh_bulk_urb_fill(struct usbh_urb *urb, urb->arg = arg; } -static inline void usbh_bulk_urb_fill_xiuos(struct usbh_urb *urb, - struct usbh_hubport *hport, - usbh_pipe_t pipe, - uint8_t *transfer_buffer, - uint32_t transfer_buffer_length, - uint32_t timeout, - usbh_complete_callback_t complete, - void *arg) -{ - struct usbh_bus *usb = usbh_get_bus_of_port(hport); - urb->usb_hc_type = usb->usb_hc_type; - urb->pipe = pipe; - urb->setup = NULL; - urb->transfer_buffer = transfer_buffer; - urb->transfer_buffer_length = transfer_buffer_length; - urb->timeout = timeout; - urb->complete = complete; - urb->arg = arg; -} - static inline void usbh_int_urb_fill(struct usbh_urb *urb, usbh_pipe_t pipe, uint8_t *transfer_buffer, @@ -164,25 +123,6 @@ static inline void usbh_int_urb_fill(struct usbh_urb *urb, urb->arg = arg; } -static inline void usbh_int_urb_fill_xiuos(struct usbh_urb *urb, - struct usbh_hubport *hport, - usbh_pipe_t pipe, - uint8_t *transfer_buffer, - uint32_t transfer_buffer_length, - uint32_t timeout, - usbh_complete_callback_t complete, - void *arg) -{ - struct usbh_bus *usb = usbh_get_bus_of_port(hport); - urb->usb_hc_type = usb->usb_hc_type; - urb->pipe = pipe; - urb->setup = NULL; - urb->transfer_buffer = transfer_buffer; - urb->transfer_buffer_length = transfer_buffer_length; - urb->timeout = timeout; - urb->complete = complete; - urb->arg = arg; -} struct usbh_class_info { uint8_t match_flags; /* Used for product specific matches; range is inclusive */ uint8_t class; /* Base device class code */ @@ -355,6 +295,67 @@ struct usbh_bus* usbh_get_bus_of_index(uint8_t usb); */ struct usbh_hubport * usbh_root_hub_port ( struct usbh_hubport *hport ); +static inline void usbh_control_urb_fill_xiuos(struct usbh_urb *urb, + struct usbh_hubport *hport, + usbh_pipe_t pipe, + struct usb_setup_packet *setup, + uint8_t *transfer_buffer, + uint32_t transfer_buffer_length, + uint32_t timeout, + usbh_complete_callback_t complete, + void *arg) +{ + struct usbh_bus *usb = usbh_get_bus_of_port(hport); + urb->usb_hc_type = usb->usb_hc_type; + urb->pipe = pipe; + urb->setup = setup; + urb->transfer_buffer = transfer_buffer; + urb->transfer_buffer_length = transfer_buffer_length; + urb->timeout = timeout; + urb->complete = complete; + urb->arg = arg; +} + +static inline void usbh_bulk_urb_fill_xiuos(struct usbh_urb *urb, + struct usbh_hubport *hport, + usbh_pipe_t pipe, + uint8_t *transfer_buffer, + uint32_t transfer_buffer_length, + uint32_t timeout, + usbh_complete_callback_t complete, + void *arg) +{ + struct usbh_bus *usb = usbh_get_bus_of_port(hport); + urb->usb_hc_type = usb->usb_hc_type; + urb->pipe = pipe; + urb->setup = NULL; + urb->transfer_buffer = transfer_buffer; + urb->transfer_buffer_length = transfer_buffer_length; + urb->timeout = timeout; + urb->complete = complete; + urb->arg = arg; +} + +static inline void usbh_int_urb_fill_xiuos(struct usbh_urb *urb, + struct usbh_hubport *hport, + usbh_pipe_t pipe, + uint8_t *transfer_buffer, + uint32_t transfer_buffer_length, + uint32_t timeout, + usbh_complete_callback_t complete, + void *arg) +{ + struct usbh_bus *usb = usbh_get_bus_of_port(hport); + urb->usb_hc_type = usb->usb_hc_type; + urb->pipe = pipe; + urb->setup = NULL; + urb->transfer_buffer = transfer_buffer; + urb->transfer_buffer_length = transfer_buffer_length; + urb->timeout = timeout; + urb->complete = complete; + urb->arg = arg; +} + int usbh_initialize(uint32_t id, struct usbh_bus *usb); struct usbh_hubport *usbh_find_hubport(uint32_t id, uint8_t dev_addr); void *usbh_find_class_instance(const char *devname);