USBLibAPIGuide  1.00.00.01
Data Structures | Macros | Enumerations | Functions | Variables
Cdc_device_class_api
Collaboration diagram for Cdc_device_class_api:

Data Structures

struct  PACKED
 USB_CDC_GET/SET_LINE_CODING request-specific data. More...
 
struct  tCDCSerInstance
 
struct  tUSBDCDCDevice
 

Macros

#define BYTE(pui8Data)   (*(uint8_t *)(pui8Data))
 
#define SHORT(pui8Data)   (*(uint16_t *)(pui8Data))
 
#define LONG(pui8Data)   (*(uint32_t *)(pui8Data))
 
#define USB_CDC_SUBCLASS_DIRECT_LINE_MODEL   0x01
 
#define USB_CDC_SUBCLASS_ABSTRACT_MODEL   0x02
 
#define USB_CDC_SUBCLASS_TELEPHONE_MODEL   0x03
 
#define USB_CDC_SUBCLASS_MULTI_CHANNEL_MODEL   0x04
 
#define USB_CDC_SUBCLASS_CAPI_MODEL   0x05
 
#define USB_CDC_SUBCLASS_ETHERNET_MODEL   0x06
 
#define USB_CDC_SUBCLASS_ATM_MODEL   0x07
 
#define USB_CDC_PROTOCOL_NONE   0x00
 
#define USB_CDC_PROTOCOL_NONE   0x00
 
#define USB_CDC_PROTOCOL_V25TER   0x01
 
#define USB_CDC_PROTOCOL_VENDOR   0xFF
 
#define USB_CDC_PROTOCOL_VENDOR   0xFF
 
#define USB_CDC_PROTOCOL_I420   0x30
 
#define USB_CDC_PROTOCOL_TRANSPARENT   0x32
 
#define USB_CDC_PROTOCOL_Q921M   0x50
 
#define USB_CDC_PROTOCOL_Q921   0x51
 
#define USB_CDC_PROTOCOL_Q921TM   0x52
 
#define USB_CDC_PROTOCOL_V42BIS   0x90
 
#define USB_CDC_PROTOCOL_Q921EURO   0x91
 
#define USB_CDC_PROTOCOL_V120   0x92
 
#define USB_CDC_PROTOCOL_CAPI20   0x93
 
#define USB_CDC_PROTOCOL_HOST_DRIVER   0xFD
 
#define USB_CDC_PROTOCOL_CDC_SPEC   0xFE
 
#define USB_CDC_CS_INTERFACE   0x24
 
#define USB_CDC_CS_ENDPOINT   0x25
 
#define USB_CDC_FD_SUBTYPE_HEADER   0x00
 
#define USB_CDC_FD_SUBTYPE_CALL_MGMT   0x01
 
#define USB_CDC_FD_SUBTYPE_ABSTRACT_CTL_MGMT   0x02
 
#define USB_CDC_FD_SUBTYPE_DIRECT_LINE_MGMT   0x03
 
#define USB_CDC_FD_SUBTYPE_TELEPHONE_RINGER   0x04
 
#define USB_CDC_FD_SUBTYPE_LINE_STATE_CAPS   0x05
 
#define USB_CDC_FD_SUBTYPE_UNION   0x06
 
#define USB_CDC_FD_SUBTYPE_COUNTRY   0x07
 
#define USB_CDC_FD_SUBTYPE_TELEPHONE_MODES   0x08
 
#define USB_CDC_FD_SUBTYPE_USB_TERMINAL   0x09
 
#define USB_CDC_FD_SUBTYPE_NETWORK_TERMINAL   0x0A
 
#define USB_CDC_FD_SUBTYPE_PROTOCOL_UNIT   0x0B
 
#define USB_CDC_FD_SUBTYPE_EXTENSION_UNIT   0x0C
 
#define USB_CDC_FD_SUBTYPE_MULTI_CHANNEL_MGMT   0x0D
 
#define USB_CDC_FD_SUBTYPE_CAPI_MGMT   0x0E
 
#define USB_CDC_FD_SUBTYPE_ETHERNET   0x0F
 
#define USB_CDC_FD_SUBTYPE_ATM   0x10
 
#define USB_CDC_CALL_MGMT_VIA_DATA   0x02
 
#define USB_CDC_CALL_MGMT_HANDLED   0x01
 
#define USB_CDC_ACM_SUPPORTS_NETWORK_CONNECTION   0x08
 
#define USB_CDC_ACM_SUPPORTS_SEND_BREAK   0x04
 
#define USB_CDC_ACM_SUPPORTS_LINE_PARAMS   0x02
 
#define USB_CDC_ACM_SUPPORTS_COMM_FEATURE   0x01
 
#define USB_CDC_DLM_NEEDS_EXTRA_PULSE_SETUP   0x04
 
#define USB_CDC_DLM_SUPPORTS_AUX   0x02
 
#define USB_CDC_DLM_SUPPORTS_PULSE   0x01
 
#define USB_CDC_TELEPHONE_SUPPORTS_COMPUTER   0x04
 
#define USB_CDC_TELEPHONE_SUPPORTS_STANDALONE   0x02
 
#define USB_CDC_TELEPHONE_SUPPORTS_SIMPLE   0x01
 
#define USB_CDC_LINE_STATE_CHANGES_NOTIFIED   0x20
 
#define USB_CDC_LINE_STATE_REPORTS_DTMF   0x10
 
#define USB_CDC_LINE_STATE_REPORTS_DIST_RING   0x08
 
#define USB_CDC_LINE_STATE_REPORTS_CALLERID   0x04
 
#define USB_CDC_LINE_STATE_REPORTS_BUSY   0x02
 
#define USB_CDC_LINE_STATE_REPORTS_INT_DIALTONE   0x01
 
#define USB_CDC_TERMINAL_NO_WRAPPER_USED   0x00
 
#define USB_CDC_TERMINAL_WRAPPER_USED   0x01
 
#define USB_CDC_MCM_SUPPORTS_SET_UNIT_PARAM   0x04
 
#define USB_CDC_MCM_SUPPORTS_CLEAR_UNIT_PARAM   0x02
 
#define USB_CDC_MCM_UNIT_PARAMS_NON_VOLATILE   0x01
 
#define USB_CDC_CAPI_INTELLIGENT   0x01
 
#define USB_CDC_CAPI_SIMPLE   0x00
 
#define USB_CDC_ETHERNET_XMIT_OK   0x01000000
 
#define USB_CDC_ETHERNET_RCV_OK   0x02000000
 
#define USB_CDC_ETHERNET_XMIT_ERROR   0x04000000
 
#define USB_CDC_ETHERNET_RCV_ERROR   0x08000000
 
#define USB_CDC_ETHERNET_RCV_NO_BUFFER   0x10000000
 
#define USB_CDC_ETHERNET_DIRECTED_BYTES_XMIT   0x20000000
 
#define USB_CDC_ETHERNET_DIRECTED_FRAMES_XMIT   0x40000000
 
#define USB_CDC_ETHERNET_MULTICAST_BYTES_XMIT   0x80000000
 
#define USB_CDC_ETHERNET_MULTICAST_FRAMES_XMIT   0x00010000
 
#define USB_CDC_ETHERNET_BROADCAST_BYTES_XMIT   0x00020000
 
#define USB_CDC_ETHERNET_BROADCAST_FRAMES_XMIT   0x00040000
 
#define USB_CDC_ETHERNET_DIRECTED_BYTES_RCV   0x00080000
 
#define USB_CDC_ETHERNET_DIRECTED_FRAMES_RCV   0x00100000
 
#define USB_CDC_ETHERNET_MULTICAST_BYTES_RCV   0x00200000
 
#define USB_CDC_ETHERNET_MULTICAST_FRAMES_RCV   0x00400000
 
#define USB_CDC_ETHERNET_BROADCAST_BYTES_RCV   0x00800000
 
#define USB_CDC_ETHERNET_BROADCAST_FRAMES_RCV   0x00000100
 
#define USB_CDC_ETHERNET_RCV_CRC_ERROR   0x00000200
 
#define USB_CDC_ETHERNET_TRANSMIT_QUEUE_LENGTH   0x00000400
 
#define USB_CDC_ETHERNET_RCV_ERROR_ALIGNMENT   0x00000800
 
#define USB_CDC_ETHERNET_XMIT_ONE_COLLISION   0x00001000
 
#define USB_CDC_ETHERNET_XMIT_MORE_COLLISIONS   0x00002000
 
#define USB_CDC_ETHERNET_XMIT_DEFERRED   0x00004000
 
#define USB_CDC_ETHERNET_XMIT_MAX_COLLISIONS   0x00008000
 
#define USB_CDC_ETHERNET_RCV_OVERRUN   0x00000001
 
#define USB_CDC_ETHERNET_XMIT_UNDERRUN   0x00000002
 
#define USB_CDC_ETHERNET_XMIT_HEARTBEAT_FAILURE   0x00000004
 
#define USB_CDC_ETHERNET_XMIT_TIMES_CRS_LOST   0x00000010
 
#define USB_CDC_ATM_TYPE_3   0x08
 
#define USB_CDC_ATM_TYPE_2   0x04
 
#define USB_CDC_ATM_TYPE_1   0x02
 
#define USB_CDC_ATM_VC_US_CELLS_SENT   0x10
 
#define USB_CDC_ATM_VC_US_CELLS_RECEIVED   0x08
 
#define USB_CDC_ATM_DS_CELLS_HEC_ERR_CORRECTED   0x04
 
#define USB_CDC_ATM_US_CELLS_SENT   0x02
 
#define USB_CDC_ATM_US_CELLS_RECEIVED   0x01
 
#define USB_CDC_SEND_ENCAPSULATED_COMMAND   0x00
 
#define USB_CDC_GET_ENCAPSULATED_RESPONSE   0x01
 
#define USB_CDC_SET_COMM_FEATURE   0x02
 
#define USB_CDC_GET_COMM_FEATURE   0x03
 
#define USB_CDC_CLEAR_COMM_FEATURE   0x04
 
#define USB_CDC_SET_AUX_LINE_STATE   0x10
 
#define USB_CDC_SET_HOOK_STATE   0x11
 
#define USB_CDC_PULSE_SETUP   0x12
 
#define USB_CDC_SEND_PULSE   0x13
 
#define USB_CDC_SET_PULSE_TIME   0x14
 
#define USB_CDC_RING_AUX_JACK   0x15
 
#define USB_CDC_SET_LINE_CODING   0x20
 
#define USB_CDC_GET_LINE_CODING   0x21
 
#define USB_CDC_SET_CONTROL_LINE_STATE   0x22
 
#define USB_CDC_SEND_BREAK   0x23
 
#define USB_CDC_SET_RINGER_PARMS   0x30
 
#define USB_CDC_GET_RINGER_PARMS   0x31
 
#define USB_CDC_SET_OPERATION_PARMS   0x32
 
#define USB_CDC_GET_OPERATION_PARMS   0x33
 
#define USB_CDC_SET_LINE_PARMS   0x34
 
#define USB_CDC_GET_LINE_PARMS   0x35
 
