[cp10] Completely rework CP-10 support. It uses a different data stream!

This commit is contained in:
Solomon Peachy 2012-12-12 19:00:45 -05:00
parent 14b6294a58
commit ecbdb9e7b4
3 changed files with 41 additions and 25 deletions

View File

@ -16,13 +16,13 @@
Verified supported printers:
ES1, ES2, ES3, ES30, ES40, C-100, CP-200, CP-300, CP-330, CP400,
ES1, ES2, ES3, ES30, ES40, CP-10, CP-100, CP-200, CP-300, CP-330, CP400,
CP500, CP510, CP710, CP720, CP730, CP740, CP750, CP760, CP770, CP780,
CP800, CP900
Unverified/untested, but should work:
ES20, CP-10, CP-220, CP600, CP810
ES20, CP-220, CP600, CP810
NOT currently supported by libusb backend: (USB PIDs unknown) **
@ -271,10 +271,34 @@
as the ES40.
***************************************************************************
Selphy CP-series (except for CP790):
Selphy CP-10:
Init func: 40 00 00 00 00 00 00 00 00 00 00 00
Plane func: 40 01 00 [plane] [length, 32-bit LE] 00 00 00 00
End func: 00 00 00 00 # NOTE: CP900 only, and not necessary!
plane codes are 0x00, 0x01, 0x02 for Y, M, and C, respectively.
length is always '00 60 81 0a' which is 688480 bytes.
Known readback values:
01 00 00 00 00 00 00 00 00 00 00 00 [idle, waiting for init]
02 00 00 00 00 00 00 00 00 00 00 00 [init sent, paper feeding]
02 00 00 00 00 00 00 00 00 00 00 00 [init sent, paper feeding]
02 00 00 00 00 00 00 00 00 00 00 00 [waiting for Y data]
04 00 00 00 00 00 00 00 00 00 00 00 [waiting for M data]
08 00 00 00 00 00 00 00 00 00 00 00 [waiting for C data]
10 00 00 00 00 00 00 00 00 00 00 00 [C done, waiting]
20 00 00 00 00 00 00 00 00 00 00 00 [All done]
Error codes are as of yet unknown.
***************************************************************************
Selphy CP-series (except for CP790 & CP-10):
This is known to apply to:
CP-10, CP-100, CP-200, CP-300, CP-330, CP400, CP500, CP510, CP710,
CP-100, CP-200, CP-300, CP-330, CP400, CP500, CP510, CP710,
CP720, CP730, CP740, CP750, CP760, CP770, CP780, CP800, CP900
Init func: 40 00 00 [pgcode] 00 00 00 00 00 00 00 00
@ -293,14 +317,13 @@
01 00 00 00 [ss] 00 [pg] 00 00 00 00 [xx] [idle, waiting for init]
02 00 [rr] 00 00 00 [pg] 00 00 00 00 [xx] [init sent, paper feeding]
02 00 [rr] 00 10 00 [pg] 00 00 00 00 [xx] [init sent, paper feeding]
02 00 [rr] 00 [qq] 00 [pg] 00 00 00 00 [xx] [waiting for Y data]
02 00 [rr] 00 70 00 [pg] 00 00 00 00 [xx] [waiting for Y data]
04 00 00 00 00 00 [pg] 00 00 00 00 [xx] [waiting for M data]
08 00 00 00 00 00 [pg] 00 00 00 00 [xx] [waiting for C data]
10 00 00 00 00 00 [pg] 00 00 00 00 [xx] [C done, waiting]
20 00 00 00 00 00 [pg] 00 00 00 00 [xx] [All done]
[xx] is 0x01 on the CP780/CP800/CP900, 0x00 on all others.
[qq] is 0x00 on CP-10, 0x70 on all others.
[rr] is error code:
0x00 no error
@ -314,7 +337,7 @@
'P' paper 0x11
'L' paper 0x22
'C' paper 0x33 (0x00 on the CP-10)
'C' paper 0x33
'W' paper 0x44
First four bits are paper, second four bits are the ribbon. They aren't

View File

@ -106,7 +106,10 @@ static int parse_printjob(uint8_t *buffer, int *bw_mode, int *plane_len)
if (buffer[12] == 0x40 &&
buffer[13] == 0x01) {
if (buffer[2] == 0x00) {
printer_type = P_CP_XXX;
if (buffer[6] == 0x00)
printer_type = P_CP10;
else
printer_type = P_CP_XXX;
} else {
printer_type = P_ES1;
*bw_mode = (buffer[2] == 0x20);
@ -242,10 +245,8 @@ static int find_and_enumerate(struct libusb_context *ctx,
valid = 1;
break;
case USB_PID_CANON_CP10: // "Canon CP-10"
if (*printer_type == P_CP_XXX) {
if (*printer_type == P_CP10)
found = i;
*printer_type = P_CP10;
}
valid = 1;
break;
case USB_PID_CANON_CP100: // "Canon CP-100"

View File

@ -131,7 +131,7 @@ struct printer_data printers[P_END] = {
.error_offset = 3,
},
{ .type = P_CP_XXX,
.model = "SELPHY CP Series (!CP790)",
.model = "SELPHY CP Series (!CP-10/CP790)",
.init_length = 12,
.foot_length = 0, /* CP900 has four-byte NULL footer that can be safely ignored */
.init_readback = { 0x01, 0x00, 0x00, 0x00, -1, 0x00, -1, 0x00, 0x00, 0x00, 0x00, -1 },
@ -154,9 +154,9 @@ struct printer_data printers[P_END] = {
.ready_c_readback = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1 },
.done_c_readback = { 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1 },
// .paper_codes
.pgcode_offset = 3,
.paper_code_offset = 6,
.error_offset = 2,
.pgcode_offset = -1,
.paper_code_offset = -1,
.error_offset = -1,
},
};
@ -183,11 +183,7 @@ static void setup_paper_codes(void)
printers[P_ES2_20].paper_codes[0x02] = 0x02; // ? guess
printers[P_ES2_20].paper_codes[0x03] = 0x03;
/* SELPHY ES3/30 paper codes -- N/A, printer does not report paper type */
// printers[P_ES3_30]paper_codes[0x01] = -1;
// printers[P_ES3_30]paper_codes[0x02] = -1;
// printers[P_ES3_30]paper_codes[0x03] = -1;
/* SELPHY ES3/30 paper codes -- N/A, printer does not report paper type */
/* SELPHY ES40/CP790 paper codes -- ? guess */
printers[P_ES40_CP790].paper_codes[0x00] = 0x11;
printers[P_ES40_CP790].paper_codes[0x01] = 0x22;
@ -200,11 +196,7 @@ static void setup_paper_codes(void)
printers[P_CP_XXX].paper_codes[0x03] = 0x33;
printers[P_CP_XXX].paper_codes[0x04] = 0x44;
/* SELPHY CP-10 paper codes */
printers[P_CP10].paper_codes[0x01] = -1;
printers[P_CP10].paper_codes[0x02] = -1;
printers[P_CP10].paper_codes[0x03] = 0x00;
printers[P_CP10].paper_codes[0x04] = -1;
/* SELPHY CP-10 paper codes -- N/A, only one type */
}
#define INCORRECT_PAPER -999