I have just started digging through the manual and the example code from CMX. I found a place in the code where the buffer pointers are written into the BDT in Little Endian format. I could not find anything in teh manual to confirm that.
Now I'm wondering if the buffer status will be in Little Endian as well. Does any body know?
Hi
Both the buffer descriptor data pointer and the control word are in little-endian format.
It is however not necessary to convert between big and little-endian when working with the control word since the defines for the bits and fields in it can simply be set to match the bit use. Eg.
#define TOK_PID_0 0x04000000#define BDT_STALL 0x04000000#define TOK_PID_1 0x08000000#define DTS 0x08000000#define TOK_PID_2 0x10000000#define NINC 0x10000000#define TOK_PID_3 0x20000000#define KEEP 0x20000000#define DATA_1 0x40000000#define OWN 0x80000000#define USB_BYTE_CNT_MASK 0x0000ff03
rather than the big-endia variant:
#define BE_TOK_PID_0 0x00000004#define BE_BDT_STALL 0x00000004#define BE_TOK_PID_1 0x00000008#define BE_DTS 0x00000008#define BE_TOK_PID_2 0x00000010#define BE_NINC 0x00000010#define BE_TOK_PID_3 0x00000020#define BE_KEEP 0x00000020#define BE_DATA_1 0x00000040#define BE_OWN 0x00000080#define BE_USB_BYTE_CNT_MASK 0x03ff0000
Regards
Mark
Thanks.
I wonder if the people who write the reference manuals look in the forums.
Normally they do not look in the forums. I do, and I strongly urge that your best course of action is to file a service request that reports the documentation error. This gets the problem logged into a database where it does get looked at by the docs people. Click here to go to the on-line service request page.
---Tom