[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/cp/ps/driver/inc/ref/drvs_aw9523b_blg.h b/cp/ps/driver/inc/ref/drvs_aw9523b_blg.h
new file mode 100644
index 0000000..ed220a5
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_aw9523b_blg.h
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2016, ZTE Corporation.
+ *
+ * File Name: drvs_aw9523b.h
+ * File Mark:
+ * Description: Provide backlight control interface for lcd module.
+ * Others:
+ * Version: V1.0
+ * Author: Zhou Tianbao
+ * Date: 2016-9-26
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_AW9523B_BLG_H
+#define _DRVS_AW9523B_BLG_H
+
+#include "drvs_general.h"
+
+/*******************************************************************************
+* Function: kpd_SetLcdBlg
+* Description: Set lcd backlight.
+* Parameters:
+* Input:
+* brightness:
+* Output:
+* None
+* Returns:
+* DRV_SUCCESS or error code
+* Others:
+*******************************************************************************/
+SINT32 kpd_SetLcdBlg(UINT8 brightness);
+
+/*******************************************************************************
+* Function: kpd_GetLcdBlgBrightness
+* Description: Get lcd backlight.
+* Parameters:
+* Input:
+* None:
+* Output:
+* pBrightness: where brightness value is stored.
+* Returns:
+* DRV_SUCCESS or error code
+* Others:
+*******************************************************************************/
+SINT32 kpd_GetLcdBlgBrightness(UINT8 *pBrightness);
+
+
+#endif
diff --git a/cp/ps/driver/inc/ref/drvs_fm_rda5802.h b/cp/ps/driver/inc/ref/drvs_fm_rda5802.h
new file mode 100644
index 0000000..6fe9384
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_fm_rda5802.h
@@ -0,0 +1,184 @@
+/***********************************************************************
+* Copyright (C) 2016, ZTE Corporation.
+*
+* File Name: hal_fm_rda5802.h
+* File Mark:
+* Description: fm RDA5802 chiper hal interface declaration.
+* Others:
+* Version: v1.0
+* Author: taochao
+* Date: 2016-03-09
+*
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+
+* History 2:
+**********************************************************************/
+#ifndef _HAL_FM_RDA5802_H
+#define _HAL_FM_RDA5802_H
+
+//#include "drv_pub.h"
+#include "oss_api.h"
+#include "oss_pub.h"
+
+#define FM_BAND_LOWER 8700 /*87MHz*/
+#define FM_BAND_UPPER 10800 /*108MHz*/
+#define FM_CHAN_SPACING 10 /*100KHz */
+
+/*fm volume level limits*/
+typedef enum
+{
+ FM_VOLUME_MIN = 0, //mute
+ FM_VOLUME_MAX = 15
+}T_HalFm_Volume_Level;
+
+//stc --- Seek/Tune complete
+//rssi--- Receive signal strength indicator
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 enable:1; // 0
+ UINT16 softReset:1; // 1
+ UINT16 :2; // 2-3
+ UINT16 clkMode:3; // 4-6
+ UINT16 seekMode:1; // 7
+ UINT16 seek:1; // 8
+ UINT16 seekUp:1; // 9
+ UINT16 clkDirectMode:1; // 10
+ UINT16 :1;
+ UINT16 bassBoost:1; // 12
+ UINT16 monoSel:1; // 13
+ UINT16 disMute:1; //14
+ UINT16 disHighZ:1; // 15
+ }bitSet;
+}T_Rda5802_Reg02H;
+
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 channelSpace:2; // 0-1
+ UINT16 bandSel:2; // 2-3
+ UINT16 tune:1; // 4
+ UINT16 :1; //5
+ UINT16 channelSel:10; //6-15
+ }bitSet;
+}T_Rda5802_Reg03H;
+
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 gpio1:2; // 0-1
+ UINT16 gpio2:2; // 2-3
+ UINT16 gpio3:2; // 4-5
+ UINT16 i2sEnable:1; // 6
+ UINT16 :1; // 7
+ UINT16 afcDisable:1; // 8
+ UINT16 softMuteEnable:1; // 9
+ UINT16 :1; // 10
+ UINT16 de:1; // 11
+ UINT16 :2; // 12-13
+ UINT16 stcIntrEnable:1; // 14
+ }bitSet;
+}T_Rda5802_Reg04H;
+#if 0
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 volume:4; // 0-3
+ UINT16 lnaIcSel:2; // 4-5
+ UINT16 lnaPortSel:2; // 6-7
+ UINT16 seekThreshold:7; // 8-14
+ UINT16 intrMode:1; //15
+ }bitSet;
+}T_Rda5802_Reg05H;
+#else
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 volume:4; // 0-3
+ UINT16 :2; // 4-5
+ UINT16 lnaPortSel:2; // 6-7
+ UINT16 seekThreshold:4; // 8-11
+ UINT16 :1; // 12
+ UINT16 seekMode:2; // 13-14
+ UINT16 intrMode:1; //15
+ }bitSet;
+}T_Rda5802_Reg05H;
+#endif
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 noSet:4; // 0-3
+ UINT16 i2sWsCnt:4; // 4-7
+ UINT16 :4; // 8-11
+ UINT16 i2sModeSel:1; // 12
+ UINT16 openmode:2; // 13-14
+ }bitSet;
+}T_Rda5802_Reg06H;
+
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 readChannel:10; // 0-9
+ UINT16 stereo:1; // 10
+ UINT16 :2; // 11-12
+ UINT16 seekFail:1; // 13
+ UINT16 stc:1; //14
+ }bitSet;
+}T_Rda5802_Reg0AH;
+
+typedef union
+{
+ UINT16 value;
+ struct
+ {
+ UINT16 :7; // 0-6
+ UINT16 fmReady:1; // 7
+ UINT16 fmTrue:1; // 8
+ UINT16 rssi:7; // 9-15
+ }bitSet;
+}T_Rda5802_Reg0BH;
+
+typedef enum
+{
+ FM_RESET = 1,
+ FM_TUNE = 2,
+ FM_WORK = 3,
+ FM_SEEK = 4,
+ FM_SLEEP = 5
+}T_Rda5802_State;
+
+typedef struct _T_Rda5802_DevInfo
+{
+ T_Rda5802_Reg02H reg02h;
+ T_Rda5802_Reg03H reg03h;
+ T_Rda5802_Reg04H reg04h;
+ T_Rda5802_Reg05H reg05h;
+ T_Rda5802_Reg06H reg06h;
+ T_Rda5802_Reg0AH reg0Ah;
+ T_Rda5802_Reg0BH reg0Bh;
+
+ T_Rda5802_State devState;
+ BOOL canWaitSTC;
+ ZOSS_SEMAPHORE_ID stcSema;
+}T_Rda5802_DevInfo;
+
+
+#endif
diff --git a/cp/ps/driver/inc/ref/drvs_gpio_ref.h b/cp/ps/driver/inc/ref/drvs_gpio_ref.h
new file mode 100644
index 0000000..fa2e4d4
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_gpio_ref.h
@@ -0,0 +1,92 @@
+/*******************************************************************************
+* Copyright (C) 2014, ZTE Corporation.
+*
+* File Name:
+* File Mark:
+* Description:
+* Others:
+* Version: V1.0
+* Author: shideyou
+* Date: 2014-04-01
+* History 1:
+* Date:
+* Version:
+* Author:
+* Modification:
+* History 2:
+********************************************************************************/
+#ifndef __DRVS_GPIO_REF_H_
+#define __DRVS_GPIO_REF_H_
+
+/*************************************************************************
+* Include files *
+*************************************************************************/
+#include "drvs_gpio.h"
+/*************************************************************************
+* Macro *
+*************************************************************************/
+
+
+/**************************************************************************
+* Types *
+**************************************************************************/
+typedef struct _T_ZDrvGpio_Config{
+ UINT32 number; //GPIO number
+ const char *name;
+}T_ZDrvGpio_Config;
+
+typedef struct _T_Gpio_ConfigData{
+ T_ZDrvGpio_Config *config_table;
+ UINT32 ngpios;
+}T_Gpio_ConfigData;
+
+typedef struct _T_Gpio_Init{
+ UINT32 number; //gpio number
+ UINT32 topFuncSel; //top func
+ UINT32 pdFuncSel; //pd func
+ UINT32 aonFuncSel; //aon func
+ UINT32 pullUpDownSel; //up down sel
+ T_ZDrvGpio_IoDirection inout;
+ T_ZDrvGpio_IoVal highlow;
+}T_Gpio_Init;
+
+typedef struct _T_Gpio_InitData{
+ T_Gpio_Init *init_table;
+ UINT32 ngpios;
+}T_Gpio_InitData;
+
+
+/**************************************************************************
+* Global Variable *
+**************************************************************************/
+
+
+/**************************************************************************
+* Function Prototypes *
+**************************************************************************/
+
+
+/**************************************************************************
+* Function Defines *
+**************************************************************************/
+
+/**************************************************************************
+* Functin: Gpio_GetConfig
+* Description: This function is used to get the table of gpio config.
+* Parameters:
+* Input:
+* NONE
+*
+* Output:
+* pointer of config table
+*
+* Returns:
+* NONE
+*
+* Others:
+* None.
+**************************************************************************/
+VOID Gpio_GetConfigTable(T_Gpio_ConfigData *gpio_conf, T_Gpio_InitData *gpio_init);
+
+
+#endif
diff --git a/cp/ps/driver/inc/ref/drvs_he43106.h b/cp/ps/driver/inc/ref/drvs_he43106.h
new file mode 100644
index 0000000..35d1e92
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_he43106.h
@@ -0,0 +1,122 @@
+
+/**************************************************************************
+ *
+ *Copyright (c) 2013 ZTE Corporation.
+ *
+ * Ä£ ¿é Ãû :
+ * ÎÄ ¼þ Ãû : drvs_he43106.h
+ * Ïà¹ØÎļþ :
+ * ʵÏÖ¹¦ÄÜ : HE43106оƬÏà¹ØÐÅÏ¢
+ * ×÷ Õß : qihongfang
+ * °æ ±¾ : V1.0
+ * Íê³ÉÈÕÆÚ : 2014-12-23
+ *
+ * ÆäËü˵Ã÷ :
+ *
+ * Ð޸ļǼºÅ ÈÕÆÚ ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+* ---------------------------------------------------------------------
+* 1 2014.12.23 Æëºì·¼ н¨
+ **************************************************************************/
+
+#ifndef _DRVS_HE43106_H
+#define _DRVS_HE43106_H
+
+#include "drvs_general.h"
+
+#define HE43106_I2C_SLAVE_ADDR0 0x3A
+#define I2C_BUS_FREQ (2*1000*1000)
+#define HE43106_ALL_BITS 0xFF
+
+
+#define HE43106_BITFVAL(var, lsh) ( (var) << (lsh) )
+#define HE43106_BITFMASK(wid, lsh) ( ((1U << (wid)) - 1) << (lsh) )
+
+//#define BIT(n) (UINT8)(1<<(n))
+//#define CHARGER "zte_charger"
+#define GPIOFUNC_FUNC 1
+
+#define BOOST_REG 0x00
+#define BLED_REG 0x01
+#define FLASHLIGHT_REG 0x02
+#define INTERRRUPT_MASK_REG 0x03
+#define INTERRRUPT_REG 0x04
+#define CHARGE_REG 0x05
+#define CP_REG 0x06
+#define TTC_TIMEOUT_REG 0x07
+#define MCU_OPTION_0_REG 0x10
+#define MCU_OPTION_1_REG 0x11
+
+
+/*define for 0x00 BOOST_REG*/
+#define OV_TEMP (1<<7)
+#define BOOST_OVERLOAD_LATCH (1<<6)
+#define LOWBAT_DETECT (1<<5)
+#define NOLOAD_DETECT (1<<4)
+#define BOOST_EN (1<<3)
+#define DISCHARGE_ON 2
+#define MCU_DISCHARGE_ON 1
+#define MCU_DISCHARGE_EN 0
+
+/*define for 0x01 BLED_REG*/
+#define MCU_BLED_EN 4
+#define MCU_BLED4_ON 3
+#define MCU_BLED3_ON 2
+#define MCU_BLED2_ON 1
+#define MCU_BLED1_ON 0
+
+
+/*define for 0x03 INTERRRUPT_MASK_REG*/
+#define MCU_INT_PIN_EN 7
+#define MASK_ABNORMAL_INT 4
+#define MASK_CP_INT 3
+#define MASK_CHARGE_INT 2
+#define MASK_NOLOAD_DET_INT 1
+#define MASK_LOWBAT_INT 0
+#define MASK_ALL_INT 0x9f
+
+/*define for 0x04 INTERRRUPT_REG*/
+#define ABNORMAL_INT (1<<4)
+#define CP_INT (1<<3)
+#define CHARGE_INT (1<<2)
+#define NOLOAD_DET_INT (1<<1)
+#define LOWBAT_INT (1<<0)
+#define CHG_INT_ALL 0x1f
+
+/*define for 0x05 CHARGE_REG*/
+#define CHARGE_DISABLE 6//(1<<6)
+#define CHARGE_TIMEOUT (1<<3)
+#define CHARGE_DONE (1<<2)
+#define CHARGE_IN_PROGRESS (1<<1)
+#define CHARGE_VIN_GOOD (1<<0)
+
+/*define for 0x06 CP_REG*/
+#define FORCE_CP_ENABLE 6
+#define CP3_HIGH 3
+#define CP2_HIGH 2
+#define CP1_HIGH 1
+#define CP0_HIGH 0
+
+/*define for 0x07 TTC_TIMEOUT_REG*/
+#define SW_RESET_CTRL1 7
+#define CHARGE_TIMOUT_SEL 0/*bit 0~2*/
+
+/*define for 0x10 MCU_OPTION_0_REG*/
+#define MCU_OL_LED_BLANK_DIS 7
+#define CP_OPTION 5
+#define MCU_CABLE_CPS_EN 4
+#define MCU_BES_OUT_SEL 3
+#define MCU_VBAT_REGULATION 0
+
+/*define for 0x11 MCU_OPTION_0_REG*/
+#define SW_RESET_CTRL2 7
+#define CHARGE_1A 5
+#define MCU_SEL_0P1S 4
+#define MCU_CHARGE_TIMEOUT_EN 3
+#define CP_PROCESS_BYPASS 2
+#define MCU_MODE 0
+
+SINT32 led_Reset(VOID);
+SINT32 chg_ChargerReset(VOID);
+
+#endif/*END of _DRVS_HE43106_H*/
+
diff --git a/cp/ps/driver/inc/ref/drvs_pm.h b/cp/ps/driver/inc/ref/drvs_pm.h
new file mode 100644
index 0000000..98c0170
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_pm.h
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (C) 2010, ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: V1.0
+ * Author: yuxiang
+ * Date: 2013-9-4
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_PM_H
+#define _DRVS_PM_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+typedef enum _T_ZDrvPmic_Enable{
+ PM_DISABLE = 0,
+ PM_ENABLE,
+ PM_ENABLE_NOT_SUPPORT = -100,
+ PM_ENABLE_MAX_STATUS = -255
+} T_ZDrvPmic_Enable;
+
+typedef enum _T_ZDrvPmic_NrmMode{
+ PM_NRMMODE_AUTO = 0,
+ PM_NRMMODE_PFM,
+ PM_NRMMODE_PWM,
+ PM_NRMMODE_NOT_SUPPORT = -100,
+ PM_NRMMODE_MAX_STATUS = -255
+}T_ZDrvPmic_NrmMode;
+
+typedef enum _T_ZDrvPmic_SlpMode{
+ PM_SLPMODE_AUTO_NORMAL = 0, //auto in dcdc, normal in ldo
+ PM_SLPMODE_ECO_NRMV, //normal voltage
+ PM_SLPMODE_ECO_SLPV, //sleep voltage
+ PM_SLPMODE_OFF, //OFF
+ PM_SLPMODE_NOT_SUPPORT = -100,
+ PM_SLPMODE_MAX_STATUS = -255
+}T_ZDrvPmic_SlpMode;
+
+//consumer
+typedef enum _T_ZDrvPmic_Regulator{
+ VCORE0 = 0,
+ VCORE1,
+ VDDR,
+ VMMC,
+ VSD0,
+ VSD1,
+ VIO_LO,
+ VIO_HI,
+ VUSB_0V9,
+ VUSB_3v3,
+ VPLL_LO,
+ VPLL_HI,
+ VSIM1,
+ VSIM2,
+ VRF_LO,
+ VRF_HI,
+ VRF_SW,
+ VPA,
+ VCTCXO1,
+ VCTCXO2,
+ VSSBUF,
+ VRTC,
+} T_ZDrvPmic_Regulator;
+
+typedef enum _T_ZDrvPmic_Vcore{
+ PM_VOLT_0_800 = 0,
+ PM_VOLT_0_850 , //output V,
+ PM_VOLT_0_875 , //output V,
+ PM_VOLT_0_900 , //output V,
+ PM_VOLT_0_925 , //output V,
+ PM_VOLT_0_950 , //output V,
+ PM_VOLT_1_100 , //output V,
+ PM_VOLT_1_150 , //output V,
+ PM_VOLT_1_200 , //output V,
+ PM_VOLT_1_250 , //output V,
+ PM_VOLT_1_600 , //output V,
+ PM_VOLT_1_800 , //output V,
+ PM_VOLT_2_750 , //output V,
+ PM_VOLT_2_800 , //output V,
+ PM_VOLT_2_850 , //output V,
+ PM_VOLT_3_000 , //output V,
+ PM_VOLT_3_300 , //output V,
+ PM_VOLT_3_600 , //output V,
+ PM_VOLT_NOT_SUPPORT = -100,
+ PM_VOLT_MAX_STATUS = -255,
+ } T_ZDrvPmic_Voltage;
+
+
+typedef struct _T_ZDrvPmic_Opt
+{
+ SINT32 (*zDrvPmic_LdoInit)(VOID);
+}T_ZDrvPmic_Opt;
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+SINT32 zDrvPmic_Initiate(VOID);
+
+SINT32 zDrvPmic_SetNormalOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable enable);
+SINT32 zDrvPmic_SetNormalVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage voltage);
+SINT32 zDrvPmic_SetNormalMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_NrmMode nrmMode);
+
+SINT32 zDrvPmic_GetNormalOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable* enable);
+SINT32 zDrvPmic_GetNormalVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage* voltage);
+SINT32 zDrvPmic_GetNormalMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_NrmMode* nrmMode);
+
+SINT32 zDrvPmic_SetSleepOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable enable);
+SINT32 zDrvPmic_SetSleepVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage voltage);
+SINT32 zDrvPmic_SetSleepMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_SlpMode slpMode);
+
+SINT32 zDrvPmic_GetSleepOnOff(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Enable* enable);
+SINT32 zDrvPmic_GetSleepVoltage(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_Voltage* voltage);
+SINT32 zDrvPmic_GetSleepMode(T_ZDrvPmic_Regulator regulator, T_ZDrvPmic_SlpMode* slpMode);
+
+SINT32 zDrvPmic_SetOpt(T_ZDrvPmic_Opt* pPmicOpt);
+
+#endif
+
diff --git a/cp/ps/driver/inc/ref/drvs_pmic_wrapper.h b/cp/ps/driver/inc/ref/drvs_pmic_wrapper.h
new file mode 100644
index 0000000..1fa10ec
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_pmic_wrapper.h
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (C) 2014, ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: V1.0
+ * Author: yuxiang
+ * Date: 2014-4-23
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_PMIC_WRAPPER_H
+#define _DRVS_PMIC_WRAPPER_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+
+/****************************************************************************
+* Types
+****************************************************************************/
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+SINT32 zDrvZx234290_Config(VOID);
+SINT32 zDrvZx234290_LdoInit(VOID);
+
+SINT32 zDrvZx234290_DischargerConfig(VOID);
+SINT32 zDrvZx234290_SleepConfig(VOID);
+SINT32 zDrvZx234290_DebugConfig(VOID);
+
+SINT32 zDrvZx234290_SetVcore(T_ZDrvPmic_Voltage vol);
+SINT32 zDrvZx234290_SetVcoreSlpV(T_ZDrvPmic_Voltage vol);
+
+SINT32 zDrvZx234290_SetVsimOnoff(T_ZDrvPmic_Enable status);
+T_ZDrvPmic_Enable zDrvZx234290_GetVsimOnoff(VOID);
+SINT32 zDrvZx234290_SetVsim(T_ZDrvPmic_Voltage vol);
+T_ZDrvPmic_Voltage zDrvZx234290_GetVsim(VOID);
+
+SINT32 zDrvZx234290_SetVsdOnoff(T_ZDrvPmic_Enable status);
+T_ZDrvPmic_Enable zDrvZx234290_GetVsdOnoff(VOID);
+SINT32 zDrvZx234290_SetVsd(T_ZDrvPmic_Voltage vol);
+T_ZDrvPmic_Voltage zDrvZx234290_GetVsd(VOID);
+
+
+#endif
+
diff --git a/cp/ps/driver/inc/ref/drvs_sensor_ref.h b/cp/ps/driver/inc/ref/drvs_sensor_ref.h
new file mode 100644
index 0000000..f07f0f2
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_sensor_ref.h
@@ -0,0 +1,734 @@
+/*******************************************************************************
+ * Copyright by ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: v2.0
+ * Author: wuhui
+ * Date: 2016-9-13
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_SENSOR_REF_H
+#define _DRVS_SENSOR_REF_H
+
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_cam.h"
+
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+#if defined(_USE_SPICC)
+
+typedef enum
+{
+ BUF_WRITING= 0, /* the Buffer storing the newest frame*/
+ BUF_FULL= 1,
+ BUF_READING= 2,
+ BUF_FREE= 3,
+ MAX_BUF_FLAG =4
+}T_Halsensor_BufFlag;
+
+#endif
+typedef enum
+{
+ SENSOR_OPEN= 0x0,
+ SENSOR_START = 0x1,
+ SENSOR_STANDBY = 0x2,
+ SENSOR_CLOSE = 0x3,
+ MAX_SENSOR_STATE
+}T_SensorState;
+
+#if defined (_CHIP_ZX297520V3)
+
+typedef enum
+{
+ CLK_OUT1_20M,
+ CLK_OUT1_40M,
+ CLK_OUT1_13M,
+ CLK_OUT1_26M
+} T_ZDrv_WifiBtFreq;
+
+#endif
+
+#if defined (_CHIP_ZX297520V2)
+
+typedef enum
+{
+ CLK_OUT1_13M,
+ CLK_OUT1_26M,
+ CLK_OUT1_20M,
+ CLK_OUT1_40M
+} T_ZDrv_WifiBtFreq;
+
+#endif
+
+#if defined(_USE_RAW_BUFFER)
+
+typedef enum
+{
+ HAL_CAM_RAWBUF_PAST= 0,
+ HAL_CAM_RAWBUF_CURRENT= 1, /* the Buffer store the newest frame*/
+ MAX_HAL_CAM_RAWBUF_FLAG =2
+}T_HalCam_RawBufFlag;
+
+typedef struct
+{
+ T_HalCam_Buff_Addr rawBufAddr;
+ UINT32 rawBufLen;
+ T_HalCam_RawBufFlag rawBufFlag;
+} T_HalSensor_RawBuff;
+
+#endif
+
+typedef struct
+{
+ UINT8 uiReg;
+ UINT8 uiVal;
+} T_HalSensor_RegVal;
+
+typedef enum
+{
+ SENSOR_POWER_OFF,
+ SENSOR_POWER_ON,
+
+ MAX_SENSOR_POWER_CTRL
+}T_HalSensor_PowerCtrl, *T_HalSensor_PowerCtrlPtr;
+
+typedef enum
+{
+ SENSOR_RESET_OFF,
+ SENSOR_RESET_ON,
+
+ MAX_SENSOR_RESET_CTRL
+}T_HalSensor_ResetCtrl, *T_HalSensor_ResetCtlPtr;
+typedef enum
+{
+ SPI_OUT_ENABLE,
+ SPI_OUT_DISABLE,
+
+ MAX_SPI_OUT_CTRL
+}T_HalSensor_SpiCtrl, *T_HalSensor_SpiCtrlPtr;
+
+
+typedef struct _T_HalSensor_Operations
+{
+ SINT32 (*halSensor_Open)( VOID );
+ SINT32 (*halSensor_Close)( VOID );
+ SINT32 (*halSensor_Start)( VOID );
+ SINT32 (*halSensor_Stop)( VOID );
+ SINT32 (*halSensor_PowerCtrl)(const T_HalSensor_PowerCtrl tPowerCtrl);
+ SINT32 (*halSensor_ResetCtrl)(const T_HalSensor_ResetCtrl tResetCtrl);
+ SINT32 (*halSensor_GetDevInfo)( T_ZDrv_SensorInfo *ptDevInfo );
+ SINT32 (*halSensor_SetPixelFmt)( T_ZDrv_PixelFmt tFmt );
+ SINT32 (*halSensor_SetImgSize)( T_ZDrv_CamOutputSize tImgSize );
+ SINT32 (*halSensor_SetFrameRate)( T_ZDrv_CamFps tFrmRate );
+ SINT32 (*halSensor_SetZoom)( T_ZDrv_CamZoom tZoom );
+ SINT32 (*halSensor_SetBrightness)( T_ZDrv_CamBrightness tBrn );
+ SINT32 (*halSensor_SetContrast)( T_ZDrv_CamContrast tCon );
+ SINT32 (*halSensor_SetEffect)( T_ZDrv_CamEffect tEffect );
+ SINT32 (*halSensor_SetWhiteBalance)( T_ZDrv_CamWhiteBalance tWB );
+ /* SINT32 (*halSensor_SetSceneMode)( T_ZDrv_SceneMode tScreen ); */
+ SINT32 (*halSensor_SetNightMode)(T_ZDrv_CamNightMode tNightMode);
+ SINT32 (*halSensor_SetLightMode)(T_ZDrv_CamLightMode tLightMode);
+ SINT32 (*halSensor_SetSaturation)(T_ZDrv_CamSaturation tSat);
+ SINT32 (*halSensor_SetMirrorFlip)(T_ZDrv_MirrorType tMirrorFlip);
+ SINT32 (*halSensor_SetAntiFlicker)(T_ZDrv_AntiFlicker tAntiFlicker);
+ SINT32 (*halSensor_SetEV)(T_ZDrv_CamExpCom tEV);
+ SINT32 (*halSensor_GetRegister)(UINT8 uiReg, UINT8 *puiVal);
+ SINT32 (*halSensor_SetRegister)(UINT8 uiReg, UINT8 uiVal);
+ #if defined(_USE_SPICC)
+ SINT32 (*halSensor_GetOneFrame)(T_HalCam_Buff_Addr* ptBuff);
+ SINT32 (*halSensor_FreeBuff)(T_HalCam_Buff_Addr readingBuff);
+ #endif
+ #if defined(_USE_RAW_BUFFER)
+ SINT32 (*halSensor_GetOneFrame)(T_HalCam_Buff_Addr ptBuff);
+ #endif
+ /* for updating of version */
+ UINT32 uiVersion;
+ VOID *pAdditionalOps;
+} T_HalSensor_Operations, *T_HalSensor_OperationsPtr;
+#if defined(_USE_TYPE_GC6133)
+SINT32 zDrvGc6133_Initiate(VOID);
+#endif
+#if defined(_USE_TYPE_BF3A01CS)
+SINT32 zDrvBf3a01cs_Initiate(VOID);
+#endif
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+/*******************************************************************************
+* Functin: halSensor_Open
+* Description: This function is used to open the sensor.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be opened.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_Open( T_ZDrv_SensorId tSensorId );
+
+
+/*******************************************************************************
+* Functin: halSensor_Close
+* Description: This function is used to close the sensor.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_Close( T_ZDrv_SensorId tSensorId );
+
+/*******************************************************************************
+* Functin: halSensor_Start
+* Description: This function is used to Start the sensor.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be started.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_Start( T_ZDrv_SensorId tSensorId );
+
+/*******************************************************************************
+* Functin: halSensor_Stop
+* Description: This function is used to stop the sensor.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be stoped.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_Stop( T_ZDrv_SensorId tSensorId );
+
+/*******************************************************************************
+* Functin: halSensor_PowerCtrl
+* Description: This function is used for controlling sensor power on/off via a GPIO.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tPowerCtrl: the logic of power on or off.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_PowerCtrl(const T_ZDrv_SensorId tSensorId, const T_HalSensor_PowerCtrl tPowerCtrl);
+
+
+/*******************************************************************************
+* Functin: halSensor_ResetCtrl
+* Description: This function is used for resetting the sensor.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tResetCtrl: the logic of reset on or off.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_ResetCtrl(const T_ZDrv_SensorId tSensorId, const T_HalSensor_ResetCtrl tResetCtrl);
+
+
+/*******************************************************************************
+* Functin: halSensor_GetDevInfo
+* Description: This function is used to get the sensor information.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* (OUT)
+* ptDevInfo: sensor information pointer.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_GetDevInfo( T_ZDrv_SensorId tSensorId, T_ZDrv_SensorInfo *ptDevInfo );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetPixelFmt
+* Description: This function is used to set the pixel format.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tFmt: pixel format.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetPixelFmt( T_ZDrv_SensorId tSensorId, T_ZDrv_PixelFmt tFmt );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetImgSize
+* Description: This function is used to set the image size .
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tImgSize: image size.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetImgSize( T_ZDrv_SensorId tSensorId, T_ZDrv_CamOutputSize tImgSize );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetFrameRate
+* Description: This function is used to set the frame rate.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tFrmRate: frame rate.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetFrameRate( T_ZDrv_SensorId tSensorId, T_ZDrv_CamFps tFrmRate );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetZoom
+* Description: This function is used to set the zoom level.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tZoom: zoom level.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetZoom( T_ZDrv_SensorId tSensorId, T_ZDrv_CamZoom tZoom );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetBrightness
+* Description: This function is used to set the brightness.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tBri: brightness.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetBrightness( T_ZDrv_SensorId tSensorId, T_ZDrv_CamBrightness tBrn );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetContrast
+* Description: This function is used to set the constrast.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tCon: constrast.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetContrast( T_ZDrv_SensorId tSensorId, T_ZDrv_CamContrast tCon );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetEffect
+* Description: This function is used to set the effect.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be closed.
+* tEffect: effect.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetEffect( T_ZDrv_SensorId tSensorId, T_ZDrv_CamEffect tEffect );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetWhiteBalance
+* Description: This function is used to set the white balance.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tWB: white balance.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetWhiteBalance( T_ZDrv_SensorId tSensorId, T_ZDrv_CamWhiteBalance tWB );
+
+
+/*******************************************************************************
+* Functin: halSensor_SetSceneMode
+* Description: This function is used to set the scene mode.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tScreen: scene mode.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+/* SINT32 halSensor_SetSceneMode( T_ZDrv_SensorId tSensorId, T_ZDrv_SceneMode tScreen ); */
+
+
+/*******************************************************************************
+* Functin: halSensor_SetNightMode
+* Description: This function is used to set the night mode.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tNightMode: night mode.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetNightMode(T_ZDrv_SensorId tSensorId, T_ZDrv_CamNightMode tNightMode);
+
+
+/*******************************************************************************
+* Functin: halSensor_SetMirrorFlip
+* Description: This function is used to set the mirror and(or) flip.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tMirrorFlip: mirror and(or) flip.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetMirrorFlip(T_ZDrv_SensorId tSensorId, T_ZDrv_MirrorType tMirrorFlip);
+
+
+/*******************************************************************************
+* Functin: halSensor_GetRegister
+* Description: This function is used to get the value of sensor register.
+* Parameters:
+* (IN)
+*
+* (OUT)
+* None.
+* Returns:
+*
+* Others:
+*
+*******************************************************************************/
+SINT32 halSensor_GetRegister(T_ZDrv_SensorId tSensorId, UINT8 uiReg, UINT8 *pValue);
+
+/*******************************************************************************
+* Functin: halSensor_SetRegister
+* Description: This function is used to set the value of sensor register.
+* Parameters:
+* (IN)
+*
+* (OUT)
+* None.
+* Returns:
+*
+* Others:
+*
+*******************************************************************************/
+SINT32 halSensor_SetRegister(T_ZDrv_SensorId tSensorId, UINT8 uiReg, UINT8 uiVal);
+
+/*******************************************************************************
+* Functin: halSeneor_SetLightMode
+* Description: This function is used to set the light mode.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tLightMode: light mode.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetLightMode(T_ZDrv_SensorId tSensorId, T_ZDrv_CamLightMode tLightMode);
+
+
+/*******************************************************************************
+* Functin: halSensor_SetSaturation
+* Description: This function is used to set the saturation.
+* Parameters:
+* (IN)
+* tSensorId: which sensor to be set.
+* tLightMode: light mode.
+* (OUT)
+* None.
+* Returns:
+* DRV_SUCCESS: successed.
+* DRV_ERR_NOT_SUPPORTED: this device don't support ioctrl operation.
+* DRV_ERR_NOT_OPENED: has not been opend yet.
+* DRV_ERR_INVALID_PARAM: the input parameters are invalid
+* DRV_ERROR: error
+* others: others programmer defined error code. for detailed information, please contact with the programmer
+* Others:
+* others error code should be a negative number, and not equal to the value that already be defined in T_ZDrv_ErrCode in drv_pub.h.
+*******************************************************************************/
+SINT32 halSensor_SetSaturation(T_ZDrv_SensorId tSensorId, T_ZDrv_CamSaturation tSat);
+
+/*******************************************************************************
+ * Function: halSensor_SetAntiFlicker
+ * Description: This function is used to anti 50/60HZ banding flicker
+ * Parameters:
+ * Input:tSat:the banding frequency mode
+ * Output:None
+ *
+ * Returns:
+ * DRV_SUCCESS: successfully set the sensor.
+ * DRV_ERR_NOT_SUPPORTED: unsupported type of setting.
+ * DRV_ERROR: fail to set the sensor.
+ *
+ * Others:
+ ********************************************************************************/
+SINT32 halSensor_SetAntiFlicker(T_ZDrv_SensorId tSensorId, T_ZDrv_AntiFlicker tAntiFlicker);
+
+/*******************************************************************************
+ * Function: halSensor_SetEV
+ * Description: This function is used to set the exposure compensation
+ * Parameters:
+ * Input:tSat:the level of EV
+ * Output:None
+ *
+ * Returns:
+ * DRV_SUCCESS: successfully set the sensor.
+ * DRV_ERR_NOT_SUPPORTED: unsupported type of setting.
+ * DRV_ERROR: fail to set the sensor.
+ *
+ * Others:
+ ********************************************************************************/
+SINT32 halSensor_SetEV(T_ZDrv_SensorId tSensorId,T_ZDrv_CamExpCom tEV);
+/*******************************************************************************
+ * Function: halSensor_GetOneFrame
+ * Description: This function is used to get one frame
+ * Parameters:
+ * Input:tSat:T_ZDrv_SensorId T_HalCam_Buff_Addr*
+ * Output:None
+ *
+ * Returns:
+ * DRV_SUCCESS: successfully set the sensor.
+ * DRV_ERR_NOT_SUPPORTED: unsupported type of setting.
+ * DRV_ERROR: fail to set the sensor.
+ *
+ * Others:
+ ********************************************************************************/
+#if defined(_USE_SPICC)
+SINT32 halSensor_GetOneFrame(T_ZDrv_SensorId tSensorId,T_HalCam_Buff_Addr* ptBuff);
+#endif
+
+#if defined(_USE_RAW_BUFFER)
+SINT32 halSensor_GetOneFrame(T_ZDrv_SensorId tSensorId,T_HalCam_Buff_Addr ptBuff);
+#endif
+
+/*******************************************************************************
+ * Function: halSensor_FreeBuff
+ * Description: This function is used to free one frame
+ * Parameters:
+ * Input:tSat:T_Halsensor_Buff_Addr
+ * Output:None
+ *
+ * Returns:
+ * DRV_SUCCESS: successfully set the sensor.
+ * DRV_ERR_NOT_SUPPORTED: unsupported type of setting.
+ * DRV_ERROR: fail to set the sensor.
+ *
+ * Others:
+ ********************************************************************************/
+#if defined(_USE_SPICC)
+SINT32 halSensor_FreeBuff(T_ZDrv_SensorId tSensorId,T_HalCam_Buff_Addr readingBuff);
+#endif
+/*******************************************************************************
+* Functin: zDrvSensor_SetOperations
+* Description: This function is used to register operations of hal layer.
+* Parameters:
+* (IN)
+* tSensorId: operations of which sensor.
+* ptOperations: operations for the specfied device.
+* (OUT)
+* None.
+* Returns:
+* None
+* Others:
+* None.
+*******************************************************************************/
+VOID zDrvSensor_SetOperations( T_ZDrv_SensorId tSensorId, T_HalSensor_OperationsPtr ptOperations );
+
+
+
+#endif/*_DRVS_SENSOR_REF_H*/
+
+
diff --git a/cp/ps/driver/inc/ref/drvs_spicc.h b/cp/ps/driver/inc/ref/drvs_spicc.h
new file mode 100644
index 0000000..4d410b7
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_spicc.h
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright by ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: v0.1
+ * Author: wuhui
+ * Date: 2017-1-13
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_SPICC_H
+#define _DRVS_SPICC_H
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_chip_cfg.h"
+#include "drvs_dma.h"
+#include "drvs_sys.h"
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+ //BASE ADDRESSS
+#define SSP1_FORCAM_BASE (SPI1_REG_BASE+0x0000)
+
+#define SSP1_COMCTRL_MS_OFFSET (2)
+#define SSP1_COMCTRL_SSPE_OFFSET (1)
+#define SSP1_FMTCTRL_LaneNum_OFFSET (13)
+#define SSP1_FMTCTRL_LaneNum_SIZE (2)
+#define SSP1_FMTCTRL_CAMMode_OFFSET (12)
+#define SSP1_FIFOCTRL_RXFIFOTHRED_OFFSET (4)
+#define SSP1_FIFOCTRL_RXFIFOTHRED_SIZE (4)
+#define SSP1_FIFOCTRL_RXFIFOCNTR_OFFSET (5)
+#define SSP1_FIFOCTRL_RXFIFOCNTR_SIZE (7)
+#define SSP1_FIFOCTRL_RXDMAEN_OFFSET (2)
+#define SSP1_SYNC_CODE_OFFSET (0)
+#define SSP1_CAMFIFO_RST_OFFSET (1)
+#define SSP1_SAMPLE_MODE_OFFSET (2)
+#define SSP1_ID_SOL_OFFSET (24)
+#define SSP1_ID_EOF_OFFSET (16)
+#define SSP1_ID_SOF_OFFSET (8)
+#define SSP1_ID_SYNC_SIZE (8)
+#define SSP1_PACKETSIZE_OFFSET (0)
+#define SSP1_PACKETSIZE_SIZE (16)
+
+//²»Í¬´«Êä¸ñʽʱµÄID ¶¨Òå
+#define MTK_START (0x01)
+#define MTK_DATA_PACKET (0x40)
+#define MTK_END (0x00)
+#define BT656_START (0xab)
+#define BT656_LINE_START (0x80)
+#define BT656_END (0xb6)
+
+
+#define set_reg_bit(regName, bitAddr, bitValue) \
+do{ \
+ if(bitValue == TRUE) \
+ reg32(regName) |= (0x1<<bitAddr); \
+ else \
+ reg32(regName) &= ~(0x1<<bitAddr); \
+}while(0)
+
+#define set_reg_bits(regName, bitsAddr, bitsLen, bitsValue) \
+do{ \
+ reg32(regName) = (reg32(regName)&(~(((0x1<<bitsLen)-0x1)<<bitsAddr)))|(bitsValue<<bitsAddr);\
+}while(0)
+
+#define read_reg_bits(regName, bitsAddr, bitsLen) ((reg32(regName)>>bitsAddr)&((0x1<<bitsLen)-0x1))
+#define read_reg_bit(regName, bitsAddr) ((reg32(regName)>>bitsAddr)&0x1)
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+typedef volatile struct _T_SPICC_Regs
+{
+ UINT32 SSP1_VER; //0x00
+ UINT32 SSP1_COM_CTRL; //0x04
+ UINT32 SSP1_FMT_CTRL; //0x08
+ UINT32 SSP1_DATA_REG; //0x0C
+ UINT32 SSP1_FIFO_CTRL; //0x10
+ UINT32 SSP1_FIFO_STA; //0x14
+ UINT32 SSP1_INT_EN; //0x18
+ UINT32 SSP1_INT_STACLR; //0x1C
+ UINT32 SSP1_TIMING; //0x20
+ UINT32 Reserved[3]; //0x24~0x2C
+ UINT32 SSP1_SYNC_CODE; //0x30
+ UINT32 SSP1_DEBUG; //0x34
+ UINT32 SSP1_PACKET_SIZE; //0x38
+}T_SPICC_Regs;
+
+typedef enum _T_SSP1_MSMode
+{
+ SSP1_AS_MASTER = 0x0,
+ SSP1_AS_SLAVE = 0x1,
+ MAX_MS_MODE = 0X02
+}T_SPICC_MSMode;
+
+typedef enum
+{
+ DISABLE = 0,
+ ENABLE =1,
+ MAX_ENABLE_TYPE =2
+}T_SPICC_ENABLE_TYPE;
+
+typedef enum _T_SPICC_LaneNum
+{
+ LANE_1_CAM = 0,
+ LANE_2_CAM = 1,
+ LANE_4_CAM = 2,
+ LANE_MAX_CAM = 3
+}T_SPICC_LaneNum;
+
+typedef enum _T_SPICC_CamMode
+{
+ SSP1_AS_NORMAL = 0,
+ SSP1_AS_CAMERA = 1,
+ MAX_SSP1_CAMMODE = 2
+}T_SPICC_CamMode;
+
+typedef enum
+{
+ RAW_DATA =0,
+ PURE_DATA = 1,
+ MAX_SAMPLE_MODE =2
+}T_SPICC_ImageSampleMode;
+
+typedef enum
+{
+ BT656_MODE = 0,
+ MTK_MODE = 1,
+ MAX_TRANSFER_MODE =2
+}T_SPICC_ImageTransferMode;
+
+typedef enum
+{
+ RX_OVERRUN_IE = 0,
+ RX_FULL_IE = 2,
+ RX_THRED_IE = 4,
+ CAM_SOF_IE = 7,
+ CAM_EOF_IE = 8,
+ MAX_SSP1_INT_EN = 9
+}T_SPICC_IntEn;
+
+typedef enum
+{
+ eRESET =0,
+ eRELEASE = 1,
+ MAX_FIFOCtrl_TYPE =2
+}T_SPICC_CamFIFORst;
+
+typedef struct _T_zDrvSPICC_Device
+{
+ T_SPICC_ImageTransferMode transMode;
+ T_SPICC_ImageSampleMode samMode;
+ T_SPICC_LaneNum laneNum;
+ UINT32 packetSize;
+}T_zDrvSPICC_Device;
+
+typedef struct _T_SPICC_DevCtrl
+{
+ T_SPICC_Regs* regPtr;
+ UINT32 rxDmaChl; // ssp rx Dma channel number
+
+}T_SPICC_DevCtrl;
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+SINT32 zDrvSPICC_Initiate(VOID);
+SINT32 zDrvSPICC_Open(T_zDrvSPICC_Device *spicc_Dev);
+SINT32 zDrvSPICC_Close(void);
+SINT32 zDrvSPICC_DmaRxloop(zDrvDma_CallbackFunc CallBack,T_ZDrvDma_ChannelDef *rxRegDmaChl,UINT32 transferListNum);
+SINT32 zDrvSPICC_DisableDmaRxloop(VOID);
+SINT32 zDrvSPICC_DeAllocDmaRxCh(VOID);
+VOID zDrvSPICC_ClkGateCtrl(T_ZDrvSysClk_Gate ClkCtrl);
+
+
+
+#endif/*_FILENAME_H*/
+
diff --git a/cp/ps/driver/inc/ref/drvs_uart_ref.h b/cp/ps/driver/inc/ref/drvs_uart_ref.h
new file mode 100644
index 0000000..f497362
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_uart_ref.h
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_uart_ref.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: V0.1
+ * Author: yangjupei
+ * Date: 2013-08-26
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+
+#ifndef __DRVS_UART_REF_H_
+#define __DRVS_UART_REF_H_
+
+#define _UART3_SUPPORT
+/****************************************************************************
+* Include files
+****************************************************************************/
+
+#include "drvs_general.h"
+
+/****************************************************************************
+* Types
+****************************************************************************/
+//define uart ifac type
+typedef enum _T_zDrvUart_Port
+{
+ UART_PORT1 =0,
+ UART_PORT2,
+#ifdef _UART3_SUPPORT
+ UART_PORT3,
+#endif
+ UART_MAX_PORT_NUM
+}
+T_zDrvUart_Port;
+
+/*******************************************************************************
+ * Function: zDrvUart_SetInstance
+ * Description: set uartConfig,and regist uart oprations to dd level
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+********************************************************************************/
+
+VOID zDrvUart_SetInstance(VOID);
+/*******************************************************************************
+ * Function: zDrvUart_SetGPIOforUart
+ * Description: set pins
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+********************************************************************************/
+VOID zDrvUart_SetGPIOforUart(T_zDrvUart_Port UartNum);
+/*******************************************************************************
+ * Function: zDrvUart_SetGPIOforGPIO
+ * Description: set pins
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+********************************************************************************/
+VOID zDrvUart_SetGPIOforGPIO(T_zDrvUart_Port UartNum);
+
+#endif
diff --git a/cp/ps/driver/inc/ref/drvs_uicc_ref.h b/cp/ps/driver/inc/ref/drvs_uicc_ref.h
new file mode 100644
index 0000000..e3e0990
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_uicc_ref.h
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (C) 2007, ZTE Corporation.
+ *
+ * File Name: drvs_uicc_ref.h
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: V0.5
+ * Author: wujinlei
+ * Date: 2013-07-12
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+
+#ifndef __DRVS_UICC_REF_H_
+#define __DRVS_UICC_REF_H_
+
+#include "drvs_general.h"
+//#include "drvs_pm_typedefine.h"
+#include "drvs_uicc.h"
+//#include "drvs_gpio.h"
+#include "drvs_pm.h"
+/*******************************************************************************
+ * Function: zDrvUICC_setVsim
+ * Description: set soc_USIM voltage
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+********************************************************************************/
+SINT32 zDrvUICC_setVsim(T_ZDrvPmic_Voltage vsim);
+
+/*******************************************************************************
+ * Function: zDrvUICC_disableVsim
+ * Description: disable soc_usim power
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+ * Others: //not use
+
+ ********************************************************************************/
+SINT32 zDrvUICC_disableVsim(VOID); /* pow uicc uart */
+
+#ifndef SOC_USIM
+/*******************************************************************************
+ * Function: zDrvUICC_disableVsim
+ * Description: disable soc_usim power
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+ * Others: //not use
+
+ ********************************************************************************/
+ VOID zDrvUICC_ConfigForDetectSIM(VOID);
+#else
+/*******************************************************************************
+ * Function: zDrvUICC_disableVsim
+ * Description: disable soc_usim power
+ * Parameters:
+ * Input: N/A
+ *
+ * Output: N/A
+ * Returns: N/A
+
+ * Others: //not use
+
+ ********************************************************************************/
+VOID zDrvUICC_ConfigForDetectSocSIM(VOID);
+#endif
+#endif
diff --git a/cp/ps/driver/inc/ref/drvs_vou_ref.h b/cp/ps/driver/inc/ref/drvs_vou_ref.h
new file mode 100644
index 0000000..1d85e0e
--- /dev/null
+++ b/cp/ps/driver/inc/ref/drvs_vou_ref.h
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright by ZTE Corporation.
+ *
+ * File Name:
+ * File Mark:
+ * Description:
+ * Others:
+ * Version: v0.1
+ * Author: wuhui
+ * Date: 2016-12-17
+ * History 1:
+ * Date:
+ * Version:
+ * Author:
+ * Modification:
+ * History 2:
+ ********************************************************************************/
+
+#ifndef _DRVS_VOU_REF_H
+#define _DRVS_VOU_REF_H
+
+
+
+/****************************************************************************
+* Include files
+****************************************************************************/
+#include "drvs_chip_cfg.h"
+#include "drvs_sys.h"
+#include "drvs_vou.h"
+
+
+/****************************************************************************
+* Macros
+****************************************************************************/
+#define MAIN_CHANNEL 0
+#define MCU_LCD 1
+
+//BASE ADDRESSS
+#define OSD_CSC_BASE (VOU_CTRL_BASE+0x0000)
+#define OSD_GLOBAL_BASE (VOU_CTRL_BASE+0x2000)
+
+#define OSD_VL_CFG_BASE (OSD_GLOBAL_BASE+0x024)
+#define OSD_GL_CFG_BASE (OSD_GLOBAL_BASE+0x090)
+#define OSD_MAIN_CHANL_BASE (OSD_GLOBAL_BASE+0x114)
+#define OSD_WB_CFG_BASE (OSD_GLOBAL_BASE+0x14C)
+
+/*VOU CLK CFG ADDRESS*/
+#define VOU_DIF_CFG_BASE (SOC_CRM_REG_BASE+0x164)
+#define VOU_DIF_CTRL_OFFSET 16
+
+#define MAX_OSD_OUTSTAND_DEPTH 15
+#define OSD_VALID_FMARK_OFFSET 18
+#define OSDCTRL1_H_BLANK_OFFSET 2
+#define OSDCTRL1_V_BLANK_OFFSET 10
+#define OSDCTRL1_BLANK_SIZE 8
+#define OSDCTRL1_MCU_OFFSET 0
+
+#define OSDCTRL0_OUTSTAND_DEPTH_OFFSET 16
+#define OSDCTRL0_OUTSTAND_DEPTH_SIZE 4
+#define OSDCTRL0_VL_ENABLE_OFFSET 11
+#define OSDCTRL0_VL_CHANNEL_OFFSET 10
+#define OSDVL0CTRL0_VL_PRIO_OFFSET 24
+#define OSDVL0CTRL0_VL_PRIO_SIZE 3
+#define OSDVL0CTRL0_VL_STARTX_OFFSET 12
+#define OSDVL0CTRL0_VL_STARTXY_SIZE 12
+#define OSDVL0CTRL0_VL_STARTY_OFFSET 0
+#define OSDVL0CTRL0_VL_YUV420PLA_OFFSET 24
+#define OSDVL0CTRL0_VL_YUV422ENABLE_OFFSET 25
+#define OSDVL0CTRL0_VL_YUV422SEQ_OFFSET 26
+#define OSDVL0CTRL0_VL_YUV422SEQ_SIZE 2
+#define OSDVL0STRI_VL_LUMASTR_OFFSET 16
+#define OSDVL0STRI_VL_STR_SIZE 16
+#define OSDVL0STRI_VL_CHROMSTR_OFFSET 0
+#define OSDVL0SRCHW_VL_SRCW_OFFSET 16
+#define OSDVL0SRCHW_VL_SRCHW_SIZE 14
+#define OSDVL0SRCHW_VL_SRCH_OFFSET 0
+#define OSDVL0ALP_VL_GALPENABLE_OFFSET 0
+#define OSDVL0ALP_VL_GALPVAL_OFFSET 8
+#define OSDVL0ALP_VL_GALPVAL_SIZE 8
+
+#define OSDCTRL0_GL_ENABLE_OFFSET 5
+#define OSDCTRL0_GL_CHANNEL_OFFSET 4
+#define OSDGL0CTRL0_GL_PRIO_OFFSET 24
+#define OSDGL0CTRL0_GL_PRIO_SIZE 3
+#define OSDCTRL0_GL_ENDIANSEL_OFFSET 27
+#define OSDGL0CTRL0_GL_POSX_OFFSET 12
+#define OSDGL0CTRL0_GL_POSXY_SIZE 12
+#define OSDGL0CTRL0_GL_POSY_OFFSET 0
+#define OSDGL0CTRL1_GL_FORMAT_OFFSET 24
+#define OSDGL0CTRL1_GL_FORMAT_SIZE 4
+#define OSDGL0CTRL2_GL_ALP_A0RGB1555_OFFSET 24
+#define OSDGL0CTRL2_GL_ALP_VAL_SIZE 8
+#define OSDGL0CTRL2_GL_ALP_A1RGB1555_OFFSET 16
+#define OSDGL0CTRL2_GL_GALP_OFFSET 8
+#define OSDGL0CTRL2_GL_ALPRANG_OFFSET 3
+#define OSDGL0CTRL2_GL_ALPMODE_OFFSET 4
+#define OSDGL0CTRL2_GL_ALPMODE_SIZE 2
+#define OSDGL0CTRL2_GL_EXTDIR_OFFSET 2
+#define OSDGL0CTRL2_GL_EXTTYPE_OFFSET 0
+#define OSDGL0CTRL2_GL_EXTTYPE_SIZE 2
+#define OSDGL0STRI_GL_STRI_OFFSET 0
+#define OSDGL0STRI_GL_STRI_SIZE 14
+#define OSDGL0KEY_GL_CKALP_OFFSET 24
+#define OSDGL0KEY_GL_CKALP_SIZE 8
+#define OSDGL0KEY_GL_CKRGB_SIZE 8
+#define OSDGL0KEY_GL_CKR_OFFSET 16
+#define OSDGL0KEY_GL_CKG_OFFSET 8
+#define OSDGL0KEY_GL_CKB_OFFSET 0
+#define OSDGL0KEYMIN1_GL_CKREG1_ENABLE_OFFSET 31
+#define OSDMCTRL1_MC_SCRW_OFFSET 20
+#define OSDMCTRL1_MC_SCRWH_SIZE 12
+#define OSDMCTRL1_MC_SCRH_OFFSET 8
+#define OSDMBGCTRL_MC_R_OFFSET 16
+#define OSDMBGCTRL_MC_G_OFFSET 8
+#define OSDMBGCTRL_MC_B_OFFSET 0
+#define OSDMBGCTRL_MC_RGB_SIZE 8
+#define OSDMCTRL0_MC_ENABLE_OFFSET 0
+#define OSDMUPT_ENABLE_OFFSET 0
+
+
+#define OSDWBCTRL0_WB_STRIDE_OFFSET 12
+#define OSDWBCTRL0_WB_STRIDE_SIZE 16
+#define OSDWBCTRL0_WB_ENABLE_OFFSET 0
+#define OSDWBCTRL0_WB_BUFNUM_OFFSET 10
+#define OSDWBCTRL0_WB_BUFNUM_SIZE 2
+#define OSDWBCTRL0_WB_PERIOD_OFFSET 7
+#define OSDWBCTRL0_WB_PERIOD_SIZE 3
+#define OSDWBCTRL0_WB_FORMAT_OFFSET1 3
+#define OSDWBCTRL0_WB_FORMAT_OFFSET2 4
+
+#define CSC_ENABLE_OFFSET 16
+#define CSC_MODE_OFFSET 0
+#define CSC_MODE_SIZE 16
+#define CSC_AC_OFFSET 16
+#define CSC_BD_OFFSET 0
+#define CSC_ACBD_SIZE 16
+#define CSC_SPACE_FLOOR_OFFSET 16
+#define CSC_SPACE_TOP_OFFSET 0
+#define CSC_SPACE_LEVEL_SIZE 8
+
+/*OSD interrupt status bit offset*/
+#define OSD_MC_FINISH_OFFSET 0
+#define OSD_CFG_ERROR_OFFSET 2
+#define OSD_BUS_ERROR_OFFSET 3
+#define OSD_VL_BWLOW_OFFSET 7
+#define OSD_GL_BWLOW_OFFSET 10
+#define OSD_MC_REGUPT_OFFSET 13
+#define OSD_WR_FINISH_OFFSET 24
+#define OSD_WR_OVERFLOW_OFFSET 25
+
+#define set_reg_bit(regName, bitAddr, bitValue) \
+do{ \
+ if(bitValue == TRUE) \
+ reg32(regName) |= (0x1<<bitAddr); \
+ else \
+ reg32(regName) &= ~(0x1<<bitAddr); \
+}while(0)
+
+#define set_reg_bits(regName, bitsAddr, bitsLen, bitsValue) \
+do{ \
+ reg32(regName) = (reg32(regName)&(~(((0x1<<bitsLen)-0x1)<<bitsAddr)))|(bitsValue<<bitsAddr);\
+}while(0)
+
+
+/****************************************************************************
+* Types
+****************************************************************************/
+typedef enum
+{
+ EPOSEDGE_VALID = 0,
+ eNEGEDGE_VALID = 1,
+ MAX_POLARITY_TYPE =2
+}E_MCU_FMARK_POLARITY;
+
+typedef volatile struct _T_OSDGlobal_Regs
+{
+ UINT32 OSD_VER; //0x00
+ UINT32 OSD_INT_STA; //0x04
+ UINT32 OSD_CLRINT_STA; //0x08
+ UINT32 OSD_INT_MSK; //0x0C
+ UINT32 OSD_CTRL0; //0x10
+}T_OSDGlobal_Regs;
+
+typedef volatile struct _T_OSD_VL_Regs
+{
+ UINT32 OSD_VL0_CTRL0; //0x024
+ UINT32 OSD_VL0_CTRL1; //0x028
+ UINT32 RESERVED0;
+ UINT32 OSD_VL0_STRI; //0x30
+ UINT32 OSD_VL0_SRC_HW; //0x34
+ UINT32 OSD_VL0_Y; //0x38
+ UINT32 OSD_VL0_U; //0x3C
+ UINT32 OSD_VL0_V; //0x40
+ UINT32 OSD_VL0_ALP; //0x44
+}T_OSD_VL_Regs;
+
+typedef volatile struct _T_OSD_GL_Regs
+{
+ UINT32 OSD_GL0_CTRL0; //0x090
+ UINT32 OSD_GL0_CTRL1; //0x094
+ UINT32 OSD_GL0_CTRL2; //0x098
+ UINT32 RESERVED0; //0x09C
+ UINT32 OSD_GL0_STRI; //0x0A0
+ UINT32 OSD_GL0_ADDR; //0x0A4
+ UINT32 RESERVED1; //0x0A8
+ UINT32 OSD_GL0_KEY_MIN0; //0x0AC
+ UINT32 OSD_GL0_KEY_MAX0; //0x0B0
+ UINT32 OSD_GL0_KEY_MIN1; //0x0B4
+ UINT32 OSD_GL0_KEY_MAX1; //0x0B8
+}T_OSD_GL_Regs;
+
+typedef volatile struct _T_OSD_MainChanel_Regs
+{
+ UINT32 OSD_MAIN_CHANL_CTRL0; //0x114
+ UINT32 OSD_MAIN_CHANL_CTRL1; //0x118
+ UINT32 OSD_MAIN_CHANL_UPT; //0x11C
+ UINT32 RESERVED0; //0x120
+ UINT32 OSD_MAIN_BG_CTRL; //0x124
+ UINT32 RESERVED[5]; //0x128~0x138
+ UINT32 OSD_CTRL1; //0x13C
+}T_OSD_MainChanel_Regs;
+
+typedef volatile struct _T_OSD_WB_Regs
+{
+ UINT32 OSD_WB_CTRL0; //0x14C
+ UINT32 OSD_WB_CTRL1; //0x150
+ UINT32 OSD_WB_ADDR0; //0x154
+ UINT32 OSD_WB_ADDR1; //0x158
+ UINT32 OSD_WB_ADDR2; //0x15C
+ UINT32 OSD_WB_ADDR3; //0x160
+}T_OSD_WB_Regs;
+
+typedef volatile struct _T_OSD_CSC_Regs
+{
+ UINT32 OSD_CSC_MODE; //0x00
+ UINT32 OSD_A1_B1; //0x04
+ UINT32 OSD_C1_D1; //0x08
+ UINT32 OSD_A2_B2; //0x0C
+ UINT32 OSD_C2_D2; //0x10
+ UINT32 OSD_A3_B3; //0x14
+ UINT32 OSD_C3_D3; //0x18
+ UINT32 OSD_SPACE_IN1; //0x1C
+ UINT32 OSD_SPACE_IN2; //0x20
+ UINT32 OSD_SPACE_IN3; //0x24
+ UINT32 OSD_SPACE_OUT1; //0x28
+ UINT32 OSD_SPACE_OUT2; //0x2C
+ UINT32 OSD_SPACE_OUT3; //0x30
+}T_CSC_Regs;
+
+typedef volatile struct _T_VOU_Regs
+{
+ T_OSDGlobal_Regs *ptOSDGlobal;
+ T_OSD_VL_Regs *ptOSDVL;
+ T_OSD_GL_Regs *ptOSDGL;
+ T_OSD_MainChanel_Regs *ptOSDMC;
+ T_OSD_WB_Regs *ptOSDWB;
+ T_CSC_Regs *ptOSDCSC;
+}T_VOU_Regs;
+
+/****************************************************************************
+* Constants
+****************************************************************************/
+
+/****************************************************************************
+* Global Variables
+****************************************************************************/
+
+/****************************************************************************
+* Function Prototypes
+****************************************************************************/
+SINT32 zDrvVOU_Open(void);
+void zDrvVOU_GetDevInfo(T_ZDrv_OSDInfo *ptDevInfo);
+SINT32 zDrvVOU_Close(VOID);
+SINT32 zDrvVOU_OneFrame(T_ZDrv_VOU_OSDPara *ptOSDPara);
+SINT32 zDrvVOU_WBParaUpdate(T_ZDrv_VOU_WBPara *ptWBPara);
+void zDrvVOU_ClkCtrl(T_ZDrvSysClk_Gate ClkCtrl);
+
+
+
+#endif/*_FILENAME_H*/
+