Advertisement
Guest User

Untitled

a guest
May 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. case 0b00100010: // set endpoint
  2. {
  3. if ( SetupPkt.wIndex != 0x0002 ) // endpoint id
  4. return; // don't know what to do with this
  5.  
  6. switch( SetupPkt.wValue )
  7. {
  8. case 0x0100: // sampling rate
  9. {
  10. /****************************************************************/
  11. /******************* to do **************************************/
  12. // you have to control the sample Rate configuration ('sampleFreq').
  13. // This case is for setting sample rate and with 'SetupPkt.bRequest'
  14. // you can select the corresponding request.
  15. //
  16. // case 0x01: // set SampleRate
  17. //
  18. // these requests are not supported
  19. // case 0x02: // SET_MIN
  20. // case 0x03: // SET_MAX
  21. // case 0x04: // SET_RES
  22. //
  23. //NOTE: You have to use 'USBSetCtrfOUTData' function (see usbdrv.h)
  24. // for sending data on OUT pipe and 'USBSetCtrlCompletionHandler'
  25. // with DoSetupSampleFreq as parameter for complete the handler.
  26. /*****************************************************************/
  27.  
  28. // SampleRate
  29. if (SetupPkt.bRequest == 0x01) {
  30. USBSetCtrfOUTData(SampleFreq, sizeof(SampleFreq));
  31. USBSetCtrlCompletionHandler(DoSetupSampleFreq);
  32. }
  33.  
  34. /*****************************************************************/
  35. }
  36. default:
  37. return;
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement