aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-14 15:55:13 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-14 15:55:13 +0000
commitafe6ae14023c7040befe73e49d00077d3425c564 (patch)
tree3ec1276e23fd2361033e94e172a190d3a6a77c42 /Projects
parent9fdc53d76541856c38d7ef940988955f84084898 (diff)
downloadlufa-afe6ae14023c7040befe73e49d00077d3425c564.tar.gz
lufa-afe6ae14023c7040befe73e49d00077d3425c564.tar.bz2
lufa-afe6ae14023c7040befe73e49d00077d3425c564.zip
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.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/Magstripe/Descriptors.h2
-rw-r--r--Projects/Magstripe/Magstripe.c6
-rw-r--r--Projects/Magstripe/Magstripe.h5
-rw-r--r--Projects/Magstripe/makefile1
4 files changed, 8 insertions, 6 deletions
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 <avr/pgmspace.h>
#include <LUFA/Drivers/USB/USB.h>
- #include <LUFA/Drivers/USB/Class/Device/HID.h>
+ #include <LUFA/Drivers/USB/Class/HID.h>
/* 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 <LUFA/Version.h>
#include <LUFA/Drivers/USB/USB.h>
- #include <LUFA/Drivers/USB/Class/Device/HID.h>
+ #include <LUFA/Drivers/USB/Class/HID.h>
/* 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.)