#define USB_CDC_DIAL_DIGITS   0x36
 
#define USB_CDC_SET_UNIT_PARAMETER   0x37
 
#define USB_CDC_GET_UNIT_PARAMETER   0x38
 
#define USB_CDC_CLEAR_UNIT_PARAMETER   0x39
 
#define USB_CDC_GET_PROFILE   0x3A
 
#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS   0x40
 
#define USB_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   0x41
 
#define USB_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   0x42
 
#define USB_CDC_SET_ETHERNET_PACKET_FILTER   0x43
 
#define USB_CDC_GET_ETHERNET_STATISTIC   0x44
 
#define USB_CDC_SET_ATM_DATA_FORMAT   0x50
 
#define USB_CDC_GET_ATM_DEVICE_STATISTICS   0x51
 
#define USB_CDC_SET_ATM_DEFAULT_VC   0x52
 
#define USB_CDC_GET_ATM_VC_STATISTICS   0x53
 
#define USB_CDC_SIZE_COMM_FEATURE   2
 
#define USB_CDC_SIZE_LINE_CODING   7
 
#define USB_CDC_SIZE_RINGER_PARMS   4
 
#define USB_CDC_SIZE_OPERATION_PARMS   2
 
#define USB_CDC_SIZE_UNIT_PARAMETER   2
 
#define USB_CDC_SIZE_PROFILE   64
 
#define USB_CDC_SIZE_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   2
 
#define USB_CDC_SIZE_ETHERNET_STATISTIC   4
 
#define USB_CDC_SIZE_ATM_DEVICE_STATISTICS   4
 
#define USB_CDC_SIZE_ATM_VC_STATISTICS   4
 
#define USB_CDC_SIZE_LINE_PARMS   10
 
#define USB_CDC_ABSTRACT_STATE   0x0001
 
#define USB_CDC_COUNTRY_SETTING   0x0002
 
#define USB_CDC_ABSTRACT_CALL_DATA_MULTIPLEXED   0x0002
 
#define USB_CDC_ABSTRACT_ENDPOINTS_IDLE   0x0001
 
#define SetResponseCommFeature(pi8Buf, ui16Data)
 
#define USB_CDC_AUX_DISCONNECT   0x0000
 
#define USB_CDC_AUX_CONNECT   0x0001
 
#define USB_CDC_ON_HOOK   0x0000
 
#define USB_CDC_OFF_HOOK   0x0001
 
#define USB_CDC_SNOOPING   0x0002
 
#define USB_CDC_STOP_BITS_1   0x00
 
#define USB_CDC_STOP_BITS_1_5   0x01
 
#define USB_CDC_STOP_BITS_2   0x02
 
#define USB_CDC_PARITY_NONE   0x00
 
#define USB_CDC_PARITY_ODD   0x01
 
#define USB_CDC_PARITY_EVEN   0x02
 
#define USB_CDC_PARITY_MARK   0x03
 
#define USB_CDC_PARITY_SPACE   0x04
 
#define SetResponseLineCoding(pi8Buf, ui8Rate, ui8Stop, ui8Parity, ui8Databits)
 
#define USB_CDC_DEACTIVATE_CARRIER   0x00
 
#define USB_CDC_ACTIVATE_CARRIER   0x02
 
#define USB_CDC_DTE_NOT_PRESENT   0x00
 
#define USB_CDC_DTE_PRESENT   0x01
 
#define USB_CDC_RINGER_EXISTS   0x80000000
 
#define USB_CDC_RINGER_DOES_NOT_EXIST   0x00000000
 
#define SetResponseRingerParms(pi8Buf, ui8Pattern, ui8Volume, ui32Exists)
 
#define GetRingerVolume(pi8Data)   (BYTE((pi8Data) + 1))
 
#define GetRingerPattern(pi8Data)   (BYTE(pi8Data))
 
#define GetRingerExists(pi8Data)   ((LONG(pi8Data)) & USB_CDC_RINGER_EXISTS)
 
#define USB_CDC_SIMPLE_MODE   0x0000
 
#define USB_CDC_STANDALONE_MODE   0x0001
 
#define USB_CDC_HOST_CENTRIC_MODE   0x0002
 
#define SetResponseOperationParms(pi8Bbuf, ui16Data)
 
#define USB_CDC_DROP_ACTIVE_CALL   0x0000
 
#define USB_CDC_START_NEW_CALL   0x0001
 
#define USB_CDC_APPLY_RINGING   0x0002
 
#define USB_CDC_REMOVE_RINGING   0x0003
 
#define USB_CDC_SWITCH_CALL   0x0004
 
#define USB_CDC_LINE_IS_ACTIVE   0x80000000
 
#define USB_CDC_LINE_IS_IDLE   0x00000000
 
#define USB_CDC_LINE_NO_ACTIVE_CALL   0x000000FF
 
#define USB_CDC_CALL_ACTIVE   0x80000000
 
#define USB_CDC_CALL_IDLE   0x00000000
 
#define USB_CDC_CALL_TYPICAL_DIALTONE   0x00000001
 
#define USB_CDC_CALL_INTERRUPTED_DIALTONE   0x00000002
 
#define USB_CDC_CALL_DIALING   0x00000003
 
#define USB_CDC_CALL_RINGBACK   0x00000004
 
#define USB_CDC_CALL_CONNECTED   0x00000005
 
#define USB_CDC_CALL_INCOMING   0x00000006
 
#define USB_CDC_CALL_STATE_IDLE   0x01
 
#define USB_CDC_CALL_STATE_DIALING   0x02
 
#define USB_CDC_CALL_STATE_RINGBACK   0x03
 
#define USB_CDC_CALL_STATE_CONNECTED   0x04
 
#define USB_CDC_CALL_STATE_INCOMING   0x05
 
#define USB_CDC_VOICE   0x00
 
#define USB_CDC_ANSWERING_MACHINE   0x01
 
#define USB_CDC_FAX   0x02
 
#define USB_CDC_MODEM   0x03
 
#define USB_CDC_UNKNOWN   0xFF
 
#define GetCallIndex(pi8Data)   (BYTE(pi8Data))
 
#define SetResponseCallState(pi8Buf, ui8Index, ui32Active, ui8StateChange, ui8State)
 
#define SetResponseLineParms(pi8Buf, ui16Length, ui8RingPattern, ui8RingVolume, ui32RingExists, ui32LineActive, ui8LineCallIndex, ui32CallActive, ui8CallStateChange, ui8CallState)
 
#define USB_CDC_NOTIFY_NETWORK_CONNECTION   0x00
 
#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE   0x01
 
#define USB_CDC_NOTIFY_AUX_JACK_HOOK_STATE   0x08
 
#define USB_CDC_NOTIFY_RING_DETECT   0x09
 
#define USB_CDC_NOTIFY_SERIAL_STATE   0x20
 
#define USB_CDC_NOTIFY_CALL_STATE_CHANGE   0x28
 
#define USB_CDC_NOTIFY_LINE_STATE_CHANGE   0x29
 
#define USB_CDC_NOTIFY_CONNECTION_SPEED_CHANGE   0x2A
 
#define USB_CDC_NETWORK_DISCONNECTED   0x0000
 
#define USB_CDC_NETWORK_CONNECTED   0x0001
 
#define USB_CDC_AUX_JACK_ON_HOOK   0x0000
 
#define USB_CDC_AUX_JACK_OFF_HOOK   0x0001
 
#define USB_CDC_NOTIFY_SERIAL_STATE_SIZE   2
 
#define USB_CDC_SERIAL_STATE_OVERRUN   0x0040
 
#define USB_CDC_SERIAL_STATE_PARITY   0x0020
 
#define USB_CDC_SERIAL_STATE_FRAMING   0x0010
 
#define USB_CDC_SERIAL_STATE_RING_SIGNAL   0x0008
 
#define USB_CDC_SERIAL_STATE_BREAK   0x0004
 
#define USB_CDC_SERIAL_STATE_TXCARRIER   0x0002
 
#define USB_CDC_SERIAL_STATE_RXCARRIER   0x0001
 
#define SetNotifyCallStatewValue(pi16Result, ui8CallState, ui8Index)
 
#define USB_CDC_LINE_STATE_IDLE   0x0000
 
#define USB_CDC_LINE_STATE_HOLD   0x0001
 
#define USB_CDC_LINE_STATE_OFF_HOOK   0x0002
 
#define USB_CDC_LINE_STATE_ON_HOOK   0x0003
 
#define SetNotifyConnectionSpeedChange(pi8Buf, ui32USBitRate, ui32DSBitRate)
 
#define USB_RX_ERROR_FLAGS
 
#define MAX_REQUEST_DATA_SIZE   sizeof(tLineCoding)
 
#define CDC_DO_SERIAL_STATE_CHANGE   0
 
#define CDC_DO_SEND_BREAK   1
 
#define CDC_DO_CLEAR_BREAK   2
 
#define CDC_DO_LINE_CODING_CHANGE   3
 
#define CDC_DO_LINE_STATE_CHANGE   4
 
#define CDC_DO_PACKET_RX   5
 
#define RX_BLOCK_OPS
 
#define CONTROL_ENDPOINT   USB_EP_1
 
#define DATA_IN_ENDPOINT   USB_EP_2
 
#define DATA_OUT_ENDPOINT   USB_EP_1
 
#define SERIAL_INTERFACE_CONTROL   0
 
#define SERIAL_INTERFACE_DATA   1
 
#define DATA_IN_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_64)
 
#define DATA_OUT_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_64)
 
#define DATA_IN_EP_MAX_SIZE_HS   USBFIFOSizeToBytes(USB_FIFO_SZ_512)
 
#define DATA_OUT_EP_MAX_SIZE_HS   USBFIFOSizeToBytes(USB_FIFO_SZ_512)
 
#define CTL_IN_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_16)
 
#define USB_CDC_SERIAL_ERRORS
 
#define NUM_CDCSER_SECTIONS
 
#define NUM_COMP_CDCSER_SECTIONS
 
#define SERDESCRIPTOR_SIZE   (8)
 
#define SERCOMMINTERFACE_SIZE   (35)
 
#define SERDATAINTERFACE_SIZE   (23)
 
#define COMPOSITE_DCDC_SIZE
 
#define USBD_CDC_EVENT_SEND_BREAK   (USBD_CDC_EVENT_BASE + 0)
 
#define USBD_CDC_EVENT_CLEAR_BREAK   (USBD_CDC_EVENT_BASE + 1)
 
#define USBD_CDC_EVENT_SET_CONTROL_LINE_STATE   (USBD_CDC_EVENT_BASE + 2)
 
#define USBD_CDC_EVENT_SET_LINE_CODING   (USBD_CDC_EVENT_BASE + 3)
 
#define USBD_CDC_EVENT_GET_LINE_CODING   (USBD_CDC_EVENT_BASE + 4)
 

Enumerations

enum  tCDCState { eCDCStateUnconfigured, eCDCStateIdle, eCDCStateWaitData, eCDCStateWaitClient }
 

Functions

