|
|
@ -37,46 +37,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "MassStorageKeyboard.h"
|
|
|
|
#include "MassStorageKeyboard.h"
|
|
|
|
|
|
|
|
|
|
|
|
/** Buffer to hold the previously generated Keyboard HID report, for comparison purposes inside the HID class driver. */
|
|
|
|
/** LUFA Mass Storage Class driver interface configuration and state information. This structure is
|
|
|
|
uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
|
|
|
|
* passed to all Mass Storage Class driver functions, so that multiple instances of the same class
|
|
|
|
|
|
|
|
|
|
|
|
/** LUFA HID Class driver interface configuration and state information. This structure is
|
|
|
|
|
|
|
|
* passed to all HID Class driver functions, so that multiple instances of the same class
|
|
|
|
|
|
|
|
* within a device can be differentiated from one another.
|
|
|
|
* within a device can be differentiated from one another.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
|
|
|
|
USB_ClassInfo_MS_Device_t Disk_MS_Interface =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.Config =
|
|
|
|
.Config =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.InterfaceNumber = 1,
|
|
|
|
.InterfaceNumber = 0,
|
|
|
|
|
|
|
|
|
|
|
|
.ReportINEndpointNumber = KEYBOARD_EPNUM,
|
|
|
|
.DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
|
|
|
|
.ReportINEndpointSize = KEYBOARD_EPSIZE,
|
|
|
|
.DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
|
|
|
|
|
|
|
.DataINEndpointDoubleBank = false,
|
|
|
|
|
|
|
|
|
|
|
|
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
|
|
|
|
.DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
|
|
|
|
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
|
|
|
|
.DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
|
|
|
|
|
|
|
.DataOUTEndpointDoubleBank = false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.TotalLUNs = TOTAL_LUNS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** LUFA Mass Storage Class driver interface configuration and state information. This structure is
|
|
|
|
/** Buffer to hold the previously generated Keyboard HID report, for comparison purposes inside the HID class driver. */
|
|
|
|
* passed to all Mass Storage Class driver functions, so that multiple instances of the same class
|
|
|
|
uint8_t PrevKeyboardHIDReportBuffer[sizeof(USB_KeyboardReport_Data_t)];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** LUFA HID Class driver interface configuration and state information. This structure is
|
|
|
|
|
|
|
|
* passed to all HID Class driver functions, so that multiple instances of the same class
|
|
|
|
* within a device can be differentiated from one another.
|
|
|
|
* within a device can be differentiated from one another.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
USB_ClassInfo_MS_Device_t Disk_MS_Interface =
|
|
|
|
USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.Config =
|
|
|
|
.Config =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.InterfaceNumber = 0,
|
|
|
|
.InterfaceNumber = 1,
|
|
|
|
|
|
|
|
|
|
|
|
.DataINEndpointNumber = MASS_STORAGE_IN_EPNUM,
|
|
|
|
.ReportINEndpointNumber = KEYBOARD_EPNUM,
|
|
|
|
.DataINEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
|
|
|
.ReportINEndpointSize = KEYBOARD_EPSIZE,
|
|
|
|
|
|
|
|
.ReportINEndpointDoubleBank = false,
|
|
|
|
|
|
|
|
|
|
|
|
.DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM,
|
|
|
|
.PrevReportINBuffer = PrevKeyboardHIDReportBuffer,
|
|
|
|
.DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE,
|
|
|
|
.PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer),
|
|
|
|
|
|
|
|
|
|
|
|
.TotalLUNs = TOTAL_LUNS,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Main program entry point. This routine contains the overall program flow, including initial
|
|
|
|
/** Main program entry point. This routine contains the overall program flow, including initial
|
|
|
|
* setup of all components and the main program loop.
|
|
|
|
* setup of all components and the main program loop.
|
|
|
|