cdc_desc.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /**
  2. **************************************************************************
  3. * @file cdc_desc.h
  4. * @version v2.0.6
  5. * @date 2021-12-31
  6. * @brief usb cdc descriptor header file
  7. **************************************************************************
  8. * Copyright notice & Disclaimer
  9. *
  10. * The software Board Support Package (BSP) that is made available to
  11. * download from Artery official website is the copyrighted work of Artery.
  12. * Artery authorizes customers to use, copy, and distribute the BSP
  13. * software and its related documentation for the purpose of design and
  14. * development in conjunction with Artery microcontrollers. Use of the
  15. * software is governed by this copyright notice and the following disclaimer.
  16. *
  17. * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  18. * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  19. * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  20. * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  21. * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  23. *
  24. **************************************************************************
  25. */
  26. /* define to prevent recursive inclusion -------------------------------------*/
  27. #ifndef __CDC_DESC_H
  28. #define __CDC_DESC_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #include "cdc_class.h"
  33. #include "usbd_core.h"
  34. /** @addtogroup AT32F403A_407_middlewares_usbd_class
  35. * @{
  36. */
  37. /** @addtogroup USB_cdc_desc
  38. * @{
  39. */
  40. /** @defgroup USB_cdc_desc_definition
  41. * @{
  42. */
  43. /**
  44. * @brief usb bcd number define
  45. */
  46. #define BCD_NUM 0x0110
  47. /**
  48. * @brief usb vendor id and product id define
  49. */
  50. #define USBD_VENDOR_ID 0x2E3C
  51. #define USBD_PRODUCT_ID 0x5740
  52. /**
  53. * @brief usb descriptor size define
  54. */
  55. #define USBD_CONFIG_DESC_SIZE 67
  56. #define USBD_SIZ_STRING_LANGID 4
  57. #define USBD_SIZ_STRING_SERIAL 0x1A
  58. /**
  59. * @brief usb string define(vendor, product configuration, interface)
  60. */
  61. #define USBD_DESC_MANUFACTURER_STRING "Artery"
  62. #define USBD_DESC_PRODUCT_STRING "AT32 Virtual Com Port"
  63. #define USBD_DESC_CONFIGURATION_STRING "Virtual ComPort Config"
  64. #define USBD_DESC_INTERFACE_STRING "Virtual ComPort Interface"
  65. /**
  66. * @brief usb endpoint interval define
  67. */
  68. #define HID_BINTERVAL_TIME 0xFF
  69. /**
  70. * @brief usb hid class descriptor define
  71. */
  72. #define USBD_CDC_CS_INTERFACE 0x24
  73. #define USBD_CDC_CS_ENDPOINT 0x25
  74. /**
  75. * @brief usb hid class sub-type define
  76. */
  77. #define USBD_CDC_SUBTYPE_HEADER 0x00
  78. #define USBD_CDC_SUBTYPE_CMF 0x01
  79. #define USBD_CDC_SUBTYPE_ACM 0x02
  80. #define USBD_CDC_SUBTYPE_UFD 0x06
  81. /**
  82. * @brief usb mcu id address deine
  83. */
  84. #define MCU_ID1 (0x1FFFF7E8)
  85. #define MCU_ID2 (0x1FFFF7EC)
  86. #define MCU_ID3 (0x1FFFF7F0)
  87. /**
  88. * @}
  89. */
  90. extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
  91. extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
  92. extern usbd_desc_handler desc_handler;
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif
  97. /**
  98. * @}
  99. */
  100. /**
  101. * @}
  102. */