4 /* sonixcam vendor specific requests */
6 #define CMDID_READ_REG 0x00
7 #define CMDID_WRITE_REG 0x08
9 #define SXREG_CHIPID 0x00 /* chip ID (either 0x10/0x11/0x12) */
10 #define SXREG_CTRL 0x01 /* 0x04 enables, 0x01 resets (probably) */
11 #define SXREG_SOMECTRL 0x02 /* 0x44 */
12 #define SXREG_I2C_CTRL 0x08 /* I2C Length in bits [6:4], bit 7 is 2WIRE */
13 #define SXREG_I2C_ADDRESS 0x09 /* I2C Target Address */
14 #define SXREG_I2C_REG 0x0a /* I2C register index */
15 #define SXREG_I2C_DATA0 0x0b /* I2C value byte 0 */
16 #define SXREG_I2C_DATA1 0x0c /* I2C value byte 1 */
17 #define SXREG_I2C_DATA2 0x0d /* I2C value byte 2 */
18 #define SXREG_I2C_DATA3 0x0e /* I2C value byte 3 */
19 #define SXREG_I2C_TERM 0x0f /* I2C termination 0x17 */
21 #define SXREG_WINDOW_LEFT 0x12 /* left start offset of window */
22 #define SXREG_WINDOW_TOP 0x13 /* top start offset of window */
23 #define SXREG_XXX 0x14
24 #define SXREG_WINDOW_WIDTH 0x15 /* width/16 of window */
25 #define SXREG_WINDOW_HEIGHT 0x16 /* height/16 of window */
26 #define SXREG_VID_CTRL_1 0x17 /* some control (0x28 on init), 0x01 low quality compression */
27 #define SXREG_VID_CTRL_2 0x18 /* some control, 0x80 enables compression, 0x10 = 1/2, 0x20 = 1/4 */
28 #define SXREG_VID_CTRL_3 0x19 /* some control, 0x20 enables compression, 0x50 disables */
30 #define BRIDGE_SN9C102 0x0102
31 #define BRIDGE_SN9C103 0x0103
32 #define BRIDGE_SN9C105 0x0105
33 #define BRIDGE_SN9C120 0x0120
37 ULONG scih_ImgSize
; /* Image data size in bytes */
38 UWORD scih_ImgWidth
; /* Image width in pixels */
39 UWORD scih_ImgHeight
; /* Image height in pixels */
42 #define BUF_EMPTY 0 /* Buffer may be reused */
43 #define BUF_READY 1 /* Buffer is filled */
44 #define BUF_BUSY 2 /* bayer in progress */
46 struct NepClassSonixcam
48 struct Node nch_Node
; /* Node linkage */
49 struct PsdDevice
*nch_Device
; /* Up linkage */
50 struct PsdInterface
*nch_Interface
; /* Up linkage */
51 struct PsdPipe
*nch_EP0Pipe
; /* Endpoint 0 pipe */
52 struct PsdEndpoint
*nch_IsoEP
; /* Endpoint 2 */
53 struct PsdRTIsoHandler
*nch_RTIso
; /* RT Iso */
54 struct Task
*nch_Task
; /* This Task */
55 struct MsgPort
*nch_TaskMsgPort
; /* Message Port of Subtask */
56 struct Hook nch_ReleaseHook
; /* Hook for release function */
58 UWORD nch_BridgeID
; /* Bridge ID */
60 IPTR nch_IfNum
; /* Interface number (usually 0, but who knows... */
61 LONG nch_ImgDoneSig
; /* Image Done signal number */
63 struct Hook nch_InReqHook
; /* Hook for input */
64 struct Hook nch_InDoneHook
; /* Hook for input */
66 UWORD nch_I2CAddr
; /* Sensor I2C Address */
67 UWORD nch_ImgCaps
; /* Image capabilities */
68 UBYTE
*nch_RawBuf
[3]; /* Triple buffering for iso data */
69 ULONG nch_RawBufSize
; /* Size of each allocated buffer */
71 ULONG nch_HeaderSize
; /* Size of header according to bridge */
73 UWORD nch_NextBufNum
; /* Number of next buffer to view */
74 UWORD nch_LastDoneNum
; /* Number of last ready buffer */
75 UWORD nch_BufState
[3]; /* Buffer States */
77 UWORD nch_IsoBufNum
; /* Buffer currently used by iso transfer */
78 UBYTE
*nch_CurrIsoBuf
; /* Current ISO buffer */
79 ULONG nch_IsoBufPos
; /* Offset in Iso Buffer */
81 UBYTE
*nch_ImgBuf
; /* RGB unbayered image */
82 ULONG nch_ImgBufSize
; /* Size of RGB image */
84 UBYTE nch_Reg
[256]; /* Shadow of registers */
88 #endif /* SONIXCAMTOOL_H */