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
TM_USBD_CDC_Functions

Library Functions. More...

Functions

TM_USBD_Result_t TM_USBD_CDC_Init (TM_USB_t USB_Mode)
 Initializes USB DEVICE for CDC class on specific USB mode. More...
 
void TM_USBD_CDC_Process (TM_USB_t USB_Mode)
 Sends all remaining data from CDC TX buffer to USB out. More...
 
uint16_t TM_USBD_CDC_Putc (TM_USB_t USB_Mode, char ch)
 Puts character over USB CDC. More...
 
uint16_t TM_USBD_CDC_Puts (TM_USB_t USB_Mode, const char *str)
 Puts string over USB CDC. More...
 
uint16_t TM_USBD_CDC_PutArray (TM_USB_t USB_Mode, uint8_t *buff, uint16_t count)
 Puts array of data from USB CDC RX buffer. More...
 
uint8_t TM_USBD_CDC_Getc (TM_USB_t USB_Mode, char *ch)
 Gets character from USB CDC RX buffer. More...
 
uint16_t TM_USBD_CDC_Gets (TM_USB_t USB_Mode, char *buff, uint16_t buffsize)
 Gets string from USB CDC RX buffer. More...
 
uint16_t TM_USBD_CDC_GetArray (TM_USB_t USB_Mode, uint8_t *buff, uint16_t count)
 Gets array of data from USB CDC RX buffer. More...
 
void TM_USBD_CDC_GetSettings (TM_USB_t USB_Mode, TM_USBD_CDC_Settings_t *Settings)
 Reads current settings set from user terminal. More...
 
void TM_USBD_CDC_INT_AddToBuffer (USBD_HandleTypeDef *pdev, uint8_t *Values, uint16_t Num)
 

Detailed Description

Library Functions.

Function Documentation

uint16_t TM_USBD_CDC_GetArray ( TM_USB_t  USB_Mode,
uint8_t *  buff,
uint16_t  count 
)

Gets array of data from USB CDC RX buffer.

Parameters
USB_ModeUSB Mode where string will be read. This parameter can be a value of TM_USB_t enumeration
*buffPointer to buffer where array will be stored
countNumber of elements to read
Return values
Numberof elements read from buffer
uint8_t TM_USBD_CDC_Getc ( TM_USB_t  USB_Mode,
char *  ch 
)

Gets character from USB CDC RX buffer.

Parameters
USB_ModeUSB Mode where char will be read. This parameter can be a value of TM_USB_t enumeration
*chPointer to character to store value into
Return values
1in case character is read or zero if buffer empty
uint16_t TM_USBD_CDC_Gets ( TM_USB_t  USB_Mode,
char *  buff,
uint16_t  buffsize 
)

Gets string from USB CDC RX buffer.

Note
Check TM_BUFFER library for more info on how strings are returned
Parameters
USB_ModeUSB Mode where string will be read. This parameter can be a value of TM_USB_t enumeration
*buffPointer to buffer where string will be saved
buffsizeBuffer size in units of bytes
Return values
Numberof elements in string
void TM_USBD_CDC_GetSettings ( TM_USB_t  USB_Mode,
TM_USBD_CDC_Settings_t Settings 
)

Reads current settings set from user terminal.

Parameters
USB_ModeUSB mode where to read settings. This parameter can be a value of TM_USB_t enumeration
*SettingsPointer to TM_USBD_CDC_Settings_t struture to fill data into
Return values
None
TM_USBD_Result_t TM_USBD_CDC_Init ( TM_USB_t  USB_Mode)

Initializes USB DEVICE for CDC class on specific USB mode.

Parameters
USB_ModeUSB Mode where CDC DEVICE will be enabled. This parameter can be a value of TM_USB_t enumeration
Return values
Memberof TM_USBD_Result_t enumeration
void TM_USBD_CDC_Process ( TM_USB_t  USB_Mode)

Sends all remaining data from CDC TX buffer to USB out.

Parameters
USB_ModeUSB Mode where process will be done. This parameter can be a value of TM_USB_t enumeration
Return values
None
uint16_t TM_USBD_CDC_PutArray ( TM_USB_t  USB_Mode,
uint8_t *  buff,
uint16_t  count 
)

Puts array of data from USB CDC RX buffer.

Parameters
USB_ModeUSB Mode where string will be read. This parameter can be a value of TM_USB_t enumeration
*buffPointer to data to be sent over USB CDC
countNumber of elements to send
Return values
Numberof elements written to TX buffer for CDC
uint16_t TM_USBD_CDC_Putc ( TM_USB_t  USB_Mode,
char  ch 
)

Puts character over USB CDC.

Parameters
USB_ModeUSB Mode where transmission will be done. This parameter can be a value of TM_USB_t enumeration
chCharacter to be sent over CDC
Return values
Numberof characters added to TX buffer
uint16_t TM_USBD_CDC_Puts ( TM_USB_t  USB_Mode,
const char *  str 
)

Puts string over USB CDC.

Parameters
USB_ModeUSB Mode where transmission will be done. This parameter can be a value of TM_USB_t enumeration
*strPointer to string to be sent over CDC
Return values
Numberof characters added to TX buffer