From afe6ae14023c7040befe73e49d00077d3425c564 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 14 Jun 2009 15:55:13 +0000 Subject: Add host mode USB Class driver stubs, add beginnings of a CDC host class driver. Split out common defines/types from class drivers into a seperate common class driver directory. Make central USB Class driver dispatch headers, used for both device and host modes. --- Projects/Magstripe/Descriptors.h | 2 +- Projects/Magstripe/Magstripe.c | 6 +++--- Projects/Magstripe/Magstripe.h | 5 +++-- Projects/Magstripe/makefile | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Projects/Magstripe') diff --git a/Projects/Magstripe/Descriptors.h b/Projects/Magstripe/Descriptors.h index 0fff2c2a8..27cfe02b7 100644 --- a/Projects/Magstripe/Descriptors.h +++ b/Projects/Magstripe/Descriptors.h @@ -41,7 +41,7 @@ #include #include - #include + #include /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index 6e5e00b91..716b9953c 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -46,7 +46,7 @@ BitBuffer_t TrackDataBuffers[3]; * passed to all HID Class driver functions, so that multiple instances of the same class * within a device can be differentiated from one another. */ -USB_ClassInfo_HID_t Keyboard_HID_Interface = +USB_ClassInfo_HID_Device_t Keyboard_HID_Interface = { .InterfaceNumber = 0, @@ -157,7 +157,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) * * \return Number of bytes in the created report */ -uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) +uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) { static bool IsKeyReleaseReport; static bool IsNewlineReport; @@ -204,7 +204,7 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI * \param ReportData Pointer to the report buffer where the received report is stored * \param ReportSize Size in bytes of the report received from the host */ -void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, +void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID, void* ReportData, uint16_t ReportSize) { // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index 6a13af4ec..c96d038f5 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -48,7 +48,7 @@ #include #include - #include + #include /* Macros: */ /** HID keyboard keycode to indicate that the "1" key is currently pressed. */ @@ -79,7 +79,8 @@ void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_UnhandledControlPacket(void); - uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData); + uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, + void* ReportData); void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void* ReportData, uint16_t ReportSize); diff --git a/Projects/Magstripe/makefile b/Projects/Magstripe/makefile index 80b17448f..b81f9f156 100644 --- a/Projects/Magstripe/makefile +++ b/Projects/Magstripe/makefile @@ -137,6 +137,7 @@ SRC = $(TARGET).c \ $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/USBTask.c \ $(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \ $(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c \ + $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c \ # List C++ source files here. (C dependencies are automatically generated.) -- cgit v1.2.3