add LPC1549, add FRDM-KL46Z, fix epComplete bit operation.

Dependents:   XBee-ExplorerLite USBLocalFileSystem USB-to-UART-bridge USBLocalFileSystem

Fork of USBDevice by mbed official

Files at this revision

API Documentation at this revision

Comitter:
va009039 <>
Date:
Tue May 13 15:31:04 2014 +0900
Parent:
21:c4c8fd0b0f12
Child:
23:554b76408e69
Commit message:
add DTR/RTS and sendBreak.

Changed in this revision

USBSerial/USBCDC.cpp Show annotated file Show diff for this revision Revisions of this file
USBSerial/USBCDC.h Show annotated file Show diff for this revision Revisions of this file
--- a/USBSerial/USBCDC.cpp	Thu May 08 22:45:45 2014 +0900
+++ b/USBSerial/USBCDC.cpp	Tue May 13 15:31:04 2014 +0900
@@ -26,6 +26,7 @@
 #define CDC_SET_LINE_CODING        0x20
 #define CDC_GET_LINE_CODING        0x21
 #define CDC_SET_CONTROL_LINE_STATE 0x22
+#define CDC_SEND_BREAK             0x23
 
 #define MAX_CDC_REPORT_SIZE MAX_PACKET_SIZE_EPBULK
 
@@ -57,9 +58,15 @@
                 terminal_connected = true;
                 break;
             case CDC_SET_CONTROL_LINE_STATE:
+                controlLineStateChanged((transfer->setup.wValue>>1) & 1, (transfer->setup.wValue) & 1);
                 terminal_connected = false;
                 success = true;
                 break;
+            case CDC_SEND_BREAK:
+                sendBreak(transfer->setup.wValue);
+                terminal_connected = true;
+                success = true;
+                break;
             default:
                 break;
         }
--- a/USBSerial/USBCDC.h	Thu May 08 22:45:45 2014 +0900
+++ b/USBSerial/USBCDC.h	Tue May 13 15:31:04 2014 +0900
@@ -111,7 +111,24 @@
     * @param stop The number of stop bits (1 or 2)
     */
     virtual void lineCodingChanged(int baud, int bits, int parity, int stop) {};
-    
+
+    /*
+    * Called by USBCallback_request when CDC control line state is changed
+    * Warning: Called in ISR
+    *
+    * @param rts Request to Send
+    * @param dtr Data Terminal Ready
+    */
+    virtual void controlLineStateChanged(int rts, int dtr) {};
+
+    /*
+    * Called by USBCallback_request when CDC send break
+    * Warning: Called in ISR
+    *
+    * @param duration break duration
+    */
+    virtual void sendBreak(uint16_t duration) {};
+
 protected:
     virtual bool USBCallback_request();
     virtual void USBCallback_requestCompleted(uint8_t *buf, uint32_t length);