usb_bridge.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // -----------------------------------------------------------------------------
  2. // Library "USBLib"
  3. // Target: for stm32l151
  4. // Author: Sychov A.
  5. // Date: 19/04/2019
  6. // Version: 1.0
  7. // -----------------------------------------------------------------------------
  8. // File: Main header file of USB-library bridging layer
  9. // Version: 1.0
  10. // -----------------------------------------------------------------------------
  11. #ifndef UBOOT_BRIDGE_H
  12. #define UBOOT_BRIDGE_H
  13. #include "core/config.h"
  14. #include "usb/usb_spec.h"
  15. #include "usb/usb_transfers.h"
  16. #include "usb/usb_hooks.h"
  17. // @usb_bridge_register_dataapp
  18. // Register (assign) the data-stream handler @dataApp for the specified endpoint (@epnum)
  19. // After the registering all the data requests relates to the endpoint will be routed to
  20. // the aproptiate handler.
  21. bool usb_bridge_register_dataapp( uint8_t epnum, const sUSBAppEntry_Data_t * dataApp );
  22. // @usb_bridge_unregister_dataapp
  23. // De-Register (detach) the data-stream handler @dataApp from the specified endpoint (@epnum)
  24. // After the deregistering all the data requests relates to the endpoint will be routed to
  25. // the default data handler handler or will be discared
  26. bool usb_bridge_unregister_dataapp( uint8_t epnum );
  27. #define MAX_DATAAPP_ENDPOINTS 8 // value: maximum EP count for data applications plus one (reserved)
  28. #define USB_ACM_CONFIGURATION_VALUE 1
  29. #define USB_ACM_INTERFACE_INDEX 1
  30. #define USB_ACM_INTERFACE_VALUE 0
  31. #define USB_TMC_CONFIGURATION_VALUE 1
  32. #define USB_TMC_INTERFACE_INDEX 1
  33. #define USB_TMC_INTERFACE_VALUE 0
  34. #endif