Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 0b00100010: // set endpoint
- {
- if ( SetupPkt.wIndex != 0x0002 ) // endpoint id
- return; // don't know what to do with this
- switch( SetupPkt.wValue )
- {
- case 0x0100: // sampling rate
- {
- /****************************************************************/
- /******************* to do **************************************/
- // you have to control the sample Rate configuration ('sampleFreq').
- // This case is for setting sample rate and with 'SetupPkt.bRequest'
- // you can select the corresponding request.
- //
- // case 0x01: // set SampleRate
- //
- // these requests are not supported
- // case 0x02: // SET_MIN
- // case 0x03: // SET_MAX
- // case 0x04: // SET_RES
- //
- //NOTE: You have to use 'USBSetCtrfOUTData' function (see usbdrv.h)
- // for sending data on OUT pipe and 'USBSetCtrlCompletionHandler'
- // with DoSetupSampleFreq as parameter for complete the handler.
- /*****************************************************************/
- // SampleRate
- if (SetupPkt.bRequest == 0x01) {
- USBSetCtrfOUTData(SampleFreq, sizeof(SampleFreq));
- USBSetCtrlCompletionHandler(DoSetupSampleFreq);
- }
- /*****************************************************************/
- }
- default:
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement