Bit-Depth Reporting

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
jmag99
Active Member
Posts: 35
Joined: Tue Jul 20, 2010 9:45 pm

Bit-Depth Reporting

Post by jmag99 »

Is there an easy way to get the bit-depth sent by the PC over USB? I'd like to use this information to setup the dac/adc in a project.


User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

If you look in descriptors_2.h (which belongs to endpoint zero) you can see:

Code: Select all

bSubslotSize (Number of bytes per subslot)

Code: Select all

subFrameSize


and

Code: Select all

bBitResolution


These define the number of bytes sent by the host and the number of bits used. Both are 24b, but USB audio class 1 uses 3 bytes and audio class 2 uses 4 bytes. These are fixed at compile time.