XilinxProcessorIPLib/drivers/mipicsiss/examples/xmipi_vck_example/mipi_cfg.c
void FrmbufwrDoneCallback(void *CallbackRef) {
	 //xil_printf("  Wr Done  \r\n");
	int Status;

	 rd_ptr = wr_ptr;
	 if(wr_ptr == 0)
		 rd_ptr = 4 ;
	 else
		 rd_ptr = wr_ptr -1 ;

	 if(wr_ptr == 4) {

		  wr_ptr = 0;
	 }
	 else{
		 wr_ptr = wr_ptr + 1;
	 }

     XVFRMBUFRD_BUFFER_BASEADDR = frame_array[rd_ptr];
	 XVFRMBUFWR_BUFFER_BASEADDR = frame_array[wr_ptr];

	 Status = XVFrmbufWr_SetBufferAddr(&frmbufwr,
                                               XVFRMBUFWR_BUFFER_BASEADDR);
	   if(Status != XST_SUCCESS) {
	     xil_printf("ERROR:: Unable to configure Frame Buffer \
                                                 Write buffer address\r\n");
	   }

	   /* Set Chroma Buffer Address for semi-planar color formats */
	   if ((Cfmt == XVIDC_CSF_MEM_Y_UV8) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV8_420) ||
	       (Cfmt == XVIDC_CSF_MEM_Y_UV10) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV10_420)) {
	     Status = XVFrmbufWr_SetChromaBufferAddr(&frmbufwr,
                             XVFRMBUFWR_BUFFER_BASEADDR+CHROMA_ADDR_OFFSET);
	     if(Status != XST_SUCCESS) {
	       xil_printf("ERROR:: Unable to configure Frame Buffer \
                                           Write chroma buffer address\r\n");
	     }
	   }

	  Status = XVFrmbufRd_SetBufferAddr(&frmbufrd, XVFRMBUFRD_BUFFER_BASEADDR);
	   if(Status != XST_SUCCESS) {
	     xil_printf("ERROR:: Unable to configure Frame Buffer \
                                                   Read buffer address\r\n");
	   }

	   /* Set Chroma Buffer Address for semi-planar color formats */
	   if ((Cfmt == XVIDC_CSF_MEM_Y_UV8) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV8_420) ||
	       (Cfmt == XVIDC_CSF_MEM_Y_UV10) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV10_420)) {
	     Status = XVFrmbufRd_SetChromaBufferAddr(&frmbufrd,
                            XVFRMBUFRD_BUFFER_BASEADDR+CHROMA_ADDR_OFFSET);
	     if(Status != XST_SUCCESS) {
	       xil_printf("ERROR:: Unable to configure Frame \
                                      Buffer Read chroma buffer address\r\n");
	     }
	   }

	   if ( (frmrd_start == 0) && (wr_ptr == 2)){
		   XV_frmbufrd_EnableAutoRestart(&frmbufrd.FrmbufRd);
		   XVFrmbufRd_Start(&frmbufrd);
		   frmrd_start = 1 ;
	   }
frm_cnt++;
}
/*****************************************************************************/
/**
 *
 * This function is called when a Frame Buffer Write Done has occurred.
 *
 * @param	CallbackRef is a callback function reference.
 *
 * @return	None.
 *
 * @note	None.
 *
 *****************************************************************************/
This function is called when a Frame Buffer Write Done has occurred.
@param       CallbackRef is a callback function reference.

@return      None.

