Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / usb / shellapps / PencamTool.h
blob5d2e8abbfe8ffefa4db0d897b928237612c1922f
1 #ifndef PENCAMTOOL_H
2 #define PENCAMTOOL_H
4 /* pencam vendor specific requests */
6 #define CMDID_CLEAR_COMMS_ERROR 0x00 /* - 0 - 0 0 */
7 #define CMDID_WRITE_CTRLREG 0x01 /* Tx 1-16 - 0-255 0-3 */
8 #define CMDID_WRITE_SDRAM 0x02 /* Tx 1-16 - 0-1 0 */
9 #define CMDID_UPLOAD_SDRAM 0x03 /* Tx 8 Yes 0 0 */
10 #define CMDID_CANCEL_TRANSACTION 0x04 /* - 0 - 0 0 */
11 #define CMDID_GRAB_IMAGE 0x05 /* Tx 0 - 0-255 0-255 */
12 #define CMDID_SET_IMAGE_INDEX 0x06 /* - 0 - 0-15 0-255 */
13 #define CMDID_SET_CAMERA_MODE 0x07 /* Tx 8 - 0-255 0 */
14 #define CMDID_TEST_CONTROL 0x08 /* Tx 0-8 - 1-4 0-255 */
15 #define CMDID_START_VIDEO 0x09 /* - - Yes 0-3 0 */
16 #define CMDID_STOP_VIDEO 0x0A /* - 0 - 0 0 */
17 #define CMDID_ERASE_FLASH 0x0B /* - 0 - 0-31 0 */
18 #define CMDID_PROGRAM_FLASH 0x0C /* Tx 1-16 - 64-127 0-255 */
19 #define CMDID_SET_AEC_MODE 0x0D /* Tx 0 - 0-3 0 */
20 #define CMDID_SET_CLKDIV 0x0E /* Tx 0 - 0-15 0 */
21 #define CMDID_SET_EXPOSURE 0x0F /* Tx 2 - 0-255 0-255 */
22 #define CMDID_SET_GAIN 0x10 /* Tx 0 - 0-255 0 */
23 #define CMDID_SET_GAIN_AND_EXP 0x11 /* Tx 4 - 0-255 0 */
24 #define CMDID_GET_LAST_ERROR 0x80 /* Rx 2 - 0 0 */
25 #define CMDID_READ_CTRLREG 0x81 /* Rx 1-16 - 0-255 0-3 */
26 #define CMDID_READ_SDRAM 0x82 /* Rx 1-16 - 0-1 0 */
27 #define CMDID_UPLOAD_IMAGE 0x83 /* Rx 16 Yes 0-15 0-255 */
28 #define CMDID_UPLOAD_THUMBNAIL 0x84 /* Rx 16 Yes 0-15 0-255 */
29 #define CMDID_GET_CAMERA_INFO 0x85 /* Rx 16 - 0 0 */
30 #define CMDID_GET_IMAGE_INFO 0x86 /* Rx 16 - 0 0 */
31 #define CMDID_GET_CAMERA_MODE 0x87 /* Rx 8 - 0 0 */
32 #define CMDID_PING 0x88 /* Rx 2 - 0-255 0-255 */
33 #define CMDID_GRAB_UPLOAD 0x89 /* Rx 8 Yes 0-255 0-255 */
34 #define CMDID_GET_COLDATA_SIZE 0x8A /* Rx 2 - 0 0 */
35 #define CMDID_GET_COLDATA 0x8B /* Rx 0-255 - 0 0 */
36 #define CMDID_GET_BUTTON_INFO 0x8C /* Rx 1 - 0 0 */
37 #define CMDID_GET_USER_IO 0x8D /* Rx 8 - 0 0 */
38 #define CMDID_READ_FLASH 0x8E /* Rx 1-16 - 64-127 0-255 */
39 #define CMDID_GET_IMAGE_HEADER 0x8F /* Rx 16 - 0-15 0-255 */
40 #define CMDID_GET_TABLE_ENTRY 0x90 /* Rx 16 - 0-15 0-255 */
41 #define CMDID_GET_ENTRY_POINTS 0x91 /* Rx 16 - 0 0 */
43 #define CAMERR_OK 0
44 #define CAMERR_BUSY 1
45 #define CAMERR_TIMEOUT 2
46 #define CAMERR_V2W_ERROR 3
47 #define CAMERR_COMMS_ERROR 4
48 #define CAMERR_BAD_EXPOSURE 5
49 #define CAMERR_BAD_INDEX 6
50 #define CAMERR_CAMERA_FULL 7
51 #define CAMERR_BAD_COMMAND 8
52 #define CAMERR_BAD_PARAM 9
53 #define CAMERR_BAD_DATALEN 10
54 #define CAMERR_TASK_FAILED 11
55 #define CAMERR_FLASH_PROGRAM_FAILED 12
56 #define CAMERR_BAD_ADDRESS 13
57 #define CAMERR_BAD_PAGE 14
58 #define CAMERR_EXISTING_IMAGE_SMALLER 15
59 #define CAMERR_COMMAND_NOT_ALLOWED 16
60 #define CAMERR_NO_SENSOR_DETECTED 17
61 #define CAMERR_COLOUR_MATRIX_UNAVAILABLE 18
63 #define HWCF_SERIAL 0x01 /* !HWCF_USB */
64 #define HWCF_60HZ 0x02 /* !HWCF_50HZ */
65 #define HWCF_16MBIT 0x04 /* !HWCF_64MBIT */
66 #define HWCF_THUMBS 0x08 /* !HWCF_NOTHUMBS */
67 #define HWCF_VIDEO 0x10 /* !HWCF_NOVIDEO */
68 #define HWCF_READY 0x20 /* !HWCF_READY */
69 #define HWCF_MONO 0x40 /* !HWCF_COLOUR */
70 #define HWCF_MEMAVAIL 0x80 /* !HWCF_NOMEM */
72 #define ICF_CIF 0x01 /* 352*288 */
73 #define ICF_VGA 0x02 /* 640x480 */
74 #define ICF_QCIF 0x04 /* 176*144 */
75 #define ICF_QVGA 0x08 /* 320*240 */
77 struct PCImageHeader
79 ULONG pcih_ImgSize; /* Image data size in bytes */
80 UWORD pcih_ImgWidth; /* Image width in pixels */
81 UWORD pcih_ImgHeight; /* Image height in pixels */
82 UWORD pcih_FineExp; /* Sensor FINE exposure */
83 UWORD pcih_CoarseExp; /* Sensor COARSE exposure */
84 UBYTE pcih_Gain; /* Sensor GAIN */
85 UBYTE pcih_ClkDiv; /* Sensor CLKDIV */
86 UBYTE pcih_AvgPixVal; /* Average pixel value (g_Ap) */
87 UBYTE pcih_Flags; /* Image flags */
90 struct PCImageInfo
92 UWORD pcii_ImgIndex; /* Current image index */
93 UWORD pcii_MaxIndex; /* Max images */
94 UWORD pcii_ImgWidth; /* Image width (in pixels) */
95 UWORD pcii_ImgHeight; /* Image height (in pixels) */
96 ULONG pcii_ImgSize; /* Image size (in bytes) */
97 UBYTE pcii_TbnWidth; /* Thumbnail width (in pixels) */
98 UBYTE pcii_TbnHeight; /* Thumbnail height (in pixels) */
99 UWORD pcii_TbnSize; /* Thumbnail size (in bytes) */
102 struct NepClassPencam
104 struct Node nch_Node; /* Node linkage */
105 struct PsdDevice *nch_Device; /* Up linkage */
106 struct PsdConfig *nch_Config; /* Up linkage */
107 struct PsdInterface *nch_Interface; /* Up linkage */
108 struct PsdPipe *nch_EP0Pipe; /* Endpoint 0 pipe */
109 struct PsdEndpoint *nch_BulkEP; /* Endpoint 2 */
110 struct PsdPipe *nch_BulkPipe; /* Endpoint 2 pipe */
111 IPTR nch_BulkPktSize; /* Size of EP1 packets */
112 struct Task *nch_Task; /* This Task */
113 struct MsgPort *nch_TaskMsgPort; /* Message Port of Subtask */
114 struct Hook nch_ReleaseHook; /* Hook for release function */
116 UWORD nch_FWVers; /* Firmware version */
117 UWORD nch_FWRev; /* Firmware revision */
118 UWORD nch_ASICVers; /* ASIC Version */
119 UWORD nch_ASICRev; /* ASIC Revision */
120 UWORD nch_HWCaps; /* Hardware capabilities */
121 UWORD nch_ImgCaps; /* Image capabilities */
122 UBYTE *nch_RawBuf; /* Pointer to raw buffer */
123 ULONG nch_RawBufSize; /* Size of the allocated buffer */
126 #endif /* PENCAMTOOL_H */