Support programming of Arduino devices in serial passthrough mode (#5129)
[betaflight.git] / src / main / vcpf4 / usbd_cdc_vcp.h
blob0a046ad1b70aaf5ec414e18f633e517550530bed
1 /**
2 ******************************************************************************
3 * @file usbd_cdc_vcp.h
4 * @author MCD Application Team
5 * @version V1.0.0
6 * @date 22-July-2011
7 * @brief Header for usbd_cdc_vcp.c file.
8 ******************************************************************************
9 * @attention
11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18 * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
19 ******************************************************************************
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef __USBD_CDC_VCP_H
24 #define __USBD_CDC_VCP_H
26 /* Includes ------------------------------------------------------------------*/
27 #include "stm32f4xx_conf.h"
29 #include "usbd_cdc_core.h"
30 #include "usbd_conf.h"
31 #include <stdint.h>
33 #include "usbd_core.h"
34 #include "usbd_usr.h"
35 #include "usbd_desc.h"
37 __ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
39 uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint32_t sendLength);
40 uint32_t CDC_Send_FreeBytes(void);
41 uint32_t CDC_Receive_DATA(uint8_t* recvBuf, uint32_t len); // HJI
42 uint32_t CDC_Receive_BytesAvailable(void);
44 uint8_t usbIsConfigured(void); // HJI
45 uint8_t usbIsConnected(void); // HJI
46 uint32_t CDC_BaudRate(void);
47 void CDC_SetCtrlLineStateCb(void (*cb)(void *context, uint16_t ctrlLineState), void *context);
48 void CDC_SetBaudRateCb(void (*cb)(void *context, uint32_t baud), void *context);
50 /* External variables --------------------------------------------------------*/
51 extern __IO uint32_t bDeviceState; /* USB device status */
53 typedef enum _DEVICE_STATE {
54 UNCONNECTED,
55 ATTACHED,
56 POWERED,
57 SUSPENDED,
58 ADDRESSED,
59 CONFIGURED
60 } DEVICE_STATE;
62 /* Exported typef ------------------------------------------------------------*/
63 /* The following structures groups all needed parameters to be configured for the
64 ComPort. These parameters can modified on the fly by the host through CDC class
65 command class requests. */
66 typedef struct __attribute__ ((packed))
68 uint32_t bitrate;
69 uint8_t format;
70 uint8_t paritytype;
71 uint8_t datatype;
72 } LINE_CODING;
75 #endif /* __USBD_CDC_VCP_H */