USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.

Dependencies:   FATFileSystem mbed-rtos

Dependents:   BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Revision:
37:f1e388e7b752
Parent:
34:028508fd50fa
--- a/USBHost/USBEndpoint.cpp	Sun Apr 30 04:17:16 2017 +0000
+++ b/USBHost/USBEndpoint.cpp	Thu Jul 20 10:13:56 2017 +0100
@@ -17,7 +17,7 @@
 
 #include "dbg.h"
 #include "USBEndpoint.h"
-
+#if !defined(USBHOST_OTHER)
 void USBEndpoint::init(HCED * hced_, ENDPOINT_TYPE type_, ENDPOINT_DIRECTION dir_, uint32_t size, uint8_t ep_number, HCTD* td_list_[2])
 {
     hced = hced_;
@@ -76,6 +76,7 @@
     hced->control &= ~(1 << 13);
     hced->control |= (speed << 13);
 }
+#endif
 
 //Only for control Eps
 void USBEndpoint::setNextToken(uint32_t token)
@@ -95,7 +96,6 @@
             break;
     }
 }
-
 struct {
     USB_TYPE type;
     const char * str;
@@ -120,19 +120,18 @@
         {USB_TYPE_PROCESSING, "USB_TYPE_PROCESSING"},
         {USB_TYPE_ERROR, "USB_TYPE_ERROR"}
 };
+const char * USBEndpoint::getStateString() {
+    return type_string[state].str;
+}
 
+#if !defined(USBHOST_OTHER)
 void USBEndpoint::setState(uint8_t st) {
     if (st > 18)
         return;
     state = type_string[st].type;
 }
 
-
-const char * USBEndpoint::getStateString() {
-    return type_string[state].str;
-}
-
-void USBEndpoint::queueTransfer()
+USB_TYPE USBEndpoint::queueTransfer()
 {
     transfer_len = (uint32_t)td_current->bufEnd - (uint32_t)td_current->currBufPtr + 1;
     transferred = transfer_len;
@@ -142,6 +141,7 @@
     state = USB_TYPE_PROCESSING;
     td_current->nextTD = (hcTd*)td_next;
     hced->tailTD = td_next;
+    return USB_TYPE_PROCESSING;
 }
 
 void USBEndpoint::unqueueTransfer(volatile HCTD * td)
@@ -160,3 +160,4 @@
     nextEp = ed;
     hced->nextED = (ed == NULL) ? 0 : (hcEd*)(ed->getHCED());
 }
+#endif