From 3ee4befff10ebe6fdbf5db5bb22563072eb6b944 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 5 Feb 2003 23:17:13 +0000 Subject: [PATCH] * gtk891x.html: More commands. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6184 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/polaroid/gt98x.html | 146 ++++++++++++++++++++++++++++++++++-- 1 file changed, 140 insertions(+), 6 deletions(-) diff --git a/camlibs/polaroid/gt98x.html b/camlibs/polaroid/gt98x.html index 48f0a0f3a..a9c8d5fc4 100644 --- a/camlibs/polaroid/gt98x.html +++ b/camlibs/polaroid/gt98x.html @@ -91,12 +91,6 @@ the start of it. lsb/msb is the size? offset? of the uploaded firmware. Function unclear. - - SICE DOWNLOAD - 0xf2 x1 x2 - x1/x2 is the size? data? of the uploaded firmware. - Function unclear. Probably transferring data in 2 byte chunks. - QUERY STORAGE FULL 0x92 @@ -112,4 +106,144 @@ the start of it. lsb/msb is the size. This is followed by a USB bulk write. Unclear. + + WRITE REG + 0x81 reg val + Sets register reg to value val + See pseudo function below. + + + READ REG + 0xf9 reg + Reads register reg + 1: return value (1 byte) + + + SIMSCANNER + 0x86 0 0 0 + + Only for serial. Whatever it does. + + + DUAL CAPTURE + 0x87 0 + + 0: echo (0x87) 1..4: some values. + + + PUSH BUTTON + 0xfd 0 0 + + 0: echo (0xfd) 1: reply value. + + + SNAP + 0x2d + + 0: echo (0xfd) 1: reply value. + + + WAIT EXPOSURE + 0x93 + + 0: echo (0xfd) 1: return value. Wait for 1. + + + SEND DRAM + 0x15 lsb1 msb1 lsb2 msb2 + + Followed by bulk read. parameters are a bit unclear. + + + LOCK SNAP + 0x90 + + + + + FREE SNAP + 0x91 + + + + + RS232 INIT + 0x01 + + Serial only I guess. + + + ERASE IMAGE + 0x59 x + + With x: +
    +
  1. Delete all images. +
  2. Delete the last image. +
+ + + + NORMAL EXIT + 0xfc + + + + + 88 Command + 0x88 + + + + +
+
+void
+DOWNLOAD_DATA(type, buffer, size) {
+	SELECT_PICTURE_TYPE(type);
+	SEND_DRAM(buffer, size);
+}
+
+/* Unclear why and how used */
+void
+SEND_USER_COMMAND(cmd, inputbuffer, inputsize, outputbuffer, outputsize) {
+	SEND_PARAMETER(&cmd, 1);
+	if (inputbuffer && inputsize) {
+		SEND_PARAMETER(inputbuffer, inputsize);
+	}
+	if (outputbuffer && outputsize) {
+		SEND_PARAMETER(&outputsize, 4);
+		DOWNLOAD_DATA(0x21, outputbuffer, outputsize);
+	}
+}
+
+void
+WRITE_REG_Command(byte reg, byte val, int porttype) {
+	// strangely different between USB/SERIAL
+	if (porttype == USB) {
+		byte buf[2];
+		buf[0] = reg;
+		buf[1] = val;
+		SEND_PARAMETERk(buf, 2);
+	} else {
+		call_driver(0x81, reg, val);
+	}
+}
+
+void
+take_picture(int checkstoragefull, int locksnapflag, int waitforexpflag) {
+	byte val;
+
+	if (checkstoragefull) QUERY_STORAGE_FULL():
+	if (locksnapflag) LOCK_SNAP();
+	SNAP();
+	if (waitforexpflag) {
+		do {
+			Sleep(500);
+			WAIT_EXPOSURE(&val);
+		} while (val != 1);
+	}
+	if (locksnapflag) FREE_SNAP();
+}
+