Commit afe6ae14 authored by Dean Camera's avatar Dean Camera
Browse files

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.
parent 9fdc53d7
......@@ -29,6 +29,7 @@
*/
#include "HIDParser.h"
#if defined(CAN_BE_HOST)
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
{
......@@ -324,3 +325,5 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData, const HID_ReportItem_t* Repor
BitMask <<= 1;
}
}
#endif
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
#include "MIDI.h"
#endif
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassMIDI
* @defgroup Group_USBClassMIDIHost MIDI Class Host Mode Driver
*
* \section Module Description
* Host Mode USB Class driver framework interface, for the MIDI USB Class driver.
*
* @{
*/
#ifndef __MIDI_CLASS_HOST_H__
#define __MIDI_CLASS_HOST_H__
/* Includes: */
#include "../../USB.h"
#include "../Common/MIDI.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Function Prototypes: */
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
#include "HID.h"
#endif
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassMassStorage
* @defgroup Group_USBClassMassStorageHost Mass Storage Class Host Mode Driver
*
* \section Module Description
* Host Mode USB Class driver framework interface, for the Mass Storage USB Class driver.
*
* @{
*/
#ifndef __MS_CLASS_HOST_H__
#define __MS_CLASS_HOST_H__
/* Includes: */
#include "../../USB.h"
#include "../Common/MassStorage.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Function Prototypes: */
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#include "../../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
#include "StillImage.h"
#endif
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassStillImage
* @defgroup Group_USBClassStillImageHost Still Image Class Host Mode Driver
*
* \section Module Description
* Host Mode USB Class driver framework interface, for the Still Image USB Class driver.
*
* @{
*/
#ifndef __SI_CLASS_HOST_H__
#define __SI_CLASS_HOST_H__
/* Includes: */
#include "../../USB.h"
#include "../Common/StillImage.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Function Prototypes: */
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBClassMIDI MIDI Device Class Driver - LUFA/Drivers/Class/MIDI.h
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - LUFA/Drivers/USB/Class/Device/MIDI.c
* - LUFA/Drivers/USB/Class/Host/MIDI.c
*
* \section Module Description
* Functions, macros, variables, enums and types related to the management of USB MIDI Class interfaces
* within a USB device. Note that the MIDI class is actually a special case of the regular Audio class,
* thus this module depends on structure definitions from the \ref Group_USBClassAudioDevice class driver module.
*
* @{
*/
#ifndef _MIDI_CLASS_H_
#define _MIDI_CLASS_H_
/* Includes: */
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
#include "Device/MIDI.h"
#endif
#if defined(USB_CAN_BE_HOST)
#include "Host/MIDI.h"
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBClassMS Mass Storage Device Class Driver - LUFA/Drivers/Class/MassStorage.h
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - LUFA/Drivers/USB/Class/Device/MassStorage.c
* - LUFA/Drivers/USB/Class/Host/MassStorage.c
*
* \section Module Description
* Functions, macros, variables, enums and types related to the management of USB Mass Storage Class interfaces
* within a USB device.
*
* @{
*/
#ifndef _MS_CLASS_H_
#define _MS_CLASS_H_
/* Includes: */
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
#include "Device/MassStorage.h"
#endif
#if defined(USB_CAN_BE_HOST)
#include "Host/MassStorage.h"
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBClassRNDIS RNDIS Device Class Driver - LUFA/Drivers/Class/RNDIS.h
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - LUFA/Drivers/USB/Class/Device/RNDIS.c
*
* \section Module Description
* Functions, macros, variables, enums and types related to the management of USB RNDIS Ethernet
* interfaces within a USB device.
*
* @{
*/
#ifndef _RNDIS_CLASS_H_
#define _RNDIS_CLASS_H_
/* Includes: */
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
#include "Device/RNDIS.h"
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBClassSI Still Image Device Class Driver - LUFA/Drivers/Class/StillImage.h
*
* \section Sec_Dependencies Module Source Dependencies
* The following files must be built with any user project that uses this module:
* - LUFA/Drivers/USB/Class/Host/StillImage.c
*
* \section Module Description
* Functions, macros, variables, enums and types related to the management of USB Still Image Class interfaces
* within a USB device.
*
* @{
*/
#ifndef _SI_CLASS_H_
#define _SI_CLASS_H_
/* Includes: */
#include "../HighLevel/USBMode.h"
#if defined(USB_CAN_BE_HOST)
#include "Host/StillImage.h"
#endif
#endif
/** @} */
......@@ -67,20 +67,6 @@
* same class driver.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBDeviceClassDrivers Device Class Drivers
*
* Device mode drivers for the standard USB classes. These drivers all implement one of the standard USB
* classes, allowing for the class to be easily implemented in a user project.
*/
/** \ingroup Group_USBClassDrivers
* @defgroup Group_USBHostClassDrivers Host Class Drivers
*
* Host mode drivers for the standard USB classes. These drivers all implement one of the standard USB
* classes, allowing for the class to be easily implemented in a user project.
*/
#ifndef __USB_H__
#define __USB_H__
......
......@@ -18,6 +18,19 @@ LUFA_SRC_FILES = ./Drivers/USB/LowLevel/DevChapter9.c \
./Drivers/USB/HighLevel/USBInterrupt.c \
./Drivers/USB/HighLevel/USBTask.c \
./Drivers/USB/HighLevel/ConfigDescriptor.c \
./Drivers/USB/Class/Device/Audio.c \
./Drivers/USB/Class/Device/CDC.c \
./Drivers/USB/Class/Device/HID.c \
./Drivers/USB/Class/Device/MIDI.c \
./Drivers/USB/Class/Device/MassStorage.c \
./Drivers/USB/Class/Device/RNDIS.c \
./Drivers/USB/Class/Host/Audio.c \
./Drivers/USB/Class/Host/CDC.c \
./Drivers/USB/Class/Host/HID.c \
./Drivers/USB/Class/Host/HIDParser.c \
./Drivers/USB/Class/Host/MIDI.c \
./Drivers/USB/Class/Host/MassStorage.c \
./Drivers/USB/Class/Host/StillImage.c \
./Drivers/Board/Temperature.c \
./Drivers/Peripheral/Serial.c \
./Drivers/Peripheral/SerialStream.c \
......
......@@ -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
......
......@@ -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,