Minor documentation page updates.
[pub/USBasp.git] / Demos / Device / MIDI / MIDI.c
index 1fee347..4fef047 100644 (file)
   this software.\r
 */\r
 \r
   this software.\r
 */\r
 \r
+/** \file\r
+ *\r
+ *  Main source file for the MIDI demo. This file contains the main tasks of\r
+ *  the demo and is responsible for the initial application hardware configuration.\r
+ */\r
+\r
 #include "MIDI.h"\r
 \r
 #include "MIDI.h"\r
 \r
+/** LUFA MIDI Class driver interface configuration and state information. This structure is\r
+ *  passed to all MIDI Class driver functions, so that multiple instances of the same class\r
+ *  within a device can be differentiated from one another.\r
+ */\r
 USB_ClassInfo_MIDI_t Keyboard_MIDI_Interface =\r
        {\r
 USB_ClassInfo_MIDI_t Keyboard_MIDI_Interface =\r
        {\r
-               .InterfaceNumber       = 0,\r
+               .StreamingInterfaceNumber = 1,\r
 \r
 \r
-               .DataINEndpointNumber  = MIDI_STREAM_IN_EPNUM,\r
-               .DataINEndpointSize    = MIDI_STREAM_EPSIZE,\r
+               .DataINEndpointNumber     = MIDI_STREAM_IN_EPNUM,\r
+               .DataINEndpointSize       = MIDI_STREAM_EPSIZE,\r
 \r
 \r
-               .DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,\r
-               .DataOUTEndpointSize   = MIDI_STREAM_EPSIZE,\r
+               .DataOUTEndpointNumber    = MIDI_STREAM_OUT_EPNUM,\r
+               .DataOUTEndpointSize      = MIDI_STREAM_EPSIZE,\r
        };\r
        };\r
-       \r
+\r
+/** Main program entry point. This routine contains the overall program flow, including initial\r
+ *  setup of all components and the main program loop.\r
+ */\r
 int main(void)\r
 {\r
        SetupHardware();\r
 int main(void)\r
 {\r
        SetupHardware();\r
@@ -55,6 +68,7 @@ int main(void)
        }\r
 }\r
 \r
        }\r
 }\r
 \r
+/** Configures the board hardware and chip peripherals for the demo's functionality. */\r
 void SetupHardware(void)\r
 {\r
        /* Disable watchdog if enabled by bootloader/fuses */\r
 void SetupHardware(void)\r
 {\r
        /* Disable watchdog if enabled by bootloader/fuses */\r
@@ -71,6 +85,7 @@ void SetupHardware(void)
        USB_Init();\r
 }\r
 \r
        USB_Init();\r
 }\r
 \r
+/** Checks for changes in the position of the board joystick, sending MIDI events to the host upon each change. */\r
 void CheckJoystickMovement(void)\r
 {\r
        static uint8_t PrevJoystickStatus;\r
 void CheckJoystickMovement(void)\r
 {\r
        static uint8_t PrevJoystickStatus;\r
@@ -133,16 +148,19 @@ void CheckJoystickMovement(void)
        PrevJoystickStatus = JoystickStatus;\r
 }\r
 \r
        PrevJoystickStatus = JoystickStatus;\r
 }\r
 \r
+/** Event handler for the library USB Connection event. */\r
 void EVENT_USB_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
 void EVENT_USB_Connect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
 }\r
 \r
+/** Event handler for the library USB Disconnection event. */\r
 void EVENT_USB_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
 void EVENT_USB_Disconnect(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
 }\r
 \r
+/** Event handler for the library USB Configuration Changed event. */\r
 void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
 void EVENT_USB_ConfigurationChanged(void)\r
 {\r
        LEDs_SetAllLEDs(LEDMASK_USB_READY);\r