Add descriptor class, subclass and protocol constants to the class drivers, modify all demos to use them where possible.
Move out private/internal host class driver constants to the common class driver headers, so that they can be used in the Low Level host mode demos. Ensure all demos, projects and bootloaders use the class driver constants where possible to minimise code repetition.
This commit is contained in:
parent
b37d77eab3
commit
55538dcef3
96 changed files with 650 additions and 631 deletions
|
@ -210,6 +210,31 @@
|
|||
#define AUDIO_EP_ACCEPTS_SMALL_PACKETS (0 << 7)
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio
|
||||
* device class.
|
||||
*/
|
||||
enum Audio_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
AUDIO_CSCP_AudioClass = 0x01, /**< Descriptor Class value indicating that the device or
|
||||
* interface belongs to the USB Audio 1.0 class.
|
||||
*/
|
||||
AUDIO_CSCP_ControlSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or
|
||||
* interface belongs to the Audio Control subclass.
|
||||
*/
|
||||
AUDIO_CSCP_ControlProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or
|
||||
* interface belongs to the Audio Control protocol.
|
||||
*/
|
||||
AUDIO_CSCP_AudioStreamingSubclass = 0x02, /**< Descriptor Subclass value indicating that the device or
|
||||
* interface belongs to the MIDI Streaming subclass.
|
||||
*/
|
||||
AUDIO_CSCP_MIDIStreamingSubclass = 0x03, /**< Descriptor Subclass value indicating that the device or
|
||||
* interface belongs to the Audio streaming subclass.
|
||||
*/
|
||||
AUDIO_CSCP_StreamingProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or
|
||||
* interface belongs to the Streaming Audio protocol.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Audio class specific interface description subtypes, for the Audio Control interface. */
|
||||
enum Audio_CSInterface_AC_SubTypes_t
|
||||
{
|
||||
|
|
|
@ -127,6 +127,40 @@
|
|||
}
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the CDC
|
||||
* device class.
|
||||
*/
|
||||
enum CDC_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
CDC_CSCP_CDCClass = 0x02, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the CDC class.
|
||||
*/
|
||||
CDC_CSCP_NoSpecificSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to no specific subclass of the CDC class.
|
||||
*/
|
||||
CDC_CSCP_ACMSubclass = 0x02, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to the Abstract Control Model CDC subclass.
|
||||
*/
|
||||
CDC_CSCP_ATCommandProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the AT Command protocol of the CDC class.
|
||||
*/
|
||||
CDC_CSCP_NoSpecificProtocol = 0x00, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to no specific protocol of the CDC class.
|
||||
*/
|
||||
CDC_CSCP_VendorSpecificProtocol = 0xFF, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to a vendor-specific protocol of the CDC class.
|
||||
*/
|
||||
CDC_CSCP_CDCDataClass = 0x0A, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the CDC Data class.
|
||||
*/
|
||||
CDC_CSCP_NoDataSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to no specific subclass of the CDC data class.
|
||||
*/
|
||||
CDC_CSCP_NoDataProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to no specific protocol of the CDC data class.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the CDC class specific control requests that can be issued by the USB bus host. */
|
||||
enum CDC_ClassRequests_t
|
||||
{
|
||||
|
|
|
@ -98,6 +98,31 @@
|
|||
#define HID_KEYBOARD_LED_KATANA (1 << 3)
|
||||
|
||||
/* Type Defines: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID
|
||||
* device class.
|
||||
*/
|
||||
enum HID_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
HID_CSCP_HIDClass = 0x03, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the HID class.
|
||||
*/
|
||||
HID_CSCP_NonBootSubclass = 0x00, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* does not implement a HID boot protocol.
|
||||
*/
|
||||
HID_CSCP_BootSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* implements a HID boot protocol.
|
||||
*/
|
||||
HID_CSCP_NonBootProtocol = 0x00, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* does not belong to a HID boot protocol.
|
||||
*/
|
||||
HID_CSCP_KeyboardBootProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the Keyboard HID boot protocol.
|
||||
*/
|
||||
HID_CSCP_MouseBootProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the Mouse HID boot protocol.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the HID class specific control requests that can be issued by the USB bus host. */
|
||||
enum HID_ClassRequests_t
|
||||
{
|
||||
|
@ -116,23 +141,6 @@
|
|||
HID_DTYPE_Report = 0x22, /**< Descriptor header type value, to indicate a HID class HID report descriptor. */
|
||||
};
|
||||
|
||||
/** Enum for the HID class boot protocols that may be supported by HID devices. */
|
||||
enum HID_BootProtocols_t
|
||||
{
|
||||
HID_BOOTP_NonBootProtocol = 0x00, /**< Constant for the protocol value of a HID interface descriptor, indicating
|
||||
* that the interface does not support any HID class boot protocol (see HID
|
||||
* Class Specification).
|
||||
*/
|
||||
HID_BOOTP_KeyboardBootProtocol = 0x01, /**< Constant for the protocol value of a HID interface descriptor, indicating
|
||||
* that the interface supports the HID class Keyboard boot protocol (see HID
|
||||
* Class Specification).
|
||||
*/
|
||||
HID_BOOTP_MouseBootProtocol = 0x02, /**< Constant for the protocol value of a HID interface descriptor, indicating
|
||||
* that the interface supports the HID class Mouse boot protocol (see HID Class
|
||||
* Specification).
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the different types of HID reports. */
|
||||
enum HID_ReportItemTypes_t
|
||||
{
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
#define MIDI_CHANNEL(channel) ((channel) - 1)
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for the possible MIDI jack types in a MIDI device jack descriptor. */
|
||||
enum MIDI_JackTypes_t
|
||||
{
|
||||
MIDI_JACKTYPE_Embedded = 0x01, /**< MIDI class descriptor jack type value for an embedded (logical) MIDI input or output jack. */
|
||||
|
|
|
@ -205,25 +205,42 @@
|
|||
#define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Mass
|
||||
* Storage device class.
|
||||
*/
|
||||
enum MS_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
MS_CSCP_MassStorageClass = 0x08, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the Mass Storage class.
|
||||
*/
|
||||
MS_CSCP_SCSITransparentSubclass = 0x06, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to the SCSI Transparent Command Set subclass of the Mass
|
||||
* storage class.
|
||||
*/
|
||||
MS_CSCP_BulkOnlyTransportProtocol = 0x50, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the Bulk Only Transport protocol of the Mass Storage class.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */
|
||||
enum MS_ClassRequests_t
|
||||
{
|
||||
MS_REQ_GetMaxLUN = 0xFE, /**< Mass Storage class-specific request to retrieve the total number of Logical
|
||||
* Units (drives) in the SCSI device.
|
||||
*/
|
||||
MS_REQ_MassStorageReset = 0xFF, /**< Mass Storage class-specific request to reset the Mass Storage interface,
|
||||
* ready for the next command.
|
||||
*/
|
||||
MS_REQ_GetMaxLUN = 0xFE, /**< Mass Storage class-specific request to retrieve the total number of Logical
|
||||
* Units (drives) in the SCSI device.
|
||||
*/
|
||||
MS_REQ_MassStorageReset = 0xFF, /**< Mass Storage class-specific request to reset the Mass Storage interface,
|
||||
* ready for the next command.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enum for the possible command status wrapper return status codes. */
|
||||
enum MS_CommandStatusCodes_t
|
||||
{
|
||||
MS_SCSI_COMMAND_Pass = 0, /**< Command completed with no error */
|
||||
MS_SCSI_COMMAND_Fail = 1, /**< Command failed to complete - host may check the exact error via a
|
||||
* SCSI REQUEST SENSE command.
|
||||
*/
|
||||
MS_SCSI_COMMAND_PhaseError = 2, /**< Command failed due to being invalid in the current phase. */
|
||||
MS_SCSI_COMMAND_Pass = 0, /**< Command completed with no error */
|
||||
MS_SCSI_COMMAND_Fail = 1, /**< Command failed to complete - host may check the exact error via a
|
||||
* SCSI REQUEST SENSE command.
|
||||
*/
|
||||
MS_SCSI_COMMAND_PhaseError = 2, /**< Command failed due to being invalid in the current phase. */
|
||||
};
|
||||
|
||||
/* Type Defines: */
|
||||
|
|
|
@ -76,19 +76,35 @@
|
|||
#define PRNT_PORTSTATUS_PAPEREMPTY (1 << 5)
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Printer
|
||||
* device class.
|
||||
*/
|
||||
enum PRNT_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
PRNT_CSCP_PrinterClass = 0x07, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the Printer class.
|
||||
*/
|
||||
PRNT_CSCP_PrinterSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to the Printer subclass.
|
||||
*/
|
||||
PRNT_CSCP_BidirectionalProtocol = 0x02, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the Bidirectional protocol of the Printer class.
|
||||
*/
|
||||
};
|
||||
|
||||
/** 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.
|
||||
*/
|
||||
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: */
|
||||
|
|
|
@ -100,6 +100,22 @@
|
|||
};
|
||||
|
||||
/* Enums: */
|
||||
/** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the
|
||||
* Still Image device class.
|
||||
*/
|
||||
enum SI_Descriptor_ClassSubclassProtocol_t
|
||||
{
|
||||
SI_CSCP_StillImageClass = 0x06, /**< Descriptor Class value indicating that the device or interface
|
||||
* belongs to the Still Image class.
|
||||
*/
|
||||
SI_CSCP_StillImageSubclass = 0x01, /**< Descriptor Subclass value indicating that the device or interface
|
||||
* belongs to the Still Image subclass.
|
||||
*/
|
||||
SI_CSCP_BulkOnlyProtocol = 0x01, /**< Descriptor Protocol value indicating that the device or interface
|
||||
* belongs to the Bulk Only Transport protocol of the Still Image class.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Enums for the possible status codes of a returned Response Block from an attached PIMA compliant Still Image device. */
|
||||
enum PIMA_ResponseCodes_t
|
||||
{
|
||||
|
|
|
@ -142,9 +142,9 @@ static uint8_t DCOMP_CDC_Host_NextCDCControlInterface(void* const CurrentDescrip
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == CDC_CONTROL_CLASS) &&
|
||||
(CurrentInterface->SubClass == CDC_CONTROL_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == CDC_CONTROL_PROTOCOL))
|
||||
if ((CurrentInterface->Class == CDC_CSCP_CDCClass) &&
|
||||
(CurrentInterface->SubClass == CDC_CSCP_ACMSubclass) &&
|
||||
(CurrentInterface->Protocol == CDC_CSCP_ATCommandProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
@ -160,9 +160,9 @@ static uint8_t DCOMP_CDC_Host_NextCDCDataInterface(void* const CurrentDescriptor
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == CDC_DATA_CLASS) &&
|
||||
(CurrentInterface->SubClass == CDC_DATA_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == CDC_DATA_PROTOCOL))
|
||||
if ((CurrentInterface->Class == CDC_CSCP_CDCDataClass) &&
|
||||
(CurrentInterface->SubClass == CDC_CSCP_NoDataSubclass) &&
|
||||
(CurrentInterface->Protocol == CDC_CSCP_NoDataProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
|
|
@ -306,14 +306,6 @@
|
|||
|
||||
/* 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: */
|
||||
#if defined(__INCLUDE_FROM_CDC_HOST_C)
|
||||
static int CDC_Host_putchar(char c,
|
||||
|
|
|
@ -118,7 +118,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
|||
|
||||
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
|
||||
HIDInterfaceInfo->State.HIDReportSize = HIDDescriptor->HIDReportLength;
|
||||
HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_BOOTP_NonBootProtocol);
|
||||
HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_CSCP_NonBootProtocol);
|
||||
HIDInterfaceInfo->State.LargestReportSize = 8;
|
||||
HIDInterfaceInfo->State.IsActive = true;
|
||||
|
||||
|
@ -132,7 +132,7 @@ static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor)
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if (CurrentInterface->Class == HID_INTERFACE_CLASS)
|
||||
if (CurrentInterface->Class == HID_CSCP_HIDClass)
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
||||
|
|
|
@ -297,9 +297,6 @@
|
|||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define HID_INTERFACE_CLASS 0x03
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_HID_HOST_C)
|
||||
static uint8_t DCOMP_HID_Host_NextHIDInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
|
@ -110,9 +110,9 @@ static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDes
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == MIDI_STREAMING_CLASS) &&
|
||||
(CurrentInterface->SubClass == MIDI_STREAMING_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == MIDI_STREAMING_PROTOCOL))
|
||||
if ((CurrentInterface->Class == AUDIO_CSCP_AudioClass) &&
|
||||
(CurrentInterface->SubClass == AUDIO_CSCP_MIDIStreamingSubclass) &&
|
||||
(CurrentInterface->Protocol == AUDIO_CSCP_StreamingProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
|
|
@ -188,11 +188,6 @@
|
|||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define MIDI_STREAMING_CLASS 0x01
|
||||
#define MIDI_STREAMING_SUBCLASS 0x03
|
||||
#define MIDI_STREAMING_PROTOCOL 0x00
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_MIDI_HOST_C)
|
||||
static uint8_t DCOMP_MIDI_Host_NextMIDIStreamingInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
|
@ -110,9 +110,9 @@ static uint8_t DCOMP_MS_Host_NextMSInterface(void* const CurrentDescriptor)
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == MASS_STORE_CLASS) &&
|
||||
(CurrentInterface->SubClass == MASS_STORE_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == MASS_STORE_PROTOCOL))
|
||||
if ((CurrentInterface->Class == MS_CSCP_MassStorageClass) &&
|
||||
(CurrentInterface->SubClass == MS_CSCP_SCSITransparentSubclass) &&
|
||||
(CurrentInterface->Protocol == MS_CSCP_BulkOnlyTransportProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
|
|||
{
|
||||
uint8_t ErrorCode = PIPE_RWSTREAM_NoError;
|
||||
|
||||
SCSICommandBlock->Signature = CBW_SIGNATURE;
|
||||
SCSICommandBlock->Signature = MS_CBW_SIGNATURE;
|
||||
SCSICommandBlock->Tag = ++MSInterfaceInfo->State.TransactionTag;
|
||||
|
||||
if (MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF)
|
||||
|
@ -180,7 +180,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
|
|||
|
||||
static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
|
||||
{
|
||||
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
|
||||
uint16_t TimeoutMSRem = MS_COMMAND_DATA_TIMEOUT_MS;
|
||||
uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
|
||||
|
||||
Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber);
|
||||
|
@ -240,7 +240,7 @@ static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfac
|
|||
uint8_t ErrorCode = PIPE_RWSTREAM_NoError;
|
||||
uint16_t BytesRem = SCSICommandBlock->DataTransferLength;
|
||||
|
||||
if (SCSICommandBlock->Flags & COMMAND_DIRECTION_DATA_IN)
|
||||
if (SCSICommandBlock->Flags & MS_COMMAND_DIR_DATA_IN)
|
||||
{
|
||||
if ((ErrorCode = MS_Host_WaitForDataReceived(MSInterfaceInfo)) != PIPE_RWSTREAM_NoError)
|
||||
{
|
||||
|
@ -357,7 +357,7 @@ uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = sizeof(SCSI_Inquiry_Response_t),
|
||||
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||
.Flags = MS_COMMAND_DIR_DATA_IN,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 6,
|
||||
.SCSICommandData =
|
||||
|
@ -393,7 +393,7 @@ uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = 0,
|
||||
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||
.Flags = MS_COMMAND_DIR_DATA_IN,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 6,
|
||||
.SCSICommandData =
|
||||
|
@ -430,7 +430,7 @@ uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInf
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = sizeof(SCSI_Capacity_t),
|
||||
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||
.Flags = MS_COMMAND_DIR_DATA_IN,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 10,
|
||||
.SCSICommandData =
|
||||
|
@ -474,7 +474,7 @@ uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = sizeof(SCSI_Request_Sense_Response_t),
|
||||
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||
.Flags = MS_COMMAND_DIR_DATA_IN,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 6,
|
||||
.SCSICommandData =
|
||||
|
@ -511,7 +511,7 @@ uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInter
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = 0,
|
||||
.Flags = COMMAND_DIRECTION_DATA_OUT,
|
||||
.Flags = MS_COMMAND_DIR_DATA_OUT,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 6,
|
||||
.SCSICommandData =
|
||||
|
@ -551,7 +551,7 @@ uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = ((uint32_t)Blocks * BlockSize),
|
||||
.Flags = COMMAND_DIRECTION_DATA_IN,
|
||||
.Flags = MS_COMMAND_DIR_DATA_IN,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 10,
|
||||
.SCSICommandData =
|
||||
|
@ -595,7 +595,7 @@ uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo
|
|||
MS_CommandBlockWrapper_t SCSICommandBlock = (MS_CommandBlockWrapper_t)
|
||||
{
|
||||
.DataTransferLength = ((uint32_t)Blocks * BlockSize),
|
||||
.Flags = COMMAND_DIRECTION_DATA_OUT,
|
||||
.Flags = MS_COMMAND_DIR_DATA_OUT,
|
||||
.LUN = LUNIndex,
|
||||
.SCSICommandLength = 10,
|
||||
.SCSICommandData =
|
||||
|
|
|
@ -313,17 +313,7 @@
|
|||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define MASS_STORE_CLASS 0x08
|
||||
#define MASS_STORE_SUBCLASS 0x06
|
||||
#define MASS_STORE_PROTOCOL 0x50
|
||||
|
||||
#define CBW_SIGNATURE 0x43425355UL
|
||||
#define CSW_SIGNATURE 0x53425355UL
|
||||
|
||||
#define COMMAND_DIRECTION_DATA_OUT (0 << 7)
|
||||
#define COMMAND_DIRECTION_DATA_IN (1 << 7)
|
||||
|
||||
#define COMMAND_DATA_TIMEOUT_MS 10000
|
||||
#define MS_COMMAND_DATA_TIMEOUT_MS 10000
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_MASSSTORAGE_HOST_C)
|
||||
|
|
|
@ -111,9 +111,9 @@ static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* CurrentDescriptor)
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == PRINTER_CLASS) &&
|
||||
(CurrentInterface->SubClass == PRINTER_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == PRINTER_PROTOCOL))
|
||||
if ((CurrentInterface->Class == PRNT_CSCP_PrinterClass) &&
|
||||
(CurrentInterface->SubClass == PRNT_CSCP_PrinterSubclass) &&
|
||||
(CurrentInterface->Protocol == PRNT_CSCP_BidirectionalProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
|
|
@ -264,11 +264,6 @@
|
|||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define PRINTER_CLASS 0x07
|
||||
#define PRINTER_SUBCLASS 0x01
|
||||
#define PRINTER_PROTOCOL 0x02
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_PRINTER_HOST_C)
|
||||
static uint8_t DCOMP_PRNT_Host_NextPRNTInterface(void* const CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
|
|
@ -142,9 +142,9 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISControlInterface(void* const CurrentDes
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == RNDIS_CONTROL_CLASS) &&
|
||||
(CurrentInterface->SubClass == RNDIS_CONTROL_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == RNDIS_CONTROL_PROTOCOL))
|
||||
if ((CurrentInterface->Class == CDC_CSCP_CDCClass) &&
|
||||
(CurrentInterface->SubClass == CDC_CSCP_ACMSubclass) &&
|
||||
(CurrentInterface->Protocol == CDC_CSCP_VendorSpecificProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
@ -160,9 +160,9 @@ static uint8_t DCOMP_RNDIS_Host_NextRNDISDataInterface(void* const CurrentDescri
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == RNDIS_DATA_CLASS) &&
|
||||
(CurrentInterface->SubClass == RNDIS_DATA_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == RNDIS_DATA_PROTOCOL))
|
||||
if ((CurrentInterface->Class == CDC_CSCP_CDCDataClass) &&
|
||||
(CurrentInterface->SubClass == CDC_CSCP_NoDataSubclass) &&
|
||||
(CurrentInterface->Protocol == CDC_CSCP_NoDataProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
|
|
@ -262,14 +262,6 @@
|
|||
|
||||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define RNDIS_CONTROL_CLASS 0x02
|
||||
#define RNDIS_CONTROL_SUBCLASS 0x02
|
||||
#define RNDIS_CONTROL_PROTOCOL 0xFF
|
||||
#define RNDIS_DATA_CLASS 0x0A
|
||||
#define RNDIS_DATA_SUBCLASS 0x00
|
||||
#define RNDIS_DATA_PROTOCOL 0x00
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_RNDIS_HOST_C)
|
||||
static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
|
||||
|
|
|
@ -128,9 +128,9 @@ uint8_t DCOMP_SI_Host_NextSIInterface(void* const CurrentDescriptor)
|
|||
USB_Descriptor_Interface_t* CurrentInterface = DESCRIPTOR_PCAST(CurrentDescriptor,
|
||||
USB_Descriptor_Interface_t);
|
||||
|
||||
if ((CurrentInterface->Class == STILL_IMAGE_CLASS) &&
|
||||
(CurrentInterface->SubClass == STILL_IMAGE_SUBCLASS) &&
|
||||
(CurrentInterface->Protocol == STILL_IMAGE_PROTOCOL))
|
||||
if ((CurrentInterface->Class == SI_CSCP_StillImageClass) &&
|
||||
(CurrentInterface->SubClass == SI_CSCP_StillImageSubclass) &&
|
||||
(CurrentInterface->Protocol == SI_CSCP_BulkOnlyProtocol))
|
||||
{
|
||||
return DESCRIPTOR_SEARCH_Found;
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ uint8_t SI_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
|||
uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
PIMA_Container_t* const PIMAHeader)
|
||||
{
|
||||
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
|
||||
uint16_t TimeoutMSRem = SI_COMMAND_DATA_TIMEOUT_MS;
|
||||
uint16_t PreviousFrameNumber = USB_Host_GetFrameNumber();
|
||||
|
||||
if ((USB_HostState != HOST_STATE_Configured) || !(SIInterfaceInfo->State.IsActive))
|
||||
|
|
|
@ -311,11 +311,7 @@
|
|||
/* Private Interface - For use in library only: */
|
||||
#if !defined(__DOXYGEN__)
|
||||
/* Macros: */
|
||||
#define STILL_IMAGE_CLASS 0x06
|
||||
#define STILL_IMAGE_SUBCLASS 0x01
|
||||
#define STILL_IMAGE_PROTOCOL 0x01
|
||||
|
||||
#define COMMAND_DATA_TIMEOUT_MS 10000
|
||||
#define SI_COMMAND_DATA_TIMEOUT_MS 10000
|
||||
|
||||
/* Function Prototypes: */
|
||||
#if defined(__INCLUDE_FROM_STILLIMAGE_HOST_C)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue