⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 app_dol2function.c

📁 台湾凌阳方案300万数码相机源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
                L2_FuncID       - L2 Function ID (04)
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_DMAC(UCHAR L2_FuncID, ULONG *ArgBuf)
{

    UCHAR  ByteData;
    USHORT WordData;
    ULONG  LongData;

    switch (L2_FuncID)
     {
      case 0x00:
                L2_DoDMA((UCHAR)ArgBuf[0], (UCHAR)ArgBuf[1], (USHORT)ArgBuf[2], (UCHAR)ArgBuf[3], (UCHAR)ArgBuf[4]);
                //PRINT_APP("L2 0400 finish\n");
                break;
      case 0x01:
                L2_ResetDMA();
                //PRINT_APP("L2 0401 finish\n");
                break;
      case 0x02:
                L2_GetDMABufSize(&ByteData);
                //PRINT_APP("L2 0402 finish\n");
                break;
      case 0x03:
                L2_WriteDMAPort((UCHAR)ArgBuf[0]);
                //PRINT_APP("L2 0403 finish\n");
                break;
      case 0x04:
                L2_ReadDMAPort(&ByteData);
                //PRINT_APP("L2 0404 finish\n");
                break;
      case 0x05:
                L2_CheckDMACmp(&ByteData);
                //PRINT_APP("L2 0405 finish\n");
                break;
      case 0x06:
                L2_SetDRAMDMA((ULONG)ArgBuf[0]);
                //PRINT_APP("L2 0406 finish\n");
                break;
      case 0x07:
                L2_SetSRAMDMA((USHORT)ArgBuf[0]);
                //PRINT_APP("L2 0407 finish\n");
                break;
      case 0x08:
                L2_SetUSBDMA((UCHAR)ArgBuf[0], (UCHAR)ArgBuf[1]);
                //PRINT_APP("L2 0408 finish\n");
                break;
      case 0x09:
                L2_SetAudDMA((UCHAR)ArgBuf[0]);
                //PRINT_APP("L2 0409 finish\n");
				break;
	  case 0x0A:
                L2_ReadDRAMDMAAdr(&LongData);
                //PRINT_APP("L2 0409 finish\n");
				break;
      case 0x0B:
                L2_SearchPattern((ULONG)ArgBuf[0], (UCHAR)ArgBuf[1], (UCHAR)ArgBuf[2], (USHORT)ArgBuf[3],&WordData,&WordData);
                //PRINT_APP("L2 040A finish\n");
                break;
      #ifdef TestModeEn
      case 0xff:
                L2_TestDMAC((UCHAR)ArgBuf[0]);
                break;
      #endif
      default:
                break;
                }

                return L2K_SUCCESS;

}



