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

📄 tidtv_dvoalign.c

📁 ti的数字电视芯片 tvp9000的源码
💻 C
字号:
/*******************************************************************************
*	@ModuleName	::	TiDTV_DvoAlign.c
*	
*	@Copyright	::	Copyright 2005- Texas Instruments, Inc.
*	
*	@Description::	Functions for TI DTV Digital Video Output Alignment APIs
*	
*	@History	::
*---------------------------------------
*	07-12-2005	Paul Hunt	Created
*******************************************************************************/

#include "TvpError.h"
#include "TvpEncoder.h"
#include "TvpEncoderMem.h"

#include "TiDTV_DvoAlign.h"

/*******************************************************************************
*	@RoutineName:: tvpEncDvoAlignHor
*
*	@Description:: Update the Horizontal Alignment of the Digital Video Output
*
*	@Input		:: none
*
*	@Output		:: none
*
*	@Return		:: none
*******************************************************************************/
void tvpEncDvoAlignHor(short Nominal, short Offset)
{
	unsigned long enc_ctrl_tmp;
	unsigned long enc_ctrl_hor = ((unsigned long) ((long) (Nominal + Offset)) );

	// read current contents to preserve other fields
	tvpEncHdRegRead( TVP_ENC_HD_CTRL_REG_15, &enc_ctrl_tmp );
	// keep only other fields from previous control word
	enc_ctrl_tmp &= ~((unsigned long ) (TVP_ENC_ST_656_DVO_MASK<<TVP_ENC_ST_656_DVO_SHIFT));

	// mask off extraneous bits of new horizontal offset value
	enc_ctrl_hor &= TVP_ENC_ST_656_DVO_MASK;
	// shift to proper location within control word
	enc_ctrl_hor <<= TVP_ENC_ST_656_DVO_SHIFT;

	// combine new horizontal offset with other fields
	enc_ctrl_tmp |= enc_ctrl_hor;
	
	// write new settings to encoder
	tvpEncHdRegWrite( TVP_ENC_HD_CTRL_REG_15, enc_ctrl_tmp );
}

/*******************************************************************************
*	@RoutineName:: tvpEncDvoAlignVer
*
*	@Description:: Update the Vertical Alignment of the Digital Video Output
*
*	@Input		:: none
*
*	@Output		:: none
*
*	@Return		:: none
*******************************************************************************/
void tvpEncDvoAlignVer(short Nominal, short Offset)
{
	unsigned long enc_ctrl_tmp;
	unsigned long enc_ctrl_ver = ((unsigned long) ((long) (Nominal + Offset)) );

	// encoder does not like VB1_WD_DVO so return instead
	if (enc_ctrl_ver == 0) return; 
	
	// read current contents to preserve other fields
	tvpEncHdRegRead( TVP_ENC_HD_CTRL_REG2_17, &enc_ctrl_tmp );
	// keep only other fields from previous control word
	enc_ctrl_tmp &= ~((unsigned long ) (TVP_ENC_VB1_WD_DVO_MASK<<TVP_ENC_VB1_WD_DVO_SHIFT));

	// mask off extraneous bits of new horizontal offset value
	enc_ctrl_ver &= TVP_ENC_VB1_WD_DVO_MASK;
	// shift to proper location within control word
	enc_ctrl_ver <<= TVP_ENC_VB1_WD_DVO_SHIFT;

	// combine new horizontal offset with other fields
	enc_ctrl_tmp |= enc_ctrl_ver;
	
	// write new settings to encoder
	tvpEncHdRegWrite( TVP_ENC_HD_CTRL_REG2_17, enc_ctrl_tmp );
}

⌨️ 快捷键说明

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