aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-18 10:31:55 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-18 10:31:55 +0000
commitf896c00c48f04fb9273555ab8d9b1af99f865d25 (patch)
treeb76827a0467c77ddeb30e11748c02a4f53779a14 /LUFA/Drivers/USB/Class/Common
parente338cb6f329d6bf948abad88637f81436ee90daf (diff)
downloadlufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.tar.gz
lufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.tar.bz2
lufa-f896c00c48f04fb9273555ab8d9b1af99f865d25.zip
Break device mode class driver interfaces into seperate config and state structs which are then combined, for clarity. Move device mode class driver interfaces back into the device mode class driver headers from the common class headers to make room for host class interfaces.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Common')
-rw-r--r--LUFA/Drivers/USB/Class/Common/Audio.h22
-rw-r--r--LUFA/Drivers/USB/Class/Common/CDC.h34
-rw-r--r--LUFA/Drivers/USB/Class/Common/HID.h34
-rw-r--r--LUFA/Drivers/USB/Class/Common/MIDI.h16
-rw-r--r--LUFA/Drivers/USB/Class/Common/MassStorage.h30
-rw-r--r--LUFA/Drivers/USB/Class/Common/RNDIS.h35
6 files changed, 7 insertions, 164 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h
index 51cdfc6f4..07667a5e1 100644
--- a/LUFA/Drivers/USB/Class/Common/Audio.h
+++ b/LUFA/Drivers/USB/Class/Common/Audio.h
@@ -349,27 +349,7 @@
uint8_t LockDelayUnits; /**< Units used for the LockDelay field, see Audio class specification */
uint16_t LockDelay; /**< Time required to internally lock endpoint's internal clock recovery circuitry */
- } USB_AudioStreamEndpoint_Spc_t;
-
- /** Class state structure. An instance of this structure should be made for each Audio interface
- * within the user application, and passed to each of the Audio class driver functions as the
- * AudioInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- */
- typedef struct
- {
- uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls */
-
- uint8_t DataINEndpointNumber; /**< Endpoint number of the incomming Audio Streaming data, if available (zero if unused) */
- uint16_t DataINEndpointSize; /**< Size in bytes of the incomming Audio Streaming data endpoint, if available (zero if unused) */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing Audio Streaming data, if available (zero if unused) */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing Audio Streaming data endpoint, if available (zero if unused) */
-
- bool InterfaceEnabled; /**< Set and cleared by the class driver to indicate if the host has enabled the streaming endpoints
- * of the Audio Streaming interface
- */
- } USB_ClassInfo_Audio_t;
+ } USB_AudioStreamEndpoint_Spc_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h
index 12f8b8381..ccc32683b 100644
--- a/LUFA/Drivers/USB/Class/Common/CDC.h
+++ b/LUFA/Drivers/USB/Class/Common/CDC.h
@@ -140,40 +140,6 @@
CDC_PARITY_Space = 4, /**< Space parity bit mode on each frame */
};
- /* Type Defines: */
- /** Class state structure. An instance of this structure should be made for each CDC interface
- * within the user application, and passed to each of the CDC class driver functions as the
- * CDCInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- */
- 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 */
-
- 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 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;
- } USB_ClassInfo_CDC_t;
-
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h
index 07ed94b56..54403d4c8 100644
--- a/LUFA/Drivers/USB/Class/Common/HID.h
+++ b/LUFA/Drivers/USB/Class/Common/HID.h
@@ -71,42 +71,20 @@
*/
typedef struct
{
- USB_Descriptor_Header_t Header;
+ USB_Descriptor_Header_t Header;
- uint16_t HIDSpec;
- uint8_t CountryCode;
+ uint16_t HIDSpec;
+ uint8_t CountryCode;
- uint8_t TotalReportDescriptors;
+ uint8_t TotalReportDescriptors;
- uint8_t HIDReportType;
- uint16_t HIDReportLength;
+ uint8_t HIDReportType;
+ uint16_t HIDReportLength;
} USB_Descriptor_HID_t;
/** Type define for the data type used to store HID report descriptor elements. */
typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
- /** Class state structure. An instance of this structure should be made for each HID interface
- * within the user application, and passed to each of the HID class driver functions as the
- * HIDInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- *
- * Note that for the HID class driver, host-to-device reports are received via HID class requests
- * rather than a dedicated endpoint to simplify the driver and its interface.
- */
- typedef struct
- {
- uint8_t InterfaceNumber; /**< Interface number of the HID interface within the device */
-
- uint8_t ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint */
- uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */
-
- uint8_t ReportINBufferSize; /**< Size of the largest possible report to send to the host, for buffer allocation purposes */
-
- bool UsingReportProtocol; /**< Indicates if the HID interface is set to Boot or Report protocol mode */
- uint16_t IdleCount; /**< Report idle period, in ms, set by the host */
- uint16_t IdleMSRemaining; /**< Total number of ms remaining before the idle period elapses */
- } USB_ClassInfo_HID_t;
-
#endif
/** @} */
diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h
index f768ba238..fad7ad89d 100644
--- a/LUFA/Drivers/USB/Class/Common/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Common/MIDI.h
@@ -145,22 +145,6 @@
uint8_t Data3; /**< Third byte of data in the MIDI event */
} USB_MIDI_EventPacket_t;
- /** Class state structure. An instance of this structure should be made for each MIDI interface
- * within the user application, and passed to each of the MIDI class driver functions as the
- * MIDIInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- */
- typedef struct
- {
- uint8_t StreamingInterfaceNumber; /**< Index of the Audio Streaming interface within the device this structure controls */
-
- uint8_t DataINEndpointNumber; /**< Endpoint number of the incomming MIDI data, if available (zero if unused) */
- uint16_t DataINEndpointSize; /**< Size in bytes of the incomming MIDI data endpoint, if available (zero if unused) */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the outgoing MIDI data, if available (zero if unused) */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the outgoing MIDI data endpoint, if available (zero if unused) */
- } USB_ClassInfo_MIDI_t;
-
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h
index b4ba0908f..d00f371a0 100644
--- a/LUFA/Drivers/USB/Class/Common/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h
@@ -94,36 +94,6 @@
SCSI_Command_Fail = 1, /**< Command failed to complete - host may check the exact error via a SCSI REQUEST SENSE command */
SCSI_Phase_Error = 2 /**< Command failed due to being invalid in the current phase */
};
-
- /* Type Defines: */
- /** Class state structure. An instance of this structure should be made for each Mass Storage interface
- * within the user application, and passed to each of the Mass Storage class driver functions as the
- * MSInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- */
- typedef struct
- {
- uint8_t InterfaceNumber; /**< Interface number of the Mass Storage interface within the device */
-
- uint8_t DataINEndpointNumber; /**< Endpoint number of the Mass Storage interface's IN data endpoint */
- uint16_t DataINEndpointSize; /**< Size in bytes of the Mass Storage interface's IN data endpoint */
-
- uint8_t DataOUTEndpointNumber; /**< Endpoint number of the Mass Storage interface's OUT data endpoint */
- uint16_t DataOUTEndpointSize; /**< Size in bytes of the Mass Storage interface's OUT data endpoint */
-
- uint8_t TotalLUNs; /**< Total number of logical drives in the Mass Storage interface */
-
- CommandBlockWrapper_t CommandBlock; /**< Mass Storage class command block structure, used internally
- * by the class driver
- */
- CommandStatusWrapper_t CommandStatus; /**< Mass Storage class command status structure, used internally
- * by the class driver
- */
-
- bool IsMassStoreReset; /**< Flag indicating that the host has requested that the Mass Storage interface be reset
- * and that all current Mass Storage operations should immediately abort
- */
- } USB_ClassInfo_MS_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
diff --git a/LUFA/Drivers/USB/Class/Common/RNDIS.h b/LUFA/Drivers/USB/Class/Common/RNDIS.h
index abc17334a..157fff359 100644
--- a/LUFA/Drivers/USB/Class/Common/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h
@@ -228,41 +228,6 @@
uint32_t InformationBufferLength;
uint32_t InformationBufferOffset;
} RNDIS_QUERY_CMPLT_t;
-
- /** Class state structure. An instance of this structure should be made for each RNDIS interface
- * within the user application, and passed to each of the RNDIS class driver functions as the
- * RNDISInterfaceInfo parameter. The contents of this structure should be set to their correct
- * values when used, or ommitted to force the library to use default values.
- */
- 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 */
-
- 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 */
-
- char* AdapterVendorDescription; /**< String description of the adapter vendor */
- MAC_Address_t AdapterMACAddress; /**< MAC address of the adapter */
-
- uint8_t RNDISMessageBuffer[RNDIS_MESSAGE_BUFFER_SIZE]; /**< Buffer to hold RNDIS messages to and from the host,
- * managed by the class driver
- */
- bool ResponseReady; /**< Internal flag indicating if a RNDIS message is waiting to be returned to the host */
- uint8_t CurrRNDISState; /**< Current RNDIS state of the adapter, a value from the RNDIS_States_t enum */
- uint32_t CurrPacketFilter; /**< Current packet filter mode, used internally by the class driver */
- Ethernet_Frame_Info_t FrameIN; /**< Structure holding the last received Ethernet frame from the host, for user
- * processing
- */
- Ethernet_Frame_Info_t FrameOUT; /**< Structure holding the next Ethernet frame to send to the host, populated by the
- * user application
- */
- } USB_ClassInfo_RNDIS_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)