aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-10-24 22:53:57 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-10-24 22:53:57 +0000
commitb37d77eab32d171ad7b28157a924a4026e2aebd1 (patch)
tree0644f7ed8f76db5e0849195e09892b159df9f475 /LUFA/Drivers/USB/Class/Device
parent8f3bee7d8661c92ce69fdf7cc131fbee1acaa4ae (diff)
downloadlufa-b37d77eab32d171ad7b28157a924a4026e2aebd1.tar.gz
lufa-b37d77eab32d171ad7b28157a924a4026e2aebd1.tar.bz2
lufa-b37d77eab32d171ad7b28157a924a4026e2aebd1.zip
All USB class drivers are now automatically included when LUFA/Drivers/USB.h is included, and no longer need to be seperately included.
All LowLevel demos changed to use the constants and types defined in the USB class drivers.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.c1
-rw-r--r--LUFA/Drivers/USB/Class/Device/Audio.h10
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.c2
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.h29
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c1
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.h11
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.c1
-rw-r--r--LUFA/Drivers/USB/Class/Device/MIDI.h10
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorage.c2
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorage.h12
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.c2
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.h13
12 files changed, 57 insertions, 37 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.c b/LUFA/Drivers/USB/Class/Device/Audio.c
index 106a968dc..156a52140 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.c
+++ b/LUFA/Drivers/USB/Class/Device/Audio.c
@@ -33,6 +33,7 @@
#if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_AUDIO_DRIVER
+#define __INCLUDE_FROM_AUDIO_DEVICE_C
#include "Audio.h"
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/Audio.h b/LUFA/Drivers/USB/Class/Device/Audio.h
index 6520a3379..a20a7177e 100644
--- a/LUFA/Drivers/USB/Class/Device/Audio.h
+++ b/LUFA/Drivers/USB/Class/Device/Audio.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB Audio 1.0 Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/Audio.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassAudio
@@ -66,7 +66,11 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_AUDIO_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/Audio.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
+ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
/* Public Interface - May be used in end-application: */
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c
index f95496ebd..2019ede0a 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.c
+++ b/LUFA/Drivers/USB/Class/Device/CDC.c
@@ -32,8 +32,8 @@
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define __INCLUDE_FROM_CDC_CLASS_DEVICE_C
#define __INCLUDE_FROM_CDC_DRIVER
+#define __INCLUDE_FROM_CDC_DEVICE_C
#include "CDC.h"
void CDC_Device_Event_Stub(void)
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.h b/LUFA/Drivers/USB/Class/Device/CDC.h
index 2e66e9fa7..9d6db767f 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.h
+++ b/LUFA/Drivers/USB/Class/Device/CDC.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB CDC Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/CDC.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassCDC
@@ -84,7 +84,11 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_CDC_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/CDC.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
+ #if defined(__INCLUDE_FROM_CDC_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
/* Public Interface - May be used in end-application: */
@@ -128,19 +132,10 @@
*/
} ControlLineStates; /**< Current states of the virtual serial port's control lines between the device and 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
- * \ref CDC_LineEncodingFormats_t enum.
- */
- uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
- * \ref CDC_LineEncodingParity_t enum.
- */
- uint8_t DataBits; /**< Bits of data per character of the virtual serial port. */
- } LineEncoding; /** Line encoding used in the virtual serial port, for the device's information. This is generally
- * only used if the virtual serial port data is to be reconstructed on a physical UART.
- */
+ CDC_LineEncoding_t LineEncoding; /** Line encoding used in the virtual serial port, for the device's information.
+ * This is generally only used if the virtual serial port data is to be
+ * reconstructed on a physical UART.
+ */
} State; /**< State data for the USB class interface within the device. All elements in this section
* are reset to their defaults when the interface is enumerated.
*/
@@ -318,7 +313,7 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(__INCLUDE_FROM_CDC_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_CDC_DEVICE_C)
static int CDC_Device_putchar(char c,
FILE* Stream) ATTR_NON_NULL_PTR_ARG(2);
static int CDC_Device_getchar(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1);
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index cdfe8497a..91a4f7a21 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -33,6 +33,7 @@
#if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_HID_DRIVER
+#define __INCLUDE_FROM_HID_DEVICE_C
#include "HID.h"
void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h
index 5329e294e..a7a931c7b 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.h
+++ b/LUFA/Drivers/USB/Class/Device/HID.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB HID Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/HID.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassHID
@@ -66,9 +66,14 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_HID_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/HID.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
+ #if defined(__INCLUDE_FROM_HID_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
+ #endif
+
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** \brief HID Class Device Mode Configuration and State Structure.
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.c b/LUFA/Drivers/USB/Class/Device/MIDI.c
index 783b67ce7..f7c59b51e 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.c
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.c
@@ -33,6 +33,7 @@
#if defined(USB_CAN_BE_DEVICE)
#define __INCLUDE_FROM_MIDI_DRIVER
+#define __INCLUDE_FROM_MIDI_DEVICE_C
#include "MIDI.h"
bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)
diff --git a/LUFA/Drivers/USB/Class/Device/MIDI.h b/LUFA/Drivers/USB/Class/Device/MIDI.h
index 5af6e18a2..3f633acfc 100644
--- a/LUFA/Drivers/USB/Class/Device/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Device/MIDI.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB MIDI Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/MIDI.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassMIDI
@@ -66,7 +66,11 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MIDI_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/MIDI.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
+ #if defined(__INCLUDE_FROM_MIDI_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
/* Public Interface - May be used in end-application: */
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c
index 039684437..f053a043e 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c
@@ -32,8 +32,8 @@
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define __INCLUDE_FROM_MS_CLASS_DEVICE_C
#define __INCLUDE_FROM_MS_DRIVER
+#define __INCLUDE_FROM_MASSSTORAGE_DEVICE_C
#include "MassStorage.h"
static volatile bool* CallbackIsResetSource;
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.h b/LUFA/Drivers/USB/Class/Device/MassStorage.h
index 8201a3ce9..6611ca114 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Device/MassStorage.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB Mass Storage Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/MassStorage.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassMS
@@ -66,7 +66,11 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_MS_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/MassStorage.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
+ #endif
+
+ #if defined(__INCLUDE_FROM_MASSSTORAGE_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
#endif
/* Public Interface - May be used in end-application: */
@@ -154,7 +158,7 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(__INCLUDE_FROM_MS_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_MASSSTORAGE_DEVICE_C)
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c
index 7b6719da6..d4ee38d58 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.c
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c
@@ -32,8 +32,8 @@
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
-#define __INCLUDE_FROM_RNDIS_CLASS_DEVICE_C
#define __INCLUDE_FROM_RNDIS_DRIVER
+#define __INCLUDE_FROM_RNDIS_DEVICE_C
#include "RNDIS.h"
static const uint32_t PROGMEM AdapterSupportedOIDList[] =
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.h b/LUFA/Drivers/USB/Class/Device/RNDIS.h
index 5aebcc63a..86d412137 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.h
@@ -33,8 +33,8 @@
*
* Device mode driver for the library USB RNDIS Class driver.
*
- * \note This file should not be included directly. It is automatically included as needed by the class driver
- * dispatch header located in LUFA/Drivers/USB/Class/RNDIS.h.
+ * \note This file should not be included directly. It is automatically included as needed by the USB module driver
+ * dispatch header located in LUFA/Drivers/USB.h.
*/
/** \ingroup Group_USBClassRNDIS
@@ -66,9 +66,14 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_RNDIS_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/RNDIS.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
+ #if defined(__INCLUDE_FROM_RNDIS_DEVICE_C) && defined(NO_STREAM_CALLBACKS)
+ #error The NO_STREAM_CALLBACKS compile time option cannot be used in projects using the library Class drivers.
+ #endif
+
+
/* Public Interface - May be used in end-application: */
/* Type Defines: */
/** \brief RNDIS Class Device Mode Configuration and State Structure.
@@ -151,7 +156,7 @@
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
- #if defined(__INCLUDE_FROM_RNDIS_CLASS_DEVICE_C)
+ #if defined(__INCLUDE_FROM_RNDIS_DEVICE_C)
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
ATTR_NON_NULL_PTR_ARG(1);
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo,