1 #ifndef _indycam_h_
2 #define _indycam_h_
3 
4 /* I2C address for the Guinness Camera */
5 #define INDYCAM_ADDR			0x56
6 
7 /* Camera version */
8 #define CAMERA_VERSION_INDY		0x10	/* v1.0 */
9 #define CAMERA_VERSION_MOOSE		0x12	/* v1.2 */
10 #define INDYCAM_VERSION_MAJOR(x)	(((x) & 0xf0) >> 4)
11 #define INDYCAM_VERSION_MINOR(x)	((x) & 0x0f)
12 
13 /* Register bus addresses */
14 #define INDYCAM_CONTROL			0x00
15 #define INDYCAM_SHUTTER			0x01
16 #define INDYCAM_GAIN			0x02
17 #define INDYCAM_BRIGHTNESS		0x03
18 #define INDYCAM_RED_BALANCE		0x04
19 #define INDYCAM_BLUE_BALANCE		0x05
20 #define INDYCAM_RED_SATURATION		0x06
21 #define INDYCAM_BLUE_SATURATION		0x07
22 #define INDYCAM_GAMMA			0x08
23 #define INDYCAM_VERSION			0x0e
24 #define INDYCAM_RESET			0x0f
25 #define INDYCAM_LED			0x46
26 #define INDYCAM_ORIENTATION		0x47
27 #define INDYCAM_BUTTON			0x48
28 
29 /* Field definitions of registers */
30 #define INDYCAM_CONTROL_AGCENA		(1<<0)
31 #define INDYCAM_CONTROL_AWBCTL		(1<<1)
32 						/* 2-3 are reserved */
33 #define INDYCAM_CONTROL_EVNFLD		(1<<4)
34 
35 #define INDYCAM_SHUTTER_10000		0x02	/* 1/10000 second */
36 #define INDYCAM_SHUTTER_4000		0x04	/* 1/4000 second */
37 #define INDYCAM_SHUTTER_2000		0x08	/* 1/2000 second */
38 #define INDYCAM_SHUTTER_1000		0x10	/* 1/1000 second */
39 #define INDYCAM_SHUTTER_500		0x20	/* 1/500 second */
40 #define INDYCAM_SHUTTER_250		0x3f	/* 1/250 second */
41 #define INDYCAM_SHUTTER_125		0x7e	/* 1/125 second */
42 #define INDYCAM_SHUTTER_100		0x9e	/* 1/100 second */
43 #define INDYCAM_SHUTTER_60		0x00	/* 1/60 second */
44 
45 #define INDYCAM_BUTTON_RELEASED		(1<<4)
46 #define INDYCAM_LED_ACTIVE		(1<<5)
47 #define INDYCAM_BOTTOM_TO_TOP		(1<<6)
48 
49 #endif
50