USB host library, support isochronous,bulk,interrupt and control.
Dependents: BaseUsbHost_example BaseJpegDecode_example SimpleJpegDecode_example
Import programBaseUsbHost_example
BaseUsbHost example program
BaseUsbHostDebug.h@0:b7d6879637a8, 2012-12-04 (annotated)
- Committer:
- va009039
- Date:
- Tue Dec 04 13:29:41 2012 +0000
- Revision:
- 0:b7d6879637a8
- Child:
- 3:ae77d63a1eda
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 0:b7d6879637a8 | 1 | // BaseUsbHostDebug.h 2012/12/2 |
va009039 | 0:b7d6879637a8 | 2 | #ifndef BASE_USB_HOST_DEBUG_H |
va009039 | 0:b7d6879637a8 | 3 | #define BASE_USB_HOST_DEBUG_H |
va009039 | 0:b7d6879637a8 | 4 | #ifdef DEBUG |
va009039 | 0:b7d6879637a8 | 5 | #define DBG(...) do{fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);fprintf(stderr,__VA_ARGS__);} while(0); |
va009039 | 0:b7d6879637a8 | 6 | #define DBG_PRINTF(...) do{fprintf(stderr,__VA_ARGS__);}while(0); |
va009039 | 0:b7d6879637a8 | 7 | #define DBG_TD(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_td(stderr,A);}while(0); |
va009039 | 0:b7d6879637a8 | 8 | #define DBG_ED(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ed(stderr,A);}while(0); |
va009039 | 0:b7d6879637a8 | 9 | #define DBG_ITD(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_itd(stderr,A);}while(0); |
va009039 | 0:b7d6879637a8 | 10 | #define DBG_IED(A) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_ied(stderr,A);}while(0); |
va009039 | 0:b7d6879637a8 | 11 | #define DBG_BYTES(A,B,C) do{fprintf(stderr,"[%s@%d] ",__PRETTY_FUNCTION__,__LINE__);print_bytes(stderr,A,B,C);}while(0); |
va009039 | 0:b7d6879637a8 | 12 | #define DBG_HEX(A,B) do{fprintf(stderr,"[%s@%d]\n",__PRETTY_FUNCTION__,__LINE__);print_hex(stderr,A,B);}while(0); |
va009039 | 0:b7d6879637a8 | 13 | #define DBG_OHCI(A) do{fprintf(stderr,"[%s@%d] %s: %08X\n",__PRETTY_FUNCTION__,__LINE__,#A,A);}while(0); |
va009039 | 0:b7d6879637a8 | 14 | #else //DEBUG |
va009039 | 0:b7d6879637a8 | 15 | #define DBG(...) while(0); |
va009039 | 0:b7d6879637a8 | 16 | #define DBG_PRINTF(...) while(0); |
va009039 | 0:b7d6879637a8 | 17 | #define DBG_TD(A) while(0); |
va009039 | 0:b7d6879637a8 | 18 | #define DBG_ED(A) while(0); |
va009039 | 0:b7d6879637a8 | 19 | #define DBG_ITD(A) while(0); |
va009039 | 0:b7d6879637a8 | 20 | #define DBG_IED(A) while(0); |
va009039 | 0:b7d6879637a8 | 21 | #define DBG_BYTES(A,B,C) while(0); |
va009039 | 0:b7d6879637a8 | 22 | #define DBG_HEX(A,B) while(0); |
va009039 | 0:b7d6879637a8 | 23 | #define DBG_OHCI(A) while(0); |
va009039 | 0:b7d6879637a8 | 24 | #endif //DEBUG |
va009039 | 0:b7d6879637a8 | 25 | |
va009039 | 0:b7d6879637a8 | 26 | void print_td(FILE* stream, HCTD* td); |
va009039 | 0:b7d6879637a8 | 27 | void print_ed(FILE* stream, HCED* ed); |
va009039 | 0:b7d6879637a8 | 28 | void print_itd(FILE* stream, HCITD* itd); |
va009039 | 0:b7d6879637a8 | 29 | void print_ied(FILE* stream, HCED* ed); |
va009039 | 0:b7d6879637a8 | 30 | void print_bytes(FILE* stream, char* s, uint8_t* buf, int len); |
va009039 | 0:b7d6879637a8 | 31 | void print_hex(FILE* stream, uint8_t* p, int len); |
va009039 | 0:b7d6879637a8 | 32 | |
va009039 | 0:b7d6879637a8 | 33 | #endif //BASE_USB_HOST_DEBUG_H |