Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

151 rader
3.0 KiB

  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : usbd_cdc_if.h
  5. * @version : v1.0_Cube
  6. * @brief : Header for usbd_cdc_if.c file.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2026 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __USBD_CDC_IF_H__
  22. #define __USBD_CDC_IF_H__
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "usbd_cdc.h"
  28. /* USER CODE BEGIN INCLUDE */
  29. #include <stdint.h>
  30. /* USER CODE END INCLUDE */
  31. /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
  32. * @brief For Usb device.
  33. * @{
  34. */
  35. /** @defgroup USBD_CDC_IF USBD_CDC_IF
  36. * @brief Usb VCP device module
  37. * @{
  38. */
  39. /** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines
  40. * @brief Defines.
  41. * @{
  42. */
  43. /* Define size for the receive and transmit buffer over CDC */
  44. #define APP_RX_DATA_SIZE 2048
  45. #define APP_TX_DATA_SIZE 2048
  46. /* USER CODE BEGIN EXPORTED_DEFINES */
  47. /* USER CODE END EXPORTED_DEFINES */
  48. /**
  49. * @}
  50. */
  51. /** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types
  52. * @brief Types.
  53. * @{
  54. */
  55. /* USER CODE BEGIN EXPORTED_TYPES */
  56. /** Read-only USB CDC activity snapshot used by production diagnostics. */
  57. typedef struct
  58. {
  59. uint32_t rxPacketCount;
  60. uint32_t rxByteCount;
  61. uint32_t rxRearmFailureCount;
  62. uint32_t txRequestCount;
  63. uint32_t txByteCount;
  64. uint32_t txBusyCount;
  65. uint32_t txFailureCount;
  66. uint32_t txCompleteCount;
  67. uint8_t initialized;
  68. } USB_CDC_RUNTIME_DIAGNOSTICS;
  69. /* USER CODE END EXPORTED_TYPES */
  70. /**
  71. * @}
  72. */
  73. /** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros
  74. * @brief Aliases.
  75. * @{
  76. */
  77. /* USER CODE BEGIN EXPORTED_MACRO */
  78. /* USER CODE END EXPORTED_MACRO */
  79. /**
  80. * @}
  81. */
  82. /** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables
  83. * @brief Public variables.
  84. * @{
  85. */
  86. /** CDC Interface callback. */
  87. extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS;
  88. /* USER CODE BEGIN EXPORTED_VARIABLES */
  89. /* USER CODE END EXPORTED_VARIABLES */
  90. /**
  91. * @}
  92. */
  93. /** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype
  94. * @brief Public functions declaration.
  95. * @{
  96. */
  97. uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len);
  98. /* USER CODE BEGIN EXPORTED_FUNCTIONS */
  99. uint8_t CDC_GetRuntimeDiagnostics(USB_CDC_RUNTIME_DIAGNOSTICS *diagnostics);
  100. /* USER CODE END EXPORTED_FUNCTIONS */
  101. /**
  102. * @}
  103. */
  104. /**
  105. * @}
  106. */
  107. /**
  108. * @}
  109. */
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113. #endif /* __USBD_CDC_IF_H__ */