@note        None.
This function is called when a Frame Buffer Write Done has occurred . @param CallbackRef is a callback function reference . @return None . @note None .
void FrmbufwrDoneCallback(void *CallbackRef) {
	int Status;
	 rd_ptr = wr_ptr;
	 if(wr_ptr == 0)
		 rd_ptr = 4 ;
	 else
		 rd_ptr = wr_ptr -1 ;
	 if(wr_ptr == 4) {
		  wr_ptr = 0;
	 }
	 else{
		 wr_ptr = wr_ptr + 1;
	 }
     XVFRMBUFRD_BUFFER_BASEADDR = frame_array[rd_ptr];
	 XVFRMBUFWR_BUFFER_BASEADDR = frame_array[wr_ptr];
	 Status = XVFrmbufWr_SetBufferAddr(&frmbufwr,
                                               XVFRMBUFWR_BUFFER_BASEADDR);
	   if(Status != XST_SUCCESS) {
	     xil_printf("ERROR:: Unable to configure Frame Buffer \
                                                 Write buffer address\r\n");
	   }
	   if ((Cfmt == XVIDC_CSF_MEM_Y_UV8) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV8_420) ||
	       (Cfmt == XVIDC_CSF_MEM_Y_UV10) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV10_420)) {
	     Status = XVFrmbufWr_SetChromaBufferAddr(&frmbufwr,
                             XVFRMBUFWR_BUFFER_BASEADDR+CHROMA_ADDR_OFFSET);
	     if(Status != XST_SUCCESS) {
	       xil_printf("ERROR:: Unable to configure Frame Buffer \
                                           Write chroma buffer address\r\n");
	     }
	   }
	  Status = XVFrmbufRd_SetBufferAddr(&frmbufrd, XVFRMBUFRD_BUFFER_BASEADDR);
	   if(Status != XST_SUCCESS) {
	     xil_printf("ERROR:: Unable to configure Frame Buffer \
                                                   Read buffer address\r\n");
	   }
	   if ((Cfmt == XVIDC_CSF_MEM_Y_UV8) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV8_420) ||
	       (Cfmt == XVIDC_CSF_MEM_Y_UV10) ||
               (Cfmt == XVIDC_CSF_MEM_Y_UV10_420)) {
	     Status = XVFrmbufRd_SetChromaBufferAddr(&frmbufrd,
                            XVFRMBUFRD_BUFFER_BASEADDR+CHROMA_ADDR_OFFSET);
	     if(Status != XST_SUCCESS) {
	       xil_printf("ERROR:: Unable to configure Frame \
                                      Buffer Read chroma buffer address\r\n");
	     }
	   }
	   if ( (frmrd_start == 0) && (wr_ptr == 2)){
		   XV_frmbufrd_EnableAutoRestart(&frmbufrd.FrmbufRd);
		   XVFrmbufRd_Start(&frmbufrd);
		   frmrd_start = 1 ;
	   }
frm_cnt++;
}
void FrmbufwrDoneCallback ( void * CallbackRef ) { int Status ; rd_ptr = wr_ptr ; if ( wr_ptr == 0 ) rd_ptr = 4 ; else rd_ptr = wr_ptr - 1 ; if ( wr_ptr == 4 ) { wr_ptr = 0 ; } else { wr_ptr = wr_ptr + 1 ; } XVFRMBUFRD_BUFFER_BASEADDR = frame_array [ rd_ptr ] ; XVFRMBUFWR_BUFFER_BASEADDR = frame_array [ wr_ptr ] ; Status = XVFrmbufWr_SetBufferAddr ( & frmbufwr , XVFRMBUFWR_BUFFER_BASEADDR ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \
 \r \n " ) ; } if ( ( Cfmt == XVIDC_CSF_MEM_Y_UV8 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV8_420 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV10 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV10_420 ) ) { Status = XVFrmbufWr_SetChromaBufferAddr ( & frmbufwr , XVFRMBUFWR_BUFFER_BASEADDR + CHROMA_ADDR_OFFSET ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \
 \r \n " ) ; } } Status = XVFrmbufRd_SetBufferAddr ( & frmbufrd , XVFRMBUFRD_BUFFER_BASEADDR ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \
 \r \n " ) ; } if ( ( Cfmt == XVIDC_CSF_MEM_Y_UV8 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV8_420 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV10 ) || ( Cfmt == XVIDC_CSF_MEM_Y_UV10_420 ) ) { Status = XVFrmbufRd_SetChromaBufferAddr ( & frmbufrd , XVFRMBUFRD_BUFFER_BASEADDR + CHROMA_ADDR_OFFSET ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \
 \r \n " ) ; } } if ( ( frmrd_start == 0 ) && ( wr_ptr == 2 ) ) { XV_frmbufrd_EnableAutoRestart ( & frmbufrd . FrmbufRd ) ; XVFrmbufRd_Start ( & frmbufrd ) ; frmrd_start = 1 ; } frm_cnt ++ ; }
This function is called when a Frame Buffer Write Done has occurred.
This function is called when a Frame Buffer Write Done has occurred .
//xil_printf("  Wr Done  \r\n"); /* Set Chroma Buffer Address for semi-planar color formats */ /* Set Chroma Buffer Address for semi-planar color formats */