usbd_cdc_if.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : usbd_cdc_if.h
  5. * @version : v2.0_Cube
  6. * @brief : Header for usbd_cdc_if.c file.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2022 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under Ultimate Liberty license
  14. * SLA0044, the "License"; You may not use this file except in compliance with
  15. * the License. You may obtain a copy of the License at:
  16. * www.st.com/SLA0044
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __USBD_CDC_IF_H__
  23. #define __USBD_CDC_IF_H__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "usbd_cdc.h"
  29. /* USER CODE BEGIN INCLUDE */
  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 256
  45. #define APP_TX_DATA_SIZE 256
  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. /* USER CODE END EXPORTED_TYPES */
  57. /**
  58. * @}
  59. */
  60. /** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros
  61. * @brief Aliases.
  62. * @{
  63. */
  64. /* USER CODE BEGIN EXPORTED_MACRO */
  65. /* USER CODE END EXPORTED_MACRO */
  66. /**
  67. * @}
  68. */
  69. /** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables
  70. * @brief Public variables.
  71. * @{
  72. */
  73. /** CDC Interface callback. */
  74. extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS;
  75. /* USER CODE BEGIN EXPORTED_VARIABLES */
  76. /* USER CODE END EXPORTED_VARIABLES */
  77. /**
  78. * @}
  79. */
  80. /** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype
  81. * @brief Public functions declaration.
  82. * @{
  83. */
  84. uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len);
  85. /* USER CODE BEGIN EXPORTED_FUNCTIONS */
  86. uint32_t CDC_DataAvailable(void);
  87. int CDC_ReadData(uint8_t *buf, uint32_t len);
  88. int CDC_WriteData(uint8_t *buf, uint32_t len);
  89. /* USER CODE END EXPORTED_FUNCTIONS */
  90. /**
  91. * @}
  92. */
  93. /**
  94. * @}
  95. */
  96. /**
  97. * @}
  98. */
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif /* __USBD_CDC_IF_H__ */