ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
usb_cdc.c File Reference

USB CDC binding of the USB link (see usb_cdc.h). More...

#include "usb_cdc.h"
#include "usb_link.h"
#include "usbd_core.h"
#include "usbd_cdc.h"
#include "usbd_desc.h"
Include dependency graph for usb_cdc.c:

Go to the source code of this file.

Functions

static int8_t itf_init (void)
 
static int8_t itf_deinit (void)
 
static int8_t itf_control (uint8_t cmd, uint8_t *p, uint16_t len)
 
static int8_t itf_receive (uint8_t *buf, uint32_t *len)
 
static int8_t itf_tx_done (uint8_t *buf, uint32_t *len, uint8_t ep)
 
int usb_cdc_init (void)
 0 = started
 
uint8_t usb_cdc_configured (void)
 enumerated by a host
 
void usb_cdc_pump (void)
 

Variables

static USBD_HandleTypeDef s_dev
 
static uint8_t s_rx [CDC_DATA_FS_MAX_PACKET_SIZE]
 
static uint8_t s_tx [2048]
 
static USBD_CDC_LineCodingTypeDef s_line = { 115200u, 0u, 0u, 8u }
 
static USBD_CDC_ItfTypeDef s_itf = { itf_init, itf_deinit, itf_control, itf_receive, itf_tx_done }
 

Detailed Description

USB CDC binding of the USB link (see usb_cdc.h).

Definition in file usb_cdc.c.

Function Documentation

◆ itf_init()

static int8_t itf_init ( void  )
static

Definition at line 16 of file usb_cdc.c.

References s_dev, s_rx, and s_tx.

◆ itf_deinit()

static int8_t itf_deinit ( void  )
static

Definition at line 23 of file usb_cdc.c.

◆ itf_control()

static int8_t itf_control ( uint8_t  cmd,
uint8_t *  p,
uint16_t  len 
)
static

Definition at line 25 of file usb_cdc.c.

References cmd(), s_line, and usbl_set_dtr().

Here is the call graph for this function:

◆ itf_receive()

static int8_t itf_receive ( uint8_t *  buf,
uint32_t *  len 
)
static

Definition at line 45 of file usb_cdc.c.

References s_dev, s_rx, and usbl_rx_isr().

Here is the call graph for this function:

◆ itf_tx_done()

static int8_t itf_tx_done ( uint8_t *  buf,
uint32_t *  len,
uint8_t  ep 
)
static

Definition at line 53 of file usb_cdc.c.

◆ usb_cdc_init()

int usb_cdc_init ( void  )

0 = started

Definition at line 61 of file usb_cdc.c.

References ACW_FS_Desc, DEVICE_FS, s_dev, and s_itf.

Referenced by app_start().

Here is the caller graph for this function:

◆ usb_cdc_configured()

uint8_t usb_cdc_configured ( void  )

enumerated by a host

Definition at line 70 of file usb_cdc.c.

References s_dev.

Referenced by usb_cdc_pump().

Here is the caller graph for this function:

◆ usb_cdc_pump()

void usb_cdc_pump ( void  )

Definition at line 72 of file usb_cdc.c.

References n, s_dev, s_tx, usb_cdc_configured(), usbl_set_configured(), usbl_tx_consume(), usbl_tx_flush(), and usbl_tx_peek().

Referenced by app_start().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_dev

USBD_HandleTypeDef s_dev
static

Definition at line 11 of file usb_cdc.c.

Referenced by itf_init(), itf_receive(), usb_cdc_configured(), usb_cdc_init(), and usb_cdc_pump().

◆ s_rx

uint8_t s_rx[CDC_DATA_FS_MAX_PACKET_SIZE]
static

Definition at line 12 of file usb_cdc.c.

Referenced by itf_init(), and itf_receive().

◆ s_tx

uint8_t s_tx[2048]
static

Definition at line 13 of file usb_cdc.c.

Referenced by itf_init(), and usb_cdc_pump().

◆ s_line

USBD_CDC_LineCodingTypeDef s_line = { 115200u, 0u, 0u, 8u }
static

Definition at line 14 of file usb_cdc.c.

Referenced by itf_control().

◆ s_itf

USBD_CDC_ItfTypeDef s_itf = { itf_init, itf_deinit, itf_control, itf_receive, itf_tx_done }
static

Definition at line 59 of file usb_cdc.c.

Referenced by usb_cdc_init().