USB Host Driver with Socket Modem support. Works with revision 323 of mbed-src but broken with any later version.

Dependencies:   FATFileSystem

Fork of F401RE-USBHost by Norimasa Okamoto

Files at this revision

API Documentation at this revision

Comitter:
fritz291
Date:
Mon Jun 22 20:41:00 2015 +0000
Parent:
22:eaefd60717c4
Child:
24:f4d432f36ec2
Commit message:
Added more USB CDC Macros.

Changed in this revision

USBHostSocketModem/USBHostSocketModem.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/USBHostSocketModem/USBHostSocketModem.cpp	Mon Jun 22 19:57:32 2015 +0000
+++ b/USBHostSocketModem/USBHostSocketModem.cpp	Mon Jun 22 20:41:00 2015 +0000
@@ -19,11 +19,16 @@
 
 #define DEVICE_TO_HOST  0x80
 #define HOST_TO_DEVICE  0x00
-#define DTR 0x0003
 //Communications and CDC Control Class
 #define CDCCONTROL 0x2
 //CDC Data Class
 #define CDCDATA 0xA
+//CDC Set Control Line State Request
+#define SET_CONTROL_LINE_STATE 0x22
+//CDC Request Type
+#define DTR_REQUEST_TYPE 0x21
+//Set Bits of SetControlLineState register to Enable DTR
+#define DTR 0x0003
 
 
 USBHostSocketModem::USBHostSocketModem()
@@ -146,7 +151,7 @@
 void USBHostSocketModem::setDTR()
 {
     //Set USB DTR to enable communication
-    int res = host->controlWrite(dev, 0x21, 0x22, DTR, 0, NULL, 0);
+    int res = host->controlWrite(dev, DTR_REQUEST_TYPE, SET_CONTROL_LINE_STATE, DTR, 0, NULL, 0);
 }