bool ProcessDataFromHost (tUSBDCDCDevice *psCDCDevice, uint32_t ui32Status)
 
bool ProcessNotificationToHost (tUSBDCDCDevice *psCDCDevice, uint32_t ui32Status)
 
bool ProcessDataToHost (tUSBDCDCDevice *psCDCDevice, uint32_t ui32Status)
 
void * USBDCDCCompositeInit (uint32_t ui32Index, tUSBDCDCDevice *psCDCDevice, tCompositeEntry *psCompEntry)
 
void * USBDCDCInit (uint32_t ui32Index, tUSBDCDCDevice *psCDCDevice)
 
void USBDCDCTerm (void *pvCDCDevice)
 
void * USBDCDCSetControlCBData (void *pvCDCDevice, void *pvCBData)
 
void * USBDCDCSetRxCBData (void *pvCDCDevice, void *pvCBData)
 
void * USBDCDCSetTxCBData (void *pvCDCDevice, void *pvCBData)
 
uint32_t USBDCDCPacketWrite (void *pvCDCDevice, uint8_t *pi8Data, uint32_t ui32Length, bool bLast)
 
uint32_t USBDCDCPacketRead (void *pvCDCDevice, uint8_t *pi8Data, uint32_t ui32Length, bool bLast)
 
uint32_t USBDCDCTxPacketAvailable (void *pvCDCDevice)
 
uint32_t USBDCDCRxPacketAvailable (void *pvCDCDevice)
 
void USBDCDCSerialStateChange (void *pvCDCDevice, uint16_t ui16State)
 
void USBDCDCPowerStatusSet (void *pvCDCDevice, uint8_t ui8Power)
 
bool USBDCDCRemoteWakeupRequest (void *pvCDCDevice)
 

Variables

uint8_t g_pui8CDCSerDeviceDescriptor []
 
uint8_t g_pui8CDCSerDescriptor []
 
const tConfigSection g_sCDCSerConfigSection
 
uint8_t g_pui8IADSerDescriptor [SERDESCRIPTOR_SIZE]
 
const tConfigSection g_sIADSerConfigSection
 
const uint8_t g_pui8CDCSerCommInterface [SERCOMMINTERFACE_SIZE]
 
const tConfigSection g_sCDCSerCommInterfaceSection
 
const uint8_t g_pui8CDCSerDataInterface [SERDATAINTERFACE_SIZE]
 
const tConfigSection g_sCDCSerDataInterfaceSection
 
const uint8_t g_pui8CDCSerDataInterfaceHS [SERDATAINTERFACE_SIZE]
 
const tConfigSection g_sCDCSerDataInterfaceSectionHS
 
const tConfigSectiong_psCDCSerSections []
 
const tConfigSectiong_psCDCSerSectionsHS []
 
const tConfigHeader g_sCDCSerConfigHeader
 
const tConfigHeader g_sCDCSerConfigHeaderHS
 
const tConfigSectiong_psCDCCompSerSections []
 
const tConfigSectiong_psCDCCompSerSectionsHS []
 
const tConfigHeader g_sCDCCompSerConfigHeader
 
const tConfigHeader g_sCDCCompSerConfigHeaderHS
 
const tConfigHeader *const g_ppCDCSerConfigDescriptors []
 
const tConfigHeader *const g_ppCDCSerConfigDescriptorsHS []
 
const tConfigHeader *const g_pCDCCompSerConfigDescriptors []
 
const tConfigHeader *const g_pCDCCompSerConfigDescriptorsHS []
 
const tCustomHandlers g_sCDCHandlers
 

Detailed Description

Macro Definition Documentation

§ BYTE

#define BYTE (   pui8Data)    (*(uint8_t *)(pui8Data))

§ SHORT

#define SHORT (   pui8Data)    (*(uint16_t *)(pui8Data))

§ LONG

#define LONG (   pui8Data)    (*(uint32_t *)(pui8Data))

§ USB_CDC_SUBCLASS_DIRECT_LINE_MODEL

#define USB_CDC_SUBCLASS_DIRECT_LINE_MODEL   0x01

§ USB_CDC_SUBCLASS_ABSTRACT_MODEL

#define USB_CDC_SUBCLASS_ABSTRACT_MODEL   0x02

§ USB_CDC_SUBCLASS_TELEPHONE_MODEL

#define USB_CDC_SUBCLASS_TELEPHONE_MODEL   0x03

§ USB_CDC_SUBCLASS_MULTI_CHANNEL_MODEL

#define USB_CDC_SUBCLASS_MULTI_CHANNEL_MODEL   0x04

§ USB_CDC_SUBCLASS_CAPI_MODEL

#define USB_CDC_SUBCLASS_CAPI_MODEL   0x05

§ USB_CDC_SUBCLASS_ETHERNET_MODEL

#define USB_CDC_SUBCLASS_ETHERNET_MODEL   0x06

§ USB_CDC_SUBCLASS_ATM_MODEL

#define USB_CDC_SUBCLASS_ATM_MODEL   0x07

§ USB_CDC_PROTOCOL_NONE [1/2]

#define USB_CDC_PROTOCOL_NONE   0x00

§ USB_CDC_PROTOCOL_NONE [2/2]

#define USB_CDC_PROTOCOL_NONE   0x00

§ USB_CDC_PROTOCOL_V25TER

#define USB_CDC_PROTOCOL_V25TER   0x01

§ USB_CDC_PROTOCOL_VENDOR [1/2]

#define USB_CDC_PROTOCOL_VENDOR   0xFF

§ USB_CDC_PROTOCOL_VENDOR [2/2]

#define USB_CDC_PROTOCOL_VENDOR   0xFF

§ USB_CDC_PROTOCOL_I420

#define USB_CDC_PROTOCOL_I420   0x30

§ USB_CDC_PROTOCOL_TRANSPARENT

#define USB_CDC_PROTOCOL_TRANSPARENT   0x32

§ USB_CDC_PROTOCOL_Q921M

#define USB_CDC_PROTOCOL_Q921M   0x50

§ USB_CDC_PROTOCOL_Q921

#define USB_CDC_PROTOCOL_Q921   0x51

§ USB_CDC_PROTOCOL_Q921TM

#define USB_CDC_PROTOCOL_Q921TM   0x52

§ USB_CDC_PROTOCOL_V42BIS

#define USB_CDC_PROTOCOL_V42BIS   0x90

§ USB_CDC_PROTOCOL_Q921EURO

#define USB_CDC_PROTOCOL_Q921EURO   0x91

§ USB_CDC_PROTOCOL_V120

#define USB_CDC_PROTOCOL_V120   0x92

§ USB_CDC_PROTOCOL_CAPI20

#define USB_CDC_PROTOCOL_CAPI20   0x93

§ USB_CDC_PROTOCOL_HOST_DRIVER

#define USB_CDC_PROTOCOL_HOST_DRIVER   0xFD

§ USB_CDC_PROTOCOL_CDC_SPEC

#define USB_CDC_PROTOCOL_CDC_SPEC   0xFE

§ USB_CDC_CS_INTERFACE

#define USB_CDC_CS_INTERFACE   0x24

§ USB_CDC_CS_ENDPOINT

#define USB_CDC_CS_ENDPOINT   0x25

§ USB_CDC_FD_SUBTYPE_HEADER

#define USB_CDC_FD_SUBTYPE_HEADER   0x00

§ USB_CDC_FD_SUBTYPE_CALL_MGMT

#define USB_CDC_FD_SUBTYPE_CALL_MGMT   0x01

§ USB_CDC_FD_SUBTYPE_ABSTRACT_CTL_MGMT

#define USB_CDC_FD_SUBTYPE_ABSTRACT_CTL_MGMT   0x02

§ USB_CDC_FD_SUBTYPE_DIRECT_LINE_MGMT

#define USB_CDC_FD_SUBTYPE_DIRECT_LINE_MGMT   0x03

§ USB_CDC_FD_SUBTYPE_TELEPHONE_RINGER

#define USB_CDC_FD_SUBTYPE_TELEPHONE_RINGER   0x04

§ USB_CDC_FD_SUBTYPE_LINE_STATE_CAPS

#define USB_CDC_FD_SUBTYPE_LINE_STATE_CAPS   0x05

§ USB_CDC_FD_SUBTYPE_UNION

#define USB_CDC_FD_SUBTYPE_UNION   0x06

§ USB_CDC_FD_SUBTYPE_COUNTRY

#define USB_CDC_FD_SUBTYPE_COUNTRY   0x07

§ USB_CDC_FD_SUBTYPE_TELEPHONE_MODES

#define USB_CDC_FD_SUBTYPE_TELEPHONE_MODES   0x08

§ USB_CDC_FD_SUBTYPE_USB_TERMINAL

#define USB_CDC_FD_SUBTYPE_USB_TERMINAL   0x09

§ USB_CDC_FD_SUBTYPE_NETWORK_TERMINAL

#define USB_CDC_FD_SUBTYPE_NETWORK_TERMINAL   0x0A

§ USB_CDC_FD_SUBTYPE_PROTOCOL_UNIT

#define USB_CDC_FD_SUBTYPE_PROTOCOL_UNIT   0x0B

§ USB_CDC_FD_SUBTYPE_EXTENSION_UNIT

#define USB_CDC_FD_SUBTYPE_EXTENSION_UNIT   0x0C

§ USB_CDC_FD_SUBTYPE_MULTI_CHANNEL_MGMT

#define USB_CDC_FD_SUBTYPE_MULTI_CHANNEL_MGMT   0x0D

§ USB_CDC_FD_SUBTYPE_CAPI_MGMT

#define USB_CDC_FD_SUBTYPE_CAPI_MGMT   0x0E

§ USB_CDC_FD_SUBTYPE_ETHERNET

#define USB_CDC_FD_SUBTYPE_ETHERNET   0x0F

§ USB_CDC_FD_SUBTYPE_ATM

#define USB_CDC_FD_SUBTYPE_ATM   0x10

§ USB_CDC_CALL_MGMT_VIA_DATA

#define USB_CDC_CALL_MGMT_VIA_DATA   0x02

§ USB_CDC_CALL_MGMT_HANDLED

#define USB_CDC_CALL_MGMT_HANDLED   0x01

§ USB_CDC_ACM_SUPPORTS_NETWORK_CONNECTION

#define USB_CDC_ACM_SUPPORTS_NETWORK_CONNECTION   0x08

§ USB_CDC_ACM_SUPPORTS_SEND_BREAK

#define USB_CDC_ACM_SUPPORTS_SEND_BREAK   0x04

§ USB_CDC_ACM_SUPPORTS_LINE_PARAMS

#define USB_CDC_ACM_SUPPORTS_LINE_PARAMS   0x02

§ USB_CDC_ACM_SUPPORTS_COMM_FEATURE

#define USB_CDC_ACM_SUPPORTS_COMM_FEATURE   0x01

§ USB_CDC_DLM_NEEDS_EXTRA_PULSE_SETUP

#define USB_CDC_DLM_NEEDS_EXTRA_PULSE_SETUP   0x04

§ USB_CDC_DLM_SUPPORTS_AUX

#define USB_CDC_DLM_SUPPORTS_AUX   0x02

§ USB_CDC_DLM_SUPPORTS_PULSE

#define USB_CDC_DLM_SUPPORTS_PULSE   0x01

§ USB_CDC_TELEPHONE_SUPPORTS_COMPUTER

#define USB_CDC_TELEPHONE_SUPPORTS_COMPUTER   0x04

§ USB_CDC_TELEPHONE_SUPPORTS_STANDALONE

#define USB_CDC_TELEPHONE_SUPPORTS_STANDALONE   0x02

§ USB_CDC_TELEPHONE_SUPPORTS_SIMPLE

#define USB_CDC_TELEPHONE_SUPPORTS_SIMPLE   0x01

§ USB_CDC_LINE_STATE_CHANGES_NOTIFIED

#define USB_CDC_LINE_STATE_CHANGES_NOTIFIED   0x20

§ USB_CDC_LINE_STATE_REPORTS_DTMF

#define USB_CDC_LINE_STATE_REPORTS_DTMF   0x10

§ USB_CDC_LINE_STATE_REPORTS_DIST_RING

#define USB_CDC_LINE_STATE_REPORTS_DIST_RING   0x08

§ USB_CDC_LINE_STATE_REPORTS_CALLERID

#define USB_CDC_LINE_STATE_REPORTS_CALLERID   0x04

§ USB_CDC_LINE_STATE_REPORTS_BUSY

#define USB_CDC_LINE_STATE_REPORTS_BUSY   0x02

§ USB_CDC_LINE_STATE_REPORTS_INT_DIALTONE

#define USB_CDC_LINE_STATE_REPORTS_INT_DIALTONE   0x01

§ USB_CDC_TERMINAL_NO_WRAPPER_USED

#define USB_CDC_TERMINAL_NO_WRAPPER_USED   0x00

§ USB_CDC_TERMINAL_WRAPPER_USED

#define USB_CDC_TERMINAL_WRAPPER_USED   0x01

§ USB_CDC_MCM_SUPPORTS_SET_UNIT_PARAM

#define USB_CDC_MCM_SUPPORTS_SET_UNIT_PARAM   0x04

§ USB_CDC_MCM_SUPPORTS_CLEAR_UNIT_PARAM

#define USB_CDC_MCM_SUPPORTS_CLEAR_UNIT_PARAM   0x02

§ USB_CDC_MCM_UNIT_PARAMS_NON_VOLATILE

#define USB_CDC_MCM_UNIT_PARAMS_NON_VOLATILE   0x01

§ USB_CDC_CAPI_INTELLIGENT

#define USB_CDC_CAPI_INTELLIGENT   0x01

§ USB_CDC_CAPI_SIMPLE

#define USB_CDC_CAPI_SIMPLE   0x00

§ USB_CDC_ETHERNET_XMIT_OK

#define USB_CDC_ETHERNET_XMIT_OK   0x01000000

§ USB_CDC_ETHERNET_RCV_OK

#define USB_CDC_ETHERNET_RCV_OK   0x02000000

§ USB_CDC_ETHERNET_XMIT_ERROR

#define USB_CDC_ETHERNET_XMIT_ERROR   0x04000000

§ USB_CDC_ETHERNET_RCV_ERROR

#define USB_CDC_ETHERNET_RCV_ERROR   0x08000000

§ USB_CDC_ETHERNET_RCV_NO_BUFFER

#define USB_CDC_ETHERNET_RCV_NO_BUFFER   0x10000000

§ USB_CDC_ETHERNET_DIRECTED_BYTES_XMIT

#define USB_CDC_ETHERNET_DIRECTED_BYTES_XMIT   0x20000000

§ USB_CDC_ETHERNET_DIRECTED_FRAMES_XMIT

#define USB_CDC_ETHERNET_DIRECTED_FRAMES_XMIT   0x40000000

§ USB_CDC_ETHERNET_MULTICAST_BYTES_XMIT

#define USB_CDC_ETHERNET_MULTICAST_BYTES_XMIT   0x80000000

§ USB_CDC_ETHERNET_MULTICAST_FRAMES_XMIT

#define USB_CDC_ETHERNET_MULTICAST_FRAMES_XMIT   0x00010000

§ USB_CDC_ETHERNET_BROADCAST_BYTES_XMIT

#define USB_CDC_ETHERNET_BROADCAST_BYTES_XMIT   0x00020000

§ USB_CDC_ETHERNET_BROADCAST_FRAMES_XMIT

#define USB_CDC_ETHERNET_BROADCAST_FRAMES_XMIT   0x00040000

§ USB_CDC_ETHERNET_DIRECTED_BYTES_RCV

#define USB_CDC_ETHERNET_DIRECTED_BYTES_RCV   0x00080000

§ USB_CDC_ETHERNET_DIRECTED_FRAMES_RCV

#define USB_CDC_ETHERNET_DIRECTED_FRAMES_RCV   0x00100000

§ USB_CDC_ETHERNET_MULTICAST_BYTES_RCV

#define USB_CDC_ETHERNET_MULTICAST_BYTES_RCV   0x00200000

§ USB_CDC_ETHERNET_MULTICAST_FRAMES_RCV

#define USB_CDC_ETHERNET_MULTICAST_FRAMES_RCV   0x00400000

§ USB_CDC_ETHERNET_BROADCAST_BYTES_RCV

#define USB_CDC_ETHERNET_BROADCAST_BYTES_RCV   0x00800000

§ USB_CDC_ETHERNET_BROADCAST_FRAMES_RCV

#define USB_CDC_ETHERNET_BROADCAST_FRAMES_RCV   0x00000100

§ USB_CDC_ETHERNET_RCV_CRC_ERROR

#define USB_CDC_ETHERNET_RCV_CRC_ERROR   0x00000200

§ USB_CDC_ETHERNET_TRANSMIT_QUEUE_LENGTH

#define USB_CDC_ETHERNET_TRANSMIT_QUEUE_LENGTH   0x00000400

§ USB_CDC_ETHERNET_RCV_ERROR_ALIGNMENT

#define USB_CDC_ETHERNET_RCV_ERROR_ALIGNMENT   0x00000800

§ USB_CDC_ETHERNET_XMIT_ONE_COLLISION

#define USB_CDC_ETHERNET_XMIT_ONE_COLLISION   0x00001000

§ USB_CDC_ETHERNET_XMIT_MORE_COLLISIONS

#define USB_CDC_ETHERNET_XMIT_MORE_COLLISIONS   0x00002000

§ USB_CDC_ETHERNET_XMIT_DEFERRED

#define USB_CDC_ETHERNET_XMIT_DEFERRED   0x00004000

§ USB_CDC_ETHERNET_XMIT_MAX_COLLISIONS

#define USB_CDC_ETHERNET_XMIT_MAX_COLLISIONS   0x00008000

§ USB_CDC_ETHERNET_RCV_OVERRUN

#define USB_CDC_ETHERNET_RCV_OVERRUN   0x00000001

§ USB_CDC_ETHERNET_XMIT_UNDERRUN

#define USB_CDC_ETHERNET_XMIT_UNDERRUN   0x00000002

§ USB_CDC_ETHERNET_XMIT_HEARTBEAT_FAILURE

#define USB_CDC_ETHERNET_XMIT_HEARTBEAT_FAILURE   0x00000004

§ USB_CDC_ETHERNET_XMIT_TIMES_CRS_LOST

#define USB_CDC_ETHERNET_XMIT_TIMES_CRS_LOST   0x00000010

§ USB_CDC_ATM_TYPE_3

#define USB_CDC_ATM_TYPE_3   0x08

§ USB_CDC_ATM_TYPE_2

#define USB_CDC_ATM_TYPE_2   0x04

§ USB_CDC_ATM_TYPE_1

#define USB_CDC_ATM_TYPE_1   0x02

§ USB_CDC_ATM_VC_US_CELLS_SENT

#define USB_CDC_ATM_VC_US_CELLS_SENT   0x10

§ USB_CDC_ATM_VC_US_CELLS_RECEIVED

#define USB_CDC_ATM_VC_US_CELLS_RECEIVED   0x08

§ USB_CDC_ATM_DS_CELLS_HEC_ERR_CORRECTED

#define USB_CDC_ATM_DS_CELLS_HEC_ERR_CORRECTED   0x04

§ USB_CDC_ATM_US_CELLS_SENT

#define USB_CDC_ATM_US_CELLS_SENT   0x02

§ USB_CDC_ATM_US_CELLS_RECEIVED

#define USB_CDC_ATM_US_CELLS_RECEIVED   0x01

§ USB_CDC_SEND_ENCAPSULATED_COMMAND

#define USB_CDC_SEND_ENCAPSULATED_COMMAND   0x00

§ USB_CDC_GET_ENCAPSULATED_RESPONSE

#define USB_CDC_GET_ENCAPSULATED_RESPONSE   0x01

§ USB_CDC_SET_COMM_FEATURE

#define USB_CDC_SET_COMM_FEATURE   0x02

§ USB_CDC_GET_COMM_FEATURE

#define USB_CDC_GET_COMM_FEATURE   0x03

§ USB_CDC_CLEAR_COMM_FEATURE

#define USB_CDC_CLEAR_COMM_FEATURE   0x04

§ USB_CDC_SET_AUX_LINE_STATE

#define USB_CDC_SET_AUX_LINE_STATE   0x10

§ USB_CDC_SET_HOOK_STATE

#define USB_CDC_SET_HOOK_STATE   0x11

§ USB_CDC_PULSE_SETUP

#define USB_CDC_PULSE_SETUP   0x12

§ USB_CDC_SEND_PULSE

#define USB_CDC_SEND_PULSE   0x13

§ USB_CDC_SET_PULSE_TIME

#define USB_CDC_SET_PULSE_TIME   0x14

§ USB_CDC_RING_AUX_JACK

#define USB_CDC_RING_AUX_JACK   0x15

§ USB_CDC_SET_LINE_CODING

#define USB_CDC_SET_LINE_CODING   0x20

§ USB_CDC_GET_LINE_CODING

#define USB_CDC_GET_LINE_CODING   0x21

§ USB_CDC_SET_CONTROL_LINE_STATE

#define USB_CDC_SET_CONTROL_LINE_STATE   0x22

§ USB_CDC_SEND_BREAK

#define USB_CDC_SEND_BREAK   0x23

§ USB_CDC_SET_RINGER_PARMS

#define USB_CDC_SET_RINGER_PARMS   0x30

§ USB_CDC_GET_RINGER_PARMS

#define USB_CDC_GET_RINGER_PARMS   0x31

§ USB_CDC_SET_OPERATION_PARMS

#define USB_CDC_SET_OPERATION_PARMS   0x32

§ USB_CDC_GET_OPERATION_PARMS

#define USB_CDC_GET_OPERATION_PARMS   0x33

§ USB_CDC_SET_LINE_PARMS

#define USB_CDC_SET_LINE_PARMS   0x34

§ USB_CDC_GET_LINE_PARMS

#define USB_CDC_GET_LINE_PARMS   0x35

