UnitreeCameraSDK  1.0.1
unitree stereo camra apis
camera_api.h
1 #ifndef CAMERA_API_H
2 #define CAMERA_API_H
3 #include <stdint.h>
4 
5 #define MAX_PATH 260
6 typedef unsigned char BYTE;
7 typedef unsigned short WORD;
8 typedef unsigned long DWORD;
9 typedef unsigned long ULONG;
10 typedef void *PVOID;
11 #define VOID void
12 
13 class info_camera_os //get information from software
14 {
15 public:
16  WORD vid;
17  WORD pid;
18  WORD bcdDevice;
19  char deviceID[MAX_PATH];
20  char device[MAX_PATH];
21  BYTE icType;
22  uint64_t busnum;
23  uint64_t devnum;
24  char location[MAX_PATH];
25 
26 };
27 
28 class info_camera_String //get information from software
29 {
30 public:
31  char iManufacturer[MAX_PATH];
32  char iProduct[MAX_PATH];
33  char iSerialNumber[MAX_PATH];
34 
35 };
36 
37 extern "C" int32_t Camera_Count(int *Number);
38 
39 
40 extern "C"
41  int32_t
42 Camera_UnInit();
43 
44 
45 struct _Device_Point_;
46 
47 typedef int32_t(*H_Fun_Pb) (struct _Device_Point_ *, BYTE*);
48 
49 
50 
51 
52 typedef int32_t(*H_Fun_HPb) (struct _Device_Point_ *, int32_t, BYTE*);
53 
54 
55 
56 typedef int32_t(*H_Fun_WPb) (struct _Device_Point_ *, WORD, BYTE*);
57 
58 typedef int32_t(*H_Fun_WB) (struct _Device_Point_ *, WORD, BYTE);
59 
60 
61 
62 typedef int32_t(*H_Fun_BWPw) (struct _Device_Point_ *, BYTE, WORD, WORD*);
63 
64 typedef int32_t(*H_Fun_BWW) (struct _Device_Point_ *, BYTE, WORD, WORD);
65 
66 typedef int32_t(*H_Fun_IPb) (struct _Device_Point_ *, int, BYTE*);
67 
68 
69 typedef int32_t(*H_Fun_Cinfo) (struct _Device_Point_ *, info_camera_os*);
70 
71 
72 typedef int32_t(*H_Fun_CinfoStr) (struct _Device_Point_ *, info_camera_String*);
73 
74 
75 
76 typedef int32_t(*Input_GPIO_Get) (struct _Device_Point_ *, ULONG, BYTE*);
77 
78 typedef int32_t(*Output_GPIO_Set) (struct _Device_Point_ *, ULONG, BYTE);
79 
80 typedef int32_t(*Input_GPIO_Init) (struct _Device_Point_ *, ULONG);
81 
82 typedef int32_t(*Output_GPIO_Init) (struct _Device_Point_ *, ULONG);
83 
84 
85 
86 
87 
88 typedef int32_t(*pExID) (struct _Device_Point_ *, BYTE*);
89 
90 
91 typedef void* (*pCUSTOMERFun) (struct _Device_Point_ *, WORD, BYTE*, BYTE);
92 
93 
94 
95 
96 typedef struct _Device_Point_
97 {
98  /***************所有的信息均为只读不允许修改赋值******************/
99  //节点定位
100  uint32_t u_index;
101 
102  //Flash类型
103  BYTE FlashType;
104 
105 
106  BYTE ISP_ID;
107  //节点信息
108  PVOID p_device;
109 
110 
111 
112  //读取Flash 4K大小
113  //参数 sizeof(buff) >= 0x1000
114  //return -1 dll没有被加载 0成功
115  H_Fun_IPb Falsh_R;
116 
117 
118  //写Flash 4K大小
119  //参数 sizeof(buff) >= 0x1000
120  //return -1 dll没有被加载 0成功
121  H_Fun_IPb Falsh_W;
122 
123 
124  H_Fun_Cinfo pInfo;
125 
126 
127 
128 
129  H_Fun_WB Set_ISP_Reg;
130 
131  H_Fun_WPb Get_ISP_Reg;
132 
133 
134  H_Fun_BWW Set_Sensor_Reg;
135 
136  H_Fun_BWPw Get_Sensor_Reg;
137 
138 
139  /****************************************
140  函数功能: 获取Gpio输入状态
141  函数指针原型:
142  int32_t
143  Camera_Get_Input_GPIO_Api(pDevice_Point pMes,
144  ULONG GPIO_ID,
145  BYTE*status)
146 
147  形参说明:
148  pMes : 节点;
149  GPIO_ID : GPIO枚举类型
150  *status : 状态 0->低 1->高
151 
152  返回值:
153  S_OK == 0
154  指针为空不支持该操作
155  *****************************************/
156 
157  Input_GPIO_Get Input_Gpio_Get;
158 
159 
160  /****************************************
161  函数功能: 设置Gpio输出值
162  函数指针原型:
163  int32_t
164  int32_t
165  Camera_Set_Output_GPIO_Api(pDevice_Point pMes,
166  ULONG GPIO_ID,
167  BYTE status)
168 
169  形参说明:
170  pMes : 节点;
171  GPIO_ID : GPIO枚举类型
172  status : 状态 0->低 1->高
173 
174  返回值:
175  S_OK == 0
176  指针为空不支持该操作
177  *****************************************/
178 
179  Output_GPIO_Set Output_Gpio_set;
180 
181 
182  /****************************************
183  函数功能: Gpio输入模式初始化
184  函数指针原型:
185  int32_t
186  Input_GPIO_Init_Api (pDevice_Point pMes,
187  ULONG GPIO_ID)
188 
189  形参说明:
190  pMes : 节点;
191  GPIO_ID : GPIO枚举类型
192 
193  返回值:
194  S_OK == 0
195  指针为空不支持该操作
196  *****************************************/
197 
198  Input_GPIO_Init Input_Gpio_init;
199 
200 
201  /****************************************
202  函数功能: Gpio输出模式初始化
203  函数指针原型:
204  int32_t
205  Output_GPIO_Init_Api (pDevice_Point pMes,
206  ULONG GPIO_ID)
207 
208  形参说明:
209  pMes : 节点;
210  GPIO_ID : GPIO枚举类型
211 
212  返回值:
213  S_OK == 0
214  指针为空不支持该操作
215  *****************************************/
216 
217  Output_GPIO_Init Output_Gpio_init;
218 
219 
220 
221 
222 
223  PVOID RES_1;
224 
225 
226 
227 
228  PVOID RES_2;
229 
230 
231 
232 
233  H_Fun_CinfoStr pInfoStr;
234 
235 
236  pExID pExid_R;
237 
238 
239  pExID pExid_W;
240 
241 
242  PVOID respoint;
243 
244  pCUSTOMERFun pCustomer;
245 
246 
248 
249 
250 extern "C"
251 pDevice_Point
252 Camera_Device_Point_Init(int tar_device_index);
253 
254 extern "C"
255 VOID
256 Camera_Device_Point_UnInit(pDevice_Point *PPDevice);
257 
258 extern "C"
259 int32_t
260 Camera_Get_information_Api(pDevice_Point pMes, info_camera_os* pinfo);
261 
262 extern "C"
263  int32_t
264 Camera_Flash_R_Api(pDevice_Point pMes, int piece_Index, BYTE*buff);
265 
266 extern "C"
267  int32_t
268 Camera_Flash_W_Api(pDevice_Point pMes, int piece_Index, BYTE*buff);
269 
270 extern "C"
271  int32_t
272 Camera_Get_Info_String_Api(pDevice_Point pMes, info_camera_String* Str);
273 
274 extern "C"
275 void*
276 Camera_Customer_Api(pDevice_Point pMes, uint16_t id, uint8_t*pdata, uint8_t len);
277 
278 extern "C"
279 int32_t
280 Camera_Updata(pDevice_Point pMes, uint8_t *FW, uint32_t SIZE, float *pf_Schedule);
281 #endif // CAMERA_API_H
282 
Definition: camera_api.h:13
Definition: camera_api.h:96
Definition: camera_api.h:28