This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Conveniently put 8-bit words into 16-bit array

Hi all,

I'm having a lot to do with USB. USB descriptors are always given in 8-bit words. But the C55x is 16-bit DSP and 8-bit data (Uint8) is aligned on 16-bit. Is there any way to conveniently fill Uint16 arrays given a sequence of 8-bit words?

For example, I should put this sequence into a Uint16:

    0x85, 0x44,                         //   REPORT_ID (Feature)
    0x06, 0x00, 0xff,                   //   USAGE_PAGE (Vendor Defined) 
    0x09, 0xC5,                         //   USAGE (Vendor Usage 0xC5)   
    0x15, 0x00,                         //   LOGICAL_MINIMUM (0)         
    0x26, 0xff, 0x00,                   //   LOGICAL_MAXIMUM (0xff)
    0x75, 0x08,                         //   REPORT_SIZE (8)            
    0x96, 0x00, 0x01,                   //   REPORT_COUNT (0x100 (256))            
    0xb1, 0x02,                         //   FEATURE (Data,Var,Abs)

Which results in

0x4485,
0x0006,
0x09FF,
0x15C5,
0x2600,
0x00FF,
0x0875,
0x0096,
0xb101,
0x0002

I don't like that because it complicates development and debug a lot...
I have first been using a script to handle this, but is not my favorite option since (easier for development, but for debug not very easy again), then I have been using a macro for each pair of 8-bit words, but it is not my preferred option as well.

Do you have any ideas how to handle this the easiest way such that I can just stick a descriptor in its standard 8-bit word format into C55x code and it'll work w/o having to call external scripts, or doing manual swapping etc.?

Thanks for all your help

Best regards,

Andreas