aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Common
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/Common
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/Common')
-rw-r--r--LUFA/Drivers/USB/Class/Common/Audio.h8
-rw-r--r--LUFA/Drivers/USB/Class/Common/CDC.h23
-rw-r--r--LUFA/Drivers/USB/Class/Common/HID.h8
-rw-r--r--LUFA/Drivers/USB/Class/Common/MIDI.h8
-rw-r--r--LUFA/Drivers/USB/Class/Common/MassStorage.h8
-rw-r--r--LUFA/Drivers/USB/Class/Common/Printer.h24
-rw-r--r--LUFA/Drivers/USB/Class/Common/RNDIS.h8
-rw-r--r--LUFA/Drivers/USB/Class/Common/RNDISConstants.h4
-rw-r--r--LUFA/Drivers/USB/Class/Common/StillImage.h42
9 files changed, 82 insertions, 51 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/Audio.h b/LUFA/Drivers/USB/Class/Common/Audio.h
index 5e65865a0..b848015e0 100644
--- a/LUFA/Drivers/USB/Class/Common/Audio.h
+++ b/LUFA/Drivers/USB/Class/Common/Audio.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -51,7 +51,7 @@
#define _AUDIO_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
@@ -62,7 +62,7 @@
/* 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
/* Macros: */
diff --git a/LUFA/Drivers/USB/Class/Common/CDC.h b/LUFA/Drivers/USB/Class/Common/CDC.h
index 6d2c519b8..eb6577e5c 100644
--- a/LUFA/Drivers/USB/Class/Common/CDC.h
+++ b/LUFA/Drivers/USB/Class/Common/CDC.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -51,7 +51,7 @@
#define _CDC_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
@@ -62,7 +62,7 @@
/* 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
/* Macros: */
@@ -308,6 +308,21 @@
uint8_t bMasterInterface; /**< Interface number of the CDC Control interface. */
uint8_t bSlaveInterface0; /**< Interface number of the CDC Data interface. */
} USB_CDC_StdDescriptor_FunctionalUnion_t;
+
+ /** Type define for a CDC Line Encoding structure, used to hold the various encoding parameters for a virtual
+ * serial port.
+ */
+ typedef 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. */
+ } CDC_LineEncoding_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 3658c8eba..b5d095e08 100644
--- a/LUFA/Drivers/USB/Class/Common/HID.h
+++ b/LUFA/Drivers/USB/Class/Common/HID.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -51,13 +51,13 @@
#define _HID_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
/* 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
/* Macros: */
diff --git a/LUFA/Drivers/USB/Class/Common/MIDI.h b/LUFA/Drivers/USB/Class/Common/MIDI.h
index ef3f8fcef..22e32479f 100644
--- a/LUFA/Drivers/USB/Class/Common/MIDI.h
+++ b/LUFA/Drivers/USB/Class/Common/MIDI.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -54,7 +54,7 @@
#define __INCLUDE_FROM_AUDIO_DRIVER
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include "Audio.h"
#include <string.h>
@@ -66,7 +66,7 @@
/* 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
/* Macros: */
diff --git a/LUFA/Drivers/USB/Class/Common/MassStorage.h b/LUFA/Drivers/USB/Class/Common/MassStorage.h
index dea847c13..e8693335d 100644
--- a/LUFA/Drivers/USB/Class/Common/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Common/MassStorage.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -51,7 +51,7 @@
#define _MS_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
@@ -62,7 +62,7 @@
/* 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
/* Macros: */
diff --git a/LUFA/Drivers/USB/Class/Common/Printer.h b/LUFA/Drivers/USB/Class/Common/Printer.h
index 97e94a3bc..03ae12e59 100644
--- a/LUFA/Drivers/USB/Class/Common/Printer.h
+++ b/LUFA/Drivers/USB/Class/Common/Printer.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations for the library USB Printer 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/Printer.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_USBClassPrinter
@@ -51,7 +51,7 @@
#define _PRINTER_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
@@ -62,7 +62,7 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_PRINTER_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/Printer.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Macros: */
@@ -75,6 +75,22 @@
/** Port status mask for a printer device, indicating that the device is currently out of paper. */
#define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
+ /* Enums: */
+ /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */
+ enum PRNT_ClassRequests_t
+ {
+ PRNT_REQ_GetDeviceID = 0x00, /**< Printer class-specific request to retrieve the Unicode ID
+ * string of the device, containing the device's name, manufacturer
+ * and supported printer languages.
+ */
+ PRNT_REQ_GetPortStatus = 0x01, /**< Printer class-specific request to get the current status of the
+ * virtual printer port, for device selection and ready states.
+ */
+ PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new
+ * printer commands.
+ */
+ };
+
/* 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 6b5234b13..ae2d5bd54 100644
--- a/LUFA/Drivers/USB/Class/Common/RNDIS.h
+++ b/LUFA/Drivers/USB/Class/Common/RNDIS.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations 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
@@ -54,7 +54,7 @@
#define __INCLUDE_FROM_CDC_DRIVER
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include "RNDISConstants.h"
#include "CDC.h"
@@ -67,7 +67,7 @@
/* 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
/* Macros: */
diff --git a/LUFA/Drivers/USB/Class/Common/RNDISConstants.h b/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
index 8edbbd701..2b955d095 100644
--- a/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
+++ b/LUFA/Drivers/USB/Class/Common/RNDISConstants.h
@@ -33,8 +33,8 @@
*
* Common RNDIS class constant definitions.
*
- * \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.
*/
/** \file
diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h
index 2ba4227ac..bb9460934 100644
--- a/LUFA/Drivers/USB/Class/Common/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Common/StillImage.h
@@ -33,8 +33,8 @@
*
* Common definitions and declarations for the library USB Still Image 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/StillImage.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_USBClassSI
@@ -51,7 +51,7 @@
#define _SI_CLASS_COMMON_H_
/* Includes: */
- #include "../../USB.h"
+ #include "../../HighLevel/StdDescriptors.h"
#include <string.h>
@@ -62,7 +62,7 @@
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_SI_DRIVER)
- #error Do not include this file directly. Include LUFA/Drivers/Class/StillImage.h instead.
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
#endif
/* Macros: */
@@ -79,42 +79,42 @@
*
* \param[in] Params Number of parameters which are to be sent in the Param field of the container.
*/
- #define PIMA_COMMAND_SIZE(Params) ((sizeof(SI_PIMA_Container_t) - 12) + ((Params) * sizeof(uint32_t)))
+ #define PIMA_COMMAND_SIZE(Params) ((sizeof(PIMA_Container_t) - 12) + ((Params) * sizeof(uint32_t)))
/** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
* a data container.
*
* \param[in] DataLen Length in bytes of the data in the container.
*/
- #define PIMA_DATA_SIZE(DataLen) ((sizeof(SI_PIMA_Container_t) - 12) + (DataLen))
+ #define PIMA_DATA_SIZE(DataLen) ((sizeof(PIMA_Container_t) - 12) + (DataLen))
/* Enums: */
/** Enum for the possible PIMA contains types. */
- enum SI_PIMA_Container_Types_t
+ enum PIMA_Container_Types_t
{
- SI_PIMA_CONTAINER_Undefined = 0, /**< Undefined container type. */
- SI_PIMA_CONTAINER_CommandBlock = 1, /**< Command Block container type. */
- SI_PIMA_CONTAINER_DataBlock = 2, /**< Data Block container type. */
- SI_PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */
- SI_PIMA_CONTAINER_EventBlock = 4, /**< Event Block container type. */
+ PIMA_CONTAINER_Undefined = 0, /**< Undefined container type. */
+ PIMA_CONTAINER_CommandBlock = 1, /**< Command Block container type. */
+ PIMA_CONTAINER_DataBlock = 2, /**< Data Block container type. */
+ PIMA_CONTAINER_ResponseBlock = 3, /**< Response container type. */
+ PIMA_CONTAINER_EventBlock = 4, /**< Event Block container type. */
};
/* Enums: */
/** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
- enum SI_PIMA_ResponseCodes_t
+ enum PIMA_ResponseCodes_t
{
- SI_PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */
- SI_PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the
+ PIMA_RESPONSE_OK = 1, /**< Response code indicating no error in the issued command. */
+ PIMA_RESPONSE_GeneralError = 2, /**< Response code indicating a general error while processing the
* issued command.
*/
- SI_PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open
+ PIMA_RESPONSE_SessionNotOpen = 3, /**< Response code indicating that the sent command requires an open
* session before being issued.
*/
- SI_PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */
- SI_PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported
+ PIMA_RESPONSE_InvalidTransaction = 4, /**< Response code indicating an invalid transaction occurred. */
+ PIMA_RESPONSE_OperationNotSupported = 5, /**< Response code indicating that the issued command is not supported
* by the attached device.
*/
- SI_PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's
+ PIMA_RESPONSE_ParameterNotSupported = 6, /**< Response code indicating that one or more of the issued command's
* parameters are not supported by the device.
*/
};
@@ -128,11 +128,11 @@
typedef struct
{
uint32_t DataLength; /**< Length of the container and data, in bytes. */
- uint16_t Type; /**< Container type, a value from the \ref SI_PIMA_Container_Types_t enum. */
+ uint16_t Type; /**< Container type, a value from the \ref PIMA_Container_Types_t enum. */
uint16_t Code; /**< Command, event or response code of the container. */
uint32_t TransactionID; /**< Unique container ID to link blocks together. */
uint32_t Params[3]; /**< Block parameters to be issued along with the block code (command blocks only). */
- } SI_PIMA_Container_t;
+ } PIMA_Container_t;
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)