§ USB_CDC_DIAL_DIGITS

#define USB_CDC_DIAL_DIGITS   0x36

§ USB_CDC_SET_UNIT_PARAMETER

#define USB_CDC_SET_UNIT_PARAMETER   0x37

§ USB_CDC_GET_UNIT_PARAMETER

#define USB_CDC_GET_UNIT_PARAMETER   0x38

§ USB_CDC_CLEAR_UNIT_PARAMETER

#define USB_CDC_CLEAR_UNIT_PARAMETER   0x39

§ USB_CDC_GET_PROFILE

#define USB_CDC_GET_PROFILE   0x3A

§ USB_CDC_SET_ETHERNET_MULTICAST_FILTERS

#define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS   0x40

§ USB_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER

#define USB_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   0x41

§ USB_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER

#define USB_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   0x42

§ USB_CDC_SET_ETHERNET_PACKET_FILTER

#define USB_CDC_SET_ETHERNET_PACKET_FILTER   0x43

§ USB_CDC_GET_ETHERNET_STATISTIC

#define USB_CDC_GET_ETHERNET_STATISTIC   0x44

§ USB_CDC_SET_ATM_DATA_FORMAT

#define USB_CDC_SET_ATM_DATA_FORMAT   0x50

§ USB_CDC_GET_ATM_DEVICE_STATISTICS

#define USB_CDC_GET_ATM_DEVICE_STATISTICS   0x51

§ USB_CDC_SET_ATM_DEFAULT_VC

#define USB_CDC_SET_ATM_DEFAULT_VC   0x52

§ USB_CDC_GET_ATM_VC_STATISTICS

#define USB_CDC_GET_ATM_VC_STATISTICS   0x53

§ USB_CDC_SIZE_COMM_FEATURE

#define USB_CDC_SIZE_COMM_FEATURE   2

§ USB_CDC_SIZE_LINE_CODING

#define USB_CDC_SIZE_LINE_CODING   7

§ USB_CDC_SIZE_RINGER_PARMS

#define USB_CDC_SIZE_RINGER_PARMS   4

§ USB_CDC_SIZE_OPERATION_PARMS

#define USB_CDC_SIZE_OPERATION_PARMS   2

§ USB_CDC_SIZE_UNIT_PARAMETER

#define USB_CDC_SIZE_UNIT_PARAMETER   2

§ USB_CDC_SIZE_PROFILE

#define USB_CDC_SIZE_PROFILE   64

§ USB_CDC_SIZE_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER

#define USB_CDC_SIZE_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER   2

§ USB_CDC_SIZE_ETHERNET_STATISTIC

#define USB_CDC_SIZE_ETHERNET_STATISTIC   4

§ USB_CDC_SIZE_ATM_DEVICE_STATISTICS

#define USB_CDC_SIZE_ATM_DEVICE_STATISTICS   4

§ USB_CDC_SIZE_ATM_VC_STATISTICS

#define USB_CDC_SIZE_ATM_VC_STATISTICS   4

§ USB_CDC_SIZE_LINE_PARMS

#define USB_CDC_SIZE_LINE_PARMS   10

§ USB_CDC_ABSTRACT_STATE

#define USB_CDC_ABSTRACT_STATE   0x0001

§ USB_CDC_COUNTRY_SETTING

#define USB_CDC_COUNTRY_SETTING   0x0002

§ USB_CDC_ABSTRACT_CALL_DATA_MULTIPLEXED

#define USB_CDC_ABSTRACT_CALL_DATA_MULTIPLEXED   0x0002

§ USB_CDC_ABSTRACT_ENDPOINTS_IDLE

#define USB_CDC_ABSTRACT_ENDPOINTS_IDLE   0x0001

§ SetResponseCommFeature

#define SetResponseCommFeature (   pi8Buf,
  ui16Data 
)
Value:
do \
{ \
(*(uint16_t *)(pi8Buf)) = ui16Data; \
} \
while(0)

§ USB_CDC_AUX_DISCONNECT

#define USB_CDC_AUX_DISCONNECT   0x0000

§ USB_CDC_AUX_CONNECT

#define USB_CDC_AUX_CONNECT   0x0001

§ USB_CDC_ON_HOOK

#define USB_CDC_ON_HOOK   0x0000

§ USB_CDC_OFF_HOOK

#define USB_CDC_OFF_HOOK   0x0001

§ USB_CDC_SNOOPING

#define USB_CDC_SNOOPING   0x0002

§ USB_CDC_STOP_BITS_1

#define USB_CDC_STOP_BITS_1   0x00

§ USB_CDC_STOP_BITS_1_5

#define USB_CDC_STOP_BITS_1_5   0x01

§ USB_CDC_STOP_BITS_2

#define USB_CDC_STOP_BITS_2   0x02

§ USB_CDC_PARITY_NONE

#define USB_CDC_PARITY_NONE   0x00

§ USB_CDC_PARITY_ODD

#define USB_CDC_PARITY_ODD   0x01

§ USB_CDC_PARITY_EVEN

#define USB_CDC_PARITY_EVEN   0x02

§ USB_CDC_PARITY_MARK

#define USB_CDC_PARITY_MARK   0x03

§ USB_CDC_PARITY_SPACE

#define USB_CDC_PARITY_SPACE   0x04

§ SetResponseLineCoding

#define SetResponseLineCoding (   pi8Buf,
  ui8Rate,
  ui8Stop,
  ui8Parity,
  ui8Databits 
)
Value:
do \
{ \
(*(uint32_t *)(pi8Buf)) = ui8Rate; \
(*((uint8_t *)(pi8Buf) + 4)) = ui8Stop; \
(*((uint8_t *)(pi8Buf) + 5)) = ui8Parity; \
(*((uint8_t *)(pi8Buf) + 6)) = ui8Databits; \
} \
while(0)

§ USB_CDC_DEACTIVATE_CARRIER

#define USB_CDC_DEACTIVATE_CARRIER   0x00

§ USB_CDC_ACTIVATE_CARRIER

#define USB_CDC_ACTIVATE_CARRIER   0x02

§ USB_CDC_DTE_NOT_PRESENT

#define USB_CDC_DTE_NOT_PRESENT   0x00

§ USB_CDC_DTE_PRESENT

#define USB_CDC_DTE_PRESENT   0x01

§ USB_CDC_RINGER_EXISTS

#define USB_CDC_RINGER_EXISTS   0x80000000

§ USB_CDC_RINGER_DOES_NOT_EXIST

#define USB_CDC_RINGER_DOES_NOT_EXIST   0x00000000

§ SetResponseRingerParms

#define SetResponseRingerParms (   pi8Buf,
  ui8Pattern,
  ui8Volume,
  ui32Exists 
)
Value:
do \
{ \
*(uint32_t *)(pi8Buf) = ((ui8Pattern) + \
((ui8Volume & 0xFF) << 8) + \
(ui32Exists & USB_CDC_RINGER_EXISTS)); \
} \
while(0)
#define USB_CDC_RINGER_EXISTS
Definition: usbcdc.h:570

§ GetRingerVolume

#define GetRingerVolume (   pi8Data)    (BYTE((pi8Data) + 1))

§ GetRingerPattern

#define GetRingerPattern (   pi8Data)    (BYTE(pi8Data))

§ GetRingerExists

#define GetRingerExists (   pi8Data)    ((LONG(pi8Data)) & USB_CDC_RINGER_EXISTS)

§ USB_CDC_SIMPLE_MODE

#define USB_CDC_SIMPLE_MODE   0x0000

§ USB_CDC_STANDALONE_MODE

#define USB_CDC_STANDALONE_MODE   0x0001

§ USB_CDC_HOST_CENTRIC_MODE

#define USB_CDC_HOST_CENTRIC_MODE   0x0002

§ SetResponseOperationParms

#define SetResponseOperationParms (   pi8Bbuf,
  ui16Data 
)
Value:
do \
{ \
WORD(pi8Buf) = ui16Data; \
} \
while(0)

§ USB_CDC_DROP_ACTIVE_CALL

#define USB_CDC_DROP_ACTIVE_CALL   0x0000

§ USB_CDC_START_NEW_CALL

#define USB_CDC_START_NEW_CALL   0x0001

§ USB_CDC_APPLY_RINGING

#define USB_CDC_APPLY_RINGING   0x0002

§ USB_CDC_REMOVE_RINGING

#define USB_CDC_REMOVE_RINGING   0x0003

§ USB_CDC_SWITCH_CALL

#define USB_CDC_SWITCH_CALL   0x0004

§ USB_CDC_LINE_IS_ACTIVE

#define USB_CDC_LINE_IS_ACTIVE   0x80000000

§ USB_CDC_LINE_IS_IDLE

#define USB_CDC_LINE_IS_IDLE   0x00000000

§ USB_CDC_LINE_NO_ACTIVE_CALL

#define USB_CDC_LINE_NO_ACTIVE_CALL   0x000000FF

§ USB_CDC_CALL_ACTIVE

#define USB_CDC_CALL_ACTIVE   0x80000000

§ USB_CDC_CALL_IDLE

#define USB_CDC_CALL_IDLE   0x00000000

§ USB_CDC_CALL_TYPICAL_DIALTONE

#define USB_CDC_CALL_TYPICAL_DIALTONE   0x00000001

§ USB_CDC_CALL_INTERRUPTED_DIALTONE

#define USB_CDC_CALL_INTERRUPTED_DIALTONE   0x00000002

§ USB_CDC_CALL_DIALING

#define USB_CDC_CALL_DIALING   0x00000003

§ USB_CDC_CALL_RINGBACK

#define USB_CDC_CALL_RINGBACK   0x00000004

§ USB_CDC_CALL_CONNECTED

#define USB_CDC_CALL_CONNECTED   0x00000005

§ USB_CDC_CALL_INCOMING

#define USB_CDC_CALL_INCOMING   0x00000006

§ USB_CDC_CALL_STATE_IDLE

#define USB_CDC_CALL_STATE_IDLE   0x01

§ USB_CDC_CALL_STATE_DIALING

#define USB_CDC_CALL_STATE_DIALING   0x02

§ USB_CDC_CALL_STATE_RINGBACK

#define USB_CDC_CALL_STATE_RINGBACK   0x03

§ USB_CDC_CALL_STATE_CONNECTED

#define USB_CDC_CALL_STATE_CONNECTED   0x04

§ USB_CDC_CALL_STATE_INCOMING

#define USB_CDC_CALL_STATE_INCOMING   0x05

§ USB_CDC_VOICE

#define USB_CDC_VOICE   0x00

§ USB_CDC_ANSWERING_MACHINE

#define USB_CDC_ANSWERING_MACHINE   0x01

§ USB_CDC_FAX

#define USB_CDC_FAX   0x02

§ USB_CDC_MODEM

#define USB_CDC_MODEM   0x03

§ USB_CDC_UNKNOWN

#define USB_CDC_UNKNOWN   0xFF

§ GetCallIndex

#define GetCallIndex (   pi8Data)    (BYTE(pi8Data))

§ SetResponseCallState

