Norimasa Okamoto / BaseDAP

Dependents:   USBMSD_LPC_HelloWorld lpcterm2 Simple-CMSIS-DAP 11u35_usbLocalFilesystem

Embed: (wiki syntax)

« Back to documentation index

BaseDAP Class Reference

DAP(Debug Access Port) interface. More...

#include <BaseDAP.h>

Public Member Functions

 BaseDAP (SWD *swd)
 Create a DAP(Debug Access Port) interface.
int Command (uint8_t *request, uint8_t *response)
 Process command.

Protected Member Functions

virtual void infoLED (int select, int value)
 LED indicator.
virtual int Vendor (uint8_t *request, uint8_t *response)
 vendor command

Detailed Description

DAP(Debug Access Port) interface.

Example:

 #include "BaseDAP.h"
 #include "USBDAP.h"
 
 USBDAP hid(64, 64, 0x0d28, 0x0204);
 
 SWD swd(p21,p22,p17); // SWDIO(dp12),SWCLK(dp3),nReset(dp23)
 DigitalOut connected(LED1);
 DigitalOut running(LED2);
 class myDAP : public BaseDAP {
 public:
     myDAP(SWD* swd):BaseDAP(swd){};
     virtual void infoLED(int select, int value) {
         switch(select) {
             case 0: connected = value; break;
             case 1: running = value; break;
         }
     } 
 };
 
 int main()
 {
     HID_REPORT recv_report;
     HID_REPORT send_report;
 
     myDAP* dap = new myDAP(&swd);
     while(1) {
         if(hid.readNB(&recv_report)) {
             dap->Command(recv_report.data, send_report.data);
             send_report.length = 64;
             hid.send(&send_report);
         }
     }    
 }

Definition at line 54 of file BaseDAP.h.


Constructor & Destructor Documentation

BaseDAP ( SWD *  swd )

Create a DAP(Debug Access Port) interface.

Parameters:
swdassign SWD interface

Definition at line 4 of file BaseDAP.cpp.


Member Function Documentation

int Command ( uint8_t *  request,
uint8_t *  response 
)

Process command.

Parameters:
requestrequest data(64 bytes)
responseresponse data(64 bytes)
Returns:
response length

Definition at line 12 of file BaseDAP.cpp.

void infoLED ( int  select,
int  value 
) [protected, virtual]

LED indicator.

Parameters:
selct0...connected LED, 1...running LED
value0...OFF, 1...ON

Definition at line 91 of file BaseDAP.cpp.

int Vendor ( uint8_t *  request,
uint8_t *  response 
) [protected, virtual]

vendor command

Definition at line 210 of file BaseDAP.cpp.