usbcfg.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * This file is free software: you can redistribute it and/or modify it
  15. * under the terms of the GNU General Public License as published by the
  16. * Free Software Foundation, either version 3 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This file is distributed in the hope that it will be useful, but
  20. * WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  22. * See the GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program. If not, see <http://www.gnu.org/licenses/>.
  26. *
  27. * Modified for use in AP_HAL by Andrew Tridgell and Siddharth Bharat Purohit
  28. */
  29. #pragma once
  30. #include "hwdef.h"
  31. #ifndef HAL_HAVE_DUAL_USB_CDC
  32. #define HAL_HAVE_DUAL_USB_CDC 0
  33. #endif
  34. #if defined(__cplusplus)
  35. extern "C" {
  36. #endif
  37. #if HAL_USE_SERIAL_USB
  38. extern const USBConfig usbcfg;
  39. extern const SerialUSBConfig serusbcfg1;
  40. extern SerialUSBDriver SDU1;
  41. #if HAL_HAVE_DUAL_USB_CDC
  42. extern SerialUSBDriver SDU2;
  43. extern const SerialUSBConfig serusbcfg2;
  44. #endif //HAL_HAVE_DUAL_USB_CDC
  45. #endif
  46. #define USB_DESC_MAX_STRLEN 100
  47. void setup_usb_strings(void);
  48. void string_substitute(const char *str, char *str2);
  49. bool string_contains(const char *haystack, const char *needle);
  50. #if defined(__cplusplus)
  51. }
  52. #endif
  53. /** @} */