#define SetResponseCallState (   pi8Buf,
  ui8Index,
  ui32Active,
  ui8StateChange,
  ui8State 
)
Value:
do \
{ \
(LONG((uint8_t *)(pi8Buf) + (10 + (4 * (ui8Index))))) = \
(((ui32Active) & USB_CDC_CALL_IS_ACTIVE) + \
(((ui8StateChange) & 0xFF) << 8) + \
((ui8State) & 0xFF)); \
} \
while(0)
#define LONG(pui8Data)
Definition: usbcdc.h:62

§ SetResponseLineParms

#define SetResponseLineParms (   pi8Buf,
  ui16Length,
  ui8RingPattern,
  ui8RingVolume,
  ui32RingExists,
  ui32LineActive,
  ui8LineCallIndex,
  ui32CallActive,
  ui8CallStateChange,
  ui8CallState 
)
Value:
do \
{ \
(WORD(pi8Buf)) = ui16Length; \
SetResponseRingerParams(((uint8_t *)(pi8Buf) + 2), \
ui8RingPattern, ui8RingVolume, \
ui32RingExists); \
(LONG((uint8_t *)(pi8Buf) + 6)) = \
(((ui32LineActive) & USB_CDC_LINE_IS_ACTIVE) + \
((ui8LineCallIndex) & 0xFF)) ; \
SetResponseCallState(pi8Buf, 0, ui32CallActive, \
ui8CallStateChange, ui8CallState); \
} \
while(0)
#define LONG(pui8Data)
Definition: usbcdc.h:62
#define USB_CDC_LINE_IS_ACTIVE
Definition: usbcdc.h:642

§ USB_CDC_NOTIFY_NETWORK_CONNECTION

#define USB_CDC_NOTIFY_NETWORK_CONNECTION   0x00

§ USB_CDC_NOTIFY_RESPONSE_AVAILABLE

#define USB_CDC_NOTIFY_RESPONSE_AVAILABLE   0x01

§ USB_CDC_NOTIFY_AUX_JACK_HOOK_STATE

#define USB_CDC_NOTIFY_AUX_JACK_HOOK_STATE   0x08

§ USB_CDC_NOTIFY_RING_DETECT

#define USB_CDC_NOTIFY_RING_DETECT   0x09

§ USB_CDC_NOTIFY_SERIAL_STATE

#define USB_CDC_NOTIFY_SERIAL_STATE   0x20

§ USB_CDC_NOTIFY_CALL_STATE_CHANGE

#define USB_CDC_NOTIFY_CALL_STATE_CHANGE   0x28

§ USB_CDC_NOTIFY_LINE_STATE_CHANGE

#define USB_CDC_NOTIFY_LINE_STATE_CHANGE   0x29

§ USB_CDC_NOTIFY_CONNECTION_SPEED_CHANGE

#define USB_CDC_NOTIFY_CONNECTION_SPEED_CHANGE   0x2A

§ USB_CDC_NETWORK_DISCONNECTED

#define USB_CDC_NETWORK_DISCONNECTED   0x0000

§ USB_CDC_NETWORK_CONNECTED

#define USB_CDC_NETWORK_CONNECTED   0x0001

§ USB_CDC_AUX_JACK_ON_HOOK

#define USB_CDC_AUX_JACK_ON_HOOK   0x0000

§ USB_CDC_AUX_JACK_OFF_HOOK

#define USB_CDC_AUX_JACK_OFF_HOOK   0x0001

§ USB_CDC_NOTIFY_SERIAL_STATE_SIZE

#define USB_CDC_NOTIFY_SERIAL_STATE_SIZE   2

§ USB_CDC_SERIAL_STATE_OVERRUN

#define USB_CDC_SERIAL_STATE_OVERRUN   0x0040

§ USB_CDC_SERIAL_STATE_PARITY

#define USB_CDC_SERIAL_STATE_PARITY   0x0020

§ USB_CDC_SERIAL_STATE_FRAMING

#define USB_CDC_SERIAL_STATE_FRAMING   0x0010

§ USB_CDC_SERIAL_STATE_RING_SIGNAL

#define USB_CDC_SERIAL_STATE_RING_SIGNAL   0x0008

§ USB_CDC_SERIAL_STATE_BREAK

#define USB_CDC_SERIAL_STATE_BREAK   0x0004

§ USB_CDC_SERIAL_STATE_TXCARRIER

#define USB_CDC_SERIAL_STATE_TXCARRIER   0x0002

§ USB_CDC_SERIAL_STATE_RXCARRIER

#define USB_CDC_SERIAL_STATE_RXCARRIER   0x0001

§ SetNotifyCallStatewValue

#define SetNotifyCallStatewValue (   pi16Result,
  ui8CallState,
  ui8Index 
)
Value:
do \
{ \
(WORD(pi16Result)) = (((ui8CallState) & 0xFF) + \
(((ui8Index) & 0xFF) << 8)); \
} \
while(0)

§ USB_CDC_LINE_STATE_IDLE

#define USB_CDC_LINE_STATE_IDLE   0x0000

§ USB_CDC_LINE_STATE_HOLD

#define USB_CDC_LINE_STATE_HOLD   0x0001

§ USB_CDC_LINE_STATE_OFF_HOOK

#define USB_CDC_LINE_STATE_OFF_HOOK   0x0002

§ USB_CDC_LINE_STATE_ON_HOOK

#define USB_CDC_LINE_STATE_ON_HOOK   0x0003

§ SetNotifyConnectionSpeedChange

#define SetNotifyConnectionSpeedChange (   pi8Buf,
  ui32USBitRate,
  ui32DSBitRate 
)
Value:
do \
{ \
LONG(pi8Buf) = ui32USBitRate; \
LONG((uint8_t *)(pi8Buf) + 4) = ui32DSBitRate; \
} \
while(0)

§ USB_RX_ERROR_FLAGS

#define USB_RX_ERROR_FLAGS
Value:
USBERR_DEV_RX_OVERRUN | \
USBERR_DEV_RX_FIFO_FULL)
#define USBERR_DEV_RX_DATA_ERROR
The device detected a CRC error in received data.
Definition: usblib.h:1303

§ MAX_REQUEST_DATA_SIZE

#define MAX_REQUEST_DATA_SIZE   sizeof(tLineCoding)

§ CDC_DO_SERIAL_STATE_CHANGE

#define CDC_DO_SERIAL_STATE_CHANGE   0

§ CDC_DO_SEND_BREAK

#define CDC_DO_SEND_BREAK   1

§ CDC_DO_CLEAR_BREAK

#define CDC_DO_CLEAR_BREAK   2

§ CDC_DO_LINE_CODING_CHANGE

#define CDC_DO_LINE_CODING_CHANGE   3

§ CDC_DO_LINE_STATE_CHANGE

#define CDC_DO_LINE_STATE_CHANGE   4

§ CDC_DO_PACKET_RX

#define CDC_DO_PACKET_RX   5

§ RX_BLOCK_OPS

#define RX_BLOCK_OPS
Value:
((1 << CDC_DO_SEND_BREAK) | \
#define CDC_DO_LINE_STATE_CHANGE
Definition: usbdcdc.c:104
#define CDC_DO_LINE_CODING_CHANGE
Definition: usbdcdc.c:102
#define CDC_DO_SEND_BREAK
Definition: usbdcdc.c:100

§ CONTROL_ENDPOINT

#define CONTROL_ENDPOINT   USB_EP_1

Referenced by USBDCDCInit().

§ DATA_IN_ENDPOINT

#define DATA_IN_ENDPOINT   USB_EP_2

§ DATA_OUT_ENDPOINT

#define DATA_OUT_ENDPOINT   USB_EP_1

§ SERIAL_INTERFACE_CONTROL

#define SERIAL_INTERFACE_CONTROL   0

§ SERIAL_INTERFACE_DATA

#define SERIAL_INTERFACE_DATA   1

§ DATA_IN_EP_MAX_SIZE

#define DATA_IN_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_64)

§ DATA_OUT_EP_MAX_SIZE

#define DATA_OUT_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_64)

§ DATA_IN_EP_MAX_SIZE_HS

#define DATA_IN_EP_MAX_SIZE_HS   USBFIFOSizeToBytes(USB_FIFO_SZ_512)

§ DATA_OUT_EP_MAX_SIZE_HS

#define DATA_OUT_EP_MAX_SIZE_HS   USBFIFOSizeToBytes(USB_FIFO_SZ_512)

§ CTL_IN_EP_MAX_SIZE

#define CTL_IN_EP_MAX_SIZE   USBFIFOSizeToBytes(USB_FIFO_SZ_16)

§ USB_CDC_SERIAL_ERRORS

#define USB_CDC_SERIAL_ERRORS
Value:
USB_CDC_SERIAL_STATE_PARITY | \
USB_CDC_SERIAL_STATE_FRAMING)
#define USB_CDC_SERIAL_STATE_OVERRUN
Definition: usbcdc.h:804

§ NUM_CDCSER_SECTIONS

#define NUM_CDCSER_SECTIONS
Value:
(sizeof(g_psCDCSerSections) / \
sizeof(g_psCDCSerSections[0]))
const tConfigSection * g_psCDCSerSections[]
Definition: usbdcdc.c:443

§ NUM_COMP_CDCSER_SECTIONS

#define NUM_COMP_CDCSER_SECTIONS
Value:
const tConfigSection * g_psCDCCompSerSections[]
Definition: usbdcdc.c:486

§ SERDESCRIPTOR_SIZE

#define SERDESCRIPTOR_SIZE   (8)

§ SERCOMMINTERFACE_SIZE

#define SERCOMMINTERFACE_SIZE   (35)

§ SERDATAINTERFACE_SIZE

#define SERDATAINTERFACE_SIZE   (23)

§ COMPOSITE_DCDC_SIZE

#define COMPOSITE_DCDC_SIZE
Value:
SERDATAINTERFACE_SIZE)
#define SERDESCRIPTOR_SIZE
Definition: usbdcdc.h:219
#define SERCOMMINTERFACE_SIZE
Definition: usbdcdc.h:226

The size of the memory that should be allocated to create a configuration descriptor for a single instance of the USB Serial CDC Device. This does not include the configuration descriptor which is automatically ignored by the composite device class.

§ USBD_CDC_EVENT_SEND_BREAK

#define USBD_CDC_EVENT_SEND_BREAK   (USBD_CDC_EVENT_BASE + 0)

The host requests that the device send a BREAK condition on its serial communication channel. The BREAK should remain active until a USBD_CDC_EVENT_CLEAR_BREAK event is received.

§ USBD_CDC_EVENT_CLEAR_BREAK

#define USBD_CDC_EVENT_CLEAR_BREAK   (USBD_CDC_EVENT_BASE + 1)

The host requests that the device stop sending a BREAK condition on its serial communication channel.

§ USBD_CDC_EVENT_SET_CONTROL_LINE_STATE

#define USBD_CDC_EVENT_SET_CONTROL_LINE_STATE   (USBD_CDC_EVENT_BASE + 2)

