summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-02-24 13:10:47 +0700
committerhathach <[email protected]>2021-05-18 12:58:24 +0700
commit1dd2cd43dda857de3f4272074c595e663ef09b22 (patch)
tree997aaf03c8bfbf7c9aaf73f24f1df2c9a7155a35 /src
parent2d15e1183064a35cc646a46bddf2b82915114cc8 (diff)
add hcd_ehci.h as interface for ehci port
Diffstat (limited to 'src')
-rw-r--r--src/host/usbh.c2
-rw-r--r--src/portable/ehci/ehci.c5
-rw-r--r--src/portable/ehci/hcd_ehci.h53
-rw-r--r--src/portable/nxp/transdimension/hcd_transdimension.c4
4 files changed, 56 insertions, 8 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index a4ee4cb5c..3761f279c 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -656,7 +656,7 @@ static bool enum_new_device(hcd_event_t* event)
//------------- connected/disconnected directly with roothub -------------//
if (dev0->hub_addr == 0)
{
- // wait until device is stable
+ // wait until device is stable TODO non blocking
osal_task_delay(RESET_DELAY);
// device unplugged while delaying
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index e2327fdc0..484e49600 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -37,6 +37,7 @@
#include "host/hcd.h"
#include "host/usbh_hcd.h"
+#include "hcd_ehci.h"
#include "ehci.h"
//--------------------------------------------------------------------+
@@ -49,10 +50,6 @@
// Periodic frame list must be 4K alignment
CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4096) static ehci_data_t ehci_data;
-// EHCI portable
-uint32_t hcd_ehci_register_addr(uint8_t rhport);
-bool hcd_ehci_init (uint8_t rhport); // TODO move later
-
//--------------------------------------------------------------------+
// PROTOTYPE
//--------------------------------------------------------------------+
diff --git a/src/portable/ehci/hcd_ehci.h b/src/portable/ehci/hcd_ehci.h
new file mode 100644
index 000000000..480d11eda
--- /dev/null
+++ b/src/portable/ehci/hcd_ehci.h
@@ -0,0 +1,53 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef _TUSB_HCD_EHCI_H_
+#define _TUSB_HCD_EHCI_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+//--------------------------------------------------------------------+
+// API Implemented by HCD
+//--------------------------------------------------------------------+
+
+// Get operational address i.e EHCI Command register
+uint32_t hcd_ehci_register_addr(uint8_t rhport);
+
+//--------------------------------------------------------------------+
+// API Implemented by EHCI
+//--------------------------------------------------------------------+
+
+// Initialize EHCI driver
+extern bool hcd_ehci_init (uint8_t rhport);
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif
diff --git a/src/portable/nxp/transdimension/hcd_transdimension.c b/src/portable/nxp/transdimension/hcd_transdimension.c
index e6b7afe8f..db447ef23 100644
--- a/src/portable/nxp/transdimension/hcd_transdimension.c
+++ b/src/portable/nxp/transdimension/hcd_transdimension.c
@@ -43,6 +43,7 @@
#include "common/tusb_common.h"
#include "common_transdimension.h"
+#include "portable/ehci/hcd_ehci.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
@@ -75,9 +76,6 @@ typedef struct
};
#endif
-// TODO better prototype later
-extern bool hcd_ehci_init (uint8_t rhport); // from ehci.c
-
//--------------------------------------------------------------------+
// Controller API
//--------------------------------------------------------------------+