blob: 5c533a973bb555d412462ed43d0c9bf393a4ca34 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright by ZTE Corporation.
3 *
4 * File Name:
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: V1.0
9 * Author: wuhui
10 * Date: 2016-9-6
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19#ifndef _DRVS_CAM_H
20#define _DRVS_CAM_H
21
22
23/****************************************************************************
24* Include files
25****************************************************************************/
26#include "drvs_general.h"
27
28/****************************************************************************
29* Macros
30****************************************************************************/
31//#define ZDRV_DEV_CAMERA "camera" /* device name of camera */
32
33typedef UINT32 PhyAddr;
34typedef UINT8 * T_HalCam_Buff_Addr;
35
36/****************************************************************************
37* Types
38****************************************************************************/
39typedef enum
40{
41 HAL_CAM_BUF_FREE= 0, /* Buffer isn't full filled */
42 HAL_CAM_BUF_READY= 1,
43 HAL_CAM_BUF_BUSY= 2,
44 MAX_HAL_CAM_BUF_FLAG =3
45}T_HalCam_EBufFlag;
46#if defined(_USE_RAW_BUFFER)
47typedef struct
48{
49 T_HalCam_Buff_Addr bufaddr;
50 T_HalCam_EBufFlag bufflag;
51} T_HalSensor_Buff;
52#endif
53/* sensors */
54typedef enum
55{
56 SENSOR_MAIN, /* main sensor */
57 SENSOR_SUB, /* sub sensor */
58 MAX_SENSOR_ID
59} T_ZDrv_SensorId;
60typedef enum
61{
62 //SENSOR_OV9656,
63 //SENSOR_OV7670,
64 //SENSOR_MT9D113,
65 //SENSOR_MT9V113,
66 //SENSOR_HI704,
67 #if defined(_USE_TYPE_GC6133)
68 SENSOR_GC6133,
69 #endif
70 #if defined(_USE_TYPE_BF3A01CS)
71 SENSOR_BF3A01CS,
72 #endif
73 MAX_SENSOR_DEV_TYPE
74} T_ZDrv_Sensor_DevType;
75
76/* sensor info */
77typedef struct
78{
79 T_ZDrv_Sensor_DevType tDevType; /* the sensor now using*/
80 T_ZDrv_SensorId tActivedSensor; /* the sensor now using*/
81 UINT16 uiWidth; /* max pixel width of the actived sensor */
82 UINT16 uiHeight; /* max pixel height of the actived sensor */
83 UINT16 pixelBytes;
84 BOOL fucSetZoom; /*whether to support set_zoom function */
85 BOOL fucSetImgSize; /*whether to support set_img_Size function */
86 BOOL fucSetEffect; /*whether to support set_effect function */
87 BOOL fucSetMirrorFlip; /*whether to support set MirrorFlip function */
88 BOOL fucSetBrightness; /*whether to support set Brightness function */
89 BOOL fucSetContrast; /*whether to support SetContrast function */
90 BOOL fucSetSaturation; /*whether to support SetSaturation function */
91 BOOL fucSetWhiteBalance; /*whether to support SetWhiteBalance function */
92 BOOL fucSetLightMode; /*whether to support SetLightMode function */
93 BOOL fucSetNightMode; /*whether to support SetNightMode function */
94 BOOL fucSetFrameRate; /*whether to support SetFrameRate function */
95
96 //BOOL funcSetExposureCompensation; /*whether to support ExposureCompensation function */
97 BOOL funcSetAntiFlicker;
98
99} T_ZDrv_SensorInfo;
100/* camera frame rate*/
101typedef enum
102{
103 Fps714 = 0,
104 Fps75 ,
105 Fps143 ,
106 Fps15 ,
107 Fps25 ,
108 Fps30 ,
109
110 MAX_FPS_SIZE
111} T_ZDrv_CamFps;
112
113/* output size */
114typedef enum
115{
116 OUTPUT_IMG_SXGA =0,
117 OUTPUT_IMG_VGA,
118 OUTPUT_IMG_QVGA,
119 OUTPUT_IMG_QQVGA,
120 OUTPUT_IMG_CIF ,
121 OUTPUT_IMG_QCIF,
122 OUTPUT_IMG_QQCIF ,
123 OUTPUT_IMG_USVGA,
124
125 MAX_OUTPUT_IMG_SIZE
126} T_ZDrv_CamOutputSize;
127
128/* night mode */
129typedef enum
130{
131 NIGHT_MODE_0, /* level 0*/
132 NIGHT_MODE_1, /* level 1 */
133 NIGHT_MODE_2, /* level 2 */
134
135 MAX_NIGHT_MODE
136} T_ZDrv_CamNightMode;
137
138/* zomm level */
139typedef enum
140{
141 ZOOM_LEVEL_0, /* level 0 */
142 ZOOM_LEVEL_1, /* level 1 */
143 ZOOM_LEVEL_2, /* level 2 */
144 ZOOM_LEVEL_3, /* level 3 */
145 ZOOM_LEVEL_4, /* level 4 */
146
147 MAX_ZOOM_LEVEL
148} T_ZDrv_CamZoom;
149
150/* brightness level */
151typedef enum
152{
153 BRI_LEVEL_0 = 0, /* level 0 (darkest) */
154 BRI_LEVEL_1, /* level 1 */
155 BRI_LEVEL_2, /* level 2 */
156 BRI_LEVEL_3, /* level 3 */
157 BRI_LEVEL_4, /* level 4 */
158 BRI_LEVEL_5, /* level 5 */
159 BRI_LEVEL_6, /* level 6 */
160
161 MAX_BRI_LEVEL
162} T_ZDrv_CamBrightness;
163
164/* contrast level*/
165typedef enum
166{
167 CON_LEVEL_0 = 0, /* level 0 (thinnest) */
168 CON_LEVEL_1, /* level 1 */
169 CON_LEVEL_2, /* level 2 */
170 CON_LEVEL_3, /* level 3 */
171 CON_LEVEL_4, /* level 4 */
172 CON_LEVEL_5, /* level 5 */
173 CON_LEVEL_6, /* level 6 (sharpest) */
174
175 MAX_CON_LEVEL
176} T_ZDrv_CamContrast;
177
178/* saturation level */
179typedef enum
180{
181 SAT_LEVEL_0,
182 SAT_LEVEL_1,
183 SAT_LEVEL_2,
184 SAT_LEVEL_3,
185 SAT_LEVEL_4,
186
187 MAX_SAT_LEVEL
188} T_ZDrv_CamSaturation;
189
190/* camera effect */
191typedef enum
192{
193 EFF_NORMAL = 0,
194 EFF_ANTIQUE,
195 EFF_BLUISH,
196 EFF_GREENISH,
197 EFF_REDISH,
198 EFF_YELLOW,
199 EFF_NEGATIVE,
200 EFF_BLACK_AND_WHITE,
201 EFF_BW_NEGATIVE,
202 EFF_SEPIA_GREEN,
203
204 MAX_EFF_TYPE
205} T_ZDrv_CamEffect;
206
207/* camera whiteblance */
208typedef enum
209{
210 WB_AUTO = 0,
211 WB_INSCANDSENCE,
212 WB_FLUORESCENT,//CWF
213 // WB_FLUORECWF, //cool white FLUORESCENT
214 WB_TUNGSTEN,
215 WB_SUNNY,
216 WB_CLOUDY,
217
218 MAX_WB_MODE
219} T_ZDrv_CamWhiteBalance;
220
221/* camera light mode */
222typedef enum
223{
224 LIGTH_AUTO, /* auto */
225 LIGTH_SUNNY, /* sunny */
226 LIGTH_CLOUDY, /* cloudy */
227 LIGTH_OFFICE, /* office */
228 LIGTH_HOME, /* home */
229 LIGTH_NIGHT, /* night */
230
231 MAX_LIGTH_MODE
232} T_ZDrv_CamLightMode;
233
234/* exposure compesation level */
235typedef enum
236{
237 EV_NEG_4_3 = 0, /* EV -2 */
238 EV_NEG_3_3, /* EV -1.5 */
239 EV_NEG_2_3, /* EV -1 */
240 EV_NEG_1_3, /* EV -0.5 */
241 EV_ZERO, /* EV 0 */
242 EV_POS_1_3, /* EV +0.5 */
243 EV_POS_2_3, /* EV +1 */
244 EV_POS_3_3, /* EV +1.5 */
245 EV_POS_4_3, /* EV +2 */
246
247 MAX_EV_LEVEL
248} T_ZDrv_CamExpCom;
249
250typedef enum
251{
252 HAL_CAM_WORD_MODE_YUV,
253 HAL_CAM_WORD_MODE_RGB,
254
255 MAX_HAL_CAM_WORD_MODE
256}T_HalCam_EWorkMode;
257
258typedef struct
259{
260 PhyAddr *Y;
261 PhyAddr *Cb;
262 PhyAddr *Cr;
263}T_ZDrv_YuvBuf;
264
265/* Image data buffer */
266typedef union
267{
268 T_ZDrv_YuvBuf YuvBuf;
269 PhyAddr *streamDataBuf;
270 PhyAddr*ARGBdataBuf;
271} T_ZDrv_ImageDataBuf;
272/* Pixel format. */
273typedef enum
274{
275 PIXEL_YCbCr400,
276 PIXEL_YCbCr420,
277 PIXEL_YUYV,
278// PIXEL_YCbCr422 = PIXEL_YUYV,
279// PIXEL_YCbCr422H = PIXEL_YUYV,
280// PIXEL_YCbCr422V = PIXEL_YUYV,
281 PIXEL_YCbCr444,
282 PIXEL_RGB_PLANAR,
283 PIXEL_RGB555,
284 PIXEL_RGB565,
285 PIXEL_RGB666,
286 PIXEL_RGB888,
287 PIXEL_ARGB888,
288
289 MAX_PIXEL_FORMAT
290} T_ZDrv_PixelFmt;
291
292/* camera data info */
293typedef struct
294{
295 T_ZDrv_ImageDataBuf dataBuf; /* image data buffer */
296 UINT32 Width; /* image width */
297 UINT32 Height; /* image height */
298 T_ZDrv_PixelFmt pixeFmt; /* pixel format */
299} T_ZDrv_CamDataInfo;
300
301typedef struct
302{
303 UINT32 ySize;
304 UINT32 uSize;
305 UINT32 vSize;
306
307} T_ZDrv_YuvBufSize;
308
309/* Image buffer size */
310typedef union
311{
312 T_ZDrv_YuvBufSize YuvBufSize;
313 UINT32 streamBufSize;
314 UINT32 ARGBBufSize;
315} T_ZDrv_ImageBufSzie;
316
317/* mirror type */
318typedef enum
319{
320 MIR_NONE,
321 MIR_V,
322 MIR_H,
323 MIR_V_H,
324
325 MAX_MIR_TYPE
326} T_ZDrv_MirrorType;
327
328typedef enum
329{
330 FLICKER_50HZ,
331 FLICKER_60HZ,
332
333 MAX_FLICKER_TYPE
334} T_ZDrv_AntiFlicker;
335
336
337/****************************************************************************
338* Constants
339****************************************************************************/
340
341/****************************************************************************
342* Global Variables
343****************************************************************************/
344
345/****************************************************************************
346* Function Prototypes
347****************************************************************************/
348
349
350#endif/*_FILENAME_H*/
351