this is the Peter Barrett USBHostShell program, a bit modified for being a bit more talkactive, just to let u know how the USB protocol layer is going on, and all the data trasnfers. Also there is a small implementation of HID descriptors, but not functional... yet :S the aim is to at least implement the gamepad HID, and make an array of function pointer to each HID function
Utils.h
- Committer:
- Sergio
- Date:
- 2010-09-13
- Revision:
- 0:e1e03118b8fe
File content as of revision 0:e1e03118b8fe:
typedef unsigned char u8; typedef unsigned short u16; typedef unsigned long u32; void DelayMS(int ms); void printfBytes(const char* label,const u8* data, int len); void printHex(const u8* d, int len); #ifndef min #define min(_a,_b) ((_a) < (_b) ? (_a) : (_b)) #endif inline int LE16(const u8* d) { return d[0] | (d[1] << 8); } inline u32 BE32(const u8* d) { return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3]; } inline void BE32(u32 n, u8* d) { d[0] = (u8)(n >> 24); d[1] = (u8)(n >> 16); d[2] = (u8)(n >> 8); d[3] = (u8)n; } inline void BE16(u32 n, u8* d) { d[0] = (u8)(n >> 8); d[1] = (u8)n; }