- Permission to use, copy, modify, distribute, and sell this
+ Permission to use, copy, modify, distribute, and sell 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
+ 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 without specific, written prior permission.
The author disclaim all warranties with regard to this
* Main source file for the VirtualSerialMouse demo. This file contains the main tasks of
* the demo and is responsible for the initial application hardware configuration.
*/
* Main source file for the VirtualSerialMouse demo. This file contains the main tasks of
* the demo and is responsible for the initial application hardware configuration.
*/
#include "VirtualSerialMouse.h"
/** LUFA CDC Class driver interface configuration and state information. This structure is
#include "VirtualSerialMouse.h"
/** LUFA CDC Class driver interface configuration and state information. This structure is
/** 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
/** 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
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
SetupHardware();
/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */
CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */
CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
uint8_t JoyStatus_LCL = Joystick_GetStatus();
char* ReportString = NULL;
static bool ActionSent = false;
uint8_t JoyStatus_LCL = Joystick_GetStatus();
char* ReportString = NULL;
static bool ActionSent = false;
if (JoyStatus_LCL & JOY_UP)
ReportString = "Joystick Up\r\n";
else if (JoyStatus_LCL & JOY_DOWN)
if (JoyStatus_LCL & JOY_UP)
ReportString = "Joystick Up\r\n";
else if (JoyStatus_LCL & JOY_DOWN)
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
- if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
- LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ ConfigSuccess &= HID_Device_ConfigureEndpoints(&Mouse_HID_Interface);
+ ConfigSuccess &= CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface);
-/** Event handler for the library USB Unhandled Control Request event. */
-void EVENT_USB_Device_UnhandledControlRequest(void)
+/** Event handler for the library USB Control Request reception event. */
+void EVENT_USB_Device_ControlRequest(void)
{
CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);
HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
{
CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);
HID_Device_ProcessControlRequest(&Mouse_HID_Interface);
*
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
*
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID
uint16_t* const ReportSize)
{
USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
uint16_t* const ReportSize)
{
USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
*
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
*
* \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced
* \param[in] ReportID Report ID of the received report from the host
- * \param[in] ReportType The type of report that the host has sent, either REPORT_ITEM_TYPE_Out or REPORT_ITEM_TYPE_Feature
- * \param[in] ReportData Pointer to a buffer where the created report has been stored
+ * \param[in] ReportType The type of report that the host has sent, either HID_REPORT_ITEM_Out or HID_REPORT_ITEM_Feature
+ * \param[in] ReportData Pointer to a buffer where the received report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
* \param[in] ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,