#include #include #include #include #include #include #include #include #include #define ISOBUF_SIZE 1023 #define WIDTH 320 #define HEIGHT 240 #define DEPTH 3 struct usb_dev_info{ char *productName; u_int16_t vendorNo; u_int16_t productNo; int returnNo; }; #define ACT_WRITE 0 #define ACT_READ 1 #define ACT_SETIF 2 /* camera_reg_read flag */ #define RREAD_NOFLAG 0 #define RREAD_IGNORE_ERR 0x01 #define RREAD_QUIET 0x02 typedef struct { u_int8_t act; u_int16_t val; u_int16_t idx; u_int16_t len; #define LENNUM_MAX 31 u_int8_t data[LENNUM_MAX]; } initURB_t; /** Header infomation */ #define SNX_HEADER_LEN 7 #define SNX_SKIPHEADER_LEN 12 #define SNX_SEQ_OFFSET 7 /* offset of sequencial number 00->40->80->c0 (uncompress mode)*/ #define SNX_HDR_SOI 0x00 #define SNX_HDR_EOI 0x40 #define SNX_HDR_SOI2 0x80 #define SNX_HDR_EOI2 0xc0 /** Prototype definition **/ int usbdev_probe(int, struct usb_dev_info *); int sonix_init(int, int id); int usb_set_interface(int, int); int camera_reg_read(int fd, initURB_t const *urb, u_int8_t *val, int flag); int camera_reg_write(int fd, initURB_t const *urb); int find_header (unsigned char *buffer, int length); void bayer2rgb24(unsigned char *, unsigned char *, int);