Functions | Variables
usbd_cdc_vcp.c File Reference

Generic media access Layer. More...

#include "usbd_cdc_vcp.h"
#include "stm32f4xx_conf.h"
#include "stdbool.h"
#include "system.h"
Include dependency graph for usbd_cdc_vcp.c:

Go to the source code of this file.

Functions

uint32_t CDC_BaudRate (void)
 
uint32_t CDC_Receive_BytesAvailable (void)
 
uint32_t CDC_Receive_DATA (uint8_t *recvBuf, uint32_t len)
 
uint32_t CDC_Send_DATA (const uint8_t *ptrBuffer, uint32_t sendLength)
 
uint32_t CDC_Send_FreeBytes (void)
 
void CDC_SetBaudRateCb (void(*cb)(void *context, uint32_t baud), void *context)
 
void CDC_SetCtrlLineStateCb (void(*cb)(void *context, uint16_t ctrlLineState), void *context)
 
uint8_t usbIsConfigured (void)
 
uint8_t usbIsConnected (void)
 
void ust_cpy (LINE_CODING *plc2, const LINE_CODING *plc1)
 
static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t *Buf, uint32_t Len)
 VCP_Ctrl Manage the CDC class requests. More...
 
static uint16_t VCP_DataRx (uint8_t *Buf, uint32_t Len)
 VCP_DataRx Data received over USB OUT endpoint are sent over CDC interface through this function. More...
 
static uint16_t VCP_DataTx (const uint8_t *Buf, uint32_t Len)
 VCP_DataTx CDC data to be sent to the Host (app) over USB. More...
 
static uint16_t VCP_DeInit (void)
 VCP_DeInit DeInitializes the Media on the STM32. More...
 
static uint16_t VCP_Init (void)
 VCP_Init Initializes the Media on the STM32. More...
 

Variables

uint8_t APP_Rx_Buffer []
 
uint32_t APP_Rx_ptr_in
 
uint32_t APP_Rx_ptr_out
 
static uint8_t APP_Tx_Buffer [APP_TX_DATA_SIZE]
 
static uint32_t APP_Tx_ptr_in = 0
 
static uint32_t APP_Tx_ptr_out = 0
 
static void(* baudRateCb )(void *context, uint32_t baud)
 
static void * baudRateCbContext
 
__IO uint32_t bDeviceState = UNCONNECTED
 
static void(* ctrlLineStateCb )(void *context, uint16_t ctrlLineState)
 
static void * ctrlLineStateCbContext
 
LINE_CODING g_lc
 
USB_OTG_CORE_HANDLE USB_OTG_dev
 
__IO uint8_t USB_Tx_State
 
CDC_IF_Prop_TypeDef VCP_fops = {VCP_Init, VCP_DeInit, VCP_Ctrl, VCP_DataTx, VCP_DataRx }
 

Detailed Description

Generic media access Layer.

Author
MCD Application Team
Version
V1.0.0
Date
22-July-2011
Attention

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2011 STMicroelectronics

Definition in file usbd_cdc_vcp.c.

Function Documentation

uint32_t CDC_BaudRate ( void  )

Definition at line 313 of file usbd_cdc_vcp.c.

uint32_t CDC_Receive_BytesAvailable ( void  )

Definition at line 247 of file usbd_cdc_vcp.c.

uint32_t CDC_Receive_DATA ( uint8_t *  recvBuf,
uint32_t  len 
)

Definition at line 235 of file usbd_cdc_vcp.c.

uint32_t CDC_Send_DATA ( const uint8_t *  ptrBuffer,
uint32_t  sendLength 
)

Definition at line 181 of file usbd_cdc_vcp.c.

uint32_t CDC_Send_FreeBytes ( void  )

Definition at line 187 of file usbd_cdc_vcp.c.

void CDC_SetBaudRateCb ( void(*)(void *context, uint32_t baud)  cb,
void *  context 
)

Definition at line 325 of file usbd_cdc_vcp.c.

