Subversion Repositories NaviCtrl

Rev

Rev 733 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
728 holgerb 1
#ifndef __CAMCTRL_H
2
#define __CAMCTRL_H
3
 
4
#define CAM_SLAVE_ADDRESS       0x26
5
 
6
// FromCamCtrl.CamStatus
7
#define CAM_STATE_RDY                   0x80   // The camera seems to be ready
8
#define CAM_STATE_REC_ACTIVE    0x40   // Recording Video 
9
#define CAM_STATE_PHOTO_MODE    0x20   // Camera is in Photo Mode
10
#define CAM_STATE_OFF                   0x10   // Camera off but connected
11
#define CAM_STATE_CAM_DISCONN   0x08   // Camera is not connected 
12
#define CAM_STATE_I2C_OK                0x04   // Cam_Ctrl is connected by I2C (set by NC)
13
#define CAM_STATE_ZOOM                  0x02   // Zoom active
14
#define CAM_STATE_PIC_CAPTURED  0x01   // Bit for captured one Photo recently
15
 
16
 
17
// ToCamCtrl.CamCommand
18
#define CAM_CMD_SWITCH_ON       0x80
19
#define CAM_CMD_SWITCH_OFF      0x40
20
#define CAM_CMD_REC_ON          0x20
21
#define CAM_CMD_REC_OFF         0x10
22
#define CAM_CMD_SHUTTER         0x08
732 holgerb 23
 
728 holgerb 24
#define CAM_CMD_RESET_CAM       0x02
25
 
26
//FromCamCtrl.Type
27
#define TYPE_LANC                               1
28
#define TYPE_IR                                 2
29
#define TYPE_MULTI                              3
30
 
31
 
32
typedef struct
33
{
34
  u8 CamStatus;
35
  u16 PhotoCount;
36
  u8 free1;
37
  u8 PPM1Okay;
38
  u8 PPM1Data;
39
  u8 PPM2Okay;
40
  u8 PPM2Data;
41
  u8 Type;             
42
  u8 Version;   // 4 = V1.04   104 = V2.04
43
  u8 Compatible;
44
} __attribute__((packed)) FromCamCtrl_t;
45
extern FromCamCtrl_t FromCamCtrl;
46
 
47
typedef struct
48
{
49
  u8 CamCommand;
50
  u8 ZoomInput;
51
  u8 dummy;
52
  u8 dummy2;
53
} __attribute__((packed)) ToCamCtrl_t;
54
extern ToCamCtrl_t ToCamCtrl;
55
void CamCtrl_GetData(u8);
56
void InitCamCtrl(void);
57
extern u16 CamCtrlTimeout;
730 holgerb 58
void CamCtrl_UpdateData(u8* pRxBuffer, u8 RxBufferSize);                                                               
728 holgerb 59
#endif // __CAMCTRL_H
60