The host requests that the device set the RS232 signaling lines to a particular state. The ui32MsgValue parameter contains the RTS and DTR control line states as defined in table 51 of the USB CDC class definition and is a combination of the following values:

(RTS) USB_CDC_DEACTIVATE_CARRIER or USB_CDC_ACTIVATE_CARRIER (DTR) USB_CDC_DTE_NOT_PRESENT or USB_CDC_DTE_PRESENT

§ USBD_CDC_EVENT_SET_LINE_CODING

#define USBD_CDC_EVENT_SET_LINE_CODING   (USBD_CDC_EVENT_BASE + 3)

The host requests that the device set the RS232 communication parameters. The pvMsgData parameter points to a tLineCoding structure defining the required number of bits per character, parity mode, number of stop bits and the baud rate.

§ USBD_CDC_EVENT_GET_LINE_CODING

#define USBD_CDC_EVENT_GET_LINE_CODING   (USBD_CDC_EVENT_BASE + 4)

The host is querying the current RS232 communication parameters. The pvMsgData parameter points to a tLineCoding structure that the application must fill with the current settings prior to returning from the callback.

Enumeration Type Documentation

§ tCDCState

enum tCDCState
Enumerator
eCDCStateUnconfigured 
eCDCStateIdle 
eCDCStateWaitData 
eCDCStateWaitClient 

Function Documentation

§ ProcessDataFromHost()

bool ProcessDataFromHost ( tUSBDCDCDevice psCDCDevice,
uint32_t  ui32Status 
)

§ ProcessNotificationToHost()

bool ProcessNotificationToHost ( tUSBDCDCDevice psCDCDevice,
uint32_t  ui32Status 
)

§ ProcessDataToHost()

bool ProcessDataToHost ( tUSBDCDCDevice psCDCDevice,
uint32_t  ui32Status 
)

§ USBDCDCCompositeInit()

void * USBDCDCCompositeInit ( uint32_t  ui32Index,
tUSBDCDCDevice psCDCDevice,
tCompositeEntry psCompEntry 
)

Initializes CDC device operation when used with a composite device.

Parameters
ui32Indexis the index of the USB controller in use.
psCDCDevicepoints to a structure containing parameters customizing the operation of the CDC device.
psCompEntryis the composite device entry to initialize when creating a composite device.

This call is very similar to USBDCDCInit() except that it is used for initializing an instance of the serial device for use in a composite device. When this CDC serial device is part of a composite device, then the psCompEntry should point to the composite device entry to initialize. This is part of the array that is passed to the USBDCompositeInit() function.

Returns
Returns zero on failure or a non-zero instance value that should be used with the remaining USB CDC APIs.

References g_pui8CDCSerDeviceDescriptor, g_sCDCHandlers, tUSBDCDCDevice::pfnControlCallback, tUSBDCDCDevice::pfnRxCallback, tUSBDCDCDevice::pfnTxCallback, tDeviceInfo::psCallbacks, tCompositeEntry::psDevInfo, tDeviceInfo::pui8DeviceDescriptor, tCompositeEntry::pvInstance, tCDCSerInstance::sDevInfo, tUSBDCDCDevice::sPrivateData, USBDCDFeatureGet(), and USBLIB_FEATURE_USBULPI.

Referenced by USBDCDCInit().

§ USBDCDCInit()

void * USBDCDCInit ( uint32_t  ui32Index,
tUSBDCDCDevice psCDCDevice 
)

Initializes CDC device operation for a given USB controller.

Parameters
ui32Indexis the index of the USB controller which is to be initialized for CDC device operation.
psCDCDevicepoints to a structure containing parameters customizing the operation of the CDC device.

An application wishing to make use of a USB CDC communication channel and appear as a virtual serial port on the host system must call this function to initialize the USB controller and attach the device to the USB bus. This function performs all required USB initialization.

The value returned by this function is the psCDCDevice pointer passed to it if successful. This pointer must be passed to all later calls to the CDC class driver to identify the device instance.

The USB CDC device class driver offers packet-based transmit and receive operation. If the application would rather use block based communication with transmit and receive buffers, USB buffers on the transmit and receive channels may be used to offer this functionality.

Transmit Operation:

Calls to USBDCDCPacketWrite() must send no more than 64 bytes of data at a time and may only be made when no other transmission is currently outstanding.

Once a packet of data has been acknowledged by the USB host, a USB_EVENT_TX_COMPLETE event is sent to the application callback to inform it that another packet may be transmitted.

Receive Operation:

An incoming USB data packet will result in a call to the application callback with event USB_EVENT_RX_AVAILABLE. The application must then call USBDCDCPacketRead(), passing a buffer capable of holding the received packet to retrieve the data and acknowledge reception to the USB host. The size of the received packet may be queried by calling USBDCDCRxPacketAvailable().

Note
The application must not make any calls to the low level USB Device API if interacting with USB via the CDC device class API. Doing so will cause unpredictable (though almost certainly unpleasant) behavior.
Returns
Returns NULL on failure or the psCDCDevice pointer on success.

References CONTROL_ENDPOINT, g_ppCDCSerConfigDescriptors, g_pui8CDCSerDescriptor, g_pui8CDCSerDeviceDescriptor, tDeviceInfo::ppsConfigDescriptors, tCDCSerInstance::sDevInfo, tUSBDCDCDevice::sPrivateData, tUSBDCDCDevice::ui16MaxPowermA, tUSBDCDCDevice::ui16PID, tUSBDCDCDevice::ui16VID, tCDCSerInstance::ui8ControlEndpoint, tUSBDCDCDevice::ui8PwrAttributes, USBDCDCCompositeInit(), and USBDCDInit().

§ USBDCDCTerm()

void USBDCDCTerm ( void *  pvCDCDevice)

Shuts down the CDC device instance.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().

This function terminates CDC operation for the instance supplied and removes the device from the USB bus. This function should not be called if the CDC device is part of a composite device and instead the USBDCompositeTerm() function should be called for the full composite device.

Following this call, the pvCDCDevice instance should not me used in any other calls.

Returns
None.

References tCDCSerInstance::ui32USBBase, USBBaseToIndex, and USBDCDTerm().

§ USBDCDCSetControlCBData()

void * USBDCDCSetControlCBData ( void *  pvCDCDevice,
void *  pvCBData 
)

Sets the client-specific pointer for the control callback.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
pvCBDatais the pointer that client wishes to be provided on each event sent to the control channel callback function.

The client uses this function to change the callback pointer passed in the first parameter on all callbacks to the pfnControlCallback function passed on USBDCDCInit().

If a client wants to make runtime changes in the callback pointer, it must ensure that the psCDCDevice structure passed to USBDCDCInit() resides in RAM. If this structure is in flash, callback pointer changes will not be possible.

Returns
Returns the previous callback pointer that was being used for this instance's control callback.

References tUSBDCDCDevice::pvControlCBData.

§ USBDCDCSetRxCBData()

void * USBDCDCSetRxCBData ( void *  pvCDCDevice,
void *  pvCBData 
)

Sets the client-specific data parameter for the receive channel callback.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
pvCBDatais the pointer that client wishes to be provided on each event sent to the receive channel callback function.

The client uses this function to change the callback pointer passed in the first parameter on all callbacks to the pfnRxCallback function passed on USBDCDCInit().

If a client wants to make runtime changes in the callback pointer, it must ensure that the psCDCDevice structure passed to USBDCDCInit() resides in RAM. If this structure is in flash, callback data changes will not be possible.

Returns
Returns the previous callback pointer that was being used for this instance's receive callback.

References tUSBDCDCDevice::pvRxCBData.

§ USBDCDCSetTxCBData()

void * USBDCDCSetTxCBData ( void *  pvCDCDevice,
void *  pvCBData 
)

Sets the client-specific data parameter for the transmit callback.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
pvCBDatais the pointer that client wishes to be provided on each event sent to the transmit channel callback function.

The client uses this function to change the callback pointer passed in the first parameter on all callbacks to the pfnTxCallback function passed on USBDCDCInit().

If a client wants to make runtime changes in the callback pointer, it must ensure that the psCDCDevice structure passed to USBDCDCInit() resides in RAM. If this structure is in flash, callback data changes will not be possible.

Returns
Returns the previous callback pointer that was being used for this instance's transmit callback.

References tUSBDCDCDevice::pvTxCBData.

§ USBDCDCPacketWrite()

uint32_t USBDCDCPacketWrite ( void *  pvCDCDevice,
uint8_t *  pi8Data,
uint32_t  ui32Length,
bool  bLast 
)

Transmits a packet of data to the USB host via the CDC data interface.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
pi8Datapoints to the first byte of data which is to be transmitted.
ui32Lengthis the number of bytes of data to transmit.
bLastindicates whether more data is to be written before a packet should be scheduled for transmission. If true, the client will make a further call to this function. If false, no further call will be made and the driver should schedule transmission of a short packet.

This function schedules the supplied data for transmission to the USB host in a single USB packet. If no transmission is currently ongoing the data is immediately copied to the relevant USB endpoint FIFO. If the bLast parameter is true, the newly written packet is then scheduled for transmission. Whenever a USB packet is acknowledged by the host, a USB_EVENT_TX_COMPLETE event will be sent to the application transmit callback indicating that more data can now be transmitted.

The maximum value for ui32Length is 64 bytes (the maximum USB packet size for the bulk endpoints in use by CDC). Attempts to send more data than this will result in a return code of 0 indicating that the data cannot be sent.

Returns
Returns the number of bytes actually sent. At this level, this will either be the number of bytes passed (if less than or equal to the maximum packet size for the USB endpoint in use and no outstanding transmission ongoing) or 0 to indicate a failure.

§ USBDCDCPacketRead()

uint32_t USBDCDCPacketRead ( void *  pvCDCDevice,
uint8_t *  pi8Data,
uint32_t  ui32Length,
bool  bLast 
)

Reads a packet of data received from the USB host via the CDC data interface.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
pi8Datapoints to a buffer into which the received data will be written.
ui32Lengthis the size of the buffer pointed to by pi8Data.
bLastindicates whether the client will make a further call to read additional data from the packet.

This function reads up to ui32Length bytes of data received from the USB host into the supplied application buffer.

Note
The bLast parameter is ignored in this implementation since the end of a packet can be determined without relying upon the client to provide this information.
Returns
Returns the number of bytes of data read.

References tCDCSerInstance::bControlBlocked, tCDCSerInstance::bRxBlocked, tCDCSerInstance::ui32USBBase, and tCDCSerInstance::ui8BulkOUTEndpoint.

§ USBDCDCTxPacketAvailable()

uint32_t USBDCDCTxPacketAvailable ( void *  pvCDCDevice)

Returns the number of free bytes in the transmit buffer.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().

This function returns the maximum number of bytes that can be passed on a call to USBDCDCPacketWrite() and accepted for transmission. The value returned will be the maximum USB packet size if no transmission is currently outstanding or 0 if a transmission is in progress.

Returns
Returns the number of bytes available in the transmit buffer.

References eCDCStateIdle, and tCDCSerInstance::iCDCTxState.

§ USBDCDCRxPacketAvailable()

