diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c index 4e2a0d9db6..6ed7fa9086 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c @@ -28,6 +28,12 @@ this software. */ +/** \file + * + * Printer Device commands, to send/recieve data to and from an attached USB + * printer, and to send and receive Printer Class control requests. + */ + #include "PrinterCommands.h" /** Sends the given data directly to the printer via the data endpoints, for the sending of print commands in printer diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h index 4656d190e1..896a5903ec 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h @@ -28,6 +28,11 @@ this software. */ +/** \file + * + * Header file for PrinterCommands.c. + */ + #ifndef _PRINTER_COMMANDS_H_ #define _PRINTER_COMMANDS_H_ diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c index 6bbacab0a8..64adf22c79 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c @@ -54,6 +54,7 @@ int main(void) } } +/** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { /* Disable watchdog if enabled by bootloader/fuses */ @@ -69,18 +70,33 @@ void SetupHardware(void) USB_Init(); } +/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and + * starts the library USB task to begin the enumeration and USB management process. + */ void EVENT_USB_DeviceAttached(void) { puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING); } +/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and + * stops the library USB task management process. + */ void EVENT_USB_DeviceUnattached(void) { puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); } +/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully + * enumerated by the host and is now ready to be used by the application. + */ +void EVENT_USB_DeviceEnumerationComplete(void) +{ + LEDs_SetAllLEDs(LEDMASK_USB_READY); +} + +/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */ void EVENT_USB_HostError(uint8_t ErrorCode) { USB_ShutDown(); @@ -92,20 +108,22 @@ void EVENT_USB_HostError(uint8_t ErrorCode) for(;;); } +/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while + * enumerating an attached USB device. + */ void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode) { puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n")); printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode); + printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode); printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } -void EVENT_USB_DeviceEnumerationComplete(void) -{ - LEDs_SetAllLEDs(LEDMASK_USB_READY); -} - +/** Task to set the configuration of the attached device after it has been enumerated, and to send some test page + * data to the attached printer. + */ void USB_Printer_Host(void) { uint8_t ErrorCode; diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index 5851349e4d..f6afcc796c 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -28,6 +28,11 @@ this software. */ +/** \file + * + * Header file for PrinterHost.c. + */ + #ifndef _MASS_STORE_HOST_H_ #define _MASS_STORE_HOST_H_ diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt b/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt new file mode 100644 index 0000000000..6326469e02 --- /dev/null +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.txt @@ -0,0 +1,64 @@ +/** \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 Printer Host Demo + * + * \section SSec_Compat Demo Compatibility: + * + * The following table indicates what microcontrollers are compatible with this demo. + * + * - AT90USB1287 + * - AT90USB1286 + * + * \section SSec_Info USB Information: + * + * The following table gives a rundown of the USB utilization of this demo. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
USB Mode:Host
USB Class:Printer Device
USB Subclass:Bidirectional Protocol
Relevant Standards:USBIF Printer Class Specification, PCL Language Specification
Usable Speeds:Low Speed Mode, Full Speed Mode
+ * + * \section SSec_Description Project Description: + * + * Printer host demonstration application. This gives a simple reference + * application for implementing a USB Printer host, for USB printers using + * the bidirectional data encapsulation protocol and PCL language. + * + * Upon connection of a compatible printer, the printer's device ID is sent + * to the AVR's serial port, and a simple test page is printed using the PCL + * printer language. + * + * \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. + * + * + * + * + * + *
+ * None + *
+ */ \ No newline at end of file