|
Data Structures | |
| struct | CDCDParseData |
| struct | _CDCDEEMDriverConfigurationDescriptors |
| struct | _CDCDEEMDriverConfigurationDescriptorsOTG |
| struct | CDCDEEMPort |
| struct | _CDCDSerialDriverConfigurationDescriptors |
| struct | _CDCDSerialDriverConfigurationDescriptorsOTG |
| struct | CDCDSerialPort |
Modules | |
| CDC Serial Device IDs | |
| USB Device CDC EEM Interface IDs | |
| USB Device EEM Port Descriptor Values | |
| USB Device Serial Port Descriptor Values | |
| USB Device Serial Port Events | |
Defines | |
| #define | MIN(a, b) ((a < b) ? a : b) |
| #define | DATAPACKETSIZE (1536) |
| #define | DATABUFFERSIZE (DATAPACKETSIZE+2) |
| #define | USB_TX_BUFFERS 64 |
Typedefs | |
| typedef uint32_t(* | CDCDSerialPortEventHandler )(uint32_t dwEvent, uint32_t dwParam, void *pArguments) |
Functions | |
| void | CDCDEEM_Initialize (USBDDriver *pUsbd, uint8_t bInterfaceNb) |
| void | CDCDEEM_ConfigureFunction (USBGenericDescriptor *pDescriptors, uint16_t wLength) |
| uint32_t | CDCDEEM_RequestHandler (const USBGenericRequest *request) |
| uint32_t | CDCDEEM_Read (void *data, uint32_t size, TransferCallback callback, void *argument) |
| uint32_t | CDCDEEM_Write (void *data, uint32_t size, TransferCallback callback, void *argument) |
| void | CDCDEEMDriver_Initialize (const USBDDriverDescriptors *pDescriptors) |
| void | CDCDEEMDriver_ConfigurationChangedHandler (uint8_t cfgnum) |
| void | CDCDEEMDriver_RequestHandler (const USBGenericRequest *request) |
| void | CDCDEEMPort_Initialize (CDCDEEMPort *pCdcd, USBDDriver *pUsbd, uint8_t firstInterface, uint8_t numInterface) |
| USBGenericDescriptor * | CDCDEEMPort_ParseInterfaces (CDCDEEMPort *pCdcd, USBGenericDescriptor *pDescriptors, uint32_t dwLength) |
| uint32_t | CDCDEEMPort_RequestHandler (CDCDEEMPort *pCdcd, const USBGenericRequest *request) |
| uint32_t | CDCDEEMPort_Read (const CDCDEEMPort *pCdcd, void *pData, uint32_t dwSize, TransferCallback fCallback, void *pArg) |
| uint32_t | CDCDEEMPort_Write (const CDCDEEMPort *pCdcd, void *pData, uint32_t dwSize, TransferCallback fCallback, void *pArg) |
| void | CDCDSerial_Initialize (USBDDriver *pUsbd, uint8_t bInterfaceNb) |
| void | CDCDSerial_ConfigureFunction (USBGenericDescriptor *pDescriptors, uint16_t wLength) |
| uint32_t | CDCDSerial_RequestHandler (const USBGenericRequest *request) |
| uint32_t | CDCDSerial_Read (void *data, uint32_t size, TransferCallback callback, void *argument) |
| uint32_t | CDCDSerial_Write (void *data, uint32_t size, TransferCallback callback, void *argument) |
| uint8_t | CDCDSerial_GetControlLineState (void) |
| void | CDCDSerial_GetLineCoding (CDCLineCoding *pLineCoding) |
| uint16_t | CDCDSerial_GetSerialState (void) |
| void | CDCDSerial_SetSerialState (uint16_t serialState) |
| void | CDCDSerialDriver_Initialize (const USBDDriverDescriptors *pDescriptors) |
| void | CDCDSerialDriver_ConfigurationChangedHandler (uint8_t cfgnum) |
| void | CDCDSerialDriver_RequestHandler (const USBGenericRequest *request) |
| void | CDCDSerialPort_Initialize (CDCDSerialPort *pCdcd, USBDDriver *pUsbd, CDCDSerialPortEventHandler fEventHandler, void *pArg, uint8_t firstInterface, uint8_t numInterface) |
| USBGenericDescriptor * | CDCDSerialPort_ParseInterfaces (CDCDSerialPort *pCdcd, USBGenericDescriptor *pDescriptors, uint32_t dwLength) |
| uint32_t | CDCDSerialPort_RequestHandler (CDCDSerialPort *pCdcd, const USBGenericRequest *request) |
| uint32_t | CDCDSerialPort_Read (const CDCDSerialPort *pCdcd, void *pData, uint32_t dwSize, TransferCallback fCallback, void *pArg) |
| uint32_t | CDCDSerialPort_Write (CDCDSerialPort *pCdcd, void *pData, uint32_t dwSize, TransferCallback fCallback, void *pArg) |
| uint8_t | CDCDSerialPort_GetControlLineState (const CDCDSerialPort *pCdcd) |
| void | CDCDSerialPort_GetLineCoding (const CDCDSerialPort *pCdcd, CDCLineCoding *pLineCoding) |
| uint16_t | CDCDSerialPort_GetSerialState (const CDCDSerialPort *pCdcd) |
| void | CDCDSerialPort_SetSerialState (CDCDSerialPort *pCdcd, uint16_t wSerialState) |
|
struct _CDCDEEMDriverConfigurationDescriptors | __attribute__ ((__packed__)) CDCDEEMDriverConfigurationDescriptors |
| uint8_t | CDCDSerial_LineCodingIsToChange (CDCLineCoding *pLineCoding) |
| void | CDCDSerial_ControlLineStateChanged (uint8_t DTR, uint8_t RTS) |
Variables | |
| const USBDeviceDescriptor | deviceDescriptor |
| const CDCDSerialDriverConfigurationDescriptors | configurationDescriptorsFS |
| const CDCDSerialDriverConfigurationDescriptors | otherSpeedDescriptorsFS |
| const CDCDSerialDriverConfigurationDescriptors | configurationDescriptorsHS |
| const CDCDSerialDriverConfigurationDescriptors | otherSpeedDescriptorsHS |
| const unsigned char | languageIdStringDescriptor [] |
| const unsigned char | productStringDescriptor [] |
| const unsigned char * | stringDescriptors [] |
| WEAK const USBDDriverDescriptors | cdcdSerialDriverDescriptors |
| #define DATABUFFERSIZE (DATAPACKETSIZE+2) |
Size in bytes of the buffer used for reading data from USB
Definition at line 69 of file CDCDEEMPort.c.
| #define DATAPACKETSIZE (1536) |
Maximum packet size in bytes
Definition at line 66 of file CDCDEEMPort.c.
| #define MIN | ( | a, | ||
| b | ||||
| ) | ((a < b) ? a : b) |
Returns the minimum between two values.
Definition at line 71 of file USBDDriverDescriptors.c.
| #define USB_TX_BUFFERS 64 |
Number of transmit buffers
Definition at line 72 of file CDCDEEMPort.c.
| typedef uint32_t(* CDCDSerialPortEventHandler)(uint32_t dwEvent, uint32_t dwParam, void *pArguments) |
Callback function for serial port events
Definition at line 88 of file CDCDSerialPort.h.
| void CDCDEEM_ConfigureFunction | ( | USBGenericDescriptor * | pDescriptors, | |
| uint16_t | wLength | |||
| ) |
Invoked whenever the device is changed by the host. Pointer to the descriptors for function configure. Length of descriptors in number of bytes.
| void CDCDEEM_Initialize | ( | USBDDriver * | pUsbd, | |
| uint8_t | bInterfaceNb | |||
| ) |
Initializes the USB Device CDC serial driver & USBD Driver.
| pUsbd | Pointer to USBDDriver instance. | |
| bInterfaceNb | Interface number for the function. |
| uint32_t CDCDEEM_Read | ( | void * | data, | |
| uint32_t | size, | |||
| TransferCallback | callback, | |||
| void * | argument | |||
| ) |
Receives data from the host through the virtual COM port created by the CDC device serial driver. This function behaves like USBD_Read.
| data | Pointer to the data buffer to put received data. | |
| size | Size of the data buffer in bytes. | |
| callback | Optional callback function to invoke when the transfer finishes. | |
| argument | Optional argument to the callback function. |
| uint32_t CDCDEEM_RequestHandler | ( | const USBGenericRequest * | request | ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| request | Pointer to a USBGenericRequest instance. |
| uint32_t CDCDEEM_Write | ( | void * | data, | |
| uint32_t | size, | |||
| TransferCallback | callback, | |||
| void * | argument | |||
| ) |
Sends a data buffer through the virtual COM port created by the CDC device serial driver. This function behaves exactly like USBD_Write.
| data | Pointer to the data buffer to send. | |
| size | Size of the data buffer in bytes. | |
| callback | Optional callback function to invoke when the transfer finishes. | |
| argument | Optional argument to the callback function. |
| void CDCDEEMDriver_ConfigurationChangedHandler | ( | uint8_t | cfgnum | ) |
Invoked whenever the active configuration of device is changed by the host.
| cfgnum | Configuration number. |
| void CDCDEEMDriver_Initialize | ( | const USBDDriverDescriptors * | pDescriptors | ) |
Initializes the USB Device CDC serial driver & USBD Driver.
| pDescriptors | Pointer to Descriptors list for CDC EEM Device. |
| void CDCDEEMDriver_RequestHandler | ( | const USBGenericRequest * | request | ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| request | Pointer to a USBGenericRequest instance. |
| void CDCDEEMPort_Initialize | ( | CDCDEEMPort * | pCdcd, | |
| USBDDriver * | pUsbd, | |||
| uint8_t | firstInterface, | |||
| uint8_t | numInterface | |||
| ) |
Initializes the USB Device CDC serial port function.
| pCdcd | Pointer to CDCDEEMPort instance. | |
| pUsbd | Pointer to USBDDriver instance. | |
| fEventHandler | Pointer to event handler function. | |
| firstInterface | First interface index for the function (0xFF to parse from descriptors). | |
| numInterface | Number of interfaces for the function. |
| USBGenericDescriptor * CDCDEEMPort_ParseInterfaces | ( | CDCDEEMPort * | pCdcd, | |
| USBGenericDescriptor * | pDescriptors, | |||
| uint32_t | dwLength | |||
| ) |
Parse CDC EEM Port information for CDCDEEMPort instance. Accepted interfaces:
| pCdcd | Pointer to CDCDEEMPort instance. | |
| pDescriptors | Pointer to descriptor list. | |
| dwLength | Descriptor list size in bytes. |
| uint32_t CDCDEEMPort_Read | ( | const CDCDEEMPort * | pCdcd, | |
| void * | pData, | |||
| uint32_t | dwSize, | |||
| TransferCallback | fCallback, | |||
| void * | pArg | |||
| ) |
Receives data from the host through the virtual COM port created by the CDC device serial driver. This function behaves like USBD_Read.
| pCdcd | Pointer to CDCDEEMPort instance. | |
| pData | Pointer to the data buffer to put received data. | |
| dwSize | Size of the data buffer in bytes. | |
| fCallback | Optional callback function to invoke when the transfer finishes. | |
| pArg | Optional argument to the callback function. |
| uint32_t CDCDEEMPort_RequestHandler | ( | CDCDEEMPort * | pCdcd, | |
| const USBGenericRequest * | request | |||
| ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| pCdcd | Pointer to CDCDEEMPort instance. | |
| request | Pointer to a USBGenericRequest instance. |
| uint32_t CDCDEEMPort_Write | ( | const CDCDEEMPort * | pCdcd, | |
| void * | pData, | |||
| uint32_t | dwSize, | |||
| TransferCallback | fCallback, | |||
| void * | pArg | |||
| ) |
Sends a data buffer through the virtual COM port created by the CDC device serial driver. This function behaves exactly like USBD_Write.
TODO batch packets ?
| pCdcd | Pointer to CDCDEEMPort instance. | |
| pData | Pointer to the data buffer to send. | |
| dwSize | Size of the data buffer in bytes. | |
| fCallback | Optional callback function to invoke when the transfer finishes. | |
| pArg | Optional argument to the callback function. |
| void CDCDSerial_ConfigureFunction | ( | USBGenericDescriptor * | pDescriptors, | |
| uint16_t | wLength | |||
| ) |
Invoked whenever the device is changed by the host. Pointer to the descriptors for function configure. Length of descriptors in number of bytes.
| void CDCDSerial_ControlLineStateChanged | ( | uint8_t | DTR, | |
| uint8_t | RTS | |||
| ) |
| uint8_t CDCDSerial_GetControlLineState | ( | void | ) |
Returns the current control line state of the RS-232 line.
| void CDCDSerial_GetLineCoding | ( | CDCLineCoding * | pLineCoding | ) |
Copy current line coding settings to pointered space.
| pLineCoding | Pointer to CDCLineCoding instance. |
| uint16_t CDCDSerial_GetSerialState | ( | void | ) |
Returns the current status of the RS-232 line.
| void CDCDSerial_Initialize | ( | USBDDriver * | pUsbd, | |
| uint8_t | bInterfaceNb | |||
| ) |
Initializes the USB Device CDC serial driver & USBD Driver.
| pUsbd | Pointer to USBDDriver instance. | |
| bInterfaceNb | Interface number for the function. |
| uint8_t CDCDSerial_LineCodingIsToChange | ( | CDCLineCoding * | pLineCoding | ) |
Invoked when the CDC LineCoding is requested to changed
| pLineCoding | Pointer to new LineCoding settings. |
Invoked when the CDC LineCoding is requested to changed
| port | Port number. | |
| pLineCoding | Pointer to new LineCoding settings. |
| uint32_t CDCDSerial_Read | ( | void * | data, | |
| uint32_t | size, | |||
| TransferCallback | callback, | |||
| void * | argument | |||
| ) |
Receives data from the host through the virtual COM port created by the CDC device serial driver. This function behaves like USBD_Read.
| data | Pointer to the data buffer to put received data. | |
| size | Size of the data buffer in bytes. | |
| callback | Optional callback function to invoke when the transfer finishes. | |
| argument | Optional argument to the callback function. |
| uint32_t CDCDSerial_RequestHandler | ( | const USBGenericRequest * | request | ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| request | Pointer to a USBGenericRequest instance. |
| void CDCDSerial_SetSerialState | ( | uint16_t | serialState | ) |
Sets the current serial state of the device to the given value.
| serialState | New device state. |
| uint32_t CDCDSerial_Write | ( | void * | data, | |
| uint32_t | size, | |||
| TransferCallback | callback, | |||
| void * | argument | |||
| ) |
Sends a data buffer through the virtual COM port created by the CDC device serial driver. This function behaves exactly like USBD_Write.
| data | Pointer to the data buffer to send. | |
| size | Size of the data buffer in bytes. | |
| callback | Optional callback function to invoke when the transfer finishes. | |
| argument | Optional argument to the callback function. |
| void CDCDSerialDriver_ConfigurationChangedHandler | ( | uint8_t | cfgnum | ) |
Invoked whenever the active configuration of device is changed by the host.
| cfgnum | Configuration number. |
| void CDCDSerialDriver_Initialize | ( | const USBDDriverDescriptors * | pDescriptors | ) |
Initializes the USB Device CDC serial driver & USBD Driver.
| pDescriptors | Pointer to Descriptors list for CDC Serial Device. |
| void CDCDSerialDriver_RequestHandler | ( | const USBGenericRequest * | request | ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| request | Pointer to a USBGenericRequest instance. |
| uint8_t CDCDSerialPort_GetControlLineState | ( | const CDCDSerialPort * | pCdcd | ) |
Returns the current control line state of the RS-232 line.
| pCdcd | Pointer to CDCDSerialPort instance. |
| void CDCDSerialPort_GetLineCoding | ( | const CDCDSerialPort * | pCdcd, | |
| CDCLineCoding * | pLineCoding | |||
| ) |
Copy current line coding settings to appointed space.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| pLineCoding | Pointer to CDCLineCoding instance. |
| uint16_t CDCDSerialPort_GetSerialState | ( | const CDCDSerialPort * | pCdcd | ) |
Returns the current status of the RS-232 line.
| pCdcd | Pointer to CDCDSerialPort instance. |
| void CDCDSerialPort_Initialize | ( | CDCDSerialPort * | pCdcd, | |
| USBDDriver * | pUsbd, | |||
| CDCDSerialPortEventHandler | fEventHandler, | |||
| void * | pArg, | |||
| uint8_t | firstInterface, | |||
| uint8_t | numInterface | |||
| ) |
Initializes the USB Device CDC serial port function.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| pUsbd | Pointer to USBDDriver instance. | |
| fEventHandler | Pointer to event handler function. | |
| firstInterface | First interface index for the function (0xFF to parse from descriptors). | |
| numInterface | Number of interfaces for the function. |
| USBGenericDescriptor * CDCDSerialPort_ParseInterfaces | ( | CDCDSerialPort * | pCdcd, | |
| USBGenericDescriptor * | pDescriptors, | |||
| uint32_t | dwLength | |||
| ) |
Parse CDC Serial Port information for CDCDSerialPort instance. Accepted interfaces:
| pCdcd | Pointer to CDCDSerialPort instance. | |
| pDescriptors | Pointer to descriptor list. | |
| dwLength | Descriptor list size in bytes. |
| uint32_t CDCDSerialPort_Read | ( | const CDCDSerialPort * | pCdcd, | |
| void * | pData, | |||
| uint32_t | dwSize, | |||
| TransferCallback | fCallback, | |||
| void * | pArg | |||
| ) |
Receives data from the host through the virtual COM port created by the CDC device serial driver. This function behaves like USBD_Read.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| pData | Pointer to the data buffer to put received data. | |
| dwSize | Size of the data buffer in bytes. | |
| fCallback | Optional callback function to invoke when the transfer finishes. | |
| pArg | Optional argument to the callback function. |
| uint32_t CDCDSerialPort_RequestHandler | ( | CDCDSerialPort * | pCdcd, | |
| const USBGenericRequest * | request | |||
| ) |
Handles CDC-specific SETUP requests. Should be called from a re-implementation of USBDCallbacks_RequestReceived() method.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| request | Pointer to a USBGenericRequest instance. |
| void CDCDSerialPort_SetSerialState | ( | CDCDSerialPort * | pCdcd, | |
| uint16_t | wSerialState | |||
| ) |
Sets the current serial state of the device to the given value.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| wSerialState | New device state. |
| uint32_t CDCDSerialPort_Write | ( | CDCDSerialPort * | pCdcd, | |
| void * | pData, | |||
| uint32_t | dwSize, | |||
| TransferCallback | fCallback, | |||
| void * | pArg | |||
| ) |
Sends a data buffer through the virtual COM port created by the CDC device serial driver. This function behaves exactly like USBD_Write.
| pCdcd | Pointer to CDCDSerialPort instance. | |
| pData | Pointer to the data buffer to send. | |
| dwSize | Size of the data buffer in bytes. | |
| fCallback | Optional callback function to invoke when the transfer finishes. | |
| pArg | Optional argument to the callback function. |
| WEAK const USBDDriverDescriptors cdcdSerialDriverDescriptors |
{
&deviceDescriptor,
(USBConfigurationDescriptor *) &(configurationDescriptorsFS),
&qualifierDescriptor,
(USBConfigurationDescriptor *) &(otherSpeedDescriptorsFS),
0,
(USBConfigurationDescriptor *) &(configurationDescriptorsHS),
&qualifierDescriptor,
(USBConfigurationDescriptor *) &(otherSpeedDescriptorsHS),
stringDescriptors,
2
}
List of standard descriptors for the serial driver.
Definition at line 561 of file USBDDriverDescriptors.c.
| const CDCDSerialDriverConfigurationDescriptors configurationDescriptorsFS |
Standard USB configuration descriptor for the CDC serial driver
Definition at line 111 of file USBDDriverDescriptors.c.
| const CDCDSerialDriverConfigurationDescriptors configurationDescriptorsHS |
Configuration descriptor (when in high-speed).
Definition at line 317 of file USBDDriverDescriptors.c.
| const USBDeviceDescriptor deviceDescriptor |
{
sizeof(USBDeviceDescriptor),
USBGenericDescriptor_DEVICE,
USBDeviceDescriptor_USB2_00,
CDCDeviceDescriptor_CLASS,
CDCDeviceDescriptor_SUBCLASS,
CDCDeviceDescriptor_PROTOCOL,
CHIP_USB_ENDPOINTS_MAXPACKETSIZE(0),
CDCDSerialDriverDescriptors_VENDORID,
CDCDSerialDriverDescriptors_PRODUCTID,
CDCDSerialDriverDescriptors_RELEASE,
0,
1,
0,
1
}
Standard USB device descriptor for the CDC serial driver
Definition at line 78 of file USBDDriverDescriptors.c.
| const unsigned char languageIdStringDescriptor[] |
{
USBStringDescriptor_LENGTH(1),
USBGenericDescriptor_STRING,
USBStringDescriptor_ENGLISH_US
}
Language ID string descriptor
Definition at line 526 of file USBDDriverDescriptors.c.
| const CDCDSerialDriverConfigurationDescriptors otherSpeedDescriptorsFS |
Other-speed configuration descriptor (when in full-speed).
Definition at line 214 of file USBDDriverDescriptors.c.
| const CDCDSerialDriverConfigurationDescriptors otherSpeedDescriptorsHS |
Other-speed configuration descriptor (when in high-speed).
Definition at line 420 of file USBDDriverDescriptors.c.
| const unsigned char productStringDescriptor[] |
{
USBStringDescriptor_LENGTH(13),
USBGenericDescriptor_STRING,
USBStringDescriptor_UNICODE('A'),
USBStringDescriptor_UNICODE('T'),
USBStringDescriptor_UNICODE('9'),
USBStringDescriptor_UNICODE('1'),
USBStringDescriptor_UNICODE('U'),
USBStringDescriptor_UNICODE('S'),
USBStringDescriptor_UNICODE('B'),
USBStringDescriptor_UNICODE('S'),
USBStringDescriptor_UNICODE('e'),
USBStringDescriptor_UNICODE('r'),
USBStringDescriptor_UNICODE('i'),
USBStringDescriptor_UNICODE('a'),
USBStringDescriptor_UNICODE('l')
}
Product string descriptor
Definition at line 534 of file USBDDriverDescriptors.c.
| const unsigned char* stringDescriptors[] |
List of string descriptors used by the device
Definition at line 554 of file USBDDriverDescriptors.c.
1.7.1