XilinxProcessorIPLib/drivers/mipicsiss/examples/xmipi_vck_example/mipi_cfg.c
int SensorReadData(u8 *BufferPtr, u16 ByteCount) {
	int Status;

	/* Set the Defaults. */
	ReceiveComplete = 1;

	Status = SensorWriteData(2);

	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Start the IIC device. */
	Status = XIic_Start(&IicSensor);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Receive the Data. */
	Status = XIic_MasterRecv(&IicSensor, BufferPtr, ByteCount);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Wait till all the data is received. */
	while ((ReceiveComplete) || (XIic_IsIicBusy(&IicSensor) == TRUE)) {

		usleep(10);
	}



	/* Stop the IIC device. */
	Status = XIic_Stop(&IicSensor);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 * This function reads data from the IIC serial Camera Sensor into a specified
 * buffer.
 *
 * @param	BufferPtr contains the address of the data buffer to be filled.
 * @param	ByteCount contains the number of bytes in the buffer to be read.
 *
 * @return	XST_SUCCESS if successful else XST_FAILURE.
 *
 * @note	None.
 *
 *****************************************************************************/
This function reads data from the IIC serial Camera Sensor into a specified
buffer.

@param       BufferPtr contains the address of the data buffer to be filled.
@param       ByteCount contains the number of bytes in the buffer to be read.



@note        None.
This function reads data from the IIC serial Camera Sensor into a specified buffer . @param BufferPtr contains the address of the data buffer to be filled . @param ByteCount contains the number of bytes in the buffer to be read . @note None .
int SensorReadData(u8 *BufferPtr, u16 ByteCount) {
	int Status;
	ReceiveComplete = 1;
	Status = SensorWriteData(2);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIic_Start(&IicSensor);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIic_MasterRecv(&IicSensor, BufferPtr, ByteCount);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	while ((ReceiveComplete) || (XIic_IsIicBusy(&IicSensor) == TRUE)) {
		usleep(10);
	}
	Status = XIic_Stop(&IicSensor);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int SensorReadData ( u8 * BufferPtr , u16 ByteCount ) { int Status ; ReceiveComplete = 1 ; Status = SensorWriteData ( 2 ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIic_Start ( & IicSensor ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIic_MasterRecv ( & IicSensor , BufferPtr , ByteCount ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } while ( ( ReceiveComplete ) || ( XIic_IsIicBusy ( & IicSensor ) == TRUE ) ) { usleep ( 10 ) ; } Status = XIic_Stop ( & IicSensor ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function reads data from the IIC serial Camera Sensor into a specified
 buffer.
This function reads data from the IIC serial Camera Sensor into a specified buffer .
/* Set the Defaults. */ /* Start the IIC device. */ /* Receive the Data. */ /* Wait till all the data is received. */ /* Stop the IIC device. */