aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Host')
-rw-r--r--Demos/Host/ClassDriver/CDCHost/CDCHost.c10
-rw-r--r--Demos/Host/LowLevel/CDCHost/CDCHost.h44
2 files changed, 33 insertions, 21 deletions
diff --git a/Demos/Host/ClassDriver/CDCHost/CDCHost.c b/Demos/Host/ClassDriver/CDCHost/CDCHost.c
index e50a28f95..941cf7cc4 100644
--- a/Demos/Host/ClassDriver/CDCHost/CDCHost.c
+++ b/Demos/Host/ClassDriver/CDCHost/CDCHost.c
@@ -40,8 +40,13 @@
* passed to all CDC Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
-USB_ClassInfo_CDC_t VirtualSerial_CDC_Interface;
-
+USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface =
+ {
+ .DataINPipeNumber = 1,
+ .DataOUTPipeNumber = 2,
+ .NotificationPipeNumber = 3,
+ };
+
/** Main program entry point. This routine configures the hardware required by the application, then
* starts the scheduler to run the application tasks.
*/
@@ -56,6 +61,7 @@ int main(void)
for (;;)
{
+ CDC_Host_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
}
}
diff --git a/Demos/Host/LowLevel/CDCHost/CDCHost.h b/Demos/Host/LowLevel/CDCHost/CDCHost.h
index fc6a7481f..9e1d63864 100644
--- a/Demos/Host/LowLevel/CDCHost/CDCHost.h
+++ b/Demos/Host/LowLevel/CDCHost/CDCHost.h
@@ -81,30 +81,36 @@
*/
typedef struct
{
- uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
-
- uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint */
- uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint */
+ const struct
+ {
+ uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */
- uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */
- uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
+ uint8_t DataINEndpointNumber; /**< Endpoint number of the CDC interface's IN data endpoint */
+ uint16_t DataINEndpointSize; /**< Size in bytes of the CDC interface's IN data endpoint */
- uint8_t ControlLineState; /**< Current control line states, as set by the host */
+ uint8_t DataOUTEndpointNumber; /**< Endpoint number of the CDC interface's OUT data endpoint */
+ uint16_t DataOUTEndpointSize; /**< Size in bytes of the CDC interface's OUT data endpoint */
+ uint8_t NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */
+ uint16_t NotificationEndpointSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
+ } Config;
+
struct
{
- uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
- uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
- * CDCDevice_CDC_LineCodingFormats_t enum
- */
- uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
- * CDCDevice_LineCodingParity_t enum
- */
- uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
- } LineEncoding;
+ uint8_t ControlLineState; /**< Current control line states, as set by the host */
+
+ struct
+ {
+ uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
+ uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
+ * CDCDevice_CDC_LineCodingFormats_t enum
+ */
+ uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
+ * CDCDevice_LineCodingParity_t enum
+ */
+ uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
+ } LineEncoding;
+ } State;
} USB_ClassInfo_CDC_Host_t;
/* Function Prototypes: */