Advertisement
Guest User

Untitled

a guest
May 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. case 0b10100010: // get 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 get information about the sample rate configuration.
  13. // This case is for getting RAM value and with 'SetupPkt.bRequest' you
  14. // can select sampling rate case.
  15. //
  16. // case 0x81: // sampling rate
  17. //
  18. // these requests are not supported
  19. // case 0x82: // GET_MIN
  20. // case 0x83: // GET_MAX
  21. // case 0x84: // GET_RES
  22. //
  23. //NOTE: You have to use 'USBSetCtrfINData' function (see usbdrv.h)
  24. // for getting information about sample rate configuration. You have to
  25. // read from the _RAM and write in SampleFreq variable.
  26. /*****************************************************************/
  27.  
  28. // SampleRate
  29. if (SetupPkt.bRequest == 0x81)
  30. USBSetCtrfINData(SampleFreq, sizeof(SampleFreq), _RAM);
  31.  
  32. /*****************************************************************/
  33. }
  34. default:
  35. return;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement