pl2303.h 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /************************************************************************************
  2. * include/nuttx/usb/pl2303.h
  3. *
  4. * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
  5. * Author: Gregory Nutt <gnutt@nuttx.org>
  6. *
  7. * NOTE: This interface was inspired by the Linux gadget interface by
  8. * David Brownell. That work was very helpful in determining a usable
  9. * partitioning of functionality between standard class drivers and various
  10. * implementations of USB controller drivers. This work, however, does
  11. * not derive directly from that work and is licensed differently.
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. *
  17. * 1. Redistributions of source code must retain the above copyright
  18. * notice, this list of conditions and the following disclaimer.
  19. * 2. Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in
  21. * the documentation and/or other materials provided with the
  22. * distribution.
  23. * 3. Neither the name NuttX nor the names of its contributors may be
  24. * used to endorse or promote products derived from this software
  25. * without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  30. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  31. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  32. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  33. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  34. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  35. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. ************************************************************************************/
  41. #ifndef __INCLUDE_NUTTX_USB_PL2303_H
  42. #define __INCLUDE_NUTTX_USB_PL2303_H
  43. /************************************************************************************
  44. * Included Files
  45. ************************************************************************************/
  46. #include <nuttx/config.h>
  47. /************************************************************************************
  48. * Pre-processor Definitions
  49. ************************************************************************************/
  50. /************************************************************************************
  51. * Public Types
  52. ************************************************************************************/
  53. /************************************************************************************
  54. * Public Data
  55. ************************************************************************************/
  56. #undef EXTERN
  57. #if defined(__cplusplus)
  58. # define EXTERN extern "C"
  59. extern "C"
  60. {
  61. #else
  62. # define EXTERN extern
  63. #endif
  64. /************************************************************************************
  65. * Public Functions
  66. ************************************************************************************/
  67. /************************************************************************************
  68. * Name: usbdev_serialinit
  69. *
  70. * Description:
  71. * Register PL2303 USB serial port (and USB serial console if so configured).
  72. *
  73. ************************************************************************************/
  74. int usbdev_serialinitialize(int minor);
  75. #undef EXTERN
  76. #if defined(__cplusplus)
  77. }
  78. #endif
  79. #endif /* __INCLUDE_NUTTX_USB_PL2303_H */