summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-04-23 16:03:40 +0700
committerhathach <[email protected]>2025-04-23 16:03:40 +0700
commita2da575793a14fdfc5137a02843af0fd8f8b772a (patch)
treeab9d028d20f8a709eb813d1538671b335ca1ddad /src/portable
parent741cb3cf029e37682634eeb355c20420c0816c8d (diff)
rename and expose tuh_bus_info_get() to application
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/chipidea/ci_hs/hcd_ci_hs.c1
-rw-r--r--src/portable/ehci/ehci.c3
-rw-r--r--src/portable/mentor/musb/hcd_musb.c5
-rw-r--r--src/portable/nxp/khci/hcd_khci.c1
-rw-r--r--src/portable/nxp/lpc17_40/hcd_lpc17_40.c1
-rw-r--r--src/portable/ohci/ohci.c3
-rw-r--r--src/portable/raspberrypi/pio_usb/hcd_pio_usb.c2
-rw-r--r--src/portable/renesas/rusb2/hcd_rusb2.c3
-rw-r--r--src/portable/synopsys/dwc2/dwc2_common.c1
-rw-r--r--src/portable/synopsys/dwc2/hcd_dwc2.c3
-rw-r--r--src/portable/template/hcd_template.c1
11 files changed, 17 insertions, 7 deletions
diff --git a/src/portable/chipidea/ci_hs/hcd_ci_hs.c b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
index c4c342a70..22eb22690 100644
--- a/src/portable/chipidea/ci_hs/hcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -35,6 +35,7 @@
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
#include "host/hcd.h"
+#include "host/usbh.h"
#include "portable/ehci/ehci_api.h"
#include "ci_hs_type.h"
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index 141a2c026..da9f49d29 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -34,6 +34,7 @@
#include "osal/osal.h"
#include "host/hcd.h"
+#include "host/usbh.h"
#include "ehci_api.h"
#include "ehci.h"
@@ -838,7 +839,7 @@ static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, tusb_desc_endpoint_t c
}
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
uint8_t const xfer_type = ep_desc->bmAttributes.xfer;
uint8_t const interval = ep_desc->bInterval;
diff --git a/src/portable/mentor/musb/hcd_musb.c b/src/portable/mentor/musb/hcd_musb.c
index 97ef46152..dcc023e0b 100644
--- a/src/portable/mentor/musb/hcd_musb.c
+++ b/src/portable/mentor/musb/hcd_musb.c
@@ -36,6 +36,7 @@ _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"");
#endif
#include "host/hcd.h"
+#include "host/usbh.h"
#include "musb_type.h"
@@ -696,7 +697,7 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet
_hcd.pipe0.remaining = 0;
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
switch (bus_info.speed) {
default: return false;
case TUSB_SPEED_LOW: USB0->TYPE0 = USB_TYPE0_SPEED_LOW; break;
@@ -745,7 +746,7 @@ bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const
uint8_t pipe_type = 0;
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
switch (bus_info.speed) {
default: return false;
case TUSB_SPEED_LOW: pipe_type |= USB_TXTYPE1_SPEED_LOW; break;
diff --git a/src/portable/nxp/khci/hcd_khci.c b/src/portable/nxp/khci/hcd_khci.c
index c3c901c5d..45732a866 100644
--- a/src/portable/nxp/khci/hcd_khci.c
+++ b/src/portable/nxp/khci/hcd_khci.c
@@ -36,6 +36,7 @@
#endif
#include "host/hcd.h"
+#include "host/usbh.h"
//--------------------------------------------------------------------+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
diff --git a/src/portable/nxp/lpc17_40/hcd_lpc17_40.c b/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
index 090d1ba69..fea3e2a66 100644
--- a/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
+++ b/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
@@ -31,6 +31,7 @@
#include "chip.h"
#include "host/hcd.h"
+#include "host/usbh.h"
void hcd_int_enable(uint8_t rhport)
{
diff --git a/src/portable/ohci/ohci.c b/src/portable/ohci/ohci.c
index 465b6731c..81091c9a7 100644
--- a/src/portable/ohci/ohci.c
+++ b/src/portable/ohci/ohci.c
@@ -38,6 +38,7 @@
#include "osal/osal.h"
#include "host/hcd.h"
+#include "host/usbh.h"
#include "ohci.h"
// TODO remove
@@ -329,7 +330,7 @@ static void ed_init(ohci_ed_t *p_ed, uint8_t dev_addr, uint16_t ep_size, uint8_t
}
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
p_ed->dev_addr = dev_addr;
p_ed->ep_number = ep_addr & 0x0F;
diff --git a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c
index 0e3d0d31a..d59a2b4ee 100644
--- a/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c
+++ b/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c
@@ -115,7 +115,7 @@ void hcd_int_disable(uint8_t rhport) {
bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const *desc_ep) {
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
bool const need_pre = (bus_info.hub_addr && bus_info.speed == TUSB_SPEED_LOW);
uint8_t const pio_rhport = RHPORT_PIO(rhport);
diff --git a/src/portable/renesas/rusb2/hcd_rusb2.c b/src/portable/renesas/rusb2/hcd_rusb2.c
index e6975287d..6f6d27d0e 100644
--- a/src/portable/renesas/rusb2/hcd_rusb2.c
+++ b/src/portable/renesas/rusb2/hcd_rusb2.c
@@ -30,6 +30,7 @@
#if CFG_TUH_ENABLED && defined(TUP_USBIP_RUSB2)
#include "host/hcd.h"
+#include "host/usbh.h"
#include "rusb2_type.h"
#if TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
@@ -663,7 +664,7 @@ bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const
if (0 == epn) {
rusb->DCPCTR = RUSB2_PIPE_CTR_PID_NAK;
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
uint16_t volatile *devadd = (uint16_t volatile *)(uintptr_t) &rusb->DEVADD[0];
devadd += dev_addr;
while (rusb->DCPCTR_b.PBUSY) {}
diff --git a/src/portable/synopsys/dwc2/dwc2_common.c b/src/portable/synopsys/dwc2/dwc2_common.c
index f6ed8fc98..e1e7d5c1a 100644
--- a/src/portable/synopsys/dwc2/dwc2_common.c
+++ b/src/portable/synopsys/dwc2/dwc2_common.c
@@ -36,6 +36,7 @@
#if CFG_TUH_ENABLED
#include "host/hcd.h"
+#include "host/usbh.h"
#endif
#include "dwc2_common.h"
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c
index 6fd343686..7c29a03cf 100644
--- a/src/portable/synopsys/dwc2/hcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/hcd_dwc2.c
@@ -36,6 +36,7 @@
#define DWC2_DEBUG 2
#include "host/hcd.h"
+#include "host/usbh.h"
#include "dwc2_common.h"
// Max number of endpoints application can open, can be larger than DWC2_CHANNEL_COUNT_MAX
@@ -476,7 +477,7 @@ bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, const tusb_desc_endpoint_t*
const tusb_speed_t rh_speed = hprt_speed_get(dwc2);
tuh_bus_info_t bus_info;
- hcd_bus_info_get(dev_addr, &bus_info);
+ tuh_bus_info_get(dev_addr, &bus_info);
// find a free endpoint
const uint8_t ep_id = edpt_alloc();
diff --git a/src/portable/template/hcd_template.c b/src/portable/template/hcd_template.c
index 22ea22e63..d2f304407 100644
--- a/src/portable/template/hcd_template.c
+++ b/src/portable/template/hcd_template.c
@@ -29,6 +29,7 @@
#if CFG_TUH_ENABLED && CFG_TUSB_MCU == OPT_MCU_NONE
#include "host/hcd.h"
+#include "host/usbh.h"
//--------------------------------------------------------------------+
// Controller API