uint32_t USBDCDCRxPacketAvailable ( void *  pvCDCDevice)

Determines whether a packet is available and, if so, the size of the buffer required to read it.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().

This function may be used to determine if a received packet remains to be read and allows the application to determine the buffer size needed to read the data.

Returns
Returns 0 if no received packet remains unprocessed or the size of the packet if a packet is waiting to be read.

References tCDCSerInstance::bControlBlocked, tCDCSerInstance::bRxBlocked, tCDCSerInstance::ui32USBBase, and tCDCSerInstance::ui8BulkOUTEndpoint.

§ USBDCDCSerialStateChange()

void USBDCDCSerialStateChange ( void *  pvCDCDevice,
uint16_t  ui16State 
)

Informs the CDC module of changes in the serial control line states or receive error conditions.

Parameters
pvCDCDeviceis the pointer to the device instance structure as returned by USBDCDCInit().
ui16Stateindicates the states of the various control lines and any receive errors detected. Bit definitions are as for the USB CDC SerialState asynchronous notification and are defined in header file usbcdc.h.

The application should call this function whenever the state of any of the incoming RS232 handshake signals changes or in response to a receive error or break condition. The ui16State parameter is the ORed combination of the following flags with each flag indicating the presence of that condition.

  • USB_CDC_SERIAL_STATE_OVERRUN
  • USB_CDC_SERIAL_STATE_PARITY
  • USB_CDC_SERIAL_STATE_FRAMING
  • USB_CDC_SERIAL_STATE_RING_SIGNAL
  • USB_CDC_SERIAL_STATE_BREAK
  • USB_CDC_SERIAL_STATE_TXCARRIER
  • USB_CDC_SERIAL_STATE_RXCARRIER

This function should be called only when the state of any flag changes.

Returns
None.

References tCDCSerInstance::ui16SerialState.

§ USBDCDCPowerStatusSet()

void USBDCDCPowerStatusSet ( void *  pvCDCDevice,
uint8_t  ui8Power 
)

Reports the device power status (bus- or self-powered) to the USB library.

Parameters
pvCDCDeviceis the pointer to the CDC device instance structure.
ui8Powerindicates the current power status, either USB_STATUS_SELF_PWR or USB_STATUS_BUS_PWR.

Applications which support switching between bus- or self-powered operation should call this function whenever the power source changes to indicate the current power status to the USB library. This information is required by the USB library to allow correct responses to be provided when the host requests status from the device.

Returns
None.

References USBDCDPowerStatusSet().

§ USBDCDCRemoteWakeupRequest()

bool USBDCDCRemoteWakeupRequest ( void *  pvCDCDevice)

Requests a remote wakeup to resume communication when in suspended state.

Parameters
pvCDCDeviceis the pointer to the CDC device instance structure.

When the bus is suspended, an application which supports remote wakeup (advertised to the host via the configuration descriptor) may call this function to initiate remote wakeup signaling to the host. If the remote wakeup feature has not been disabled by the host, this will cause the bus to resume operation within 20mS. If the host has disabled remote wakeup, false will be returned to indicate that the wakeup request was not successful.

Returns
Returns true if the remote wakeup is not disabled and the signaling was started or false if remote wakeup is disabled or if signaling is currently ongoing following a previous call to this function.

References USBDCDRemoteWakeupRequest().

Variable Documentation

§ g_pui8CDCSerDeviceDescriptor

uint8_t g_pui8CDCSerDeviceDescriptor[]
Initial value:
=
{
18,
USBShort(0x110),
0,
64,
USBShort(0),
USBShort(0),
USBShort(0x100),
1,
2,
3,
1
}
#define USB_CDC_PROTOCOL_NONE
Definition: usbcdc.h:102
#define USBShort(ui16Value)
Definition: usblib.h:834
#define USB_CLASS_CDC
Definition: usblib.h:421
#define USB_DTYPE_DEVICE
Definition: usblib.h:280

Referenced by USBDCDCCompositeInit(), and USBDCDCInit().

§ g_pui8CDCSerDescriptor

uint8_t g_pui8CDCSerDescriptor[]
Initial value:
=
{
9,
USBShort(9),
2,
1,
5,
250,
}
#define USB_DTYPE_CONFIGURATION
Definition: usblib.h:281
#define USBShort(ui16Value)
Definition: usblib.h:834
#define USB_CONF_ATTR_SELF_PWR
Definition: usblib.h:602

Referenced by USBDCDCInit().

§ g_sCDCSerConfigSection

const tConfigSection g_sCDCSerConfigSection
Initial value:
=
{
}
uint8_t g_pui8CDCSerDescriptor[]
Definition: usbdcdc.c:202

§ g_pui8IADSerDescriptor

uint8_t g_pui8IADSerDescriptor[SERDESCRIPTOR_SIZE]
Initial value:
=
{
8,
0x0,
0x2,
0
}
#define USB_CDC_SUBCLASS_ABSTRACT_MODEL
Definition: usbcdc.h:71
#define USB_DTYPE_INTERFACE_ASC
Definition: usblib.h:289
#define USB_CLASS_CDC
Definition: usblib.h:421
#define USB_CDC_PROTOCOL_V25TER
Definition: usbcdc.h:92

§ g_sIADSerConfigSection

const tConfigSection g_sIADSerConfigSection
Initial value:
=
{
}
uint8_t g_pui8IADSerDescriptor[SERDESCRIPTOR_SIZE]
Definition: usbdcdc.c:234

§ g_pui8CDCSerCommInterface

const uint8_t g_pui8CDCSerCommInterface[SERCOMMINTERFACE_SIZE]

§ g_sCDCSerCommInterfaceSection

const tConfigSection g_sCDCSerCommInterfaceSection
Initial value:
=
{
}
const uint8_t g_pui8CDCSerCommInterface[SERCOMMINTERFACE_SIZE]
Definition: usbdcdc.c:261

§ g_pui8CDCSerDataInterface

const uint8_t g_pui8CDCSerDataInterface[SERDATAINTERFACE_SIZE]

§ g_sCDCSerDataInterfaceSection

const tConfigSection g_sCDCSerDataInterfaceSection
Initial value:
=
{
}
const uint8_t g_pui8CDCSerDataInterface[SERDATAINTERFACE_SIZE]
Definition: usbdcdc.c:338

§ g_pui8CDCSerDataInterfaceHS

const uint8_t g_pui8CDCSerDataInterfaceHS[SERDATAINTERFACE_SIZE]

§ g_sCDCSerDataInterfaceSectionHS

const tConfigSection g_sCDCSerDataInterfaceSectionHS
Initial value:
=
{
}
const uint8_t g_pui8CDCSerDataInterfaceHS[SERDATAINTERFACE_SIZE]
Definition: usbdcdc.c:390

§ g_psCDCSerSections

const tConfigSection* g_psCDCSerSections[]
Initial value:
=
{
}
const tConfigSection g_sCDCSerCommInterfaceSection
Definition: usbdcdc.c:327
const tConfigSection g_sCDCSerDataInterfaceSection
Definition: usbdcdc.c:379
const tConfigSection g_sCDCSerConfigSection
Definition: usbdcdc.c:222

§ g_psCDCSerSectionsHS

const tConfigSection* g_psCDCSerSectionsHS[]
Initial value:
=
{
}
const tConfigSection g_sCDCSerDataInterfaceSectionHS
Definition: usbdcdc.c:431
const tConfigSection g_sCDCSerCommInterfaceSection
Definition: usbdcdc.c:327
const tConfigSection g_sCDCSerConfigSection
Definition: usbdcdc.c:222

§ g_sCDCSerConfigHeader

const tConfigHeader g_sCDCSerConfigHeader
Initial value:
=
{
}
#define NUM_CDCSER_SECTIONS
Definition: usbdcdc.c:457
const tConfigSection * g_psCDCSerSections[]
Definition: usbdcdc.c:443

§ g_sCDCSerConfigHeaderHS

const tConfigHeader g_sCDCSerConfigHeaderHS
Initial value:
=
{
}
#define NUM_CDCSER_SECTIONS
Definition: usbdcdc.c:457
const tConfigSection * g_psCDCSerSectionsHS[]
Definition: usbdcdc.c:450

§ g_psCDCCompSerSections

const tConfigSection* g_psCDCCompSerSections[]
Initial value:
=
{
}
const tConfigSection g_sCDCSerCommInterfaceSection
Definition: usbdcdc.c:327
const tConfigSection g_sIADSerConfigSection
Definition: usbdcdc.c:250
const tConfigSection g_sCDCSerDataInterfaceSection
Definition: usbdcdc.c:379
const tConfigSection g_sCDCSerConfigSection
Definition: usbdcdc.c:222

§ g_psCDCCompSerSectionsHS

const tConfigSection* g_psCDCCompSerSectionsHS[]
Initial value:
=
{
}
const tConfigSection g_sCDCSerDataInterfaceSectionHS
Definition: usbdcdc.c:431
const tConfigSection g_sCDCSerCommInterfaceSection
Definition: usbdcdc.c:327
const tConfigSection g_sIADSerConfigSection
Definition: usbdcdc.c:250
const tConfigSection g_sCDCSerConfigSection
Definition: usbdcdc.c:222

§ g_sCDCCompSerConfigHeader

const tConfigHeader g_sCDCCompSerConfigHeader
Initial value:
=
{
}
#define NUM_COMP_CDCSER_SECTIONS
Definition: usbdcdc.c:502
const tConfigSection * g_psCDCCompSerSections[]
Definition: usbdcdc.c:486

§ g_sCDCCompSerConfigHeaderHS

const tConfigHeader g_sCDCCompSerConfigHeaderHS
Initial value:
=
{
}
const tConfigSection * g_psCDCCompSerSectionsHS[]
Definition: usbdcdc.c:494
#define NUM_COMP_CDCSER_SECTIONS
Definition: usbdcdc.c:502

§ g_ppCDCSerConfigDescriptors

const tConfigHeader* const g_ppCDCSerConfigDescriptors[]
Initial value:
=
{
}
const tConfigHeader g_sCDCSerConfigHeader
Definition: usbdcdc.c:467

Referenced by USBDCDCInit().

§ g_ppCDCSerConfigDescriptorsHS

const tConfigHeader* const g_ppCDCSerConfigDescriptorsHS[]
Initial value:
=
{
}
const tConfigHeader g_sCDCSerConfigHeaderHS
Definition: usbdcdc.c:473

§ g_pCDCCompSerConfigDescriptors

const tConfigHeader* const g_pCDCCompSerConfigDescriptors[]
Initial value:
=
{
}
const tConfigHeader g_sCDCCompSerConfigHeader
Definition: usbdcdc.c:512

§ g_pCDCCompSerConfigDescriptorsHS

const tConfigHeader* const g_pCDCCompSerConfigDescriptorsHS[]
Initial value:
=
{
}
const tConfigHeader g_sCDCCompSerConfigHeaderHS
Definition: usbdcdc.c:518

§ g_sCDCHandlers

const tCustomHandlers g_sCDCHandlers

Referenced by USBDCDCCompositeInit().

© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale