diff --git a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_cfg.h b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_cfg.h index a4b8f003..f6da9460 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_cfg.h +++ b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_cfg.h @@ -30,6 +30,8 @@ #include "hx_drv_gpio.h" #include "hx_drv_inp.h" +#define IMG_640_480 1 + typedef enum { APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X, @@ -50,6 +52,18 @@ typedef enum #define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130) #define DYNAMIC_ADDRESS +#ifdef IMG_640_480 +#define IMX708_SENSOR_WIDTH 2304 +#define IMX708_SENSOR_HEIGHT 1296 +#define IMX708_INP_CROP_WIDTH 1280 +#define IMX708_INP_CROP_HEIGHT 960 +#define IMX708_INP_OUT_WIDTH 640 +#define IMX708_INP_OUT_HEIGHT 480 +#define IMX708_HW2x2_CROP_WIDTH 640 +#define IMX708_HW2x2_CROP_HEIGHT 480 +#define IMX708_HW5x5_CROP_WIDTH 640 +#define IMX708_HW5x5_CROP_HEIGHT 480 +#else #define IMX708_SENSOR_WIDTH 2304 #define IMX708_SENSOR_HEIGHT 1296 #define IMX708_INP_CROP_WIDTH 2304 @@ -60,6 +74,7 @@ typedef enum #define IMX708_HW2x2_CROP_HEIGHT 264 #define IMX708_HW5x5_CROP_WIDTH 576 #define IMX708_HW5x5_CROP_HEIGHT 320 +#endif #define IMX708_QBC_ADJUST (0x02) #define IMX708_REG_BASE_SPC_GAINS_L (0x7b10) @@ -108,10 +123,17 @@ typedef enum * * CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0 */ +#ifdef IMG_640_480 +#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B +#define DP_INP_BINNING INP_BINNING_DISABLE +#define DP_INP_CROP_START_X 504 +#define DP_INP_CROP_START_Y 168 +#else #define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B #define DP_INP_BINNING INP_BINNING_DISABLE #define DP_INP_CROP_START_X 0 #define DP_INP_CROP_START_Y 0 +#endif #define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH #define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT #define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH diff --git a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_sensor.c b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_sensor.c index 1187dd44..f68548cc 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_sensor.c +++ b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm/cis_sensor/cis_imx708/cisdp_sensor.c @@ -119,6 +119,7 @@ void IMX708_set_pll200() cfg.mipiclk.hscmipiclkdiv = 0; } + cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M; hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1); uint32_t mipi_pixel_clk = 96; @@ -463,12 +464,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, evthandlerdp_CBEven crop.start_y = DP_INP_CROP_START_Y; if(DP_INP_CROP_WIDTH >= 1) - crop.last_x = DP_INP_CROP_WIDTH - 1; + crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1; else crop.last_x = 0; if(DP_INP_CROP_HEIGHT >= 1) - crop.last_y = DP_INP_CROP_HEIGHT - 1; + crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1; else crop.last_y = 0; diff --git a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_cfg.h b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_cfg.h index a4b8f003..f6da9460 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_cfg.h +++ b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_cfg.h @@ -30,6 +30,8 @@ #include "hx_drv_gpio.h" #include "hx_drv_inp.h" +#define IMG_640_480 1 + typedef enum { APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X, @@ -50,6 +52,18 @@ typedef enum #define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130) #define DYNAMIC_ADDRESS +#ifdef IMG_640_480 +#define IMX708_SENSOR_WIDTH 2304 +#define IMX708_SENSOR_HEIGHT 1296 +#define IMX708_INP_CROP_WIDTH 1280 +#define IMX708_INP_CROP_HEIGHT 960 +#define IMX708_INP_OUT_WIDTH 640 +#define IMX708_INP_OUT_HEIGHT 480 +#define IMX708_HW2x2_CROP_WIDTH 640 +#define IMX708_HW2x2_CROP_HEIGHT 480 +#define IMX708_HW5x5_CROP_WIDTH 640 +#define IMX708_HW5x5_CROP_HEIGHT 480 +#else #define IMX708_SENSOR_WIDTH 2304 #define IMX708_SENSOR_HEIGHT 1296 #define IMX708_INP_CROP_WIDTH 2304 @@ -60,6 +74,7 @@ typedef enum #define IMX708_HW2x2_CROP_HEIGHT 264 #define IMX708_HW5x5_CROP_WIDTH 576 #define IMX708_HW5x5_CROP_HEIGHT 320 +#endif #define IMX708_QBC_ADJUST (0x02) #define IMX708_REG_BASE_SPC_GAINS_L (0x7b10) @@ -108,10 +123,17 @@ typedef enum * * CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0 */ +#ifdef IMG_640_480 +#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B +#define DP_INP_BINNING INP_BINNING_DISABLE +#define DP_INP_CROP_START_X 504 +#define DP_INP_CROP_START_Y 168 +#else #define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B #define DP_INP_BINNING INP_BINNING_DISABLE #define DP_INP_CROP_START_X 0 #define DP_INP_CROP_START_Y 0 +#endif #define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH #define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT #define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH diff --git a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_sensor.c b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_sensor.c index 31633afd..0485651a 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_sensor.c +++ b/EPII_CM55M_APP_S/app/scenario_app/allon_sensor_tflm_freertos/cis_sensor/cis_imx708/cisdp_sensor.c @@ -122,6 +122,7 @@ void IMX708_set_pll200() cfg.mipiclk.hscmipiclkdiv = 0; } + cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M; hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1); uint32_t mipi_pixel_clk = 96; @@ -466,12 +467,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, sensordplib_CBEvent crop.start_y = DP_INP_CROP_START_Y; if(DP_INP_CROP_WIDTH >= 1) - crop.last_x = DP_INP_CROP_WIDTH - 1; + crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1; else crop.last_x = 0; if(DP_INP_CROP_HEIGHT >= 1) - crop.last_y = DP_INP_CROP_HEIGHT - 1; + crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1; else crop.last_y = 0; diff --git a/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_cfg.h b/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_cfg.h index a4b8f003..f6da9460 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_cfg.h +++ b/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_cfg.h @@ -30,6 +30,8 @@ #include "hx_drv_gpio.h" #include "hx_drv_inp.h" +#define IMG_640_480 1 + typedef enum { APP_DP_RES_RGB640x480_INP_SUBSAMPLE_1X, @@ -50,6 +52,18 @@ typedef enum #define SENSORDPLIB_SENSOR_IMX708 (SENSORDPLIB_SENSOR_HM2130) #define DYNAMIC_ADDRESS +#ifdef IMG_640_480 +#define IMX708_SENSOR_WIDTH 2304 +#define IMX708_SENSOR_HEIGHT 1296 +#define IMX708_INP_CROP_WIDTH 1280 +#define IMX708_INP_CROP_HEIGHT 960 +#define IMX708_INP_OUT_WIDTH 640 +#define IMX708_INP_OUT_HEIGHT 480 +#define IMX708_HW2x2_CROP_WIDTH 640 +#define IMX708_HW2x2_CROP_HEIGHT 480 +#define IMX708_HW5x5_CROP_WIDTH 640 +#define IMX708_HW5x5_CROP_HEIGHT 480 +#else #define IMX708_SENSOR_WIDTH 2304 #define IMX708_SENSOR_HEIGHT 1296 #define IMX708_INP_CROP_WIDTH 2304 @@ -60,6 +74,7 @@ typedef enum #define IMX708_HW2x2_CROP_HEIGHT 264 #define IMX708_HW5x5_CROP_WIDTH 576 #define IMX708_HW5x5_CROP_HEIGHT 320 +#endif #define IMX708_QBC_ADJUST (0x02) #define IMX708_REG_BASE_SPC_GAINS_L (0x7b10) @@ -108,10 +123,17 @@ typedef enum * * CROP DISABLE: DP_INP_CROP_START_X/DP_INP_CROP_START_Y/DP_INP_CROP_WIDTH/DP_INP_CROP_HEIGHT all 0 */ +#ifdef IMG_640_480 +#define DP_INP_SUBSAMPLE INP_SUBSAMPLE_4TO2_B +#define DP_INP_BINNING INP_BINNING_DISABLE +#define DP_INP_CROP_START_X 504 +#define DP_INP_CROP_START_Y 168 +#else #define DP_INP_SUBSAMPLE INP_SUBSAMPLE_8TO2_B #define DP_INP_BINNING INP_BINNING_DISABLE #define DP_INP_CROP_START_X 0 #define DP_INP_CROP_START_Y 0 +#endif #define DP_INP_CROP_WIDTH IMX708_INP_CROP_WIDTH #define DP_INP_CROP_HEIGHT IMX708_INP_CROP_HEIGHT #define DP_INP_OUT_WIDTH IMX708_INP_OUT_WIDTH diff --git a/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_sensor.c b/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_sensor.c index 64e951b5..1cc920a0 100644 --- a/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_sensor.c +++ b/EPII_CM55M_APP_S/app/scenario_app/tflm_fd_fm/cis_sensor/cis_imx708/cisdp_sensor.c @@ -119,6 +119,7 @@ void IMX708_set_pll200() cfg.mipiclk.hscmipiclkdiv = 0; } + cfg.dpclk = SCU_HSCDPCLKSRC_RC96M48M; hx_drv_scu_set_pdhsc_dpclk_cfg(cfg, 0, 1); uint32_t mipi_pixel_clk = 96; @@ -463,12 +464,12 @@ int cisdp_dp_init(bool inp_init, SENSORDPLIB_PATH_E dp_type, evthandlerdp_CBEven crop.start_y = DP_INP_CROP_START_Y; if(DP_INP_CROP_WIDTH >= 1) - crop.last_x = DP_INP_CROP_WIDTH - 1; + crop.last_x = DP_INP_CROP_START_X + DP_INP_CROP_WIDTH - 1; else crop.last_x = 0; if(DP_INP_CROP_HEIGHT >= 1) - crop.last_y = DP_INP_CROP_HEIGHT - 1; + crop.last_y = DP_INP_CROP_START_Y + DP_INP_CROP_HEIGHT - 1; else crop.last_y = 0;