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

📄 l2_dram.c

📁 台湾凌阳方案300万数码相机源代码
💻 C
📖 第 1 页 / 共 4 页
字号:
//-----------------------------------------------------------------------------
/*
routine description:
                Check if the decompression error happened
arguments:
                none
return value:
                0x00     - success
                others   - error
*/
UCHAR L2_CheckDecompress(void) USING_0
{
        UCHAR decomperr;

        //avoid warning

        //body
        if(XBYTE[0x2887]==0x01)  // decompress OK
           decomperr=0x00;
        else                     // decompress fail
           decomperr=0x01;

        //return
        return(decomperr);
}

//-----------------------------------------------------------------------------
//L2_SetAFBAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the frame buffer A starting address
arguments:
                AFBAddr - Starting address of frame buffer A
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetAFBAddr(ULONG AFBAddr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2753]=(UCHAR)AFBAddr&0xff;
        XBYTE[0x2754]=(UCHAR)(AFBAddr>>8)&0xff;
        XBYTE[0x2755]=(UCHAR)(AFBAddr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetAFBSize
//-----------------------------------------------------------------------------
/*
routine description:
                Set the frame buffer A width and height
arguments:
                AFBHSize - The frame buffer A width
                AFBVSize - The frame buffer A height
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetAFBSize(USHORT AFBHSize, USHORT AFBVSize) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2760]=(UCHAR)AFBHSize&0xff;
        XBYTE[0x2761]=(UCHAR)(AFBHSize>>8)&0x0f;  //limit the width to 4095
        XBYTE[0x2762]=(UCHAR)AFBVSize&0xff;
        XBYTE[0x2763]=(UCHAR)(AFBVSize>>8)&0x0f;  //limit the height to 4095

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetBFBAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the frame buffer B starting address
arguments:
                BFBAddr - Starting address of frame buffer B
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetBFBAddr(ULONG BFBAddr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2756]=(UCHAR)BFBAddr&0xff;
        XBYTE[0x2757]=(UCHAR)(BFBAddr>>8)&0xff;
        XBYTE[0x2758]=(UCHAR)(BFBAddr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetBFBSize
//-----------------------------------------------------------------------------
/*
routine description:
                Set the frame buffer B width and height
arguments:
                BFBHSize - The frame buffer B width
                BFBVSize - The frame buffer B height
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetBFBSize(USHORT BFBHSize, USHORT BFBVSize) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2764]=(UCHAR)BFBHSize&0xff;
        XBYTE[0x2765]=(UCHAR)(BFBHSize>>8)&0x0f;  //limit the width to 4095
        XBYTE[0x2766]=(UCHAR)BFBVSize&0xff;
        XBYTE[0x2767]=(UCHAR)(BFBVSize>>8)&0x0f;  //limit the height to 4095

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetAVLCAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the VLC buffer A starting address
arguments:
                Addr - Starting address of A VLC buffer
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetAVLCAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2730]=(UCHAR)Addr&0xff;
        XBYTE[0x2731]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x2732]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetBVLCAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the VLC buffer B starting address
arguments:
                Addr - Starting address of B VlC bufferreturn value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetBVLCAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2733]=(UCHAR)Addr&0xff;
        XBYTE[0x2734]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x2735]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetDCTAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the DC-term buffer starting address
arguments:
                Addr - Starting address of the DC-term buffer
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetDCTAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2736]=(UCHAR)Addr&0xff;
        XBYTE[0x2737]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x2738]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetAUDAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the audio buffer starting address
arguments:
                Addr - Starting address of the audio buffer
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetAUDAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x273a]=(UCHAR)Addr&0xff;
        XBYTE[0x273b]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x273c]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetFOSDAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the FONT-based OSD buffer starting address
arguments:
                Addr - Starting address of the Font-based OSD buffer
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetFOSDAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2759]=(UCHAR)Addr&0xff;
        XBYTE[0x275a]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x275b]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetRFBAddr
//-----------------------------------------------------------------------------
/*
routine description:
                Set the RAW frame buffer starting address
arguments:
                Addr - Starting address of the raw frame buffer
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetRFBAddr(ULONG Addr) USING_0
{
        UCHAR status = L2K_SUCCESS;

        //body
        XBYTE[0x2768]=(UCHAR)Addr&0xff;
        XBYTE[0x2769]=(UCHAR)(Addr>>8)&0xff;
        XBYTE[0x276a]=(UCHAR)(Addr>>16)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetACDSPWidth
//-----------------------------------------------------------------------------
/*
routine description:
                Set the width of the A-frame buffer for CDSP reference only
arguments:
                Width: image width to be processed
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetACDSPWidth(USHORT Width) USING_0
{
        UCHAR status = L2K_SUCCESS;
        //body
        XBYTE[0x27f0]=(UCHAR)Width&0xff;
        XBYTE[0x27f1]=(UCHAR)(Width>>8)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetBCDSPWidth
//-----------------------------------------------------------------------------
/*
routine description:
                Set the width of the B-frame buffer for CDSP reference only
arguments:
                Width: image width to be processed
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetBCDSPWidth(USHORT Width) USING_0
{
        UCHAR status = L2K_SUCCESS;
        //body
        XBYTE[0x27f2]=(UCHAR)Width&0xff;
        XBYTE[0x27f3]=(UCHAR)(Width>>8)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetRCDSPWidth
//-----------------------------------------------------------------------------
/*
routine description:
                Set the width of the raw frame buffer for CDSP reference only
arguments:
                Width: image width to be processed
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetRCDSPWidth(USHORT Width) USING_0
{
        UCHAR status = L2K_SUCCESS;
        //body
        XBYTE[0x27f4]=(UCHAR)Width&0xff;
        XBYTE[0x27f5]=(UCHAR)(Width>>8)&0xff;

        //return
        return(status);
}

//-----------------------------------------------------------------------------
//L2_SetImageType
//-----------------------------------------------------------------------------
/*
routine description:
                Set the image type
arguments:
                ImgType: image type
return value:
                0x00    - success
                others  - error
*/
UCHAR L2_SetImageType(UCHAR ImgType) USING_0
{
        UCHAR status = L2K_SUCCESS;

⌨️ 快捷键说明

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