aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-07-19 12:36:19 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-07-19 12:36:19 +0000
commit786479faf0605d610c93041191ee5bd6d020ccf9 (patch)
tree1d1728538d447c1eb79e66bce95a1a5602441e2c /Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
parentd3fb6273aa59c60f2d3f41de321c35ff08ef8feb (diff)
downloadlufa-786479faf0605d610c93041191ee5bd6d020ccf9.tar.gz
lufa-786479faf0605d610c93041191ee5bd6d020ccf9.tar.bz2
lufa-786479faf0605d610c93041191ee5bd6d020ccf9.zip
Add partial project documentation to the incomplete PrinterHost demo.
Change over Printer_GetDeviceID() to require a pointer to the destination buffer plus the buffer size, rather than using a pointer to a special structure. Make new Printer_SendData() function to hide the implementation of sending data to an attached printer, cleaning up the main demo source file body.
Diffstat (limited to 'Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h')
-rw-r--r--Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
index e9c1d9fb9..01f1f1408 100644
--- a/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
+++ b/Demos/Host/Incomplete/PrinterHost/Lib/PrinterCommands.h
@@ -33,27 +33,29 @@
/* Includes: */
#include <avr/io.h>
+ #include <string.h>
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- #define PROTOCOL_UNIDIRECTIONAL 0x01
- #define PROTOCOL_BIDIRECTIONAL 0x02
- #define PROTOCOL_IEEE1284 0x03
-
+ /** Printer class-specific request to retrieve the printer's ID string */
#define GET_DEVICE_ID 0
+
+ /** Printer class-specific request to retrieve the printer's virtual port status flags */
#define GET_PORT_STATUS 1
+
+ /** Printer class-specific request to soft-reset the device */
#define SOFT_RESET 2
- /* Type Defines: */
- typedef struct
- {
- uint16_t Length;
- uint8_t String[128];
- } Device_ID_String_t;
+ /** Pipe number of the Printer data IN pipe */
+ #define PRINTER_DATA_IN_PIPE 1
+
+ /** Pipe number of the Printer data OUT pipe */
+ #define PRINTER_DATA_OUT_PIPE 2
/* Function Prototypes: */
- uint8_t Printer_GetDeviceID(Device_ID_String_t* DeviceIDString);
+ uint8_t Printer_SendData(char* PrinterCommands);
+ uint8_t Printer_GetDeviceID(char* DeviceIDString, uint8_t BufferSize);
uint8_t Printer_GetPortStatus(uint8_t* PortStatus);
uint8_t Printer_SoftReset(void);