//-----------------------------------------------------------------------------
//App_DoL2Function_LCDTV
//-----------------------------------------------------------------------------
/*
routine description:
                Do specified LCDTV L2 Function
arguments:
                L2_FuncID       - L2 Function ID
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_LCDTV(UCHAR L2_FuncID, ULONG *ArgBuf)
{


	switch (L2_FuncID)
	{
		case 0x00:
			L2_InitLCDTV((ULONG)ArgBuf[0]);
			break;
		case 0x01:
			L2_SetDisplayType((UCHAR)ArgBuf[0]);
			break;
		case 0x02:
			L2_SetDisplaySrcImgSize((USHORT)ArgBuf[0],(USHORT)ArgBuf[1],(UCHAR)ArgBuf[2]);
			break;
		case 0x03:
			L2_TurnOnOffDisplay((UCHAR)ArgBuf[0]);
			break;
		case 0x04:
			L2_SetColorPalette((UCHAR)ArgBuf[0],(UCHAR)ArgBuf[1],(UCHAR)ArgBuf[2],(UCHAR)ArgBuf[3]);
			break;
		case 0x05:
			L2_SetFOSDIndex((UCHAR)ArgBuf[0],(UCHAR)ArgBuf[1],(USHORT)ArgBuf[2]);
			break;
		case 0x06:
			L2_SetFOSDAttr((UCHAR)ArgBuf[0],(UCHAR)ArgBuf[1],(UCHAR)ArgBuf[2]);
			break;
		case 0x07:
			L2_SetFOSDOffset((UCHAR)ArgBuf[0],(UCHAR)ArgBuf[1],(UCHAR)ArgBuf[2]);
			break;
		case 0x08:
			L2_SetFOSDBGMixlevel((UCHAR)ArgBuf[0]);
			break;
		case 0x09:
			L2_SetOSDSelWindow((USHORT)ArgBuf[0],(USHORT)ArgBuf[1],(USHORT)ArgBuf[2],(USHORT)ArgBuf[3],(UCHAR)ArgBuf[4]);
			break;
		case 0x0A:
			L2_SetLCDTVGamma((UCHAR*) ArgBuf);
			break;
		case 0x0B:
			L2_TurnOnTVGamma((UCHAR)ArgBuf[0]);
			break;
		case 0x0C:
			L2_ShowFOSDEffect((UCHAR)ArgBuf[0],(UCHAR)ArgBuf[1]);
			break;
		case 0x0D:
			L2_DefineColorKey((UCHAR)ArgBuf[0]);
			break;
		case 0x0E:
			L2_CtrlScreen((UCHAR)ArgBuf[0]);
			break;
#ifdef TestModeEn
		case 0x0F:
			L2_TestTVSRAM((UCHAR)ArgBuf[0]);
			break;
#endif
		default:
			break;
	}

	return L2K_SUCCESS;

}
//-----------------------------------------------------------------------------
//App_DoL2Function_SDRAM
//-----------------------------------------------------------------------------
/*
routine description:
                Do specified SDRAM L2 Function
arguments:
                L2_FuncID       - L2 Function ID
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_SDRAM(UCHAR L2_FuncID, ULONG *ArgBuf)
{

  switch (L2_FuncID)
 {
  case 0x00:
          L2_InitSDRAM((ULONG)ArgBuf[0]);
          break;
  case 0x11:
          L2_SetJPEGVscale((USHORT)ArgBuf[0], (USHORT)ArgBuf[1]);
          break;
  case 0x12:
          L2_WriteQTable((UCHAR)ArgBuf[0], (UCHAR)ArgBuf[1], 0);
          break;
  case 0x20:
          L2_Compress((UCHAR)ArgBuf[0], ArgBuf[1], (USHORT)ArgBuf[2], (USHORT)ArgBuf[3],
                      ArgBuf[4], ArgBuf[5], (UCHAR)ArgBuf[6]);
          break;
  case 0x21:
          L2_DeCompress(ArgBuf[0], (USHORT)ArgBuf[1], (USHORT)ArgBuf[2], ArgBuf[3],
                        (UCHAR)ArgBuf[4], (UCHAR)ArgBuf[5], (USHORT)ArgBuf[6]);

          break;
  default:
          break;
 }

  return L2K_SUCCESS;
}


//-----------------------------------------------------------------------------
//App_DoL2Function_Front
//-----------------------------------------------------------------------------
/*
routine description:
                Do specified Front L2 Function
arguments:
                L2_FuncID       - L2 Function ID
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_Front(UCHAR L2_FuncID, ULONG *ArgBuf)
{
  UCHAR temp0[1], temp1[1];





  temp0[0] = (UCHAR)ArgBuf[0];
  temp1[0] = (UCHAR)ArgBuf[1];
  switch (L2_FuncID)
   {
     case 0x00:
       L2_InitFront((ULONG)ArgBuf[0]);
       break;
	 case 0x01:
//       L2_InitLens();
       break;
	 case 0x10:
       L2_WriteSSC (temp0, temp1, 0x01, 0x00);
           ////PRINT_L2 ("            Write I2C reg %bx = %bx \n", temp0[0], temp0[1]);
       break;
	 case 0x11:
       L2_ReadSSC(temp0[0], temp1, 0x01, 0x01);
           ////PRINT_L2 ("            Read I2C reg %bx = %bx \n", temp0[0], temp0[1]);
       break;
	 case 0x12:

       break;
	 case 0x21:
         L2_CloseMShutter();
       break;
	 case 0x22:
         L2_OpenMShutter();
       break;
	 case 0x23:
         L2_SetIris((UCHAR)ArgBuf[0]);
       break;
     case 0x24:
//         L2_SetFlash((USHORT)ArgBuf[0], (USHORT)ArgBuf[1], (UCHAR)ArgBuf[2]);
       break;
     case 0x25:
           L2_SetFocus((UCHAR)ArgBuf[0], (UCHAR)ArgBuf[1]);
       break;
	 case 0x30:
         L2_SnapFront((UCHAR)ArgBuf[0]);
       break;
	 case 0x31:
       break;
	 case 0x32:
       L2_AdjustGain((USHORT)ArgBuf[0], 0);
       break;
     case 0x33:
       L2_SetExposureTime((USHORT)ArgBuf[0], 0);
       break;
     case 0x34:
       L2_SetFrameRate ((UCHAR)ArgBuf[0], 0);
       break;
	 case 0x35:
       L2_SetFrontImgOffsetm((USHORT)ArgBuf[0], (USHORT)ArgBuf[1]);
       break;
	 case 0x36:
       L2_SetFrontImgOffsetc((USHORT)ArgBuf[0], (USHORT)ArgBuf[1]);
       break;
	 case 0x37:
       L2_SetFrontImgSizem((USHORT)ArgBuf[0], (USHORT)ArgBuf[1]);
       break;
	 case 0x38:
       L2_SetFrontImgSizem((USHORT)ArgBuf[0], (USHORT)ArgBuf[1]);
       break;
     case 0xF0:
       //L3_SetProbe(0);
       break;
     case 0xFF:
       {
        /*L2_SetCDSPScale(100,100);
      	L2_SetAFBAddr(0x04d380);
       	L2_SetAFBSize(640, 480);
       	L2_SetACDSPWidth(640);
        L2_SetRFBAddr(0x04d380);
       	L2_SetRFBSize(640, 480);
       	L2_SetRCDSPWidth(640);
       	L2_SetCamMode(2);
        L2_WaitVD(0, 1);*/
