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
Diff: USBHostSocketModem/USBHostSocketModem.cpp
- Revision:
- 23:7e6294a61139
- Parent:
- 22:eaefd60717c4
- Child:
- 25:36cbb55f5627
--- 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); }