simple CMSIS-DAP debug adapter.(not mbed interface)

Dependencies:   BaseDAP SWD USBDAP USBDevice mbed

Simple CMSIS-DAP debug adapter

CMSIS-DAPデバッグアダプタです。mbedインターフェースではありません。
/media/uploads/va009039/simple-cmsis-dap-lpc1549-1.jpg

参考

https://github.com/mbedmicro/CMSIS-DAP

Other platforms

Import programF042K6_Simple-CMSIS-DAP

cmsis-dap debug adapter

Import programL152RE_Simple-CMSIS-DAP

cmsis-dap debug adapter

Import programTG-LPC11U35-501_Simple-CMSIS-DAP

CMSIS-DAP debug adapter

Revision:
0:dbe821206b04
Child:
1:2957e24bb52f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jun 23 03:26:58 2014 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "USBDAP.h"
+#include "BaseDAP.h"
+
+SWD swd(D12, D10, D6); // SWDIO,SWCLK,nRESET
+DigitalOut connected(LED_GREEN);
+DigitalOut running(LED_RED);
+
+class myDAP : public BaseDAP {
+public:
+    myDAP(SWD* swd):BaseDAP(swd){};
+    virtual void infoLED(int select, int value) {
+        switch(select) {
+            case 0:
+                connected = value^1; 
+                running = 1;
+                break;
+            case 1: 
+                running = value^1; 
+                connected = 1;
+                break;
+        }
+    } 
+};
+
+int main() {
+   USBDAP* hid = new USBDAP;
+   myDAP* dap = new myDAP(&swd);
+   while(1) {
+        HID_REPORT recv_report;
+        if(hid->readNB(&recv_report)) {
+            HID_REPORT send_report;
+            dap->Command(recv_report.data, send_report.data);
+            send_report.length = 64;
+            hid->send(&send_report);
+        }
+    }    
+}
+