#ifndef __BOARD_KDP520_DVP_H__
#define __BOARD_KDP520_DVP_H__

#define IMGSRC_IN_0             YES
#define IMGSRC_IN_1             NO

#if (IMGSRC_IN_0 == YES)
#define IMGSRC_IN_0_PORT        IMGSRC_IN_PORT_DPI
#define IMGSRC_0_SENSORID       SENSOR_ID_EXTERN
#define IMGSRC_0_FORMAT         IMG_FORMAT_RAW8
#define IMGSRC_0_TYPE           IMG_TYPE_RGB
#define IMGSRC_0_RES            SENSOR_RES_640_480
#define IMGSRC_0_WIDTH          640
#define IMGSRC_0_HEIGHT         480
#define IMGSRC_0_TILE_AVG       0
#define IMGSRC_0_MIPI_LANE      2
#else
#define IMGSRC_IN_0_PORT        IMGSRC_IN_PORT_NONE
#define IMGSRC_0_SENSORID       SENSOR_ID_NONE
#define IMGSRC_0_FORMAT         IMG_FORMAT_RGB565
#define IMGSRC_0_TYPE           IMG_TYPE_RGB
#define IMGSRC_0_RES            SENSOR_RES_640_480
#define IMGSRC_0_WIDTH          640
#define IMGSRC_0_HEIGHT         480
#define IMGSRC_0_TILE_AVG       0
#define IMGSRC_0_MIPI_LANE      2
#endif

#if (IMGSRC_IN_1 == YES)
#define IMGSRC_IN_1_PORT        IMGSRC_IN_PORT_MIPI
#define IMGSRC_1_SENSORID       SENSOR_ID_SC132GS
#define IMGSRC_1_FORMAT         IMG_FORMAT_RAW8
#define IMGSRC_1_TYPE           IMG_TYPE_IR
#define IMGSRC_1_RES            SENSOR_RES_480_640
#define IMGSRC_1_WIDTH          480
#define IMGSRC_1_HEIGHT         640
#define IMGSRC_1_TILE_AVG       1
#define IMGSRC_1_MIPI_LANE      2
#else
#define IMGSRC_IN_1_PORT        IMGSRC_IN_PORT_NONE
#define IMGSRC_1_SENSORID       SENSOR_ID_NONE
#define IMGSRC_1_FORMAT         IMG_FORMAT_RAW8
#define IMGSRC_1_TYPE           IMG_TYPE_IR
#define IMGSRC_1_RES            SENSOR_RES_480_640
#define IMGSRC_1_WIDTH          480
#define IMGSRC_1_HEIGHT         640
#define IMGSRC_1_TILE_AVG       1
#define IMGSRC_1_MIPI_LANE      2
#endif

#if (IMGSRC_IN_0_PORT == IMGSRC_IN_PORT_MIPI || IMGSRC_IN_1_PORT == IMGSRC_IN_PORT_MIPI)
#define IMGSRC_IN_HAS_MIPI
#define MIPI_LANE_RGB           2
#define MIPI_LANE_NIR           2
#endif

#if (IMGSRC_IN_0_PORT ==  IMGSRC_IN_PORT_DPI || IMGSRC_IN_1_PORT ==  IMGSRC_IN_PORT_DPI)
#define IMGSRC_IN_HAS_DPI
#if (IMGSRC_IN_0_PORT ==  IMGSRC_IN_PORT_DPI)
#define IMAGE_DVP_PORT_NO       0
#else
#define IMAGE_DVP_PORT_NO       1
#endif
#endif

#if (IMGSRC_IN_0_PORT ==  IMGSRC_IN_PORT_UVC || IMGSRC_IN_1_PORT == IMGSRC_IN_PORT_UVC)
#define IMGSRC_IN_HAS_UVC
#endif

#if (IMGSRC_IN_0 && IMGSRC_IN_1 && IMGSRC_IN_2)
#define CAM_ID_MAX              3
#elif (IMGSRC_IN_0 && IMGSRC_IN_1)
#define CAM_ID_MAX              2
#elif (IMGSRC_IN_0 || IMGSRC_IN_1)
#define CAM_ID_MAX              1
#else
#define CAM_ID_MAX              0
#endif

#define IMGSRC_NUM              CAM_ID_MAX
#define MIPI_CAM_RGB            0
#define MIPI_CAM_NIR            1

#define LCDC_WIDTH              640
#define LCDC_HEIGHT             480

#define RGB_IMG_SOURCE_W        IMGSRC_0_WIDTH
#define RGB_IMG_SOURCE_H        IMGSRC_0_HEIGHT
#define NIR_IMG_SOURCE_W        IMGSRC_1_WIDTH
#define NIR_IMG_SOURCE_H        IMGSRC_1_HEIGHT

#define PANEL_TYPE              PANEL_MZT_480X272
#define DISPLAY_DEVICE          DISPLAY_DEVICE_LCDC

#define CAM_CLK_MS      2
#define CAM_CLK_NS      242
#define CAM_CLK_PS      2
#define CSI0_TXESC      4
#define CSI0_CSI        11
#define CSI0_VC0        5
#define CSI1_TXESC      4
#define CSI1_CSI        7
#define CSI1_VC0        1
#endif // __BOARD_KDP520_DVP_H__
