![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
#include "UsbDeviceCdcCom.h"
Go to the source code of this file.
Functions | |
| static void | ConfCallback (stc_usbn_t *pstcUsb) |
| Configuration change callback, used to see if configuration is set or cleared. More... | |
| static void | RxTxCallback (stc_usbn_t *pstcUsb, struct stc_usbn_endpoint_data *pstcEndpoint) |
| Receive or transmitted data callback. More... | |
| static boolean_t | SendData (uint8_t *pu8Buffer, uint32_t u32DataSize, en_usbsend_mode_t enMode) |
| static void | DecodeSetupRequest (stc_usbn_t *pstcUsb, stc_usb_request_t *pstcSetup) |
| static void | SetLineCoding (stc_usbn_t *pstcUsb, stc_usbn_endpoint_data_t *pstcEndpoint) |
| static void | SendLineCoding (void) |
| static uint32_t | ASCIItobin (uint8_t k) |
| void | UsbDeviceCdcCom_Init (stc_usbn_t *pstcUsb) |
| Initialisation callback. More... | |
| void | UsbDeviceCdcCom_SetReceivedCallback (cdc_data_received_t pstnCallback) |
| void | UsbDeviceCdcCom_SetSentCallback (cdc_data_sent_t pstnCallback) |
| boolean_t | UsbDeviceCdcCom_DataSent (void) |
| void | UsbDeviceCdcCom_SetCallbackLineCodingChange (usbdevicecdccom_linecodingchange_func_ptr_t pfnLineCodingChangeCallback) |
| boolean_t | UsbDeviceCdcCom_IsConnected (void) |
| uint8_t | UsbDeviceCdcCom_SendByte (char_t c) |
| uint8_t | UsbDeviceCdcCom_SendString (char_t *pcBuffer) |
| uint8_t | UsbDeviceCdcCom_SendBuffer (uint8_t *pu8Buffer, uint32_t u32Size) |
| void | UsbDeviceCdcCom_SetSeparator (const char_t cNewSeperator) |
| void | UsbDeviceCdcCom_SetEchomode (boolean_t bEchoOnOff) |
| void | UsbDeviceCdcCom_SetEchoAtSeperatorOnly (boolean_t bEchoAtSeperatorOnlyOnOff) |
| uint32_t | UsbDeviceCdcCom_ReceivedLength (void) |
| uint32_t | UsbDeviceCdcCom_ReceiveBuffer (uint8_t *pu8Buffer) |
| uint8_t | UsbDeviceCdcCom_ReceiveByte (void) |
| uint8_t | UsbDeviceCdcCom_ReceiveLastByte (void) |
| uint8_t | UsbDeviceCdcCom_SendHex (uint32_t n, uint8_t digits) |
| uint8_t | UsbDeviceCdcCom_SendDec (uint32_t x) |
| void | UsbDeviceCdcCom_SendBinAsci4 (uint16_t a, uint8_t base, char_t fill) |
| void | UsbDeviceCdcCom_SendBinAsci8 (uint16_t a, uint8_t base, char_t fill) |
| void | UsbDeviceCdcCom_SendBin2DotDec99 (uint8_t a) |
| uint32_t | UsbDeviceCdcCom_ReceiveHex (uint8_t digits) |
Variables | |
| static const char_t | pcASCII [] = "0123456789ABCDEF" |
| static volatile uint8_t | DataReceivedFlags = 0 |
| static volatile uint8_t | DataSentFlags = 0 |
| static uint8_t | pu8VcommBuffer [512] |
| static stc_cdc_linecoding_t | stcLineCoding = {9600, 0 , 0 ,8} |
| static uint8_t | pu8LineCoding [8] |
| static boolean_t | bEchoMode = FALSE |
| static boolean_t | bEchoAtSeperatorOnly = FALSE |
| static boolean_t | bVcommActive = FALSE |
| static boolean_t | bSeperatorFlag = FALSE |
| static char_t | cSeperator = '\0' |
| static volatile uint32_t | u32ReceivedData = 0 |
| static uint8_t | pu8IngoingBuffer [128] |
| static boolean_t | bReady = FALSE |
| static stc_usbn_t * | pstcUsbHandle = NULL |
| static stc_usbn_endpoint_data_t * | pstcEndpointIN |
| static stc_usbn_endpoint_data_t * | pstcEndpointOUT |
| static stc_usbn_endpoint_buffer_t | stcEndpointBufferIN |
| static stc_usbn_endpoint_buffer_t | stcEndpointBufferOUT |
| static usbdevicecdccom_linecodingchange_func_ptr_t | pfnLineCodingChange |
| static cdc_data_received_t | pstnReceivedData |
| static cdc_data_sent_t | pstnSentData |
CONST USB_ASSISTANT_OFF
A detailed description is available at USB Device Cdc Com Module description
History:
Definition in file UsbDeviceCdcCom.c.
|
static |
Definition at line 876 of file UsbDeviceCdcCom.c.
Referenced by UsbDeviceCdcCom_ReceiveHex().

|
static |
Configuration change callback, used to see if configuration is set or cleared.
| pstcUsb | Pointer to USB instance |
Definition at line 137 of file UsbDeviceCdcCom.c.
References bReady, FALSE, TRUE, UsbConfigured, and UsbDevice_GetStatus().
Referenced by UsbDeviceCdcCom_Init().


|
static |
Decode setup request (class specific) handler
| pstcUsb | USB handle |
| pstcSetup | pointer of setup request |
Definition at line 356 of file UsbDeviceCdcCom.c.
References stc_usb_request::bRequest, bVcommActive, FALSE, GET_LINE_CODING, pstcUsbHandle, SendLineCoding(), SET_CONTROL_LINE_STATE, SET_LINE_CODING, SetLineCoding(), TRUE, UsbDevice_ReceiveDataControl(), UsbDevice_SendDataControl(), and stc_usb_request::wValue.
Referenced by UsbDeviceCdcCom_Init().


|
static |
Receive or transmitted data callback.
| pstcUsb | Pointer to USB instance |
| pstcEndpoint | Pointer to endpoint instance |
Definition at line 158 of file UsbDeviceCdcCom.c.
References bEchoAtSeperatorOnly, bEchoMode, bSeperatorFlag, bVcommActive, cSeperator, DataReceivedFlags, DataSentFlags, FALSE, stc_usbn_endpoint_data::pstcEndpointBuffer, pstcUsbHandle, pstnReceivedData, pstnSentData, stc_usbn_endpoint_buffer::pu8Buffer, pu8VcommBuffer, TRUE, stc_usbn_endpoint_buffer::u32BufferSize, stc_usbn_endpoint_buffer::u32DataSize, u32ReceivedData, stc_usbn_endpoint_data::u8EndpointAddress, UsbDevice_ReceiveData(), UsbDevice_SendData(), USBDEVICECDCCOM_MAX_RECEIVE_BUFFER, UsbIRQ, and UsbPOLL.
Referenced by UsbDeviceCdcCom_Init().


|
static |
Is called from main application to send data via endpoint 1
| pu8Buffer | Buffer to send |
| u32DataSize | Buffersize |
| enMode | Sending mode: UsbPOLL, UsbIRQ or UsbDMA; |
Definition at line 303 of file UsbDeviceCdcCom.c.
References DataSentFlags, FALSE, Ok, pstcUsbHandle, TRUE, UsbConfigured, UsbDevice_GetStatus(), UsbDevice_SendData(), and UsbPOLL.
Referenced by UsbDeviceCdcCom_SendBuffer(), UsbDeviceCdcCom_SendByte(), and UsbDeviceCdcCom_SendString().


|
static |
answer for request "GET_LINE_CODING"
Definition at line 458 of file UsbDeviceCdcCom.c.
References stc_cdc_linecoding::bCharFormat, stc_cdc_linecoding::bDataBits, stc_cdc_linecoding::bParityType, stc_cdc_linecoding::dwDTERate, pstcUsbHandle, pu8LineCoding, and UsbDevice_SendDataControl().
Referenced by DecodeSetupRequest().


|
static |
callback for data package of setup request "SET_LINE_CODING"
| pstcUsb | USB handle |
| pstcEndpoint | endpoint handle of received data |
Definition at line 401 of file UsbDeviceCdcCom.c.
References stc_cdc_linecoding::bCharFormat, stc_cdc_linecoding::bDataBits, stc_cdc_linecoding::bParityType, stc_cdc_linecoding::dwDTERate, pfnLineCodingChange, stc_usbn_endpoint_data::pstcEndpointBuffer, and stc_usbn_endpoint_buffer::pu8Buffer.
Referenced by DecodeSetupRequest().

Definition at line 98 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), and UsbDeviceCdcCom_SetEchoAtSeperatorOnly().
Definition at line 97 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), and UsbDeviceCdcCom_SetEchomode().
Definition at line 104 of file UsbDeviceCdcCom.c.
Referenced by ConfCallback(), and UsbDeviceCdcCom_IsConnected().
Definition at line 100 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), UsbDeviceCdcCom_ReceiveBuffer(), and UsbDeviceCdcCom_ReceivedLength().
Definition at line 99 of file UsbDeviceCdcCom.c.
Referenced by DecodeSetupRequest(), RxTxCallback(), UsbDeviceCdcCom_IsConnected(), UsbDeviceCdcCom_SendBuffer(), UsbDeviceCdcCom_SendByte(), and UsbDeviceCdcCom_SendString().
|
static |
Definition at line 101 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), UsbDeviceCdcCom_ReceivedLength(), and UsbDeviceCdcCom_SetSeparator().
|
static |
Definition at line 92 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback().
|
static |
Definition at line 93 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), SendData(), and UsbDeviceCdcCom_DataSent().
|
static |
Definition at line 80 of file UsbDeviceCdcCom.c.
Referenced by UsbDeviceCdcCom_SendDec(), and UsbDeviceCdcCom_SendHex().
|
static |
Definition at line 110 of file UsbDeviceCdcCom.c.
Referenced by SetLineCoding(), and UsbDeviceCdcCom_SetCallbackLineCodingChange().
|
static |
Definition at line 106 of file UsbDeviceCdcCom.c.
|
static |
Definition at line 107 of file UsbDeviceCdcCom.c.
|
static |
Definition at line 105 of file UsbDeviceCdcCom.c.
Referenced by DecodeSetupRequest(), RxTxCallback(), SendData(), SendLineCoding(), and UsbDeviceCdcCom_Init().
|
static |
Definition at line 121 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), and UsbDeviceCdcCom_SetReceivedCallback().
|
static |
Definition at line 122 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), and UsbDeviceCdcCom_SetSentCallback().
|
static |
Definition at line 103 of file UsbDeviceCdcCom.c.
Referenced by UsbDeviceCdcCom_Init().
|
static |
Definition at line 96 of file UsbDeviceCdcCom.c.
Referenced by SendLineCoding().
|
static |
Definition at line 94 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), UsbDeviceCdcCom_ReceiveBuffer(), UsbDeviceCdcCom_ReceiveByte(), and UsbDeviceCdcCom_ReceiveLastByte().
|
static |
Definition at line 108 of file UsbDeviceCdcCom.c.
Referenced by UsbDeviceCdcCom_Init().
|
static |
Definition at line 109 of file UsbDeviceCdcCom.c.
Referenced by UsbDeviceCdcCom_Init().
|
static |
Definition at line 95 of file UsbDeviceCdcCom.c.
|
static |
Definition at line 102 of file UsbDeviceCdcCom.c.
Referenced by RxTxCallback(), UsbDeviceCdcCom_ReceiveBuffer(), UsbDeviceCdcCom_ReceiveByte(), UsbDeviceCdcCom_ReceivedLength(), and UsbDeviceCdcCom_ReceiveLastByte().