📄 vpc3230.c
字号:
dev_vpc323FPWrite(VPC_SCMODE_FP_REG,temp);
}
//******************************************************************************
//
// FUNCTION : BYTE dev_vpc323GetVideoBrightness(BYTE VidDecId)
// USAGE : Get the brightness value from video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : Brightness value
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static BYTE __near dev_vpc323GetVideoBrightness(BYTE VidDecId)
{
VidDecId=VidDecId+0;
return 0;
// return GVideoDecoder[VidDecId].Brightness;
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323SetVideoContrast(BYTE VidDecId,BYTE cval)
// USAGE : Set the contrast for video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// : cval - contrast value
// OUTPUT : None
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
static void __near dev_vpc323SetVideoContrast(BYTE cval)
{
WORD temp, temp1;
// GVideoDecoder[VidDecId].Contrast = cval;
temp1 = (((WORD)cval*0x3F)/100);
temp1 = temp1 & 0x003F;
temp = dev_vpc323FPRead(VPC_SCCT_FP_REG);
temp = temp & 0xFFC0;
temp = temp | temp1;
dev_vpc323FPWrite(VPC_SCCT_FP_REG,temp);
temp = dev_vpc323FPRead(VPC_SCMODE_FP_REG);
temp &= 0x7ff;
dev_vpc323FPWrite(VPC_SCMODE_FP_REG,temp);
}
//******************************************************************************
//
// FUNCTION : BYTE dev_vpc323GetVideoContrast(BYTE VidDecId)
// USAGE : Get the constast value from video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : Contrast value
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static BYTE __near dev_vpc323GetVideoContrast(BYTE VidDecId)
{
VidDecId=VidDecId+0;
return 0;
// return GVideoDecoder[VidDecId].Contrast;
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323SetVideoSaturation(BYTE VidDecId,BYTE sval)
// USAGE : Set the saturation for video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// : sval - saturation value
// OUTPUT : None
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
static void __near dev_vpc323SetVideoSaturation(BYTE sval)
{
WORD temp;
// GVideoDecoder[VidDecId].Saturation = sval;
temp = (((WORD)sval*0xFF)/100);
temp = temp << 4;
dev_vpc323FPWrite(VPC_ACC_SAT_FP_REG,temp);
}
//******************************************************************************
//
// FUNCTION : BYTE dev_vpc323GetVideoSaturation(BYTE VidDecId)
// USAGE : Get the saturation value from video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : Saturation value
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static BYTE __near dev_vpc323GetVideoSaturation(BYTE VidDecId)
{
VidDecId=VidDecId+0;
return 0;
// return GVideoDecoder[VidDecId].Saturation;
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323SetVideoHue(BYTE VidDecId,BYTE hval)
// USAGE : Set the Hue for video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// : hval - hue value
// OUTPUT : None
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
static void __near dev_vpc323SetVideoHue(BYTE hval)
{
WORD temp;
// GVideoDecoder[VidDecId].Hue = hval;
temp = (((WORD)hval*0xFF)/100);
temp = temp & 0x00FF;
if(temp > 0x7f)
{
temp = temp - 0x80;
temp = temp << 1;
}
else
{
temp = 0x80 - temp;
temp = temp << 1;
temp = 0xFFFF-temp;
}
dev_vpc323FPWrite(VPC_TINT_FP_REG,temp);
}
//******************************************************************************
//
// FUNCTION : BYTE dev_vpc323GetVideoHue(BYTE VidDecId)
// USAGE : Get the Hue value from video decoder device
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : Hue value
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static BYTE __near dev_vpc323GetVideoHue(BYTE VidDecId)
{
VidDecId=VidDecId+0;
return 0;
// return GVideoDecoder[VidDecId].Hue;
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323SetVideoSharpness(BYTE VidDecId,BYTE sharpval)
// USAGE : Set value for video sharpness.
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// sharpval - sharpness value
// OUTPUT : None
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
static void __near dev_vpc323SetVideoSharpness(BYTE sharpval)
{
WORD temp, temp1;
// GVideoDecoder[VidDecId].Sharpness = sharpval;
temp1 = (WORD)sharpval;
temp1 = temp1 & 0x0007;
temp = dev_vpc323FPRead(VPC_SCCT_FP_REG);
temp = temp & 0xF8FF;
temp = temp | (temp1<<8);
dev_vpc323FPWrite(VPC_SCCT_FP_REG,temp);
temp = dev_vpc323FPRead(VPC_SCMODE_FP_REG);
temp &= 0x7ff;
dev_vpc323FPWrite(VPC_SCMODE_FP_REG,temp);
temp = dev_vpc323FPRead(VPC_COMB_UC_FP_REG);
temp = temp & 0xF0FF;
temp = temp | (temp1<<9);
dev_vpc323FPWrite(VPC_COMB_UC_FP_REG,temp);
}
//******************************************************************************
//
// FUNCTION : BYTE dev_vpc323GetVideoSharpness(BYTE VidDecId)
// USAGE : Get value of video sharpness.
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : Sharpness value
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static BYTE __near dev_vpc323GetVideoSharpness(BYTE VidDecId)
{
VidDecId=VidDecId+0;
return 0;
// return GVideoDecoder[VidDecId].Sharpness;
}
#endif
//????
//******************************************************************************
//
// FUNCTION : void dev_vpc323PatGenControl(BYTE VidDecId,BYTE OnOff)
// USAGE : Turn on/off PatGenControl.
// INPUT : VidDecId - video decoder device ID (SAA7115, vpc323)
// OUTPUT : None
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
#if UNUSED && 0
static void __near dev_vpc323PatGenControl(BYTE OnOff)
{
WORD Temp;
Temp = dev_vpc323_WordRead(VPC_AVO_STOP_TWC_REG);
if(OnOff)
{
Temp = Temp | 0x9800;
dev_vpc323_WordWrite(VPC_AVO_STOP_TWC_REG,Temp);
}
else
{
Temp = Temp & ~(0x9800);
dev_vpc323_WordWrite(VPC_AVO_STOP_TWC_REG,Temp);
}
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323PowerUp(BYTE VidDecId)
// USAGE : This function powers up the vpc323 modules.
// INPUT : video decoder id
// OUTPUT : None
// GLOBALS : None
// USED_REGS : Power Save Control
//
//******************************************************************************
#if UNUSED && 0
static void __near dev_vpc323PowerUp(BYTE VidDecId)
{
VidDecId++; // Dummy
}
#endif
//******************************************************************************
//
// FUNCTION : void dev_vpc323PowerDown(void)
// USAGE : This function powers down the vpc323 modules.
// INPUT : video decoder id
// OUTPUT : None
// GLOBALS : None
// USED_REGS : Power Save Control
//
//******************************************************************************
#if UNUSED && 0
static void __near dev_vpc323PowerDown(BYTE VidDecId)
{
VidDecId++; // Dummy
}
#endif
//******************************************************************************
//
// FUNCTION : vpc323_VideoDecoderEntry
// USAGE : This function is main entry point into the video decoder
// driver.
// INPUT : driver function and WORD value.
// OUTPUT : returns WORD value.
// GLOBALS : None
// USED_REGS : None
//
//******************************************************************************
WORD vpc323_VideoDecoderEntry(BYTE func, void *p1, void *p2)
{
WORD val = (WORD)p1;
WORD ret = 0;
// use P2 to set which device.
if(p2 == NULL_PTR)
VID_DECODER_ID = VID_DECODER_ID_0;
else if((BYTE)p2 == 1)
VID_DECODER_ID = VID_DECODER_ID_1;
else if((BYTE)p2 == 2)
VID_DECODER_ID = VID_DECODER_ID_2;
else
VID_DECODER_ID = (BYTE)p2;
switch(func)
{
case gmd_VID_SET_INPUT :
dev_vpc323SetVideoInput((BYTE)val);
break;
case gmd_VID_SET_OUTPUT_FORMAT :
dev_vpc323SetVideoOutputFormat((BYTE)val);
break;
case gmd_VID_SET_MODE :
dev_vpc323ConfigVideoMode((BYTE)val);
break;
case gmd_VID_SET_MIXER :
/*void dev_vpc323VideoMixerControl((BYTE)val) */
break;
case gmd_VID_SET_BRIGHTNESS :
dev_vpc323SetVideoBrightness((BYTE)val);
break;
case gmd_VID_SET_CONTRAST :
dev_vpc323SetVideoContrast((BYTE)val);
break;
case gmd_VID_SET_SATURATION :
dev_vpc323SetVideoSaturation((BYTE)val);
break;
case gmd_VID_SET_HUE :
dev_vpc323SetVideoHue((BYTE)val);
break;
case gmd_VID_SET_SHARPNESS :
dev_vpc323SetVideoSharpness((BYTE)val);
break;
case gmd_VID_GET_STATUS :
ret = (WORD)dev_vpc323GetVideoStatus();
break;
case gmd_VID_GET_INTERLACE :
ret = (WORD)dev_vpc323GetVideoInterlace();
break;
case gmd_VID_GET_LINES_PER_FIELD:
ret = dev_vpc323GetVideoLinesPerField();
break;
case gmd_VID_GET_SUB_MODE :
ret = (WORD)dev_vpc323GetVideoSubMode();
break;
case gmd_VID_GET_MODE :
ret = (WORD)dev_vpc323GetVideoMode();
break;
default :
msg_vdd("No Video Decoder Funcion!!",0);
break;
}
return ret;
}
#endif // (USE_VPORT && USE_GSEL_DRVR_MODEL)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -