1
0

usb.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* This file is the part of the LUS32 project
  2. *
  3. * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef _USB_H_
  16. #define _USB_H_
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. #if defined(STM32L0)
  21. #if defined(FORCE_C_DRIVER)
  22. #define USE_STMV0_DRIVER
  23. #elif defined(FORCE_ASM_DRIVER)
  24. #define USE_STMV0A_DRIVER
  25. #elif defined(STM32L052xx)
  26. #define USE_STMV0A_DRIVER
  27. #else
  28. #define USE_STMV0_DRIVER
  29. #endif
  30. #elif defined(STM32L1)
  31. #if defined(FORCE_C_DRIVER)
  32. #define USE_STMV1_DRIVER
  33. #elif defined(FORCE_ASM_DRIVER)
  34. #define USE_STMV1A_DRIVER
  35. #elif defined(STM32L100xC)
  36. #define USE_STMV1A_DRIVER
  37. #else
  38. #define USE_STMV1_DRIVER
  39. #endif
  40. #else
  41. #error "No supported MCU family selected"
  42. #endif
  43. #include "inc/usbd_core.h"
  44. #if !defined(__ASSEMBLER__)
  45. #include "inc/usb_std.h"
  46. #if defined(USE_STMV0A_DRIVER)
  47. extern const struct usbd_driver usb_stmv0a;
  48. #define usbd_hw usb_stmv0a
  49. #elif defined(USE_STMV0_DRIVER)
  50. extern const struct usbd_driver usb_stmv0;
  51. #define usbd_hw usb_stmv0
  52. #elif defined(USE_STMV1_DRIVER)
  53. extern const struct usbd_driver usb_stmv1;
  54. #define usbd_hw usb_stmv1
  55. #elif defined(USE_STMV1A_DRIVER)
  56. extern const struct usbd_driver usb_stmv1a;
  57. #define usbd_hw usb_stmv1a
  58. #endif
  59. #endif
  60. #if defined (__cplusplus)
  61. }
  62. #endif
  63. #endif //_USB_H_