Simple USBHost MSD(USB flash drive) for EA LPC4088 QSB test program

Dependencies:   LPC4088-USBHost mbed

EA LPC4088をUSBホストにしてUSBフラッシュメモリ(USB flash drive)を読み書きするテストプログラムです。
/media/uploads/va009039/lpc4088-msd-1.jpg
/media/uploads/va009039/lpc4088-msd-2.png

https://bitbucket.org/va009039/lpc4088_usbhost

Committer:
va009039
Date:
Tue Apr 22 10:54:52 2014 +0000
Revision:
0:11152e69fc05
first commit,sync rev.25.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:11152e69fc05 1 // BaseUsbHostDebug.h 2014/4/22
va009039 0:11152e69fc05 2 #pragma once
va009039 0:11152e69fc05 3
va009039 0:11152e69fc05 4 #ifdef USB_DEBUG
va009039 0:11152e69fc05 5 //#define USB_DBG(...) do{fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);fprintf(stderr,__VA_ARGS__);} while(0);
va009039 0:11152e69fc05 6 #define USB_DBG_IF(C, ...) if(C){fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);fprintf(stderr,__VA_ARGS__);}else{}
va009039 0:11152e69fc05 7 #define USB_DBG_ED_IF(C,A) if(C){fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ed(stderr,A);}else{}
va009039 0:11152e69fc05 8 #define USB_DBG_ED(A) fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ed(stderr,A);
va009039 0:11152e69fc05 9 #else
va009039 0:11152e69fc05 10 //#define USB_DBG(...) while(0);
va009039 0:11152e69fc05 11 #define USB_DBG_IF(...) while(0);
va009039 0:11152e69fc05 12 #define USB_DBG_ED_IF(C,A) while(0)
va009039 0:11152e69fc05 13 #define USB_DBG_ED(A) while(0)
va009039 0:11152e69fc05 14 #endif
va009039 0:11152e69fc05 15
va009039 0:11152e69fc05 16 #ifdef DEBUG
va009039 0:11152e69fc05 17 #define DBG(...) do{fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);fprintf(stderr,__VA_ARGS__);} while(0);
va009039 0:11152e69fc05 18 #define DBG_PRINTF(...) do{fprintf(stderr,__VA_ARGS__);}while(0);
va009039 0:11152e69fc05 19 #define DBG_TD(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_td(stderr,A);}while(0);
va009039 0:11152e69fc05 20 #define DBG_ED(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ed(stderr,A);}while(0);
va009039 0:11152e69fc05 21 #define DBG_ITD(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_itd(stderr,A);}while(0);
va009039 0:11152e69fc05 22 #define DBG_IED(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ied(stderr,A);}while(0);
va009039 0:11152e69fc05 23 #define DBG_BYTES(A,B,C) do{fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);print_bytes(stderr,A,B,C);}while(0);
va009039 0:11152e69fc05 24 #define DBG_HEX(A,B) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_hex(stderr,A,B);}while(0);
va009039 0:11152e69fc05 25 #define DBG_OHCI(A) do{fprintf(stderr,"[%s@%d] %s: %08X\n",__PRETTY_FUNCTION__,__LINE__,#A,A);}while(0);
va009039 0:11152e69fc05 26 #else //DEBUG
va009039 0:11152e69fc05 27 #define DBG(...) while(0);
va009039 0:11152e69fc05 28 #define DBG_PRINTF(...) while(0);
va009039 0:11152e69fc05 29 #define DBG_TD(A) while(0);
va009039 0:11152e69fc05 30 #define DBG_ED(A) while(0);
va009039 0:11152e69fc05 31 #define DBG_ITD(A) while(0);
va009039 0:11152e69fc05 32 #define DBG_IED(A) while(0);
va009039 0:11152e69fc05 33 #define DBG_BYTES(A,B,C) while(0);
va009039 0:11152e69fc05 34 #define DBG_HEX(A,B) while(0);
va009039 0:11152e69fc05 35 #define DBG_OHCI(A) while(0);
va009039 0:11152e69fc05 36 #endif //DEBUG
va009039 0:11152e69fc05 37
va009039 0:11152e69fc05 38 void print_td(FILE* stream, HCTD* td);
va009039 0:11152e69fc05 39 void print_ed(FILE* stream, HCED* ed);
va009039 0:11152e69fc05 40 void print_itd(FILE* stream, HCITD* itd);
va009039 0:11152e69fc05 41 void print_ied(FILE* stream, HCED* ed);
va009039 0:11152e69fc05 42 void print_bytes(FILE* stream, char* s, uint8_t* buf, int len);
va009039 0:11152e69fc05 43 void print_hex(FILE* stream, uint8_t* p, int len);
va009039 0:11152e69fc05 44
va009039 0:11152e69fc05 45