1 #ifndef USB_REMOTE_H
2 #define USB_REMOTE_H
3
4
5
6
7
8
9
10 extern int handle_usb_remote();
11 extern void wait_until_remote_button_is_released(void);
12 extern void usb_remote_key( void );
13 extern int get_usb_bit();
14 extern int get_hdmi_hpd_bit();
15 extern int get_analog_av_bit();
16 extern int get_remote_state();
17 extern int get_usb_power(int edge);
18 extern void clear_usb_power();
19 extern void set_usb_remote_state();
20 extern void usb_remote_status_led(int);
21 extern void kbd_synch_delay(int);
22
23 extern int usb_HPtimer_handle;
24 extern int start_usb_HPtimer(int);
25 extern int stop_usb_HPtimer();
26 extern int force_usb_state(int);
27
28 extern int GetAdChValue(int);
29
30
31
32
33
34 extern int usb_remote_active;
35 extern int usb_sync_wait_flag;
36 extern int bracketing_timeout;
37 extern int forced_usb_port ;
38
39 #undef USB_REMOTE_DEBUGGING
40
41 #undef USB_REMOTE_RECORD
42
43
44 #define NUM_USB_INPUT_DRV 5
45 #define NUM_USB_MODULES 10
46
47
48 enum REMOTE_INPUT_TYPE {
49 REMOTE_INPUT_USB,
50 REMOTE_INPUT_HDMI_HPD,
51 REMOTE_INPUT_ANALOG_AV,
52 REMOTE_INPUT_AD_CHANNEL,
53 } ;
54
55 typedef struct {
56 const char *name;
57 enum REMOTE_INPUT_TYPE type;
58 } remote_input_desc_t;
59
60 enum {
61 INVALID_STATE ,
62 INVALID_DEVICE ,
63 INVALID_MODULE
64 } ;
65
66
67 enum SWITCH_TYPE {
68 SW_NONE = 0 ,
69 SW_ONE_PRESS ,
70 SW_TWO_PRESS ,
71 SW_RICOH_CA1
72 } ;
73
74 enum CONTROL_MODULE {
75 RMT_NONE = 0 ,
76 RMT_HALF_PRESS_FULL_PRESS ,
77 RMT_AUTO_1 ,
78 RMT_AUTO_2 ,
79 RMT_CONTINUOUS ,
80 RMT_ZOOM ,
81 RMT_BRACKETING
82 } ;
83
84 enum VIRTUAL_REMOTE_STATE {
85 REMOTE_RESET = 0 ,
86 REMOTE_RELEASE,
87 REMOTE_HALF_PRESS,
88 REMOTE_FULL_PRESS
89 } ;
90
91 enum DRIVER_STATE {
92 SW_RESET = 0 ,
93 SW_IDLE,
94 SW_POWER_CONNECT,
95 SW_POWER_ON,
96 SW_POWER_DISCONNECT,
97 SW_FULL_PRESS_ACTIVE ,
98 SW_SHORT_PRESS ,
99 SW_CANCEL_PULSE ,
100 SW_HALF_PRESS,
101 SW_FULL_PRESS ,
102 SW_FULL_PRESS_RESET,
103 SW_PRESS ,
104 SW_RELEASE ,
105 SW_CANCEL,
106
107 SW_CA1_1XX,
108 SW_CA1_10X,
109 SW_CA1_100,
110 SW_CA1_101,
111 SW_CA1_11
112
113 } ;
114
115 enum LOGIC_MODULE_STATE {
116 LM_RESET = 0 ,
117 LM_RELEASE,
118 LM_HALF_PRESS,
119 LM_FULL_PRESS,
120 LM_START_RECORD ,
121 LM_RECORDING ,
122 LM_STOP_RECORDING ,
123 LM_KEY_PRESS
124 } ;
125
126 enum USB_POWER_STATE {
127 USB_POWER_OFF,
128 USB_POWER_ON
129 } ;
130
131 enum CAMERA_MODE {
132 CAMERA_MODE_SHOOTING ,
133 CAMERA_MODE_PLAYBACK ,
134 CAMERA_MODE_VIDEO
135 } ;
136
137 enum ZOOM_MODE {
138 ZOOM_STEP_OUT = 1,
139 ZOOM_STEP_IN ,
140 ZOOM_SHOOT ,
141 ZOOM_FULL_OUT ,
142 ZOOM_FULL_IN
143 } ;
144
145 enum PLAYBACK_MODE {
146 PLAYBACK_NEXT =1 ,
147 PLAYBACK_REVERSE ,
148 PLAYBACK_LEFT ,
149 PLAYBACK_RIGHT
150 } ;
151
152
153 enum GET_USB_PWR {
154 SINGLE_PULSE,
155 USB_STATE ,
156 BUFFERED_PULSE ,
157 PULSE_COUNT,
158 LM_PULSE_COUNT,
159 HPTIMER_ERROR_COUNT
160 } ;
161
162
163
164 #define RMT_DISABLED 0
165 #define RMT_ENABLED 1
166
167
168
169 #define REMOTE_CLICK_TIME 100
170 #define DEBOUNCE_TIME 10
171 #define FULL_PRESS_PULSE_TIME 1000
172 #define MAX_FULL_PRESS_DELAY 1000
173 #define CA1_MIN_HALFPRESS_TIME 10
174 #define CA1_MAX_HALFPRESS_TIME 50
175 #define CA1_CANCEL_PULSE_TIME 100
176 #define CA1_MIN_FULLPRESS_TIME 100
177 #define CA1_MAX_FULLPRESS_TIME 300
178 #define CA1_FULL_WAIT_PRESS_TIMEOUT 30000
179
180 #define DELAY_TIMEOUT 10000
181
182 #define BRACKETING_TIMEOUT 10000
183
184
185
186
187
188 extern enum SWITCH_TYPE switch_type ;
189 extern enum VIRTUAL_REMOTE_STATE virtual_remote_state;
190 extern enum DRIVER_STATE driver_state;
191 extern enum LOGIC_MODULE_STATE logic_module_state ;
192 extern enum USB_POWER_STATE usb_state ;
193 extern enum CAMERA_MODE camera_mode ;
194
195 #endif