aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/ClassDriver/MouseHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:34:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-09-20 12:34:07 +0000
commitaa640330a1b9421a16e425f5e0043a08558fb9bf (patch)
treee638cc7b81f60530c392a3ec8cb6af9c62b6456f /Demos/Host/ClassDriver/MouseHost
parent51566d1a811f43dc39f38cb597de44ba9363d974 (diff)
downloadlufa-aa640330a1b9421a16e425f5e0043a08558fb9bf.tar.gz
lufa-aa640330a1b9421a16e425f5e0043a08558fb9bf.tar.bz2
lufa-aa640330a1b9421a16e425f5e0043a08558fb9bf.zip
Finish Class Driver MouseHost demo. Update HID Host Class driver; boot protocol now works, still need to finish and test report protocol mode.
Diffstat (limited to 'Demos/Host/ClassDriver/MouseHost')
-rw-r--r--Demos/Host/ClassDriver/MouseHost/MouseHost.c14
-rw-r--r--Demos/Host/ClassDriver/MouseHost/MouseHost.txt72
2 files changed, 80 insertions, 6 deletions
diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
index ead296102..926776f23 100644
--- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c
+++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
@@ -115,10 +115,16 @@ int main(void)
{
USB_MouseReport_Data_t MouseReport;
uint8_t ReportID = 0;
- uint8_t LEDMask = LEDS_NO_LEDS;
+ uint8_t LEDMask = LEDS_NO_LEDS;
+ /* Receive next boot protocol mouse report from the device */
HID_Host_ReceiveReport(&Mouse_HID_Interface, false, &ReportID, &MouseReport);
+ /* Print mouse report data through the serial port */
+ printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
+ MouseReport.Y,
+ MouseReport.Button);
+
/* Alter status LEDs according to mouse X movement */
if (MouseReport.X > 0)
LEDMask |= LEDS_LED1;
@@ -134,13 +140,9 @@ int main(void)
/* Alter status LEDs according to mouse button position */
if (MouseReport.Button)
LEDMask = LEDS_ALL_LEDS;
-
+
LEDs_SetAllLEDs(LEDMask);
}
- else
- {
- LEDs_SetAllLEDs(LEDS_NO_LEDS);
- }
break;
}
diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.txt b/Demos/Host/ClassDriver/MouseHost/MouseHost.txt
new file mode 100644
index 000000000..8a3c1674c
--- /dev/null
+++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.txt
@@ -0,0 +1,72 @@
+/** \file
+ *
+ * This file contains special DoxyGen information for the generation of the main page and other special
+ * documentation pages. It is not a project source file.
+ */
+
+/** \mainpage Mouse Host Demo
+ *
+ * \section SSec_Compat Demo Compatibility:
+ *
+ * The following table indicates what microcontrollers are compatible with this demo.
+ *
+ * - AT90USB1287
+ * - AT90USB647
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Host</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Human Interface Device (HID)</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>N/A</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF HID Specification, USBIF HID Usage Tables</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Low Speed Mode, Full Speed Mode</td>
+ * </tr>
+ * </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Mouse host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse host, for USB mice using
+ * the standard mouse HID profile.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs,
+ * as well as printed out the serial terminal as formatted dY, dY and
+ * button status information.
+ *
+ * This uses a naive method where the mouse is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatible mice with advanced characteristics, as shown in the
+ * MouseHostWithParser demo application.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
+ */