usb.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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(STM32L052xx) && !defined(USE_C_DRIVER)
  21. #define USE_STMV0A_DRIVER
  22. #elif defined(STM32L052xx)
  23. #define USE_STMV0_DRIVER
  24. #elif defined(STM32L053xx) || defined(STM32F042xx) || defined(STM32F072xx) || \
  25. defined(STM32L432xx) || defined(STM32L442xx) || defined(STM32L433xx) || \
  26. defined(STM32L443xx)
  27. #define USE_STMV0_DRIVER
  28. #warning "Driver has not been tested with this MPU"
  29. #else
  30. #error "No supported MCU family selected"
  31. #endif
  32. #include "inc\usbd_core.h"
  33. #if !defined(__ASSEMBLER__)
  34. #include "inc\usb_std.h"
  35. #if defined(USE_STMV0A_DRIVER)
  36. extern const struct usbd_driver usb_stmv0a;
  37. #define usbd_hw usb_stmv0a
  38. #elif defined(USE_STMV0_DRIVER)
  39. extern const struct usbd_driver usb_stmv0;
  40. #define usbd_hw usb_stmv0
  41. #endif
  42. #endif
  43. #if defined (__cplusplus)
  44. }
  45. #endif
  46. #endif //_USB_H_