mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-29 04:22:09 +00:00
Enhanced class drivers to use the same public/private section seperations as other portions of the library.
This commit is contained in:
parent
afe6ae1402
commit
b7049da11b
@ -36,6 +36,12 @@
|
|||||||
|
|
||||||
#include "CDCHost.h"
|
#include "CDCHost.h"
|
||||||
|
|
||||||
|
/** LUFA CDC Class driver interface configuration and state information. This structure is
|
||||||
|
* 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;
|
||||||
|
|
||||||
/** Main program entry point. This routine configures the hardware required by the application, then
|
/** Main program entry point. This routine configures the hardware required by the application, then
|
||||||
* starts the scheduler to run the application tasks.
|
* starts the scheduler to run the application tasks.
|
||||||
*/
|
*/
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
/** Configures the endpoints of a given Audio interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given Audio interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
|
||||||
|
@ -51,15 +51,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
#if defined(INCLUDE_FROM_CDC_CLASS_DEVICE_C)
|
|
||||||
void CDC_Device_Event_Stub(void);
|
|
||||||
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
|
|
||||||
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
|
|
||||||
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
|
|
||||||
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the
|
||||||
* given CDC interface is selected.
|
* given CDC interface is selected.
|
||||||
@ -147,6 +140,19 @@
|
|||||||
*/
|
*/
|
||||||
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);
|
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);
|
||||||
|
|
||||||
|
/* Private Interface - For use in library only: */
|
||||||
|
#if !defined(__DOXYGEN__)
|
||||||
|
/* Function Prototypes: */
|
||||||
|
#if defined(INCLUDE_FROM_CDC_CLASS_DEVICE_C)
|
||||||
|
void CDC_Device_Event_Stub(void);
|
||||||
|
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
|
||||||
|
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
|
||||||
|
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
|
||||||
|
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
/** Configures the endpoints of a given HID interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given HID interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
/** Configures the endpoints of a given MIDI interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given MIDI interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||||
|
@ -51,13 +51,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
#if defined(INCLUDE_FROM_MS_CLASS_DEVICE_C)
|
|
||||||
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
|
||||||
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
|
||||||
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||||
* containing the given Mass Storage interface is selected.
|
* containing the given Mass Storage interface is selected.
|
||||||
@ -93,6 +88,17 @@
|
|||||||
*/
|
*/
|
||||||
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
||||||
|
|
||||||
|
/* Private Interface - For use in library only: */
|
||||||
|
#if !defined(__DOXYGEN__)
|
||||||
|
/* Function Prototypes: */
|
||||||
|
#if defined(INCLUDE_FROM_MS_CLASS_DEVICE_C)
|
||||||
|
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
||||||
|
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo);
|
||||||
|
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
@ -52,16 +52,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
#if defined(INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
|
|
||||||
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
|
|
||||||
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
|
|
||||||
uint32_t OId, void* QueryData, uint16_t QuerySize,
|
|
||||||
void* ResponseData, uint16_t* ResponseSize);
|
|
||||||
static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId,
|
|
||||||
void* SetData, uint16_t SetSize);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library
|
/** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library
|
||||||
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
* \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration
|
||||||
* containing the given HID interface is selected.
|
* containing the given HID interface is selected.
|
||||||
@ -86,6 +78,20 @@
|
|||||||
*/
|
*/
|
||||||
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
|
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
|
||||||
|
|
||||||
|
/* Private Interface - For use in library only: */
|
||||||
|
#if !defined(__DOXYGEN__)
|
||||||
|
/* Function Prototypes: */
|
||||||
|
#if defined(INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
|
||||||
|
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
|
||||||
|
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
|
||||||
|
uint32_t OId, void* QueryData, uint16_t QuerySize,
|
||||||
|
void* ResponseData, uint16_t* ResponseSize);
|
||||||
|
static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId,
|
||||||
|
void* SetData, uint16_t SetSize);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
@ -43,7 +43,7 @@ static uint8_t CDC_Host_ProcessConfigDescriptor(void)
|
|||||||
if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
|
if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)
|
||||||
return ControlError;
|
return ControlError;
|
||||||
|
|
||||||
if (ConfigDescriptorSize > MAX_CONFIG_DESCRIPTOR_SIZE)
|
if (ConfigDescriptorSize > 512)
|
||||||
return DescriptorTooLarge;
|
return DescriptorTooLarge;
|
||||||
|
|
||||||
ConfigDescriptorData = alloca(ConfigDescriptorSize);
|
ConfigDescriptorData = alloca(ConfigDescriptorSize);
|
||||||
|
@ -49,6 +49,20 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
|
/* Function Prototypes: */
|
||||||
|
void CDC_Host_Task(void);
|
||||||
|
|
||||||
|
/* Private Interface - For use in library only: */
|
||||||
|
#if !defined(__DOXYGEN__)
|
||||||
|
/* Macros: */
|
||||||
|
#define CDC_CONTROL_CLASS 0x02
|
||||||
|
#define CDC_CONTROL_SUBCLASS 0x02
|
||||||
|
#define CDC_CONTROL_PROTOCOL 0x01
|
||||||
|
#define CDC_DATA_CLASS 0x0A
|
||||||
|
#define CDC_DATA_SUBCLASS 0x00
|
||||||
|
#define CDC_DATA_PROTOCOL 0x00
|
||||||
|
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
#if defined(INCLUDE_FROM_CDC_CLASS_HOST_C)
|
#if defined(INCLUDE_FROM_CDC_CLASS_HOST_C)
|
||||||
static uint8_t CDC_Host_ProcessConfigDescriptor(void);
|
static uint8_t CDC_Host_ProcessConfigDescriptor(void);
|
||||||
@ -57,7 +71,7 @@
|
|||||||
static uint8_t DComp_CDC_Host_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor);
|
static uint8_t DComp_CDC_Host_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CDC_Host_Task(void);
|
#endif
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Function Prototypes: */
|
/* Function Prototypes: */
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
Loading…
Reference in New Issue
Block a user