aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Device
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-09-28 12:14:06 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-09-28 12:14:06 +0000
commit713670043a1edb714461fc83c2b8817f3db99961 (patch)
tree9c45545908c0ad14ad8e136e34de00867fc569a7 /LUFA/Drivers/USB/Class/Device
parent800485bd95de4287006a0d0aa099bc510e929531 (diff)
downloadlufa-713670043a1edb714461fc83c2b8817f3db99961.tar.gz
lufa-713670043a1edb714461fc83c2b8817f3db99961.tar.bz2
lufa-713670043a1edb714461fc83c2b8817f3db99961.zip
Move out many of the common class driver constants into grouped enums, to make them more managable.
Add new CDC descriptor structs to the CDC class driver, so that the CDC demos can use human readable field names. Rename prefix for Still Image Host class driver functions from "SImage_" to "SI_" to remain consistent with the rest of the driver.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device')
-rw-r--r--LUFA/Drivers/USB/Class/Device/CDC.c10
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.c14
-rw-r--r--LUFA/Drivers/USB/Class/Device/HID.h4
-rw-r--r--LUFA/Drivers/USB/Class/Device/MassStorage.c8
-rw-r--r--LUFA/Drivers/USB/Class/Device/RNDIS.c4
5 files changed, 20 insertions, 20 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c
index a5a296deb..44d1caa09 100644
--- a/LUFA/Drivers/USB/Class/Device/CDC.c
+++ b/LUFA/Drivers/USB/Class/Device/CDC.c
@@ -51,7 +51,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
switch (USB_ControlRequest.bRequest)
{
- case REQ_GetLineEncoding:
+ case CDC_REQ_GetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -60,7 +60,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
}
break;
- case REQ_SetLineEncoding:
+ case CDC_REQ_SetLineEncoding:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -71,7 +71,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
}
break;
- case REQ_SetControlLineState:
+ case CDC_REQ_SetControlLineState:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -83,7 +83,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
}
break;
- case REQ_SendBreak:
+ case CDC_REQ_SendBreak:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -248,7 +248,7 @@ void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_Device_t* const CDC
USB_Request_Header_t Notification = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE),
- .bRequest = NOTIF_SerialState,
+ .bRequest = CDC_NOTIF_SerialState,
.wValue = 0,
.wIndex = 0,
.wLength = sizeof(CDCInterfaceInfo->State.ControlLineStates.DeviceToHost),
diff --git a/LUFA/Drivers/USB/Class/Device/HID.c b/LUFA/Drivers/USB/Class/Device/HID.c
index 1953d9fbc..5111eba59 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.c
+++ b/LUFA/Drivers/USB/Class/Device/HID.c
@@ -45,7 +45,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
switch (USB_ControlRequest.bRequest)
{
- case REQ_GetReport:
+ case HID_REQ_GetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
uint16_t ReportSize = 0;
@@ -68,7 +68,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
}
break;
- case REQ_SetReport:
+ case HID_REQ_SetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
uint16_t ReportSize = USB_ControlRequest.wLength;
@@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
}
break;
- case REQ_GetProtocol:
+ case HID_REQ_GetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -94,7 +94,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
}
break;
- case REQ_SetProtocol:
+ case HID_REQ_SetProtocol:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -104,7 +104,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
}
break;
- case REQ_SetIdle:
+ case HID_REQ_SetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -114,7 +114,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter
}
break;
- case REQ_GetIdle:
+ case HID_REQ_GetIdle:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -158,7 +158,7 @@ void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)
memset(ReportINData, 0, sizeof(ReportINData));
- bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, REPORT_ITEM_TYPE_In,
+ bool ForceSend = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, HID_REPORT_ITEM_In,
ReportINData, &ReportINSize);
bool StatesChanged = false;
bool IdlePeriodElapsed = (HIDInterfaceInfo->State.IdleCount && !(HIDInterfaceInfo->State.IdleMSRemaining));
diff --git a/LUFA/Drivers/USB/Class/Device/HID.h b/LUFA/Drivers/USB/Class/Device/HID.h
index 638dac159..e90f15d1f 100644
--- a/LUFA/Drivers/USB/Class/Device/HID.h
+++ b/LUFA/Drivers/USB/Class/Device/HID.h
@@ -156,7 +156,7 @@
* \param[in,out] ReportID If preset to a non-zero value, this is the report ID being requested by the host. If zero,
* this should be set to the report ID of the generated HID input report (if any). If multiple
* reports are not sent via the given HID interface, this parameter should be ignored.
- * \param[in] ReportType Type of HID report to generate, either \ref REPORT_ITEM_TYPE_In or \ref REPORT_ITEM_TYPE_Feature.
+ * \param[in] ReportType Type of HID report to generate, either \ref HID_REPORT_ITEM_In or \ref HID_REPORT_ITEM_Feature.
* \param[out] ReportData Pointer to a buffer where the generated HID report should be stored.
* \param[out] ReportSize Number of bytes in the generated input report, or zero if no report is to be sent.
*
@@ -177,7 +177,7 @@
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
* \param[in] ReportID Report ID of the received output report. If multiple reports are not received via the given HID
* interface, this parameter should be ignored.
- * \param[in] ReportType Type of received HID report, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
+ * \param[in] ReportType Type of received HID report, either \ref HID_REPORT_ITEM_Out or \ref HID_REPORT_ITEM_Feature.
* \param[in] ReportData Pointer to a buffer where the received HID report is stored.
* \param[in] ReportSize Size in bytes of the received report from the host.
*/
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c
index 096a222c2..06ad2c85a 100644
--- a/LUFA/Drivers/USB/Class/Device/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c
@@ -48,7 +48,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
switch (USB_ControlRequest.bRequest)
{
- case REQ_MassStorageReset:
+ case MS_REQ_MassStorageReset:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -58,7 +58,7 @@ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfac
}
break;
- case REQ_GetMaxLUN:
+ case MS_REQ_GetMaxLUN:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -107,12 +107,12 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);
MSInterfaceInfo->State.CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ?
- SCSI_Command_Pass : SCSI_Command_Fail;
+ MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail;
MSInterfaceInfo->State.CommandStatus.Signature = MS_CSW_SIGNATURE;
MSInterfaceInfo->State.CommandStatus.Tag = MSInterfaceInfo->State.CommandBlock.Tag;
MSInterfaceInfo->State.CommandStatus.DataTransferResidue = MSInterfaceInfo->State.CommandBlock.DataTransferLength;
- if ((MSInterfaceInfo->State.CommandStatus.Status == SCSI_Command_Fail) &&
+ if ((MSInterfaceInfo->State.CommandStatus.Status == MS_SCSI_COMMAND_Fail) &&
(MSInterfaceInfo->State.CommandStatus.DataTransferResidue))
{
Endpoint_StallTransaction();
diff --git a/LUFA/Drivers/USB/Class/Device/RNDIS.c b/LUFA/Drivers/USB/Class/Device/RNDIS.c
index ea9e8cf99..394827ed2 100644
--- a/LUFA/Drivers/USB/Class/Device/RNDIS.c
+++ b/LUFA/Drivers/USB/Class/Device/RNDIS.c
@@ -77,7 +77,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
switch (USB_ControlRequest.bRequest)
{
- case REQ_SendEncapsulatedCommand:
+ case RNDIS_REQ_SendEncapsulatedCommand:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
Endpoint_ClearSETUP();
@@ -88,7 +88,7 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
}
break;
- case REQ_GetEncapsulatedResponse:
+ case RNDIS_REQ_GetEncapsulatedResponse:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
RNDIS_Message_Header_t* MessageHeader = (RNDIS_Message_Header_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;