TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

USB CDC Device library for STM32Fxxx devices - http://stm32f4-discovery.com/2015/08/hal-library-21-multi-purpose-usb-library-for-stm32fxxx/. More...

Modules

 TM_USBD_CDC_Macros
 Library defines.
 
 TM_USBD_CDC_Typedefs
 Library Typedefs.
 
 TM_USBD_CDC_Functions
 Library Functions.
 

Detailed Description

USB CDC Device library for STM32Fxxx devices - http://stm32f4-discovery.com/2015/08/hal-library-21-multi-purpose-usb-library-for-stm32fxxx/.

This library is designed to allow STM32Fxxx device to acts like CDC device to your computer (Virtual COM port).

Note
Check TM_USB library for configuration settings first!
Main features
- Works on USB FS or HS mode
- Can receive/transmit single character, string or custom array
- Buffer sizes can be selected for user needs
Read terminal settings

Using this library, you can read settings set by user from terminal window on computer if needed. Check TM_USBD_CDC_GetSettings function and TM_USBD_CDC_Settings_t structure for more information.

USBD CDC configuration

Each user can use this library for its own needs. For that purpose, some configurations can be done to maximize use of library. In this function, user can "only" set settings regarding USB CDC TX and RX ring buffers used for CDC application.

Use defines.h file for copy/paste settings you need and change it.

//Receive & transmit buffers size for both USB modes
//This setting is by default the value for all other settings used in library if not changed
//Entire RAM usage if both modes enabled will be 6 * USBD_CDC_BUFFER_SIZE if default settings used
#define USBD_CDC_BUFFER_SIZE 256
//Receive buffer size for FS mode
//Number of bytes for receive on FS USB port if FS mode is enabled in TM_USB library
//Set this to large value if you will use FS mode with a lot of receive data from USB CDC
#define USBD_CDC_RECEIVE_BUFFER_SIZE_FS USBD_CDC_BUFFER_SIZE
//Receive buffer size for HS mode
//Number of bytes for receive on HS USB port if HS mode is enabled in TM_USB library
//Set this to large value if you will use HS mode with a lot of receive data from USB CDC
#define USBD_CDC_RECEIVE_BUFFER_SIZE_HS USBD_CDC_BUFFER_SIZE
//Transmit buffer size for FS mode
//Number of bytes for transmit on FS USB port if FS mode is enabled in TM_USB library
//Set this to large value if you will use FS mode with a lot of transmit data to USB CDC
#define USBD_CDC_TRANSMIT_BUFFER_SIZE_FS USBD_CDC_BUFFER_SIZE
//Transmit buffer size for HS mode
//Number of bytes for transmit on HS USB port if HS mode is enabled in TM_USB library
//Set this to large value if you will use HS mode with a lot of transmit data to USB CDC
#define USBD_CDC_TRANSMIT_BUFFER_SIZE_HS USBD_CDC_BUFFER_SIZE
//Temporary buffer TX size for USB transmissions
//Used for temporary storage data for USB transmission
//Set to large value if a lot of data will be transmitted from device to USB CDC
#define USBD_CDC_TMP_TRANSMIT_BUFFER_SIZE USBD_CDC_BUFFER_SIZE
//Temporary buffer RX size for USB transmissions
//Used for temporary storage data for USB transmission
//Set to large value if a lot of data will be received from USB CDC to device
#define USBD_CDC_TMP_RECEIVE_BUFFER_SIZE USBD_CDC_BUFFER_SIZE
Changelog
 Version 1.0
  - First release
Dependencies
 - STM32Fxxx HAL
 - defines.h
 - TM BUFFER
 - TM DELAY
 - TM USB
 - TM USB DEVICE
 - USB Device Stack
 - USB Device CDC