/*-------------------------------------------------------------------------------------------------
--
-- File Name    : main.c



-- Description  : This module replicates the CoaXPress Device main interface functionality.




-- Targeted device : Microchip FPGAs
-- Author          : India Solutions Team




--
-- COPYRIGHT 2023 BY MICROCHIP
-- THE INFORMATION CONTAINED IN THIS DOCUMENT IS SUBJECT TO LICENSING RESTRICTIONS
-- FROM MICROCHIP CORP.  IF YOU ARE NOT IN POSSESSION OF WRITTEN AUTHORIZATION FROM
-- MICROCHIP FOR USE OF THIS FILE, THEN THE FILE SHOULD BE IMMEDIATELY DESTROYED AND
-- NO BACK-UP OF THE FILE SHOULD BE MADE.
--



-------------------------------------------------------------------------------------------------*/

#ifndef APPLICATION_IMX334_COREI2C_IMX334_COREI2C_H_
#define APPLICATION_IMX334_COREI2C_IMX334_COREI2C_H_


#include "drivers/fpga_ip/CoreI2C/core_i2c.h"
#include "drivers/fpga_ip/CoreGPIO/core_gpio.h"
#include "fpga_design_config/fpga_design_config.h"

/*Pattern generator in camera - 1-enabled/0-disabled*/
/*If enabled, overrides all other camera settings*/
#define CAMERA_PATTERN_GEN_EN		0

/*Camera Configuration-
 * 0 - 500Mbps data rate, 1080p resolution
 * 1 - 1188Mbps data rate, 4k resolution */
#define CAM_CONFIG_4K_1_2M	1

#define FRAME_RATE_60FPS    0
#define STREAM0             1
#define STREAM1             2
#define DUAL_STREAM         3

/*Number of lane
* 1 - four lane
* 0 - eight lane  */
#define CAM_CONFIG_lane 1

#define CAM1_RST GPIO_4
#define CAM2_RST GPIO_5
#define CAM_CLK_EN GPIO_6
/*I2C Addresses*/
#define IMX334_1_DEV_REG  (0x1A )	//After adjusting for shift
#define IMX334_2_DEV_REG  (0x10)	//After adjusting for shift

void imx334_cam_reginit(uint8_t , uint8_t *);
void imx334_cam_init(void);
//void pattern_setting( uint8_t i2c_ch_sel);
void pattern_setting(uint8_t i2c_ch_sel, uint8_t Pattern_st);
void gain_setting( uint8_t i2c_ch_sel,uint16_t in_gain);
void reverse_x_setting( uint8_t i2c_ch_sel, uint16_t reverse_x);
void reverse_y_setting( uint8_t i2c_ch_sel, uint16_t reverse_y);
void resolution_setting( uint8_t i2c_ch_sel, uint8_t resolution[4]);

#endif /* APPLICATION_IMX334_COREI2C_IMX334_COREI2C_H_ */