void CDC_SetCtrlLineStateCb ( void(*)(void *context, uint16_t ctrlLineState)  cb,
void *  context 
)

Definition at line 338 of file usbd_cdc_vcp.c.

uint8_t usbIsConfigured ( void  )

Definition at line 289 of file usbd_cdc_vcp.c.

uint8_t usbIsConnected ( void  )

Definition at line 301 of file usbd_cdc_vcp.c.

void ust_cpy ( LINE_CODING plc2,
const LINE_CODING plc1 
)

Definition at line 100 of file usbd_cdc_vcp.c.

static uint16_t VCP_Ctrl ( uint32_t  Cmd,
uint8_t *  Buf,
uint32_t  Len 
)
static

VCP_Ctrl Manage the CDC class requests.

Parameters
CmdCommand code
BufBuffer containing command data (request parameters)
LenNumber of data to be sent (in bytes)
Return values
Resultof the opeartion (USBD_OK in all cases)

Definition at line 116 of file usbd_cdc_vcp.c.

static uint16_t VCP_DataRx ( uint8_t *  Buf,
uint32_t  Len 
)
static

VCP_DataRx Data received over USB OUT endpoint are sent over CDC interface through this function.

Note
This function will block any OUT packet reception on USB endpoint until exiting this function. If you exit this function before transfer is complete on CDC interface (ie. using DMA controller) it will result in receiving more data while previous ones are still not sent.
Parameters
BufBuffer of data to be received
LenNumber of data received (in bytes)
Return values
Resultof the opeartion: USBD_OK if all operations are OK else VCP_FAIL

Definition at line 268 of file usbd_cdc_vcp.c.

static uint16_t VCP_DataTx ( const uint8_t *  Buf,
uint32_t  Len 
)
static

VCP_DataTx CDC data to be sent to the Host (app) over USB.

Parameters
BufBuffer of data to be sent
LenNumber of data to be sent (in bytes)
Return values
Resultof the operation: USBD_OK if all operations are OK else VCP_FAIL

Definition at line 206 of file usbd_cdc_vcp.c.

static uint16_t VCP_DeInit ( void  )
static

VCP_DeInit DeInitializes the Media on the STM32.

Parameters
None
Return values
Resultof the opeartion (USBD_OK in all cases)

Definition at line 94 of file usbd_cdc_vcp.c.

static uint16_t VCP_Init ( void  )
static

VCP_Init Initializes the Media on the STM32.

Parameters
None
Return values
Resultof the opeartion (USBD_OK in all cases)

Definition at line 80 of file usbd_cdc_vcp.c.

Variable Documentation

uint8_t APP_Rx_Buffer[]
uint8_t APP_Tx_Buffer[APP_TX_DATA_SIZE]
static

Definition at line 53 of file usbd_cdc_vcp.c.

uint32_t APP_Tx_ptr_in = 0
static

Definition at line 55 of file usbd_cdc_vcp.c.

uint32_t APP_Tx_ptr_out = 0
static

Definition at line 54 of file usbd_cdc_vcp.c.

void(* baudRateCb) (void *context, uint32_t baud)
static

Definition at line 65 of file usbd_cdc_vcp.c.

void* baudRateCbContext
static

Definition at line 66 of file usbd_cdc_vcp.c.

__IO uint32_t bDeviceState = UNCONNECTED

Definition at line 37 of file usbd_cdc_vcp.c.

void(* ctrlLineStateCb) (void *context, uint16_t ctrlLineState)
static

Definition at line 63 of file usbd_cdc_vcp.c.

void* ctrlLineStateCbContext
static

Definition at line 64 of file usbd_cdc_vcp.c.

Definition at line 32 of file usbd_cdc_vcp.c.

USB_OTG_CORE_HANDLE USB_OTG_dev

Definition at line 34 of file usbd_cdc_vcp.c.

Definition at line 70 of file usbd_cdc_vcp.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:21