/*  // original
		L2_SetCDSPScale(100,100); //TurnOff the CDSP H-scale function
        L2_SetImageType(0);         //Set raw dta type
        L2_SetDisplayMode(0,0);     // disable  frame rate conversion

       L2_SetRFBAddr(0x04d380);  //captured raw data will be stored in the buffer
       L2_SetAFBAddr(0x04d380);

       L2_SetAFBSize(640,480);
       L2_SetRFBSize(640,480);      //pointed by the Raw buffer pointer
       L2_SetRCDSPWidth(640);
       L2_SetACDSPWidth(640);

       L2_SetCamMode(0); //prepare to receiver data fomr the sensor
       L2_SetCamMode(2);

       L2_WaitVD(0,1);   //wait for the falling edge of VD for one time                          // Set to DSC mode
       L2_SnapFront(1);  //Trigger the  CMOS sensor into the full-frame mode
       while ((XBYTE[0X2B05] & 0x10) == 0x10);
       //PRINT_APP("front done\n");
       while ((XBYTE[0x27b0]& 0x02) == 0);
       //PRINT_APP("capture done\n");
       L2_SetCMOSPreview();
*/
// WZH
		L2_SetCDSPScale(100,100); //TurnOff the CDSP H-scale function
        L2_SetImageType(0);         //Set raw dta type
        L2_SetDisplayMode(0,0);     // disable  frame rate conversion
//patch5.0@richie@sdram mapping begin
       L2_SetRFBAddr(K_SDRAM_ImageCaptureGeneralBufAddr);  //captured raw data will be stored in the buffer
       L2_SetAFBAddr(K_SDRAM_ImageCaptureGeneralBufAddr);
//patch5.0@richie@sdram mapping end
       L2_SetAFBSize(640,480);
       L2_SetRFBSize(640,480);      //pointed by the Raw buffer pointer
       L2_SetRCDSPWidth(640);
       L2_SetACDSPWidth(640);

       L2_SetCamMode(0); //prepare to receiver data fomr the sensor
       L2_SetCamMode(2);

       L2_WaitVD(0,1);   //wait for the falling edge of VD for one time                          // Set to DSC mode
       L2_SnapFront(1);  //Trigger the  CMOS sensor into the full-frame mode
       while ((XBYTE[0X2B05] & 0x10) == 0x10);
       //PRINT_APP("front done\n");
       while ((XBYTE[0x27b0]& 0x02) == 0);
       //PRINT_APP("capture done\n");
       L2_SetCMOSPreview();

       }
        break;
      default:
        break;
    }
   return L2K_SUCCESS;
}


//-----------------------------------------------------------------------------
//App_DoL2Function_Misc
//-----------------------------------------------------------------------------
/*
routine description:
                Do specified Misc L2 Function
arguments:
                L2_FuncID       - L2 Function ID
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_Misc(UCHAR L2_FuncID, ULONG *ArgBuf)
{

                UCHAR temp0 = L2_FuncID;
                ULONG *temp1 = ArgBuf;
                return L2K_SUCCESS;

}



//-----------------------------------------------------------------------------
//App_DoL2Function_USB
//-----------------------------------------------------------------------------
/*
routine description:
                Do specified USB L2 Function
arguments:
                L2_FuncID       - L2 Function ID
                ArgBuf  - Pointer to the argument buffer

return value:
                0x00    - success

*/

UCHAR App_DoL2Function_USB(UCHAR L2_FuncID, ULONG *ArgBuf)
{

                UCHAR temp0 = L2_FuncID;
                ULONG *temp1 = ArgBuf;
                return L2K_SUCCESS;

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -