aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host
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 /Demos/Host
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 'Demos/Host')
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c6
-rw-r--r--Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c2
-rw-r--r--Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c4
-rw-r--r--Demos/Host/ClassDriver/MouseHost/MouseHost.c2
-rw-r--r--Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c8
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/StillImageHost.c14
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c10
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c8
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h2
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c12
10 files changed, 34 insertions, 34 deletions
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
index 8420d05ab..fb48c2b17 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
- .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL,
+ .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo
},
@@ -138,7 +138,7 @@ int main(void)
/* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
if (ReportItem->Value)
LEDMask = LEDS_ALL_LEDS;
@@ -146,7 +146,7 @@ int main(void)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
index 8bdf2b6ec..ddce64c24 100644
--- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
+++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c
@@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
- .HIDInterfaceProtocol = HID_BOOT_KEYBOARD_PROTOCOL,
+ .HIDInterfaceProtocol = HID_BOOTP_KeyboardBootProtocol,
},
};
diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
index 9135e53eb..3fd23f051 100644
--- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
- .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL,
+ .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo
},
@@ -138,7 +138,7 @@ int main(void)
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
(ReportItem->Attributes.BitSize == 8) &&
(ReportItem->Attributes.Logical.Maximum > 1) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Key code is an unsigned char in length, cast to the appropriate type */
uint8_t KeyCode = (uint8_t)ReportItem->Value;
diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
index a03381cc6..d76f048d9 100644
--- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c
+++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
@@ -50,7 +50,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
- .HIDInterfaceProtocol = HID_BOOT_MOUSE_PROTOCOL,
+ .HIDInterfaceProtocol = HID_BOOTP_MouseBootProtocol,
},
};
diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
index 7482b01b0..d02424c7b 100644
--- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
+++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c
@@ -53,7 +53,7 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface =
.DataOUTPipeNumber = 2,
.DataOUTPipeDoubleBank = false,
- .HIDInterfaceProtocol = HID_NON_BOOT_PROTOCOL,
+ .HIDInterfaceProtocol = HID_BOOTP_NonBootProtocol,
.HIDParserData = &HIDReportInfo
},
@@ -138,14 +138,14 @@ int main(void)
/* Determine what report item is being tested, process updated value as needed */
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
if (ReportItem->Value)
LEDMask = LEDS_ALL_LEDS;
}
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
int16_t WheelDelta = HID_ALIGN_DATA(ReportItem, int16_t);
@@ -155,7 +155,7 @@ int main(void)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
index 152639fef..f5d1b23fd 100644
--- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
+++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c
@@ -86,8 +86,8 @@ int main(void)
break;
}
- if (SImage_Host_ConfigurePipes(&DigitalCamera_SI_Interface,
- ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError)
+ if (SI_Host_ConfigurePipes(&DigitalCamera_SI_Interface,
+ ConfigDescriptorSize, ConfigDescriptorData) != SI_ENUMERROR_NoError)
{
puts_P(PSTR("Attached Device Not a Valid Still Image Class Device.\r\n"));
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
@@ -110,7 +110,7 @@ int main(void)
case HOST_STATE_Configured:
puts_P(PSTR("Opening Session...\r\n"));
- if (SImage_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+ if (SI_Host_OpenSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
{
puts_P(PSTR("Could not open PIMA session.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -119,8 +119,8 @@ int main(void)
puts_P(PSTR("Turning off Device...\r\n"));
- SImage_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL);
- if (SImage_Host_ReceiveResponse(&DigitalCamera_SI_Interface))
+ SI_Host_SendCommand(&DigitalCamera_SI_Interface, 0x1013, 0, NULL);
+ if (SI_Host_ReceiveResponse(&DigitalCamera_SI_Interface))
{
puts_P(PSTR("Could not turn off device.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -131,7 +131,7 @@ int main(void)
puts_P(PSTR("Closing Session...\r\n"));
- if (SImage_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
+ if (SI_Host_CloseSession(&DigitalCamera_SI_Interface) != PIPE_RWSTREAM_NoError)
{
puts_P(PSTR("Could not close PIMA session.\r\n"));
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
@@ -143,7 +143,7 @@ int main(void)
break;
}
- SImage_Host_USBTask(&DigitalCamera_SI_Interface);
+ SI_Host_USBTask(&DigitalCamera_SI_Interface);
USB_USBTask();
}
}
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
index e92c242d2..cf469ffec 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.c
@@ -193,9 +193,9 @@ void Joystick_HID_Task(void)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
- uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
- uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
- uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+ uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+ uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+ uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -258,7 +258,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
bool FoundData;
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Get the joystick button value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
@@ -274,7 +274,7 @@ void ProcessJoystickReport(uint8_t* JoystickReport)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Get the joystick relative position value */
FoundData = USB_GetHIDReportItemInfo(JoystickReport, ReportItem);
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
index dfb1a4a08..94aca2fef 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
@@ -194,9 +194,9 @@ void Keyboard_HID_Task(void)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
- uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
- uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
- uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+ uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+ uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+ uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -258,7 +258,7 @@ void ProcessKeyboardReport(uint8_t* KeyboardReport)
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_KEYBOARD) &&
(ReportItem->Attributes.BitSize == 8) &&
(ReportItem->Attributes.Logical.Maximum > 1) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Retrieve the keyboard scan-code from the report data retrieved from the device */
bool FoundData = USB_GetHIDReportItemInfo(KeyboardReport, ReportItem);
diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
index d9e90a8da..bb038f1c5 100644
--- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
+++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
@@ -75,7 +75,7 @@
/** Additional error code for Mass Storage functions when a device returns a logical command failure. */
#define MASS_STORE_SCSI_COMMAND_FAILED 0xC0
- /* Type defines: */
+ /* Type Defines: */
/** Type define for a Mass Storage class Command Block Wrapper, used to wrap SCSI
* commands for transport over the USB bulk endpoints to the device.
*/
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
index 38e4b2564..5536d872b 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
+++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
@@ -194,9 +194,9 @@ void Mouse_HID_Task(void)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
- uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
- uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
- uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
+ uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_In];
+ uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Out];
+ uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
@@ -259,7 +259,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
bool FoundData;
if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_BUTTON) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Get the mouse button value */
FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);
@@ -274,7 +274,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
}
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
(ReportItem->Attributes.Usage.Usage == USAGE_SCROLL_WHEEL) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Get the mouse wheel value if it is contained within the current
* report, if not, skip to the next item in the parser list
@@ -290,7 +290,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
else if ((ReportItem->Attributes.Usage.Page == USAGE_PAGE_GENERIC_DCTRL) &&
((ReportItem->Attributes.Usage.Usage == USAGE_X) ||
(ReportItem->Attributes.Usage.Usage == USAGE_Y)) &&
- (ReportItem->ItemType == REPORT_ITEM_TYPE_In))
+ (ReportItem->ItemType == HID_REPORT_ITEM_In))
{
/* Get the mouse relative position value */
FoundData = USB_GetHIDReportItemInfo(MouseReport, ReportItem);