support multi USB IP for host

This commit is contained in:
sakumisu
2024-01-06 22:16:58 +08:00
parent d517f2594e
commit 1158fc3d8c
24 changed files with 752 additions and 617 deletions

View File

@@ -14,6 +14,8 @@ extern "C" {
typedef void (*usbh_complete_callback_t)(void *arg, int nbytes);
struct usbh_bus;
/**
* @brief USB Iso Configuration.
*
@@ -59,21 +61,21 @@ struct usbh_urb {
*
* @return On success will return 0, and others indicate fail.
*/
int usb_hc_init(void);
int usb_hc_init(struct usbh_bus *bus);
/**
* @brief usb host controller hardware deinit.
*
* @return On success will return 0, and others indicate fail.
*/
int usb_hc_deinit(void);
int usb_hc_deinit(struct usbh_bus *bus);
/**
* @brief Get frame number.
*
* @return frame number.
*/
uint16_t usbh_get_frame_number(void);
uint16_t usbh_get_frame_number(struct usbh_bus *bus);
/**
* @brief control roothub.
*
@@ -81,7 +83,7 @@ uint16_t usbh_get_frame_number(void);
* @param buf buf for reading response or write data.
* @return On success will return 0, and others indicate fail.
*/
int usbh_roothub_control(struct usb_setup_packet *setup, uint8_t *buf);
int usbh_roothub_control(struct usbh_bus *bus, struct usb_setup_packet *setup, uint8_t *buf);
/**
* @brief Submit a usb transfer request to an endpoint.