CuVoodoo STM32F1 firmware template
|
library for USB CDC ACM communication (code) More...
Go to the source code of this file.
Functions | |
struct { | |
struct usb_cdc_header_descriptor header | |
header | |
struct usb_cdc_call_management_descriptor call_mgmt | |
call management descriptor | |
struct usb_cdc_acm_descriptor acm | |
descriptor | |
struct usb_cdc_union_descriptor cdc_union | |
descriptor | |
} | __attribute__ ((packed)) |
USB CDC ACM functional descriptor. More... | |
static void | usb_disconnect (void) |
disconnect USB by pulling down D+ to for re-enumerate | |
static int | cdcacm_control_request (usbd_device *usbd_dev, struct usb_setup_data *req, uint8_t **buf, uint16_t *len, void(**complete)(usbd_device *usbd_dev, struct usb_setup_data *req)) |
incoming USB CDC ACM control request More... | |
static void | cdcacm_data_rx_cb (usbd_device *usbd_dev, uint8_t ep) |
USB CDC ACM data received callback. More... | |
static void | cdcacm_data_tx_cb (usbd_device *usbd_dev, uint8_t ep) |
USB CDC ACM data transmitted callback. More... | |
static void | cdcacm_set_config (usbd_device *usbd_dev, uint16_t wValue) |
set USB CDC ACM configuration More... | |
void | cdcacm_setup (void) |
setup USB CDC ACM peripheral | |
char | cdcacm_getchar (void) |
get character received over USB (blocking) More... | |
void | cdcacm_putchar (char c) |
send character over USB (non-blocking) More... | |
void | usb_lp_can_rx0_isr (void) |
USB interrupt service routine called when data is received. | |
Variables | |
static const struct usb_device_descriptor | device_descriptor |
USB CDC ACM device descriptor. More... | |
static const struct usb_endpoint_descriptor | data_endpoints [] |
USB CDC ACM data endpoints. More... | |
static const struct usb_endpoint_descriptor | communication_endpoints [] |
USB CDC ACM communication endpoints. More... | |
static const struct usb_interface_descriptor | communication_interface [] |
USB CDC interface descriptor. More... | |
static const struct usb_interface_descriptor | data_interface [] |
USB CDC ACM data class interface descriptor. More... | |
static const struct usb_interface | interfaces [] |
USB CDC ACM interface descriptor. More... | |
static const struct usb_config_descriptor | config |
USB CDC ACM configuration descriptor. More... | |
static const char * | usb_strings [] |
USB string table. More... | |
static uint8_t | usbd_control_buffer [128] = {0} |
buffer to be used for control requests | |
static usbd_device * | usb_device = NULL |
structure holding all the info related to the USB device | |
static bool | connected = false |
is the USB device is connected to a host | |
static uint8_t | rx_buffer [CDCACM_BUFFER] = {0} |
ring buffer for received data | |
static volatile uint8_t | rx_i = 0 |
current position of read received data | |
static volatile uint8_t | rx_used = 0 |
how much data has been received and not red | |
mutex_t | rx_lock = MUTEX_UNLOCKED |
lock to update rx_i or rx_used | |
static uint8_t | tx_buffer [CDCACM_BUFFER] = {0} |
ring buffer for data to transmit | |
static volatile uint8_t | tx_i = 0 |
current position if transmitted data | |
static volatile uint8_t | tx_used = 0 |
how much data needs to be transmitted | |
mutex_t | tx_lock = MUTEX_UNLOCKED |
lock to update tx_i or tx_used | |
volatile uint8_t | cdcacm_received = 0 |
how many bytes available in the received buffer since last read | |
|
static |
USB CDC ACM functional descriptor.
< descriptor length
< descriptor type
< descriptor subtype
< CDC value
< descriptor length
< descriptor type
< descriptor subtype
< capabilities
< data interface
< descriptor length
< descriptor type
< descriptor subtype
< capabilities
< descriptor length
< descriptor type
< descriptor subtype
< control interface
< subordinate interface
Definition at line 99 of file usb_cdcacm.c.
|
static |
incoming USB CDC ACM control request
[in] | usbd_dev | USB device descriptor |
[in] | req | control request information |
[in] | buf | control request data |
[in] | len | control request data length |
[in] | complete | not used |
Definition at line 245 of file usb_cdcacm.c.
|
static |
USB CDC ACM data received callback.
[in] | usbd_dev | USB device descriptor |
[in] | ep | endpoint where data came in |
Definition at line 299 of file usb_cdcacm.c.
|
static |
USB CDC ACM data transmitted callback.
[in] | usbd_dev | USB device descriptor |
[in] | ep | endpoint where data came in |
Definition at line 321 of file usb_cdcacm.c.
char cdcacm_getchar | ( | void | ) |
get character received over USB (blocking)
Definition at line 379 of file usb_cdcacm.c.
void cdcacm_putchar | ( | char | c | ) |
send character over USB (non-blocking)
[in] | c | character to send |
Definition at line 391 of file usb_cdcacm.c.
|
static |
set USB CDC ACM configuration
[in] | usbd_dev | USB device descriptor |
[in] | wValue | not used |
Definition at line 346 of file usb_cdcacm.c.
|
static |
USB CDC ACM communication endpoints.
Definition at line 81 of file usb_cdcacm.c.
|
static |
USB CDC interface descriptor.
Definition at line 131 of file usb_cdcacm.c.
|
static |
USB CDC ACM configuration descriptor.
Definition at line 175 of file usb_cdcacm.c.
|
static |
USB CDC ACM data endpoints.
Definition at line 62 of file usb_cdcacm.c.
|
static |
USB CDC ACM data class interface descriptor.
Definition at line 151 of file usb_cdcacm.c.
|
static |
USB CDC ACM device descriptor.
Definition at line 42 of file usb_cdcacm.c.
|
static |
USB CDC ACM interface descriptor.
Definition at line 166 of file usb_cdcacm.c.
|
static |
USB string table.
Definition at line 191 of file usb_cdcacm.c.