?? viporosd.c
字號:
for(j=0 ; j<7 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); for(j=0 ; j<7 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); for(j=0 ; j<7 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); for(j=0 ; j<7 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); for(j=0 ; j<3 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); } Vipor_SC_Write_Byte(0x09, 0x02); #undef i #undef j}
//--------------------------------------------------------------------------
// Function : VPP_OsdClearArea
// Description : clear area data
// Input : (bHstart,bVstart) -> (x1,y1)
// (bHend , bVend ) -> (x2,y2)
//--------------------------------------------------------------------------
void VPP_OsdClearArea(BYTE bVstart, BYTE bVend, BYTE bHstart, BYTE bHend, BYTE bAttr)
{ #define i __bViporTemp12 #define j __bViporTemp13 #define k __bViporTemp14 for(k=0 ; k<8 ; k++) gbTrmBuf[k] = 0x00; Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ATTR, bAttr); // (VPSC_OSD_AT) Set attribute
for(i=bVstart ; i<=bVend ; i++)
{
Vipor_OsdSetAddress(i, bHstart); // set starting address
for(j=0; j<=(bHend - bHstart)/7; j++)
{
for(k=0 ; k<7 ; j++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); }
for (k=0;k<=(bHend - bHstart)%7;k++) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, _VIPOR__); } #undef i #undef j
#undef k}//--------------------------------------------------------------------------// Function : Vipor_OsdPositionSet// Description : Set OSD display position// Input : (hpos,vpos) -> (x,y)//--------------------------------------------------------------------------void Vipor_OsdPositionSet(BYTE bHpos, BYTE bVpos){ Vipor_SC_Write_Byte(VP_OSD_H_POSITION, bHpos); // VPSC_OSD_HPOSITION Vipor_SC_Write_Byte(VP_OSD_V_POSITION, bVpos); // VPSC_OSD_VPOSITION}//--------------------------------------------------------------------------// Function : PrintString// Description : Print a string in OSD. The pRomData pointer is first character// Input : pRomData -> array of string head// (col,row) -> (x,y) Print position//--------------------------------------------------------------------------void Vipor_PrintString(BYTE bRow, BYTE bCol, BYTE bColor, BYTE code *pRomData){ #define i __bViporTemp13 #define bData __bViporTemp14 //#define bx __bViporTemp3 if(*pRomData == _VIPOR_EOF) return;
bRow &= 0x0F; // mask off other attribute
Vipor_OsdSetAddress(bRow, bCol); // set starting address
Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ATTR, bColor); // (VPSC_OSD_AT)set attribute
for(i=0 ; *(pRomData+i)!=_VIPOR_EOF ; i++)
{
bData = *(pRomData+i);
Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, bData); // (VPSC_OSD_DT) //909R
bCol++;
if( bCol>=30 ) break; // avoid overflow
} #undef i #undef bData //#undef bx }//#ifdef SetPicture_ALLvoid Vipor_PrintString_ALL(BYTE bRow, BYTE bCol, BYTE bColor, BYTE *pRomData){ #define i __bViporTemp13 #define bData __bViporTemp14 //#define bx __bViporTemp3 if(*pRomData == _VIPOR_EOF) return; bRow &= 0x0F; // mask off other attribute Vipor_OsdSetAddress(bRow, bCol); // set starting address Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ATTR, bColor); // (VPSC_OSD_AT)set attribute for(i=0 ; *(pRomData+i)!=_VIPOR_EOF ; i++) { bData = *(pRomData+i); Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, bData); // (VPSC_OSD_DT) //909R bCol++; if( bCol>=30 ) break; // avoid overflow } #undef i #undef bData //#undef bx }//#endif//--------------------------------------------------------------------------// Function : PrintChar// Description : Print a char// Input : bChar -> character// (col,row) -> (x,y) Print position//--------------------------------------------------------------------------void Vipor_PrintChar(BYTE bRow, BYTE bCol, BYTE bColor, BYTE bChar){ Vipor_OsdSetAddress(bRow, bCol); // set starting address //Vipor_SC_Write_Byte(0x59, bColor); // (VPSC_OSD_AT)set attribute //Vipor_SC_Write_Byte(0x5A, bChar); // (VPSC_OSD_DT) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ATTR, bColor); // (VPSC_OSD_AT)set attribute Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, bChar); // (VPSC_OSD_DT)}#if 1 //--------------------------------------------------------------------------// Function : Vipor_SetFirstCharAttr// Input : (bCol,bRow) -> first char position// : bColor -> first char attr//--------------------------------------------------------------------------void Vipor_SetFirstCharAttr(BYTE bRow, BYTE bCol, BYTE bColor){ bRow &= 0x0F; // mask off other attribute Vipor_OsdSetAddress(bRow, bCol); // set starting address //Vipor_SC_Write_Byte(0x59, bColor); // (VPSC_OSD_AT)set attribute Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ATTR, bColor); // (VPSC_OSD_AT)set attribute}//--------------------------------------------------------------------------// Function : Vipor_SetOneCharContent// Input : bChar -> char // note : use with Vipor_SetFirstCharAttr//--------------------------------------------------------------------------void Vipor_SetOneCharContent(BYTE bChar){ //Vipor_SC_Write_Byte(0x5A, bChar); // (VPSC_OSD_DT) Vipor_SC_Write_Byte(VP_OSD_FONT_CODE_ADDR, bChar); // (VPSC_OSD_DT)}#endif//**************************************************************************// Function : OsdWindow// Description : Open a OSD window// Input : num -> OSD window index// (x0, y0, x1, y1) -> define window area// color -> define window color//**************************************************************************void OsdWindow(BYTE num, BYTE x0, BYTE y0, BYTE x1, BYTE y1, BYTE color){ #define bval __bViporTemp13 #define idx __bViporTemp14 //BYTE bval,idx; // idx = (num-1) * 5; idx = num * 5; Vipor_SC_Write_Byte(VP_OSD_WIN_ADDR,idx+1); Vipor_SC_Write_Byte(VP_OSD_WIN_DATA,0x08); bval = y0; // window starting adress Vipor_SC_Write_Byte(VP_OSD_WIN_ADDR,idx); // Vstart Vipor_SC_Write_Byte(VP_OSD_WIN_DATA,bval); bval = y1; // window starting adress Vipor_SC_Write_Byte(VP_OSD_WIN_ADDR,idx+1); // Vend Vipor_SC_Write_Byte(VP_OSD_WIN_DATA,bval); bval = (x1 + 1) << 3; // Hend bval |= (color >> 2); // R,G,B Vipor_SC_Write_Byte(VP_OSD_WIN_ADDR,idx+3); Vipor_SC_Write_Byte(VP_OSD_WIN_DATA,bval); bval = (x0 + 1) << 3; // Hstart bval |= 0x04; // Osd enable if( color & 0x02 ) bval |= 0x01; // Intensity Vipor_SC_Write_Byte(VP_OSD_WIN_ADDR,idx+2); Vipor_SC_Write_Byte(VP_OSD_WIN_DATA,bval); #undef bval #undef idx}//--------------------------------------------------------------------------// Function : Vipor_OsdEnable// Description : Enable/Disable osd display// Input : 1 -> Enable// 0 -> Disable//--------------------------------------------------------------------------void Vipor_OsdEnable(BYTE flag){ if(flag) { Vipor_SC_Write_Byte(VP_OSD_CTRL_REG, 0x1D); // (VPSC_OSD_CONTROL) Set enable bit. } else { Vipor_SC_Write_Byte(VP_OSD_CTRL_REG, 0x1C); // (VPSC_OSD_CONTROL) Set disable bit. }}void Vipor_OsdInit(void){ #define i __bViporTemp5 //BYTE i; //Vipor_OsdEnable(FALSE);//printf("time 1 = %x\n", UTL_GetSysTimer()); Vipor_LoadColorLookupTable();//printf("time 2 = %x\n", UTL_GetSysTimer()); Vipor_SC_Write_Byte(VP_OSD_SP_DEF, 0x5A); // VPSC_OSD_SPDEF=01011010 // |/|/|||+--- 0 0:Intensity color of space code // |/|/||+---- 1 1:Blue color of space code // |/|/|+----- 0 2:Green color of space code // |/|/+------ 1 3:Red color of space code // |/+-------- 01 54:Veritical position step // |/+-------- 01 76:Horziontal position step//printf("time 3 = %x\n", UTL_GetSysTimer()); Vipor_SC_Write_Byte(VP_OSD_SYS_CTRL, 0x00); // VPSC_SYS_CONTROL Vipor_SC_Write_Byte(VP_OSD_START_ROW, 0x00); // VPSC_OSD_STARTROW Vipor_SC_Write_Byte(VP_OSD_DISP_OPTION, 0x00); // VPSC_SYS_CONTROL1 Vipor_SC_Write_Byte(VP_OSD_CTRL_REG_2, 0x00); // VPSC_OSD_CONTROL2 Vipor_SC_Write_Byte(VP_OSD_CTRL_REG, 0x1C); // VPSC_OSD_CONTROL //Vipor_SC_Write_Byte(VP_OSD_GRAPHIC_START, 0xFF); // VPSC_GRAPHIC_START //Vipor_SC_Write_Byte(VP_OSD_GRAPHIC_END, 0xFF); // VPSC_GRAPHIC_END Vipor_OsdDisableWindow(0); Vipor_OsdDisableWindow(1); Vipor_OsdDisableWindow(2); Vipor_OsdDisableWindow(3);//printf("time 4 = %x\n", UTL_GetSysTimer()); for(i = 0; i < 15; i++) { Vipor_OsdSetRowAttr(i, 0x00, 0x14); // Normal } //printf("time 5 = %x\n", UTL_GetSysTimer()); Vipor_OsdSetRowAttr(15, 0x00, 0x15); // NORMAL + EOD Vipor_OsdClearRow(0, 15, VIPOR_OSD_BLACK); // OSD_BLACK=0 Vipor_OsdPositionSet(5,5); Vipor_OsdEnable(TRUE);//printf("time 6 = %x\n", UTL_GetSysTimer()); Vipor_SC_Write_Byte(0x85, 0x00); #undef i}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -