X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/3cbdcd36868693cfc1863231a1ec64507ce3d29f..384848253274a7afa74e463a56e1257cf3b8924e:/LUFA/Drivers/USB/Class/Host/CDC.h diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h index 7625c494b..5e0e4690c 100644 --- a/LUFA/Drivers/USB/Class/Host/CDC.h +++ b/LUFA/Drivers/USB/Class/Host/CDC.h @@ -31,6 +31,10 @@ /** \ingroup Group_USBClassCDC * @defgroup Group_USBClassCDCHost CDC Class Host Mode Driver * + * \section Sec_Dependencies Module Source Dependencies + * The following files must be built with any user project that uses this module: + * - LUFA/Drivers/USB/Class/Host/CDC.c + * * \section Module Description * Host Mode USB Class driver framework interface, for the CDC USB Class driver. * @@ -67,8 +71,6 @@ */ struct { - uint8_t ControlInterfaceNumber; /**< Interface number of the CDC control interface within the device */ - uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe */ uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe */ uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */ @@ -103,18 +105,28 @@ } USB_ClassInfo_CDC_Host_t; /* Enums: */ - typedef enum + enum { CDC_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */ - CDC_ENUMERROR_ControlError = 1, /**< A control request to the device failed to complete successfully */ - CDC_ENUMERROR_DescriptorTooLarge = 2, /**< The device's Configuration Descriptor is too large to process */ - CDC_ENUMERROR_InvalidConfigDataReturned = 3, /**< The device returned an invalid Configuration Descriptor */ - CDC_ENUMERROR_NoCDCInterfaceFound = 4, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */ - CDC_ENUMERROR_NoEndpointFound = 5, /**< Compatible CDC endpoints were not found in the device's CDC interface */ + CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */ + CDC_ENUMERROR_NoCDCInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */ + CDC_ENUMERROR_EndpointsNotFound = 3, /**< Compatible CDC endpoints were not found in the device's CDC interface */ } CDCHost_EnumerationFailure_ErrorCodes_t; /* Function Prototypes: */ void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); + uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t ConfigDescriptorLength, + uint8_t* DeviceConfigDescriptor); + + void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); + + uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); + uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); + + void CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length); + void CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data); + uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); + uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) @@ -132,22 +144,10 @@ /* Function Prototypes: */ #if defined(INCLUDE_FROM_CDC_CLASS_HOST_C) - static uint8_t CDC_Host_ProcessConfigDescriptor(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); static uint8_t DComp_CDC_Host_NextCDCControlInterface(void* CurrentDescriptor); static uint8_t DComp_CDC_Host_NextCDCDataInterface(void* CurrentDescriptor); static uint8_t DComp_CDC_Host_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor); - #endif - - void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); - - uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); - uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); - - void CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, char* Data, uint16_t Length); - void CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint8_t Data); - uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); - uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo); - + #endif #endif /* Disable C linkage for C++ Compilers: */