usb_desc.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef _USB_DESC_H
  2. #define _USB_DESC_H
  3. #include "usb_hid_desc.h"
  4. #include "usb_audio_desc.h"
  5. #include "usb_vendor_desc.h"
  6. #define USB_DEV_VID 0x0642
  7. #define USB_DEV_PID 0x0001
  8. #define USB_DEV_LANG_ID 0x0409
  9. #define USB_DESC_MANUF "AB2020"
  10. #define USB_DESC_PRODUCT "AB202X_WIRELESS"
  11. #define USB_DESC_SERIAL "S0001"
  12. //Descriptor String Index
  13. #define STR_LANGUAGE_ID 0
  14. #define STR_MANUFACTURER 1
  15. #define STR_PRODUCT 2
  16. #define STR_SERIAL_NUM 3
  17. #define USB_MAX_STR_DESC_SIZE 64
  18. enum{
  19. #if USB_HID_EN
  20. USB_HID_ITF_INDEX,
  21. #endif
  22. #if USB_AUDIO_EN
  23. USB_AUDIO_CTL_ITF_INDEX,
  24. #if USB_MIC_EN
  25. USB_AUDIO_STREAM_MIC_ITF_INDEX,
  26. #endif
  27. #if USB_SPEAKER_EN
  28. USB_AUDIO_STREAM_SPEAKER_ITF_INDEX,
  29. #endif
  30. #endif
  31. #if USB_VENDOR_EN
  32. USB_VENDOR_ITF_INDEX,
  33. #endif
  34. USB_ITF_NUM,
  35. };
  36. uint8_t *usb_get_device_descriptor(uint8_t *length);
  37. uint8_t *usb_get_cfg_descriptor(uint8_t *length);
  38. uint8_t *usb_get_lang_id_str_descriptor(uint8_t *length);
  39. uint8_t *usb_get_manufacturer_str_descriptor(uint8_t *length);
  40. uint8_t *usb_get_product_str_descriptor(uint8_t *length);
  41. uint8_t *usb_get_serial_str_descriptor(uint8_t *length);
  42. #endif